From owner-svn-src-all@freebsd.org Sun Sep 8 01:58:03 2019 Return-Path: Delivered-To: svn-src-all@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 0EF02E498D; Sun, 8 Sep 2019 01:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46QvZf6ggRz4Lw9; Sun, 8 Sep 2019 01:58:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C86B3ECAE; Sun, 8 Sep 2019 01:58:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x881w2H1068753; Sun, 8 Sep 2019 01:58:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x881w2uC068752; Sun, 8 Sep 2019 01:58:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909080158.x881w2uC068752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 8 Sep 2019 01:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352027 - in stable: 11/lib/libc/nameser 12/lib/libc/nameser X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/lib/libc/nameser 12/lib/libc/nameser X-SVN-Commit-Revision: 352027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 01:58:03 -0000 Author: cy Date: Sun Sep 8 01:58:02 2019 New Revision: 352027 URL: https://svnweb.freebsd.org/changeset/base/352027 Log: MFC r351889: Bounds check again after advancing cp, otherwise we have a possible heap buffer overflow. This was discovered by a Google fuzzer test. This can lead to remote denial of service. User interaction and execution privileges are not a prerequisite for exploitation. Reported by: enh at Google, to FreeBSD by maya@NetBSD.org Obtained from: enh at Google See also: NetBSD ns_name.c r1.12 Reviewed by: delphij, ume MFC after: 3 days https://android-review.googlesource.com/c/platform/bionic/+/1093130 Differential Revision: https://reviews.freebsd.org/D21523 Modified: stable/11/lib/libc/nameser/ns_name.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/nameser/ns_name.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/nameser/ns_name.c ============================================================================== --- stable/11/lib/libc/nameser/ns_name.c Sat Sep 7 23:39:30 2019 (r352026) +++ stable/11/lib/libc/nameser/ns_name.c Sun Sep 8 01:58:02 2019 (r352027) @@ -682,7 +682,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) { const u_char *cp; u_int n; - int l; + int l = 0; cp = *ptrptr; while (cp < eom && (n = *cp++) != 0) { @@ -692,7 +692,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) cp += n; continue; case NS_TYPE_ELT: /*%< EDNS0 extended label */ - if ((l = labellen(cp - 1)) < 0) { + if (cp < eom && (l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /*%< XXX */ return (-1); } From owner-svn-src-all@freebsd.org Sun Sep 8 01:58:03 2019 Return-Path: Delivered-To: svn-src-all@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 637F3E4992; Sun, 8 Sep 2019 01:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46QvZg20rXz4LwB; Sun, 8 Sep 2019 01:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2898DECAF; Sun, 8 Sep 2019 01:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x881w3MJ068759; Sun, 8 Sep 2019 01:58:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x881w3uQ068758; Sun, 8 Sep 2019 01:58:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909080158.x881w3uQ068758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 8 Sep 2019 01:58:03 +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: r352027 - in stable: 11/lib/libc/nameser 12/lib/libc/nameser X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/lib/libc/nameser 12/lib/libc/nameser X-SVN-Commit-Revision: 352027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 01:58:03 -0000 Author: cy Date: Sun Sep 8 01:58:02 2019 New Revision: 352027 URL: https://svnweb.freebsd.org/changeset/base/352027 Log: MFC r351889: Bounds check again after advancing cp, otherwise we have a possible heap buffer overflow. This was discovered by a Google fuzzer test. This can lead to remote denial of service. User interaction and execution privileges are not a prerequisite for exploitation. Reported by: enh at Google, to FreeBSD by maya@NetBSD.org Obtained from: enh at Google See also: NetBSD ns_name.c r1.12 Reviewed by: delphij, ume MFC after: 3 days https://android-review.googlesource.com/c/platform/bionic/+/1093130 Differential Revision: https://reviews.freebsd.org/D21523 Modified: stable/12/lib/libc/nameser/ns_name.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/nameser/ns_name.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/nameser/ns_name.c ============================================================================== --- stable/12/lib/libc/nameser/ns_name.c Sat Sep 7 23:39:30 2019 (r352026) +++ stable/12/lib/libc/nameser/ns_name.c Sun Sep 8 01:58:02 2019 (r352027) @@ -684,7 +684,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) { const u_char *cp; u_int n; - int l; + int l = 0; cp = *ptrptr; while (cp < eom && (n = *cp++) != 0) { @@ -694,7 +694,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) cp += n; continue; case NS_TYPE_ELT: /*%< EDNS0 extended label */ - if ((l = labellen(cp - 1)) < 0) { + if (cp < eom && (l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /*%< XXX */ return (-1); } From owner-svn-src-all@freebsd.org Sun Sep 8 09:47:22 2019 Return-Path: Delivered-To: svn-src-all@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 97B25EE654; Sun, 8 Sep 2019 09:47:22 +0000 (UTC) (envelope-from gonzo@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 46R60B3TCVz3D9Q; Sun, 8 Sep 2019 09:47:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 410171C16E; Sun, 8 Sep 2019 09:47:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x889lMl2048856; Sun, 8 Sep 2019 09:47:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x889lLRC048852; Sun, 8 Sep 2019 09:47:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201909080947.x889lLRC048852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Sep 2019 09:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352028 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 352028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 09:47:22 -0000 Author: gonzo Date: Sun Sep 8 09:47:21 2019 New Revision: 352028 URL: https://svnweb.freebsd.org/changeset/base/352028 Log: [rpi] Inherit framebuffer BPP value from the VideoCore firmware Instead of using hardcoded bpp of 24, obtain current/configured value from VideoCore. This solves certain problems with Xorg/Qt apps that require bpp of 32 to work properly. The mode can be forced by setting framebuffer_depth value in config.txt PR: 235363 Submitted by: Steve Peurifoy Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Sep 8 01:58:02 2019 (r352027) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Sep 8 09:47:21 2019 (r352028) @@ -85,7 +85,13 @@ bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_ memset(fb, 0, sizeof(*fb)); if (bcm2835_mbox_fb_get_w_h(fb) != 0) return (ENXIO); - fb->bpp = FB_DEPTH; + if (bcm2835_mbox_fb_get_bpp(fb) != 0) + return (ENXIO); + if (fb->bpp < FB_DEPTH) { + device_printf(sc->dev, "changing fb bpp from %d to %d\n", fb->bpp, FB_DEPTH); + fb->bpp = FB_DEPTH; + } else + device_printf(sc->dev, "keeping existing fb bpp of %d\n", fb->bpp); fb->vxres = fb->xres; fb->vyres = fb->yres; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Sep 8 01:58:02 2019 (r352027) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Sep 8 09:47:21 2019 (r352028) @@ -499,6 +499,26 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *fb) } int +bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *fb) +{ + int err; + struct msg_fb_get_bpp msg; + + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + BCM2835_MBOX_INIT_TAG(&msg.bpp, GET_DEPTH); + msg.bpp.tag_hdr.val_len = 0; + msg.end_tag = 0; + + err = bcm2835_mbox_property(&msg, sizeof(msg)); + if (err == 0) + fb->bpp = msg.bpp.body.resp.bpp; + + return (err); +} + +int bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) { int err; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Sep 8 01:58:02 2019 (r352027) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Sep 8 09:47:21 2019 (r352028) @@ -474,6 +474,14 @@ struct msg_fb_get_w_h { int bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *); +struct msg_fb_get_bpp { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_depth bpp; + uint32_t end_tag; +}; + +int bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *); + struct msg_fb_setup { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_fb_w_h physical_w_h; From owner-svn-src-all@freebsd.org Sun Sep 8 19:39:46 2019 Return-Path: Delivered-To: svn-src-all@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 C8CECDE63C; Sun, 8 Sep 2019 19:39:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RM7k4xzLz400k; Sun, 8 Sep 2019 19:39:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 895D71E42; Sun, 8 Sep 2019 19:39:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88JdkhX098161; Sun, 8 Sep 2019 19:39:46 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Jdk1u098159; Sun, 8 Sep 2019 19:39:46 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909081939.x88Jdk1u098159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Sep 2019 19:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352032 - in head/stand: . i386/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: . i386/loader X-SVN-Commit-Revision: 352032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:39:46 -0000 Author: tsoome Date: Sun Sep 8 19:39:45 2019 New Revision: 352032 URL: https://svnweb.freebsd.org/changeset/base/352032 Log: loader: --gc-sections needs sections to work with --gc-sections is not really useful unless we generate sections with -ffunction-sections -fdata-sections While there, i386/loader would win from --gc-sections too. Modified: head/stand/defs.mk head/stand/i386/loader/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Sun Sep 8 16:24:34 2019 (r352031) +++ head/stand/defs.mk Sun Sep 8 19:39:45 2019 (r352032) @@ -65,6 +65,7 @@ CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mc # Experience has shown that problems arise between ~520k to ~530k. CFLAGS.clang+= -Oz CFLAGS.gcc+= -Os +CFLAGS+= -ffunction-sections -fdata-sections .endif # GELI Support, with backward compat hooks (mostly) Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Sun Sep 8 16:24:34 2019 (r352031) +++ head/stand/i386/loader/Makefile Sun Sep 8 19:39:45 2019 (r352032) @@ -47,7 +47,7 @@ HELP_FILES= ${.CURDIR}/help.i386 CLEANFILES+= ${LOADER} ${LOADER}.bin CFLAGS+= -Wall -LDFLAGS+= -static -Ttext 0x0 +LDFLAGS+= -static -Ttext 0x0 -Wl,--gc-sections # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a From owner-svn-src-all@freebsd.org Sun Sep 8 19:40:52 2019 Return-Path: Delivered-To: svn-src-all@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 EE57EDE91D; Sun, 8 Sep 2019 19:40:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RM905xGlz40KR; Sun, 8 Sep 2019 19:40:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B087B1E61; Sun, 8 Sep 2019 19:40:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88Jeq1i098471; Sun, 8 Sep 2019 19:40:52 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Jequu098469; Sun, 8 Sep 2019 19:40:52 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909081940.x88Jequu098469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Sep 2019 19:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352033 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:40:53 -0000 Author: mhorne Date: Sun Sep 8 19:40:52 2019 New Revision: 352033 URL: https://svnweb.freebsd.org/changeset/base/352033 Log: Allow for compiler versions >= 10 Both clang and gcc development branches have reached version 10. Since we only parse for a single digit in the major version number, this causes COMPILER_VERSION to be set to its default of 0.0.0, meaning version checks fail with these newer compilers. Reviewed by: emaste Approved by: markj (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21413 Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sun Sep 8 19:39:45 2019 (r352032) +++ head/share/mk/bsd.compiler.mk Sun Sep 8 19:40:52 2019 (r352033) @@ -187,7 +187,7 @@ ${X_}COMPILER_TYPE:= clang . endif .endif .if !defined(${X_}COMPILER_VERSION) -${X_}COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +${X_}COMPILER_VERSION!=echo "${_v:M[1-9]*.[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif From owner-svn-src-all@freebsd.org Sun Sep 8 19:44:22 2019 Return-Path: Delivered-To: svn-src-all@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 9AEFFDEA11; Sun, 8 Sep 2019 19:44:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RMF23ZTFz40k4; Sun, 8 Sep 2019 19:44:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E9312006; Sun, 8 Sep 2019 19:44:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88JiMAN004162; Sun, 8 Sep 2019 19:44:22 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88JiMFM004161; Sun, 8 Sep 2019 19:44:22 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909081944.x88JiMFM004161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Sep 2019 19:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352034 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:44:22 -0000 Author: mhorne Date: Sun Sep 8 19:44:21 2019 New Revision: 352034 URL: https://svnweb.freebsd.org/changeset/base/352034 Log: RISC-V: fix kernel CFLAGS with clang Use the -march and -mabi flags for both gcc and clang as they are compatible. Specify the "medium" code model separately as it goes by the name "medany" under gcc, although they are equivalent. Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21436 Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Sep 8 19:40:52 2019 (r352033) +++ head/sys/conf/kern.mk Sun Sep 8 19:44:21 2019 (r352034) @@ -128,8 +128,18 @@ CFLAGS += -ffixed-x18 INLINE_LIMIT?= 8000 .endif +# +# For RISC-V we specify the soft-float ABI (lp64) to avoid the use of floating +# point registers within the kernel. We also specify the "medium" code model, +# which generates code suitable for a 2GiB addressing range located at any +# offset, allowing modules to be located anywhere in the 64-bit address space. +# Note that clang and GCC refer to this code model as "medium" and "medany" +# respectively. +# .if ${MACHINE_CPUARCH} == "riscv" -CFLAGS.gcc+= -mcmodel=medany -march=rv64imafdc -mabi=lp64 +CFLAGS+= -march=rv64imafdc -mabi=lp64 +CFLAGS.clang+= -mcmodel=medium +CFLAGS.gcc+= -mcmodel=medany INLINE_LIMIT?= 8000 .endif From owner-svn-src-all@freebsd.org Sun Sep 8 19:46:35 2019 Return-Path: Delivered-To: svn-src-all@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 81BA6DEBC0; Sun, 8 Sep 2019 19:46:35 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RMHb2ghJz40xp; Sun, 8 Sep 2019 19:46:35 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AB74200B; Sun, 8 Sep 2019 19:46:35 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88JkYOg004315; Sun, 8 Sep 2019 19:46:34 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88JkYMi004314; Sun, 8 Sep 2019 19:46:34 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909081946.x88JkYMi004314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Sep 2019 19:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352035 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:46:35 -0000 Author: mhorne Date: Sun Sep 8 19:46:34 2019 New Revision: 352035 URL: https://svnweb.freebsd.org/changeset/base/352035 Log: Remove a duplicate KTR entry Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D21438 Modified: head/sys/riscv/riscv/intr_machdep.c Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Sun Sep 8 19:44:21 2019 (r352034) +++ head/sys/riscv/riscv/intr_machdep.c Sun Sep 8 19:46:34 2019 (r352035) @@ -205,7 +205,7 @@ ipi_send(struct pcpu *pc, int ipi) { u_long mask; - CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); + CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); mask = (1 << pc->pc_hart); @@ -235,7 +235,6 @@ ipi_cpu(int cpu, u_int ipi) CPU_ZERO(&cpus); CPU_SET(cpu, &cpus); - CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x\n", __func__, cpu, ipi); ipi_send(cpuid_to_pcpu[cpu], ipi); } From owner-svn-src-all@freebsd.org Sun Sep 8 19:53:12 2019 Return-Path: Delivered-To: svn-src-all@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 3FEE8DF05F; Sun, 8 Sep 2019 19:53:12 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RMRD0vsnz41Tk; Sun, 8 Sep 2019 19:53:12 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02D3021E8; Sun, 8 Sep 2019 19:53:12 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88JrBgt010140; Sun, 8 Sep 2019 19:53:11 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88JrBlw010139; Sun, 8 Sep 2019 19:53:11 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909081953.x88JrBlw010139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Sep 2019 19:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352036 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:53:12 -0000 Author: mhorne Date: Sun Sep 8 19:53:11 2019 New Revision: 352036 URL: https://svnweb.freebsd.org/changeset/base/352036 Log: Fix compilation of locore.S with clang The branch from _start to mpentry has to cross a large section of data; an offset larger than can be specified with a 12-bit branch immediate. Fix this by converting the branch to an unconditional jump. The gcc assembler does this conversion silently but it is not done automatically by clang. Reported by: Jeremy Bennett Reviewed by: markj Approved by: markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21437 Modified: head/sys/riscv/riscv/locore.S Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Sun Sep 8 19:46:34 2019 (r352035) +++ head/sys/riscv/riscv/locore.S Sun Sep 8 19:53:11 2019 (r352036) @@ -69,12 +69,18 @@ _start: la t0, hart_lottery li t1, 1 amoadd.w t0, t1, 0(t0) - bnez t0, mpentry /* - * Page tables + * We must jump to mpentry in the non-BSP case because the offset is + * too large to fit in a 12-bit branch immediate. */ + beqz t0, 1f + j mpentry + /* + * Page tables + */ +1: /* Add L1 entry for kernel */ la s1, pagetable_l1 la s2, pagetable_l2 /* Link to next level PN */ From owner-svn-src-all@freebsd.org Sun Sep 8 19:54:29 2019 Return-Path: Delivered-To: svn-src-all@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 829F2DF0CB; Sun, 8 Sep 2019 19:54:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RMSj2xgPz41bv; Sun, 8 Sep 2019 19:54:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E18B21ED; Sun, 8 Sep 2019 19:54:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88JsTpZ010238; Sun, 8 Sep 2019 19:54:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88JsTFe010237; Sun, 8 Sep 2019 19:54:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909081954.x88JsTFe010237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Sep 2019 19:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352037 - head/stand/i386/zfsloader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsloader X-SVN-Commit-Revision: 352037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 19:54:29 -0000 Author: tsoome Date: Sun Sep 8 19:54:28 2019 New Revision: 352037 URL: https://svnweb.freebsd.org/changeset/base/352037 Log: remove leftover zfsloader directory It really is empty. Deleted: head/stand/i386/zfsloader/ From owner-svn-src-all@freebsd.org Sun Sep 8 20:02:42 2019 Return-Path: Delivered-To: svn-src-all@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 DE4D9E01E4; Sun, 8 Sep 2019 20:02:42 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bsdio.com (muon.bluestop.org [65.103.231.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46RMfB2v0Kz42Ps; Sun, 8 Sep 2019 20:02:42 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bsdio.com (localhost [127.0.0.1]) by muon.bsdio.com (Postfix) with ESMTP id C44F0FD5C7; Sun, 8 Sep 2019 14:02:41 -0600 (MDT) Received: from muon.bsdio.com ([127.0.0.1]) by muon.bsdio.com (muon.bsdio.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yP9C7CySZLAu; Sun, 8 Sep 2019 14:02:40 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.120]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by muon.bsdio.com (Postfix) with ESMTPSA; Sun, 8 Sep 2019 14:02:40 -0600 (MDT) From: Rebecca Cran Subject: Re: svn commit: r351831 - in head: . stand/efi/boot1 stand/efi/gptboot tools/build/mk To: Andrew Turner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909042055.x84KtnH6078288@repo.freebsd.org> <8273514D-62F3-4ECB-99D0-78A7633A276A@fubar.geek.nz> Autocrypt: addr=bcran@freebsd.org; keydata= mQINBFrUMZ4BEADI1yUEGeZeXeTCPay1ZpTBdDEpGPAw1dq2VCSTc1VhsnrEBa1iZxAfaeSv Uu5Ti7jlhQ/3sQMl0bJMKGB/RtmIW7k8h2w476oZmG8gChk8su5ZEx/pV1gdqInyFmmJKTYc gabJz8pL+m82w07qPv+oalepZ4dbj+HF++RAK/iEju+q9UHlsjj8e3mMNsvtrOz1K6bnpveO jZ+ms/2H3Hs5a4k8y6buwe2RvwhJQaXa13cR3LhzL+nwj4B9PHZZEa2WpEyYpw/bI0V9YSQN QgC1CYRzDyakZge6BCM6wHOgZSUzRPufGilrNKUwIVbRoIBR9/85+0wR+PlFUOUOfOc6ox7T dWcIx6PuPhek48rh4uwmmwsPtPiH4Z3T5p+GmWQ9NLFZKA1YnEdaSkWtYZsDxwVZZeYG2plt MfhXP0Hj4rf9Y3eoUenCaGioxAbUOBCtXdTGNAhNjz1g5NGDBVyhjKkzwJQvt9UrYTseERit 5dX2CMTy8hYLvSXd/Ivy+HylUS5IslfZxW5z9LgWX7Z97kILgkH3N0ewtLkygkG+Y+x7uaAV dFqp9ASOyzaiwKbJdeOI+WxRSh+AqeCR0S+bpkcLudLmbjrPmaFwjKycy1H85Z5R2J3YHyXY oT6OYjD8vLbUU2GWp6Onkcy1Pu8EMbRuzKil6HnpYg3BexbPFwARAQABtCBSZWJlY2NhIENy YW4gPGJjcmFuQGZyZWVic2Qub3JnPokCVAQTAQgAPhYhBB+5fZtkTdO940Yr4g0CK1MRvhAg BQJa2B8pAhsjBQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEA0CK1MRvhAgAe0P /R65umdPBVFCYKPZ91HMqlZtn0EWOGwycWEK/feWI+jaYOa+8+VVxFau4gwnBmgCdf5XOAJW QugUlPte9T+dP9QXmgm8z3KMLCj2PATYlmqmQfvIleJPf8w7BFBw/kkd6ZxoEQXaEyZwWuJc vY58uFYizZ8s1gMjD7uV3eg2UuGYd4loBZ3MSanWrhE6mmxAjzcYYb0KTsaTH9ON4uctcTYG 4FN0KzRx5d4nAhnS/yaL+3OI23vUDt+XnOCx8tIOczScOEN5NFChgyvTxzwi7hTVNB7uUCha mN6vcjtrrzi03zHXooldE4gRJ5G+SzuH9yHKrrwYXUeKi8sG8uXVoWwzsLbCxHRe7T9Ow7Im 92Aep3DEIE9whG6Fg3hRQ4/d/9OVCGrV3XwRMEstCvamJQc69ZsULo1ssGmPvcLn8fNaLNeP ICCLQj4JLcYvKKfLIQ/Cm0Orsy8rJGhwF4W1mBUbTdR6pk2azEkrhE7KZDylgikpNNqshKV3 1nD/5SNrTDl0P8rTnu0OKT0IbozIsaz9FD2xMPHPUMPnVSTB96+PhgoBIQlHcys19gftotuN 1tlLs4Ny93xWLSjKWoW5l9E9LbIh+M8gD3A7JyyV9DRZkHdbOt3pGjpaozchDPCpRkcsFXp4 9zSbXtxnbAWfZwoSYQTvznmXpzHMzoLMWf/guQINBFrUMZ4BEADkc4mvMcMcDF1tdNxNQuIB E1F243oZamG3LACCKfc1Yur3CPzHwIk5LXCUmbq23iE5bowxMWw3mlVT0p5xM0WnUidIBwCK u4kRyy/fY4NyWWBuwy9srpTdmUcKRBRNB8zEZE8xIlidD1ijjgqLBfeM7n9ylawAxHLxwU96 sdpdHFzb7Z0yKY2e/bzDaHiG0fUvcCmkgLf+uwKKZid1j8zR5PzKpgPqfy/PF01eKyGV3MNu 8Y90xMoiEMWfCI2IB1m+hTuzZoboFvGV54SiMuvfWK/VMQjhsL6K2ddOqwVuy2nIMI4G3xDQ W/v8KVyn43OSIAyW1eaklhzu0Ir2sO60PXRkvbTUrouvmSvpJfIQS49rU0M/X6FSDgXQLKrZ 3my94+g8ptz9KoVml6s4OAwYVz+sb49nuSxipFKkU5FwhKOLmzbsBxCtytcUJoLmjuJPJPDQ ue6YJiIXyc86GVY2pH3DjemKdbB4dSgqAJIp+lCzKSJzz7bgueh2Ox8vzx1tSxKj7V8Nal+U TKKbkxPmMh+e20YZ4esAVifO3bS6IJP/aDnfagghB71vA7+aWGXPbjPlc2UHpCBiRSsl+Igo QXvdvZBsKRyfBx8neODa2C6JIE5vcaCjilSeKF8SzsFXvimnndhQNhAPU/DwQwSXdCl4gTsF Vi5d8Oxq1sce+wARAQABiQI8BBgBCAAmFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAlrUMZ4C GwwFCQlmAYAACgkQDQIrUxG+ECAWnRAAsmZX+KgNxW3v7R/76Tz4Wjmh4AGeE+Ji3p5QsdTY ny1B6vYBL9vCzPJ/AK8pgKMDRaweUP5eZQpfrdWC8Q7SNGgi4Q+97KEs+i2xZLQ+WJb8a+WE EIc716u0y4ITiHfOgM5jWcFO4MXQATbJgv0drLLesa+LQCvZgPBqupt307EsCubQs+Sxt+RV jf6rOUolp1GJXEQYwGsKklVd6yqLC8M1BSG53/WE5tSv5GzBZ8fp6EtmjT7leuidFtEvKYHQ z4DqG9ELpHUF0X0UUCBK/MgXe3kCVLKE060UrJ4M6uPSx57rmVFA2MvwQR8M7GsWC5UsSM4P YwPWBhwxE7vcx0691YKAHT/5q8LxRVBdUyzPSprMhSQFttsBt+ygm6wRi3Pi3TuCEARNubPk QefyeC34yr40SAUCkOl3eWxSXPF4NfXFQb4AAzZSE5hv3qbDuwo3lrL0LqpIpEQPAz+JZ1QZ 6mMFQ5/JD9Gukj54kZc0X8w3sQt0a8vyE/qrJg8vKgv2rCHrPc5MeDkEUEFiiJiCEDdkJtMy oRlU3S4NrnbyLOLEcHE8fGe3hStPX8hY62id2ecdQ5WZ7vLZW5SFeLarbUciuHIkVL6MHnUj bV7XlY50N7ebeFCIdlCWhdum2FJs/Ni+SSxbZC564vrokwlBBGSo6WTPQTa8IWx1DtU= Message-ID: Date: Sun, 8 Sep 2019 14:02:29 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <8273514D-62F3-4ECB-99D0-78A7633A276A@fubar.geek.nz> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="O2Z1L7znuXQdnPpciO2oDKDp4xaijmwDA" X-Rspamd-Queue-Id: 46RMfB2v0Kz42Ps X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; ASN(0.00)[asn:209, ipnet:65.103.224.0/19, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:02:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --O2Z1L7znuXQdnPpciO2oDKDp4xaijmwDA Content-Type: multipart/mixed; boundary="5jmEh2KaRAa2nQBFciqRTMqRrcNG2vodQ"; protected-headers="v1" From: Rebecca Cran To: Andrew Turner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r351831 - in head: . stand/efi/boot1 stand/efi/gptboot tools/build/mk References: <201909042055.x84KtnH6078288@repo.freebsd.org> <8273514D-62F3-4ECB-99D0-78A7633A276A@fubar.geek.nz> In-Reply-To: <8273514D-62F3-4ECB-99D0-78A7633A276A@fubar.geek.nz> --5jmEh2KaRAa2nQBFciqRTMqRrcNG2vodQ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-09-06 04:02, Andrew Turner wrote: > I use them in a Jenkins instance to test arm64. I specifically don=E2=80= =99t give the Jenkins user any root access so am unable to use mdconfig t= o create the ESP image. I would use makefs however support for generating= fat images hasn=E2=80=99t made it into a release yet, and it doesn=E2=80= =99t build on 12 as many needed structs are protected by _KERNEL. >=20 > I don=E2=80=99t care about the image being installed, but would like to= be able to generate it when needed on the latest 12 release without need= ing root access. Sorry for the delay in replying. I'd prefer not to partially revert the commit, but I'm not sure what the solution would be. Perhaps we could accelerate the MFC of msdos makefs support to 12-STABLE? --=20 Rebecca Cran --5jmEh2KaRAa2nQBFciqRTMqRrcNG2vodQ-- --O2Z1L7znuXQdnPpciO2oDKDp4xaijmwDA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAl11XlUACgkQDQIrUxG+ ECCUwA/+I+cI4c81bGgL3/FaqVoMGSUVGm21ODJN/c9JQiLYOK/uPGwbfP4Fk327 mcPjbGGAmOHJarbre+0X9e+WUSdH60g/x6b0Rw4BMzDWZpUkp7p0/VDZyJNE6JX4 hDfX0n4LpKPFoReN28IwBBn0y0XBy/oGlqxALNNr28s8xBVaRuHMhQqE0H+NV/bk dziVzlZXN+5jBtVKLqTV6WibTTzzoEa/xZOsrMZeVXbRi8+t9cAFtUR4dBF7RfjF TivIEJEe6+eEUfLUpeRCgWy8OjZvrLywRpL/LFbXx8wtvpDoNt9rtCPYrDqCMF/Y Uz5WksQm6QU8V3QTGis3bQxV+qE/CRRNVfaqgcdjEiq6mBQY1bwAYjee5l7tvZf5 0yL4htnU3Mzyf2neQI9FeQuac2jY6biurg0A907+sl0zoPh0GwR5iWZa1hmruxgs 74J0KYnwNEZjjIENZ98kxBm639Ah6PLtObxqB0gEpFnZZIs/SxdleycjsUIRgUht yWGZdMymFpdSeeqX3Naf/V7gnPUEVhq+QqO81DJzBP3rZ8lsAw5GYslMT0pH4eZt cojU+dOAPVq0dKzktOh8+8xbIwJ211Q69zbmp73UvDNfYm0B2wZlPrcdjwLh6qur ubalD5RGxZAYbDnroLIA2aLZ0aAdf7/Ii1W/uXhPigm0YBRyyaM= =f6QH -----END PGP SIGNATURE----- --O2Z1L7znuXQdnPpciO2oDKDp4xaijmwDA-- From owner-svn-src-all@freebsd.org Sun Sep 8 20:27:43 2019 Return-Path: Delivered-To: svn-src-all@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 0A4D1E09A2; Sun, 8 Sep 2019 20:27:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RNC20RDrz43Kb; Sun, 8 Sep 2019 20:27:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id h144so24130085iof.7; Sun, 08 Sep 2019 13:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bL823FPjBR5qUjIupXjojBD3rJVDnaCjLe9xvBx1KJk=; b=kDva9FqXT+OUkCdsQwRVdqmA3NsrESsxSF8WW1YG7Fu1xUHcbwDwrzzD7NiMDGsuMx 5sbc3e7VdE5EQ3SzGR0DQtO6vW7wS0zNV/XZT/lMsn3HWy9e1Ok7VqgCWz0gs7xazojN BubUXHgjUNEgrBGWSP9PO/duVrM9wieF+Sbp4MYon97KWtmxf8bL8CkoEHreL2me3l5A SWQfRhjbdTBFDX+rr9ThKtN0GnYR7WDQ7EuCno2NTe1oPcXtdtvsUwr25Fy/EJryMdu2 fkcPzFXc7geP97o5a+/diqGAI5U0wr1G7g/Q4bR8hrfGAxEzAR9KNry/OjDBNS/LswBU RyIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=bL823FPjBR5qUjIupXjojBD3rJVDnaCjLe9xvBx1KJk=; b=Ovsj6aRH+xNEdN0mbQeP5bUnEVyRWSK8zqop2xqkEtosXEAtvAaGiGgyfrLCh9l8pB ZZtTZpltZDfiJTbiHLjUm99vqpQ03ZPen2y2ciVcuMTx0TepvnHeqPsvHgiwSB+5xDUY 7cAfStq8azSj0ixVle2Ak+H1jJxOd3c0aDRgFK4To8uO3ddlqOVBFDOx1Sb3bF7k0kqT pu3fIXyQXvDQ48apWZnkp3fKCC+/kKWS2nEE6sMybZgPXu1JmvSE+5N+0hn/JQFR1APQ P2HZktbtaxsBLzA55/zOKFIHwOjkvogwyPKltfH/x2m1IwF+zowZauGIc1ZerEu5lKFy ykdQ== X-Gm-Message-State: APjAAAUgZ15S7y/8YhQshJKvglcrMhICzqftHyn+lo18R3bi3leDo1vz Hd7baxivOjhgYungr8c3v5usQz1G3Dg= X-Google-Smtp-Source: APXvYqysphZqFTGZxgZg6IKPwDnmOTZke1JRc3zTFIF+Gdfa3jtG9TI9iUFZNfVu3tOFRa7rBLvLcA== X-Received: by 2002:a05:6638:692:: with SMTP id i18mr21559519jab.108.1567974460724; Sun, 08 Sep 2019 13:27:40 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-39-167.dsl.bell.ca. [69.159.39.167]) by smtp.gmail.com with ESMTPSA id s201sm32893839ios.83.2019.09.08.13.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2019 13:27:39 -0700 (PDT) Sender: Mark Johnston Date: Sun, 8 Sep 2019 16:18:19 -0400 From: Mark Johnston To: Slawa Olhovchenkov Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351673 - in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm Message-ID: <20190908201819.GA49837@raichu> References: <201909012222.x81MMh0F022462@repo.freebsd.org> <79c74018-1329-ee69-3480-e2f99821fa93@FreeBSD.org> <20190903161427.GA38096@zxy.spb.ru> <20190903220106.GB26733@raichu> <20190904144524.GD3953@zxy.spb.ru> <20190907145034.GB6523@spy> <20190907153110.GG3953@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190907153110.GG3953@zxy.spb.ru> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46RNC20RDrz43Kb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kDva9FqX; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d42 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.25 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.55)[ip: (2.32), ipnet: 2607:f8b0::/32(-2.75), asn: 15169(-2.27), country: US(-0.05)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:27:43 -0000 On Sat, Sep 07, 2019 at 06:31:10PM +0300, Slawa Olhovchenkov wrote: > On Sat, Sep 07, 2019 at 10:50:34AM -0400, Mark Johnston wrote: > > > On Wed, Sep 04, 2019 at 05:45:24PM +0300, Slawa Olhovchenkov wrote: > > > On Tue, Sep 03, 2019 at 06:01:06PM -0400, Mark Johnston wrote: > > > > > Mostly problem I am see at this > > > > > work -- very slowly vm_page_free(). May be currenly this is more > > > > > speedy... > > > > > > > > How did you determine this? > > > > > > This is you guess: > > > > So was the guess correct? > > I am just trust to you. > How to check this guess? You can try to measure time spent in pmap_remove() relative to the rest of _kmem_unback(). > > If so, IMO the real solution is to avoid kmem_* > > for data buffers and use ABD instead. > > What problem resolve this? To allocate buffers larger than PAGE_SIZE the kernel must allocate a number of physical pages and map them using the page tables. The step of creating and destroying mappings is expensive and doesn't scale well to many CPUs. With ABD, ZFS avoids this expense when its caches are shrunk. > ABD any way is slowly vs kmem_*. Can we solve this problem instead? > > > ====== > > > > while ((slab = SLIST_FIRST(&freeslabs)) != NULL) { > > > > SLIST_REMOVE(&freeslabs, slab, uma_slab, us_hlink); > > > > keg_free_slab(keg, slab, keg->uk_ipers); > > > > } > > > > 2019 Feb 2 19:49:54.800524364 zio_data_buf_1048576 1032605 cache_reclaim limit 100 dom 0 nitems 1672 imin 298 > > > > 2019 Feb 2 19:49:54.800524364 zio_data_buf_1048576 1033736 cache_reclaim recla 149 dom 0 nitems 1672 imin 298 > > > > 2019 Feb 2 19:49:54.802524468 zio_data_buf_1048576 3119710 cache_reclaim limit 100 dom 1 nitems 1 imin 0 > > > > 2019 Feb 2 19:49:54.802524468 zio_data_buf_1048576 3127550 keg_drain2 > > > > 2019 Feb 2 19:49:54.803524487 zio_data_buf_1048576 4444219 keg_drain3 > > > > 2019 Feb 2 19:49:54.838524634 zio_data_buf_1048576 39553705 keg_drain4 > > > > 2019 Feb 2 19:49:54.838524634 zio_data_buf_1048576 39565323 zone_reclaim:return > > > > > > > > 35109.486 ms for last loop, 149 items to freed. > > > > > > 35ms to free 149MB (38144 4KB pages), so roughly 1us per page. That > > > does seem like a lot, but freeing a page (vm_page_free(m)) is much > > > more expensive than freeing an item to UMA (i.e., uma_zfree()). > > > Most of that time will be spent in _kmem_unback(). > > > ====== From owner-svn-src-all@freebsd.org Sun Sep 8 20:28:07 2019 Return-Path: Delivered-To: svn-src-all@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 B0820E0A06; Sun, 8 Sep 2019 20:28:07 +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 46RNCW49Kyz43S5; Sun, 8 Sep 2019 20:28:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5461D274A; Sun, 8 Sep 2019 20:28:07 +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 x88KS7NZ028280; Sun, 8 Sep 2019 20:28:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KS7Gv028279; Sun, 8 Sep 2019 20:28:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082028.x88KS7Gv028279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:28:07 +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: r352038 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:28:07 -0000 Author: markj Date: Sun Sep 8 20:28:06 2019 New Revision: 352038 URL: https://svnweb.freebsd.org/changeset/base/352038 Log: MFC r351547, r351549: Fix several logic issues in domainset_empty_vm(). Modified: stable/12/sys/kern/kern_cpuset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Sun Sep 8 19:54:28 2019 (r352037) +++ stable/12/sys/kern/kern_cpuset.c Sun Sep 8 20:28:06 2019 (r352038) @@ -457,7 +457,7 @@ static struct domainset * _domainset_create(struct domainset *domain, struct domainlist *freelist) { struct domainset *ndomain; - int i, j, max; + int i, j; KASSERT(domain->ds_cnt <= vm_ndomains, ("invalid domain count in domainset %p", domain)); @@ -476,8 +476,7 @@ _domainset_create(struct domainset *domain, struct dom if (ndomain == NULL) { LIST_INSERT_HEAD(&cpuset_domains, domain, ds_link); domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0, j = 0; i < max; i++) + for (i = 0, j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++) if (DOMAINSET_ISSET(i, &domain->ds_mask)) domain->ds_order[j++] = i; } @@ -500,25 +499,31 @@ _domainset_create(struct domainset *domain, struct dom static bool domainset_empty_vm(struct domainset *domain) { - int i, j, max; + domainset_t empty; + int i, j; - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0; i < max; i++) - if (DOMAINSET_ISSET(i, &domain->ds_mask) && VM_DOMAIN_EMPTY(i)) - DOMAINSET_CLR(i, &domain->ds_mask); + DOMAINSET_ZERO(&empty); + for (i = 0; i < vm_ndomains; i++) + if (VM_DOMAIN_EMPTY(i)) + DOMAINSET_SET(i, &empty); + if (DOMAINSET_SUBSET(&empty, &domain->ds_mask)) + return (true); + + /* Remove empty domains from the set and recompute. */ + DOMAINSET_NAND(&domain->ds_mask, &empty); domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = j = 0; i < max; i++) { + for (i = j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++) if (DOMAINSET_ISSET(i, &domain->ds_mask)) domain->ds_order[j++] = i; - else if (domain->ds_policy == DOMAINSET_POLICY_PREFER && - domain->ds_prefer == i && domain->ds_cnt > 1) { - domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; - domain->ds_prefer = -1; - } + + /* Convert a PREFER policy referencing an empty domain to RR. */ + if (domain->ds_policy == DOMAINSET_POLICY_PREFER && + DOMAINSET_ISSET(domain->ds_prefer, &empty)) { + domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + domain->ds_prefer = -1; } - return (DOMAINSET_EMPTY(&domain->ds_mask)); + return (false); } /* From owner-svn-src-all@freebsd.org Sun Sep 8 20:37:43 2019 Return-Path: Delivered-To: svn-src-all@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 DE8F3E0F54; Sun, 8 Sep 2019 20:37:43 +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 46RNQb5YLPz4424; Sun, 8 Sep 2019 20:37:43 +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 9D954293F; Sun, 8 Sep 2019 20:37:43 +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 x88KbhqK034208; Sun, 8 Sep 2019 20:37:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KbgY0034205; Sun, 8 Sep 2019 20:37:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082037.x88KbgY0034205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:37:42 +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: r352039 - in stable/12/sys: kern vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern vm X-SVN-Commit-Revision: 352039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:37:43 -0000 Author: markj Date: Sun Sep 8 20:37:42 2019 New Revision: 352039 URL: https://svnweb.freebsd.org/changeset/base/352039 Log: MFC r350431: Centralize the logic in vfs_vmio_unwire() and sendfile_free_page(). Modified: stable/12/sys/kern/kern_sendfile.c stable/12/sys/kern/vfs_bio.c stable/12/sys/vm/vm_page.c stable/12/sys/vm/vm_page.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sendfile.c ============================================================================== --- stable/12/sys/kern/kern_sendfile.c Sun Sep 8 20:28:06 2019 (r352038) +++ stable/12/sys/kern/kern_sendfile.c Sun Sep 8 20:37:42 2019 (r352039) @@ -119,76 +119,22 @@ sfstat_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQUE | CTLFLAG_RW, NULL, 0, sfstat_sysctl, "I", "sendfile statistics"); -/* - * Detach mapped page and release resources back to the system. Called - * by mbuf(9) code when last reference to a page is freed. - */ static void -sendfile_free_page(vm_page_t pg, bool nocache) -{ - bool freed; - - vm_page_lock(pg); - /* - * In either case check for the object going away on us. This can - * happen since we don't hold a reference to it. If so, we're - * responsible for freeing the page. In 'noncache' case try to free - * the page, but only if it is cheap to. - */ - if (vm_page_unwire_noq(pg)) { - vm_object_t obj; - - if ((obj = pg->object) == NULL) - vm_page_free(pg); - else { - freed = false; - if (nocache && !vm_page_xbusied(pg) && - VM_OBJECT_TRYWLOCK(obj)) { - /* Only free unmapped pages. */ - if (obj->ref_count == 0 || - !pmap_page_is_mapped(pg)) - /* - * The busy test before the object is - * locked cannot be relied upon. - */ - freed = vm_page_try_to_free(pg); - VM_OBJECT_WUNLOCK(obj); - } - if (!freed) { - /* - * If we were asked to not cache the page, place - * it near the head of the inactive queue so - * that it is reclaimed sooner. Otherwise, - * maintain LRU. - */ - if (nocache) - vm_page_deactivate_noreuse(pg); - else if (vm_page_active(pg)) - vm_page_reference(pg); - else - vm_page_deactivate(pg); - } - } - } - vm_page_unlock(pg); -} - -static void sendfile_free_mext(struct mbuf *m) { struct sf_buf *sf; vm_page_t pg; - bool nocache; + int flags; KASSERT(m->m_flags & M_EXT && m->m_ext.ext_type == EXT_SFBUF, ("%s: m %p !M_EXT or !EXT_SFBUF", __func__, m)); sf = m->m_ext.ext_arg1; pg = sf_buf_page(sf); - nocache = m->m_ext.ext_flags & EXT_FLAG_NOCACHE; + flags = (m->m_ext.ext_flags & EXT_FLAG_NOCACHE) != 0 ? VPR_TRYFREE : 0; sf_buf_free(sf); - sendfile_free_page(pg, nocache); + vm_page_release(pg, flags); if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { struct sendfile_sync *sfs = m->m_ext.ext_arg2; Modified: stable/12/sys/kern/vfs_bio.c ============================================================================== --- stable/12/sys/kern/vfs_bio.c Sun Sep 8 20:28:06 2019 (r352038) +++ stable/12/sys/kern/vfs_bio.c Sun Sep 8 20:37:42 2019 (r352039) @@ -2904,47 +2904,6 @@ vfs_vmio_iodone(struct buf *bp) } /* - * Unwire a page held by a buf and either free it or update the page queues to - * reflect its recent use. - */ -static void -vfs_vmio_unwire(struct buf *bp, vm_page_t m) -{ - bool freed; - - vm_page_lock(m); - if (vm_page_unwire_noq(m)) { - if ((bp->b_flags & B_DIRECT) != 0) - freed = vm_page_try_to_free(m); - else - freed = false; - if (!freed) { - /* - * Use a racy check of the valid bits to determine - * whether we can accelerate reclamation of the page. - * The valid bits will be stable unless the page is - * being mapped or is referenced by multiple buffers, - * and in those cases we expect races to be rare. At - * worst we will either accelerate reclamation of a - * valid page and violate LRU, or unnecessarily defer - * reclamation of an invalid page. - * - * The B_NOREUSE flag marks data that is not expected to - * be reused, so accelerate reclamation in that case - * too. Otherwise, maintain LRU. - */ - if (m->valid == 0 || (bp->b_flags & B_NOREUSE) != 0) - vm_page_deactivate_noreuse(m); - else if (vm_page_active(m)) - vm_page_reference(m); - else - vm_page_deactivate(m); - } - } - vm_page_unlock(m); -} - -/* * Perform page invalidation when a buffer is released. The fully invalid * pages will be reclaimed later in vfs_vmio_truncate(). */ @@ -2953,7 +2912,7 @@ vfs_vmio_invalidate(struct buf *bp) { vm_object_t obj; vm_page_t m; - int i, resid, poffset, presid; + int flags, i, resid, poffset, presid; if (buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); @@ -2972,6 +2931,7 @@ vfs_vmio_invalidate(struct buf *bp) * * See man buf(9) for more information */ + flags = (bp->b_flags & B_NOREUSE) != 0 ? VPR_NOREUSE : 0; obj = bp->b_bufobj->bo_object; resid = bp->b_bufsize; poffset = bp->b_offset & PAGE_MASK; @@ -2993,7 +2953,7 @@ vfs_vmio_invalidate(struct buf *bp) } if (pmap_page_wired_mappings(m) == 0) vm_page_set_invalid(m, poffset, presid); - vfs_vmio_unwire(bp, m); + vm_page_release_locked(m, flags); resid -= presid; poffset = 0; } @@ -3009,7 +2969,7 @@ vfs_vmio_truncate(struct buf *bp, int desiredpages) { vm_object_t obj; vm_page_t m; - int i; + int flags, i; if (bp->b_npages == desiredpages) return; @@ -3024,14 +2984,22 @@ vfs_vmio_truncate(struct buf *bp, int desiredpages) /* * The object lock is needed only if we will attempt to free pages. */ - obj = (bp->b_flags & B_DIRECT) != 0 ? bp->b_bufobj->bo_object : NULL; - if (obj != NULL) + flags = (bp->b_flags & B_NOREUSE) != 0 ? VPR_NOREUSE : 0; + if ((bp->b_flags & B_DIRECT) != 0) { + flags |= VPR_TRYFREE; + obj = bp->b_bufobj->bo_object; VM_OBJECT_WLOCK(obj); + } else { + obj = NULL; + } for (i = desiredpages; i < bp->b_npages; i++) { m = bp->b_pages[i]; KASSERT(m != bogus_page, ("allocbuf: bogus page found")); bp->b_pages[i] = NULL; - vfs_vmio_unwire(bp, m); + if (obj != NULL) + vm_page_release_locked(m, flags); + else + vm_page_release(m, flags); } if (obj != NULL) VM_OBJECT_WUNLOCK(obj); Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Sun Sep 8 20:28:06 2019 (r352038) +++ stable/12/sys/vm/vm_page.c Sun Sep 8 20:37:42 2019 (r352039) @@ -3746,29 +3746,92 @@ vm_page_unswappable(vm_page_t m) vm_page_enqueue(m, PQ_UNSWAPPABLE); } +static void +vm_page_release_toq(vm_page_t m, int flags) +{ + + /* + * Use a check of the valid bits to determine whether we should + * accelerate reclamation of the page. The object lock might not be + * held here, in which case the check is racy. At worst we will either + * accelerate reclamation of a valid page and violate LRU, or + * unnecessarily defer reclamation of an invalid page. + * + * If we were asked to not cache the page, place it near the head of the + * inactive queue so that is reclaimed sooner. + */ + if ((flags & (VPR_TRYFREE | VPR_NOREUSE)) != 0 || m->valid == 0) + vm_page_deactivate_noreuse(m); + else if (vm_page_active(m)) + vm_page_reference(m); + else + vm_page_deactivate(m); +} + /* - * Attempt to free the page. If it cannot be freed, do nothing. Returns true - * if the page is freed and false otherwise. - * - * The page must be managed. The page and its containing object must be - * locked. + * Unwire a page and either attempt to free it or re-add it to the page queues. */ -bool -vm_page_try_to_free(vm_page_t m) +void +vm_page_release(vm_page_t m, int flags) { + vm_object_t object; + bool freed; - vm_page_assert_locked(m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("vm_page_release: page %p is unmanaged", m)); + + vm_page_lock(m); + if (m->object != NULL) + VM_OBJECT_ASSERT_UNLOCKED(m->object); + if (vm_page_unwire_noq(m)) { + if ((object = m->object) == NULL) { + vm_page_free(m); + } else { + freed = false; + if ((flags & VPR_TRYFREE) != 0 && !vm_page_busied(m) && + /* Depends on type stability. */ + VM_OBJECT_TRYWLOCK(object)) { + /* + * Only free unmapped pages. The busy test from + * before the object was locked cannot be relied + * upon. + */ + if ((object->ref_count == 0 || + !pmap_page_is_mapped(m)) && m->dirty == 0 && + !vm_page_busied(m)) { + vm_page_free(m); + freed = true; + } + VM_OBJECT_WUNLOCK(object); + } + + if (!freed) + vm_page_release_toq(m, flags); + } + } + vm_page_unlock(m); +} + +/* See vm_page_release(). */ +void +vm_page_release_locked(vm_page_t m, int flags) +{ + VM_OBJECT_ASSERT_WLOCKED(m->object); - KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("page %p is unmanaged", m)); - if (m->dirty != 0 || vm_page_held(m) || vm_page_busied(m)) - return (false); - if (m->object->ref_count != 0) { - pmap_remove_all(m); - if (m->dirty != 0) - return (false); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("vm_page_release_locked: page %p is unmanaged", m)); + + vm_page_lock(m); + if (vm_page_unwire_noq(m)) { + if ((flags & VPR_TRYFREE) != 0 && + (m->object->ref_count == 0 || !pmap_page_is_mapped(m)) && + m->dirty == 0 && !vm_page_busied(m)) { + vm_page_free(m); + } else { + vm_page_release_toq(m, flags); + } } - vm_page_free(m); - return (true); + vm_page_unlock(m); } /* Modified: stable/12/sys/vm/vm_page.h ============================================================================== --- stable/12/sys/vm/vm_page.h Sun Sep 8 20:28:06 2019 (r352038) +++ stable/12/sys/vm/vm_page.h Sun Sep 8 20:37:42 2019 (r352039) @@ -563,8 +563,12 @@ bool vm_page_reclaim_contig(int req, u_long npages, vm bool vm_page_reclaim_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); +#define VPR_TRYFREE 0x01 +#define VPR_NOREUSE 0x02 +void vm_page_release(vm_page_t m, int flags); +void vm_page_release_locked(vm_page_t m, int flags); bool vm_page_remove(vm_page_t); -int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); +int vm_page_rename(vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex); void vm_page_requeue(vm_page_t m); @@ -575,7 +579,6 @@ void vm_page_set_valid_range(vm_page_t m, int base, in int vm_page_sleep_if_busy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_sunbusy(vm_page_t m); -bool vm_page_try_to_free(vm_page_t m); int vm_page_trysbusy(vm_page_t m); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unswappable(vm_page_t m); From owner-svn-src-all@freebsd.org Sun Sep 8 20:38:59 2019 Return-Path: Delivered-To: svn-src-all@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 5C307E102C; Sun, 8 Sep 2019 20:38:59 +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 46RNS31rpZz44Dj; Sun, 8 Sep 2019 20:38:59 +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 243CA2943; Sun, 8 Sep 2019 20:38:59 +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 x88KcxRD034426; Sun, 8 Sep 2019 20:38:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Kcx9D034425; Sun, 8 Sep 2019 20:38:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082038.x88Kcx9D034425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:38:59 +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: r352040 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 352040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:38:59 -0000 Author: markj Date: Sun Sep 8 20:38:58 2019 New Revision: 352040 URL: https://svnweb.freebsd.org/changeset/base/352040 Log: MFC r351332: Unconditionally enable debug.vm_lowmem. Modified: stable/12/sys/vm/vm_kern.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Sun Sep 8 20:37:42 2019 (r352039) +++ stable/12/sys/vm/vm_kern.c Sun Sep 8 20:38:58 2019 (r352040) @@ -839,7 +839,6 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) #endif } -#ifdef DIAGNOSTIC /* * Allow userspace to directly trigger the VM drain routine for testing * purposes. @@ -862,4 +861,3 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, debug_vm_lowmem, "I", "set to trigger vm_lowmem event with given flags"); -#endif From owner-svn-src-all@freebsd.org Sun Sep 8 20:39:56 2019 Return-Path: Delivered-To: svn-src-all@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 8E6B5E11EE; Sun, 8 Sep 2019 20:39:56 +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 46RNT83BScz44PF; Sun, 8 Sep 2019 20:39:56 +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 519FC2947; Sun, 8 Sep 2019 20:39:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88KdupC034516; Sun, 8 Sep 2019 20:39:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KduwJ034515; Sun, 8 Sep 2019 20:39:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082039.x88KduwJ034515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:39: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: r352041 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:39:56 -0000 Author: markj Date: Sun Sep 8 20:39:55 2019 New Revision: 352041 URL: https://svnweb.freebsd.org/changeset/base/352041 Log: MFC r351672: Restrict the input domain set in cpuset_setdomain(2) to all_domains. Modified: stable/12/sys/kern/kern_cpuset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Sun Sep 8 20:38:58 2019 (r352040) +++ stable/12/sys/kern/kern_cpuset.c Sun Sep 8 20:39:55 2019 (r352041) @@ -2156,6 +2156,14 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le DOMAINSET_COPY(mask, &domain.ds_mask); domain.ds_policy = policy; + /* + * Sanitize the provided mask. + */ + if (!DOMAINSET_SUBSET(&all_domains, &domain.ds_mask)) { + error = EINVAL; + goto out; + } + /* Translate preferred policy into a mask and fallback. */ if (policy == DOMAINSET_POLICY_PREFER) { /* Only support a single preferred domain. */ @@ -2165,12 +2173,12 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le } domain.ds_prefer = DOMAINSET_FFS(&domain.ds_mask) - 1; /* This will be constrained by domainset_shadow(). */ - DOMAINSET_FILL(&domain.ds_mask); + DOMAINSET_COPY(&all_domains, &domain.ds_mask); } /* - * When given an impossible policy, fall back to interleaving - * across all domains + * When given an impossible policy, fall back to interleaving + * across all domains. */ if (domainset_empty_vm(&domain)) domainset_copy(&domainset2, &domain); From owner-svn-src-all@freebsd.org Sun Sep 8 20:41:01 2019 Return-Path: Delivered-To: svn-src-all@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 B86E7E12C1; Sun, 8 Sep 2019 20:41:01 +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 46RNVP49b1z44Xb; Sun, 8 Sep 2019 20:41:01 +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 7267A296E; Sun, 8 Sep 2019 20:41:01 +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 x88Kf1iJ035298; Sun, 8 Sep 2019 20:41:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Kf0Vs035295; Sun, 8 Sep 2019 20:41:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082041.x88Kf0Vs035295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:41: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: r352042 - stable/12/lib/libfetch X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libfetch X-SVN-Commit-Revision: 352042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:41:01 -0000 Author: markj Date: Sun Sep 8 20:41:00 2019 New Revision: 352042 URL: https://svnweb.freebsd.org/changeset/base/352042 Log: MFC r351573: Document fetchReqHTTP(). Modified: stable/12/lib/libfetch/Makefile stable/12/lib/libfetch/fetch.3 stable/12/lib/libfetch/http.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libfetch/Makefile ============================================================================== --- stable/12/lib/libfetch/Makefile Sun Sep 8 20:39:55 2019 (r352041) +++ stable/12/lib/libfetch/Makefile Sun Sep 8 20:41:00 2019 (r352042) @@ -68,6 +68,7 @@ MLINKS+= fetch.3 fetchPutFTP.3 MLINKS+= fetch.3 fetchPutFile.3 MLINKS+= fetch.3 fetchPutHTTP.3 MLINKS+= fetch.3 fetchPutURL.3 +MLINKS+= fetch.3 fetchReqHTTP.3 MLINKS+= fetch.3 fetchStat.3 MLINKS+= fetch.3 fetchStatFTP.3 MLINKS+= fetch.3 fetchStatFile.3 Modified: stable/12/lib/libfetch/fetch.3 ============================================================================== --- stable/12/lib/libfetch/fetch.3 Sun Sep 8 20:39:55 2019 (r352041) +++ stable/12/lib/libfetch/fetch.3 Sun Sep 8 20:41:00 2019 (r352042) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2016 +.Dd August 28, 2019 .Dt FETCH 3 .Os .Sh NAME @@ -53,6 +53,7 @@ .Nm fetchPutHTTP , .Nm fetchStatHTTP , .Nm fetchListHTTP , +.Nm fetchReqHTTP , .Nm fetchXGetFTP , .Nm fetchGetFTP , .Nm fetchPutFTP , @@ -112,6 +113,8 @@ .Ft struct url_ent * .Fn fetchListHTTP "struct url *u" "const char *flags" .Ft FILE * +.Fn fetchReqHTTP "struct url *u" "const char *method" "const char *flags" "const char *content_type" "const char *body" +.Ft FILE * .Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags" .Ft FILE * .Fn fetchGetFTP "struct url *u" "const char *flags" @@ -355,9 +358,10 @@ and password "anonymous@". .Sh HTTP SCHEME The .Fn fetchXGetHTTP , -.Fn fetchGetHTTP -and +.Fn fetchGetHTTP , .Fn fetchPutHTTP +and +.Fn fetchReqHTTP functions implement the HTTP/1.1 protocol. With a little luck, there is even a chance that they comply with RFC2616 and RFC2617. @@ -386,6 +390,18 @@ will send a conditional .Li If-Modified-Since HTTP header to only fetch the content if it is newer than .Va ims_time . +.Pp +The function +.Fn fetchReqHTTP +can be used to make requests with an arbitrary HTTP verb, +including POST, DELETE, CONNECT, OPTIONS, TRACE or PATCH. +This can be done by setting the argument +.Fa method +to the intended verb, such as +.Ql POST , +and +.Fa body +to the content. .Pp Since there seems to be no good way of implementing the HTTP PUT method in a manner consistent with the rest of the Modified: stable/12/lib/libfetch/http.c ============================================================================== --- stable/12/lib/libfetch/http.c Sun Sep 8 20:39:55 2019 (r352041) +++ stable/12/lib/libfetch/http.c Sun Sep 8 20:41:00 2019 (r352042) @@ -2093,6 +2093,9 @@ fetchListHTTP(struct url *url __unused, const char *fl return (NULL); } +/* + * Arbitrary HTTP verb and content requests + */ FILE * fetchReqHTTP(struct url *URL, const char *method, const char *flags, const char *content_type, const char *body) From owner-svn-src-all@freebsd.org Sun Sep 8 20:42:02 2019 Return-Path: Delivered-To: svn-src-all@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 1BEFEE134E; Sun, 8 Sep 2019 20:42:02 +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 46RNWY6vBxz44ql; Sun, 8 Sep 2019 20:42:01 +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 B5A7F2AD5; Sun, 8 Sep 2019 20:42:01 +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 x88Kg1wn040077; Sun, 8 Sep 2019 20:42:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Kg18v040076; Sun, 8 Sep 2019 20:42:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082042.x88Kg18v040076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:42: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: r352043 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 352043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:42:02 -0000 Author: markj Date: Sun Sep 8 20:42:01 2019 New Revision: 352043 URL: https://svnweb.freebsd.org/changeset/base/352043 Log: MFC r351613: Remove unused VM page locking macros. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Sun Sep 8 20:42:28 2019 Return-Path: Delivered-To: svn-src-all@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 D6124E153C; Sun, 8 Sep 2019 20:42: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 46RNX44Mljz44yY; Sun, 8 Sep 2019 20:42: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 7A3CA2AED; Sun, 8 Sep 2019 20:42: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 x88KgSLj040162; Sun, 8 Sep 2019 20:42:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KgS5F040161; Sun, 8 Sep 2019 20:42:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082042.x88KgS5F040161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:42: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: r352044 - stable/12/sys/dev/sound/midi X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/sound/midi X-SVN-Commit-Revision: 352044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:42:28 -0000 Author: markj Date: Sun Sep 8 20:42:28 2019 New Revision: 352044 URL: https://svnweb.freebsd.org/changeset/base/352044 Log: MFC r351624: Properly check for an interrupted cv_wait_sig(). Modified: stable/12/sys/dev/sound/midi/sequencer.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/midi/sequencer.c ============================================================================== --- stable/12/sys/dev/sound/midi/sequencer.c Sun Sep 8 20:42:01 2019 (r352043) +++ stable/12/sys/dev/sound/midi/sequencer.c Sun Sep 8 20:42:28 2019 (r352044) @@ -912,7 +912,7 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int iof goto err1; retval = cv_wait_sig(&scp->in_cv, &scp->seq_lock); - if (retval == EINTR) + if (retval != 0) goto err1; } @@ -977,7 +977,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io * We slept, maybe things have changed since last * dying check */ - if (retval == EINTR) + if (retval != 0) goto err0; #if 0 /* From owner-svn-src-all@freebsd.org Sun Sep 8 20:42:56 2019 Return-Path: Delivered-To: svn-src-all@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 54F0BE15BA; Sun, 8 Sep 2019 20:42:56 +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 46RNXc1dXwz4569; Sun, 8 Sep 2019 20:42:56 +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 1B7552B01; Sun, 8 Sep 2019 20:42:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88Kgtsd040227; Sun, 8 Sep 2019 20:42:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KgtQG040226; Sun, 8 Sep 2019 20:42:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082042.x88KgtQG040226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:42:55 +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: r352045 - stable/12/usr.bin/cpuset X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/cpuset X-SVN-Commit-Revision: 352045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:42:56 -0000 Author: markj Date: Sun Sep 8 20:42:55 2019 New Revision: 352045 URL: https://svnweb.freebsd.org/changeset/base/352045 Log: MFC r351671: Fix an off-by-one bug in the CPU and domain ID parser. Modified: stable/12/usr.bin/cpuset/cpuset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/cpuset/cpuset.c ============================================================================== --- stable/12/usr.bin/cpuset/cpuset.c Sun Sep 8 20:42:28 2019 (r352044) +++ stable/12/usr.bin/cpuset/cpuset.c Sun Sep 8 20:42:55 2019 (r352045) @@ -100,10 +100,10 @@ parselist(char *list, struct bitset *mask, int size) for (l = list; *l != '\0';) { if (isdigit(*l)) { curnum = atoi(l); - if (curnum > size) + if (curnum >= size) errx(EXIT_FAILURE, "List entry %d exceeds maximum of %d", - curnum, size); + curnum, size - 1); while (isdigit(*l)) l++; switch (state) { From owner-svn-src-all@freebsd.org Sun Sep 8 20:53:30 2019 Return-Path: Delivered-To: svn-src-all@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 8E394E1E08; Sun, 8 Sep 2019 20:53:30 +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 46RNmp341Kz45mw; Sun, 8 Sep 2019 20:53:30 +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 338C22CD0; Sun, 8 Sep 2019 20:53:30 +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 x88KrUcR046180; Sun, 8 Sep 2019 20:53:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88KrTtb046176; Sun, 8 Sep 2019 20:53:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082053.x88KrTtb046176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 20:53:29 +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: r352046 - in stable/12: cddl/contrib/opensolaris/cmd/lockstat share/man/man4 sys/kern sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/lockstat share/man/man4 sys/kern sys/sys X-SVN-Commit-Revision: 352046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 20:53:30 -0000 Author: markj Date: Sun Sep 8 20:53:29 2019 New Revision: 352046 URL: https://svnweb.freebsd.org/changeset/base/352046 Log: MFC r351361, r351363: Add lockmgr(9) probes to the lockstat DTrace provider. Modified: stable/12/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c stable/12/share/man/man4/dtrace_lockstat.4 stable/12/sys/kern/kern_lock.c stable/12/sys/kern/kern_lockstat.c stable/12/sys/sys/lockstat.h Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Sep 8 20:42:55 2019 (r352045) +++ stable/12/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Sep 8 20:53:29 2019 (r352046) @@ -158,29 +158,33 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = { { 'C', "Lock", "R/W writer blocked by readers", "nsec", "lockstat:::rw-block", "arg2 == 0 && arg3 == 0 && arg4" }, { 'C', "Lock", "R/W reader blocked by writer", "nsec", - "lockstat:::rw-block", "arg2 != 0 && arg3 == 1" }, + "lockstat:::rw-block", "arg2 == 1 && arg3 == 1" }, { 'C', "Lock", "R/W reader blocked by write wanted", "nsec", - "lockstat:::rw-block", "arg2 != 0 && arg3 == 0 && arg4" }, + "lockstat:::rw-block", "arg2 == 1 && arg3 == 0 && arg4" }, { 'C', "Lock", "R/W writer spin on writer", "nsec", "lockstat:::rw-spin", "arg2 == 0 && arg3 == 1" }, { 'C', "Lock", "R/W writer spin on readers", "nsec", "lockstat:::rw-spin", "arg2 == 0 && arg3 == 0 && arg4" }, { 'C', "Lock", "R/W reader spin on writer", "nsec", - "lockstat:::rw-spin", "arg2 != 0 && arg3 == 1" }, + "lockstat:::rw-spin", "arg2 == 1 && arg3 == 1" }, { 'C', "Lock", "R/W reader spin on write wanted", "nsec", - "lockstat:::rw-spin", "arg2 != 0 && arg3 == 0 && arg4" }, + "lockstat:::rw-spin", "arg2 == 1 && arg3 == 0 && arg4" }, { 'C', "Lock", "SX exclusive block", "nsec", "lockstat:::sx-block", "arg2 == 0" }, { 'C', "Lock", "SX shared block", "nsec", - "lockstat:::sx-block", "arg2 != 0" }, + "lockstat:::sx-block", "arg2 == 1" }, { 'C', "Lock", "SX exclusive spin", "nsec", "lockstat:::sx-spin", "arg2 == 0" }, { 'C', "Lock", "SX shared spin", "nsec", - "lockstat:::sx-spin", "arg2 != 0" }, - { 'C', "Lock", "Unknown event (type 16)", "units" }, - { 'C', "Lock", "Unknown event (type 17)", "units" }, - { 'C', "Lock", "Unknown event (type 18)", "units" }, - { 'C', "Lock", "Unknown event (type 19)", "units" }, + "lockstat:::sx-spin", "arg2 == 1" }, + { 'C', "Lock", "lockmgr writer blocked by writer", "nsec", + "lockstat:::lockmgr-block", "arg2 == 0 && arg3 == 1" }, + { 'C', "Lock", "lockmgr writer blocked by readers", "nsec", + "lockstat:::lockmgr-block", "arg2 == 0 && arg3 == 0 && arg4" }, + { 'C', "Lock", "lockmgr reader blocked by writer", "nsec", + "lockstat:::lockmgr-block", "arg2 == 1 && arg3 == 1" }, + { 'C', "Lock", "lockmgr reader blocked by write wanted", "nsec", + "lockstat:::lockmgr-block", "arg2 == 1 && arg3 == 0 && arg4" }, { 'C', "Lock", "Unknown event (type 20)", "units" }, { 'C', "Lock", "Unknown event (type 21)", "units" }, { 'C', "Lock", "Unknown event (type 22)", "units" }, @@ -211,8 +215,12 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = { { 'H', "Lock", "SX exclusive hold", "nsec", "lockstat:::sx-release", "arg1 == 0", "lockstat:::sx-acquire" }, - { 'H', "Lock", "Unknown event (type 38)", "units" }, - { 'H', "Lock", "Unknown event (type 39)", "units" }, + { 'H', "Lock", "lockmgr shared hold", "nsec", + "lockstat:::lockmgr-release", "arg1 == 1", + "lockstat:::lockmgr-acquire" }, + { 'H', "Lock", "lockmgr exclusive hold", "nsec", + "lockstat:::lockmgr-release,lockstat:::lockmgr-disown", "arg1 == 0", + "lockstat:::lockmgr-acquire" }, { 'H', "Lock", "Unknown event (type 40)", "units" }, { 'H', "Lock", "Unknown event (type 41)", "units" }, { 'H', "Lock", "Unknown event (type 42)", "units" }, Modified: stable/12/share/man/man4/dtrace_lockstat.4 ============================================================================== --- stable/12/share/man/man4/dtrace_lockstat.4 Sun Sep 8 20:42:55 2019 (r352045) +++ stable/12/share/man/man4/dtrace_lockstat.4 Sun Sep 8 20:53:29 2019 (r352046) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2018 +.Dd August 20, 2019 .Dt DTRACE_LOCKSTAT 4 .Os .Sh NAME @@ -50,6 +50,12 @@ .Fn lockstat:::sx-spin "struct sx *" "uint64_t" .Fn lockstat:::sx-upgrade "struct sx *" .Fn lockstat:::sx-downgrade "struct sx *" +.Fn lockstat:::lockmgr-acquire "struct lock *" "int" +.Fn lockstat:::lockmgr-release "struct lock *" "int" +.Fn lockstat:::lockmgr-disown "struct lock *" "int" +.Fn lockstat:::lockmgr-block "struct lock *" "uint64_t" "int" "int" "int" +.Fn lockstat:::lockmgr-upgrade "struct lock *" +.Fn lockstat:::lockmgr-downgrade "struct lock *" .Fn lockstat:::thread-spin "struct mtx *" "uint64" .Sh DESCRIPTION The DTrace @@ -62,6 +68,7 @@ The provider contains DTrace probes for inspecting kernel lock state transitions. Probes exist for the +.Xr lockmgr 9 , .Xr mutex 9 , .Xr rwlock 9 , and @@ -159,76 +166,50 @@ The second argument is if the lock is being acquired or released as a writer, and .Dv 1 if it is being acquired or released as a reader. -.Pp The -.Fn lockstat:::rw-block -probe fires when a thread removes itself from the CPU while -waiting to acquire a -.Xr rwlock 9 . -The -.Fn lockstat:::rw-spin -probe fires when a thread spins while waiting to acquire a -.Xr rwlock 9 . -Both probes take the same set of arguments. -The first argument is a pointer to the lock structure that describes -the lock. -The second argument is the length of time, in nanoseconds, -that the waiting thread was off the CPU or spinning for the lock. -The third argument is -.Dv 0 -if the thread is attempting to acquire the lock as a writer, and -.Dv 1 -if the thread is attempting to acquire the lock as a reader. -The fourth argument is -.Dv 0 -if the thread is waiting for a writer to release the lock, and -.Dv 1 -if the thread is waiting for a reader to release the lock. -The fifth argument is the number of readers that held the lock when -the thread first attempted to acquire the lock. -This argument will be -.Dv 0 -if the fourth argument is -.Dv 0 . -.Pp -The -.Fn lockstat:::rw-upgrade -probe fires when a thread successfully upgrades a held -.Xr rwlock 9 -read lock to a write lock. -The -.Fn lockstat:::rw-downgrade -probe fires when a thread downgrades a held -.Xr rwlock 9 -write lock to a read lock. -The only argument is a pointer to the structure which describes -the lock being acquired. -.Pp -The .Fn lockstat:::sx-acquire and -.Fn lockstat:::sx-release -probes fire when a +.Fn lockstat:::sx-release , +and +.Fn lockstat:::lockmgr-acquire +and +.Fn lockstat:::lockmgr-release +probes fire upon the corresponding events for .Xr sx 9 -is acquired or released, respectively. +and +.Xr lockmgr 9 +locks, respectively. +The +.Fn lockstat:::lockmgr-disown +probe fires when a +.Xr lockmgr 9 +exclusive lock is disowned. +In this state, the lock remains exclusively held, but may be +released by a different thread. +The +.Fn lockstat:::lockmgr-release +probe does not fire when releasing a disowned lock. The first argument is a pointer to the structure which describes -the lock being acquired. +the lock being disowned. The second argument is -.Dv 0 -if the shared lock is being acquired or released, and -.Dv 1 -if the exclusive lock is being acquired or released. +.Dv 0 , +for compatibility with +.Fn lockstat:::lockmgr-release . .Pp The -.Fn lockstat:::sx-block -probe fires when a thread takes itself off the CPU while -waiting to acquire a -.Xr sx 9 . +.Fn lockstat:::rw-block , +.Fn lockstat:::sx-block , +and +.Fn lockstat:::lockmgr-block +probes fire when a thread removes itself from the CPU while +waiting to acquire a lock of the corresponding type. The +.Fn lockstat:::rw-spin +and .Fn lockstat:::sx-spin -probe fires when a thread spins while waiting to acquire a -.Xr sx 9 . -Both probes take the same set of arguments. +probes fire when a thread spins while waiting to acquire a lock +of the corresponding type. +All probes take the same set of arguments. The first argument is a pointer to the lock structure that describes the lock. The second argument is the length of time, in nanoseconds, @@ -240,28 +221,40 @@ if the thread is attempting to acquire the lock as a w if the thread is attempting to acquire the lock as a reader. The fourth argument is .Dv 0 -if the thread is waiting for a writer to release the lock, and +if the thread is waiting for a reader to release the lock, and .Dv 1 -if the thread is waiting for a reader to release the lock. +if the thread is waiting for a writer to release the lock. The fifth argument is the number of readers that held the lock when the thread first attempted to acquire the lock. This argument will be .Dv 0 if the fourth argument is -.Dv 0 . +.Dv 1 . .Pp The +.Fn lockstat:::lockmgr-upgrade , +.Fn lockstat:::rw-upgrade , +and .Fn lockstat:::sx-upgrade -probe fires when a thread successfully upgrades a held +probes fire when a thread successfully upgrades a held +.Xr lockmgr 9 , +.Xr rwlock 9 , +or .Xr sx 9 -shared lock to an exclusive lock. +shared/reader lock to an exclusive/writer lock. The only argument is a pointer to the structure which describes the lock being acquired. The +.Fn lockstat:::lockmgr-downgrade , +.Fn lockstat:::rw-downgrade , +and .Fn lockstat:::sx-downgrade -probe fires when a thread downgrades a held +probes fire when a thread downgrades a held +.Xr lockmgr 9 , +.Xr rwlock 9 , +or .Xr sx 9 -exclusive lock to a shared lock. +exclusive/writer lock to a shared/reader lock. .Pp The .Fn lockstat:::thread-spin @@ -291,10 +284,11 @@ provider first appeared in .Fx 9 . .Sh AUTHORS This manual page was written by -.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org . +.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org +and +.An -nosplit +.An Mark Johnston Aq Mt markj@FreeBSD.org . .Sh BUGS Probes for -.Xr lockmgr 9 -and .Xr rmlock 9 locks have not yet been added. Modified: stable/12/sys/kern/kern_lock.c ============================================================================== --- stable/12/sys/kern/kern_lock.c Sun Sep 8 20:42:55 2019 (r352045) +++ stable/12/sys/kern/kern_lock.c Sun Sep 8 20:53:29 2019 (r352046) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -201,8 +202,8 @@ lockmgr_note_shared_acquire(struct lock *lk, int conte uint64_t waittime, const char *file, int line, int flags) { - lock_profile_obtain_lock_success(&lk->lock_object, contested, waittime, - file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(lockmgr__acquire, lk, contested, + waittime, file, line, LOCKSTAT_READER); LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, file, line); WITNESS_LOCK(&lk->lock_object, LK_TRYWIT(flags), file, line); TD_LOCKS_INC(curthread); @@ -214,7 +215,7 @@ static void lockmgr_note_shared_release(struct lock *lk, const char *file, int line) { - lock_profile_release_lock(&lk->lock_object); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER); WITNESS_UNLOCK(&lk->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, file, line); TD_LOCKS_DEC(curthread); @@ -226,8 +227,8 @@ lockmgr_note_exclusive_acquire(struct lock *lk, int co uint64_t waittime, const char *file, int line, int flags) { - lock_profile_obtain_lock_success(&lk->lock_object, contested, waittime, - file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(lockmgr__acquire, lk, contested, + waittime, file, line, LOCKSTAT_WRITER); LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | LK_TRYWIT(flags), file, line); @@ -239,7 +240,7 @@ static void lockmgr_note_exclusive_release(struct lock *lk, const char *file, int line) { - lock_profile_release_lock(&lk->lock_object); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER); LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); @@ -553,6 +554,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc const char *iwmesg; int ipri, itimo; +#ifdef KDTRACE_HOOKS + uint64_t sleep_time = 0; +#endif #ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; @@ -643,8 +647,14 @@ retry_sleepq: * shared lock and the shared waiters flag is set, * we will sleep. */ +#ifdef KDTRACE_HOOKS + sleep_time -= lockstat_nsecs(&lk->lock_object); +#endif error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, SQ_SHARED_QUEUE); +#ifdef KDTRACE_HOOKS + sleep_time += lockstat_nsecs(&lk->lock_object); +#endif flags &= ~LK_INTERLOCK; if (error) { LOCK_LOG3(lk, @@ -656,6 +666,12 @@ retry_sleepq: __func__, lk); } if (error == 0) { +#ifdef KDTRACE_HOOKS + if (sleep_time != 0) + LOCKSTAT_RECORD4(lockmgr__block, lk, sleep_time, + LOCKSTAT_READER, (x & LK_SHARE) == 0, + (x & LK_SHARE) == 0 ? 0 : LK_SHARERS(x)); +#endif #ifdef LOCK_PROFILING lockmgr_note_shared_acquire(lk, contested, waittime, file, line, flags); @@ -680,6 +696,9 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc const char *iwmesg; int ipri, itimo; +#ifdef KDTRACE_HOOKS + uint64_t sleep_time = 0; +#endif #ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; @@ -819,8 +838,14 @@ retry_sleepq: * exclusive lock and the exclusive waiters flag * is set, we will sleep. */ +#ifdef KDTRACE_HOOKS + sleep_time -= lockstat_nsecs(&lk->lock_object); +#endif error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, SQ_EXCLUSIVE_QUEUE); +#ifdef KDTRACE_HOOKS + sleep_time += lockstat_nsecs(&lk->lock_object); +#endif flags &= ~LK_INTERLOCK; if (error) { LOCK_LOG3(lk, @@ -832,6 +857,12 @@ retry_sleepq: __func__, lk); } if (error == 0) { +#ifdef KDTRACE_HOOKS + if (sleep_time != 0) + LOCKSTAT_RECORD4(lockmgr__block, lk, sleep_time, + LOCKSTAT_WRITER, (x & LK_SHARE) == 0, + (x & LK_SHARE) == 0 ? 0 : LK_SHARERS(x)); +#endif #ifdef LOCK_PROFILING lockmgr_note_exclusive_acquire(lk, contested, waittime, file, line, flags); @@ -875,6 +906,7 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct l line); WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | LK_TRYWIT(flags), file, line); + LOCKSTAT_RECORD0(lockmgr__upgrade, lk); TD_SLOCKS_DEC(curthread); goto out; } @@ -1022,7 +1054,8 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i goto out; } if (tid != LK_KERNPROC) - lock_profile_release_lock(&lk->lock_object); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, + LOCKSTAT_WRITER); if (x == tid && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) goto out; @@ -1203,7 +1236,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo break; case LK_DOWNGRADE: _lockmgr_assert(lk, KA_XLOCKED, file, line); - LOCK_LOG_LOCK("XDOWNGRADE", &lk->lock_object, 0, 0, file, line); WITNESS_DOWNGRADE(&lk->lock_object, 0, file, line); /* @@ -1229,6 +1261,8 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo break; cpu_spinwait(); } + LOCK_LOG_LOCK("XDOWNGRADE", &lk->lock_object, 0, 0, file, line); + LOCKSTAT_RECORD0(lockmgr__downgrade, lk); break; case LK_RELEASE: _lockmgr_assert(lk, KA_LOCKED, file, line); @@ -1460,6 +1494,7 @@ _lockmgr_disown(struct lock *lk, const char *file, int if (LK_HOLDER(lk->lk_lock) != tid) return; lock_profile_release_lock(&lk->lock_object); + LOCKSTAT_RECORD1(lockmgr__disown, lk, LOCKSTAT_WRITER); LOCK_LOG_LOCK("XDISOWN", &lk->lock_object, 0, 0, file, line); WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); TD_LOCKS_DEC(curthread); Modified: stable/12/sys/kern/kern_lockstat.c ============================================================================== --- stable/12/sys/kern/kern_lockstat.c Sun Sep 8 20:42:55 2019 (r352045) +++ stable/12/sys/kern/kern_lockstat.c Sun Sep 8 20:53:29 2019 (r352046) @@ -62,6 +62,14 @@ SDT_PROBE_DEFINE2(lockstat, , , sx__spin, "struct sx * SDT_PROBE_DEFINE1(lockstat, , , sx__upgrade, "struct sx *"); SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct sx *"); +SDT_PROBE_DEFINE2(lockstat, , , lockmgr__acquire, "struct lock *", "int"); +SDT_PROBE_DEFINE2(lockstat, , , lockmgr__release, "struct lock *", "int"); +SDT_PROBE_DEFINE2(lockstat, , , lockmgr__disown, "struct lock *", "int"); +SDT_PROBE_DEFINE5(lockstat, , , lockmgr__block, "struct lock *", "uint64_t", + "int", "int", "int"); +SDT_PROBE_DEFINE1(lockstat, , , lockmgr__upgrade, "struct lock *"); +SDT_PROBE_DEFINE1(lockstat, , , lockmgr__downgrade, "struct lock *"); + SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t"); volatile bool __read_frequently lockstat_enabled; Modified: stable/12/sys/sys/lockstat.h ============================================================================== --- stable/12/sys/sys/lockstat.h Sun Sep 8 20:42:55 2019 (r352045) +++ stable/12/sys/sys/lockstat.h Sun Sep 8 20:53:29 2019 (r352046) @@ -65,6 +65,13 @@ SDT_PROBE_DECLARE(lockstat, , , sx__spin); SDT_PROBE_DECLARE(lockstat, , , sx__upgrade); SDT_PROBE_DECLARE(lockstat, , , sx__downgrade); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__acquire); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__release); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__disown); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__block); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__upgrade); +SDT_PROBE_DECLARE(lockstat, , , lockmgr__downgrade); + SDT_PROBE_DECLARE(lockstat, , , thread__spin); #define LOCKSTAT_WRITER 0 From owner-svn-src-all@freebsd.org Sun Sep 8 21:21:33 2019 Return-Path: Delivered-To: svn-src-all@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 5AC30E3890; Sun, 8 Sep 2019 21:21:33 +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 46RPP91lkCz481x; Sun, 8 Sep 2019 21:21:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FE5B32DC; Sun, 8 Sep 2019 21:21:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88LLWIi062291; Sun, 8 Sep 2019 21:21:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88LLWv3062290; Sun, 8 Sep 2019 21:21:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909082121.x88LLWv3062290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Sep 2019 21:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r352047 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: markj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 352047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 21:21:33 -0000 Author: markj Date: Sun Sep 8 21:21:32 2019 New Revision: 352047 URL: https://svnweb.freebsd.org/changeset/base/352047 Log: Release mhorne. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Sep 8 20:53:29 2019 (r352046) +++ svnadmin/conf/mentors Sun Sep 8 21:21:32 2019 (r352047) @@ -24,7 +24,6 @@ johalun imp kadesai ken Co-mentor: scottl, ambrisko leitao jhibbits Co-mentor: nwhitehorn mahrens mckusick -mhorne markj miwi araujo mjoras rstone ram ken Co-mentor: mav From owner-svn-src-all@freebsd.org Sun Sep 8 21:37:52 2019 Return-Path: Delivered-To: svn-src-all@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 E6E49E3D65; Sun, 8 Sep 2019 21:37:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RPm05nHrz48g4; Sun, 8 Sep 2019 21:37:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB12A36C6; Sun, 8 Sep 2019 21:37:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88Lbq0l070190; Sun, 8 Sep 2019 21:37:52 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88LbqGP070189; Sun, 8 Sep 2019 21:37:52 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909082137.x88LbqGP070189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Sep 2019 21:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352048 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 21:37:53 -0000 Author: mhorne Date: Sun Sep 8 21:37:52 2019 New Revision: 352048 URL: https://svnweb.freebsd.org/changeset/base/352048 Log: Fix cpuwhich_t column width Not bumping .Dd since this is purely a format change. Approved by: markj (mentor) Modified: head/lib/libc/sys/cpuset.2 Modified: head/lib/libc/sys/cpuset.2 ============================================================================== --- head/lib/libc/sys/cpuset.2 Sun Sep 8 21:21:32 2019 (r352047) +++ head/lib/libc/sys/cpuset.2 Sun Sep 8 21:37:52 2019 (r352048) @@ -96,7 +96,7 @@ is interpreted and is of type The .Fa which argument may have the following values: -.Bl -column CPU_WHICH_CPUSET -offset indent +.Bl -column CPU_WHICH_INTRHANDLER -offset indent .It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" .It Dv CPU_WHICH_JAIL Ta "id is jid (jail id)" From owner-svn-src-all@freebsd.org Sun Sep 8 22:52:48 2019 Return-Path: Delivered-To: svn-src-all@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 D8C91E5FA8; Sun, 8 Sep 2019 22:52:48 +0000 (UTC) (envelope-from cem@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 46RRQS5Q6Rz4D2P; Sun, 8 Sep 2019 22:52:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E92445CE; Sun, 8 Sep 2019 22:52:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88Mqm2S017437; Sun, 8 Sep 2019 22:52:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88Mqm4g017434; Sun, 8 Sep 2019 22:52:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909082252.x88Mqm4g017434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 8 Sep 2019 22:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352050 - head/sys/gdb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/gdb X-SVN-Commit-Revision: 352050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 22:52:48 -0000 Author: cem Date: Sun Sep 8 22:52:47 2019 New Revision: 352050 URL: https://svnweb.freebsd.org/changeset/base/352050 Log: gdb(4): Root a sysctl tree at 'debug.gdb.' Like debug.ddb and debug.kdb. Rename 'debug.gdbcons' to 'debug.gdb.cons,' but leave the old name as a compatibility alias. Modified: head/sys/gdb/gdb_cons.c head/sys/gdb/gdb_int.h head/sys/gdb/gdb_main.c Modified: head/sys/gdb/gdb_cons.c ============================================================================== --- head/sys/gdb/gdb_cons.c Sun Sep 8 21:43:19 2019 (r352049) +++ head/sys/gdb/gdb_cons.c Sun Sep 8 22:52:47 2019 (r352050) @@ -60,8 +60,11 @@ struct gdbcons { static struct gdbcons state = { -1 }; static int gdbcons_enable = 0; +SYSCTL_INT(_debug_gdb, OID_AUTO, cons, CTLFLAG_RWTUN, &gdbcons_enable, 0, + "copy console messages to GDB"); +/* Legacy sysctl alias */ SYSCTL_INT(_debug, OID_AUTO, gdbcons, CTLFLAG_RWTUN, &gdbcons_enable, - 0, "copy console messages to GDB"); + 0, "copy console messages to GDB"); static void gdb_cnprobe(struct consdev *cp) Modified: head/sys/gdb/gdb_int.h ============================================================================== --- head/sys/gdb/gdb_int.h Sun Sep 8 21:43:19 2019 (r352049) +++ head/sys/gdb/gdb_int.h Sun Sep 8 22:52:47 2019 (r352050) @@ -31,9 +31,13 @@ #ifndef _GDB_GDB_INT_H_ #define _GDB_GDB_INT_H_ +#include + #ifndef EOF #define EOF (-1) #endif + +SYSCTL_DECL(_debug_gdb); extern struct gdb_dbgport *gdb_cur; Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Sun Sep 8 21:43:19 2019 (r352049) +++ head/sys/gdb/gdb_main.c Sun Sep 8 22:52:47 2019 (r352050) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +SYSCTL_NODE(_debug, OID_AUTO, gdb, CTLFLAG_RW, 0, "GDB settings"); + static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; From owner-svn-src-all@freebsd.org Mon Sep 9 01:33:46 2019 Return-Path: Delivered-To: svn-src-all@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 8C3C4EA113; Mon, 9 Sep 2019 01:33:46 +0000 (UTC) (envelope-from cem@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 46RW0B38R8z4LkP; Mon, 9 Sep 2019 01:33:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F1286219; Mon, 9 Sep 2019 01:33:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x891Xk2A011444; Mon, 9 Sep 2019 01:33:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x891Xjor011442; Mon, 9 Sep 2019 01:33:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909090133.x891Xjor011442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 9 Sep 2019 01:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352053 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 352053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 01:33:46 -0000 Author: cem Date: Mon Sep 9 01:33:45 2019 New Revision: 352053 URL: https://svnweb.freebsd.org/changeset/base/352053 Log: ddb(4): Move an extern variable declaration to a header Trivial cleanup, no functional change. Modified: head/sys/ddb/db_command.h head/sys/ddb/db_run.c Modified: head/sys/ddb/db_command.h ============================================================================== --- head/sys/ddb/db_command.h Mon Sep 9 01:05:51 2019 (r352052) +++ head/sys/ddb/db_command.h Mon Sep 9 01:33:45 2019 (r352053) @@ -49,6 +49,7 @@ void db_command_init(void); void db_command_loop(void); void db_command_script(const char *command); +extern int db_cmd_loop_done; extern db_addr_t db_dot; /* current location */ extern db_addr_t db_last_addr; /* last explicit address typed */ extern db_addr_t db_prev; /* last address examined Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Mon Sep 9 01:05:51 2019 (r352052) +++ head/sys/ddb/db_run.c Mon Sep 9 01:33:45 2019 (r352053) @@ -48,8 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include #define STEP_ONCE 1 #define STEP_RETURN 2 @@ -331,8 +332,6 @@ db_clear_single_step(void) } #endif /* SOFTWARE_SSTEP */ - -extern int db_cmd_loop_done; /* single-step */ /*ARGSUSED*/ From owner-svn-src-all@freebsd.org Mon Sep 9 03:31:47 2019 Return-Path: Delivered-To: svn-src-all@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 48D86EBFB0; Mon, 9 Sep 2019 03:31:47 +0000 (UTC) (envelope-from pfg@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 46RYcM0hVDz4Qt5; Mon, 9 Sep 2019 03:31:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0947777D; Mon, 9 Sep 2019 03:31:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x893VkWr082290; Mon, 9 Sep 2019 03:31:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x893Vkje082289; Mon, 9 Sep 2019 03:31:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201909090331.x893Vkje082289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 9 Sep 2019 03:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352054 - head/sys/dev/ral X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/ral X-SVN-Commit-Revision: 352054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 03:31:47 -0000 Author: pfg Date: Mon Sep 9 03:31:46 2019 New Revision: 352054 URL: https://svnweb.freebsd.org/changeset/base/352054 Log: ral(4): Use unsigned to avoid undefined behavior. Found by NetBSD's kUBSan Obtained from: NetBSD (github 5b153f1) Modified: head/sys/dev/ral/rt2860.c Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Mon Sep 9 01:33:45 2019 (r352053) +++ head/sys/dev/ral/rt2860.c Mon Sep 9 03:31:46 2019 (r352054) @@ -2220,7 +2220,7 @@ static void rt2860_enable_mrr(struct rt2860_softc *sc) { #define CCK(mcs) (mcs) -#define OFDM(mcs) (1 << 3 | (mcs)) +#define OFDM(mcs) (1U << 3 | (mcs)) RAL_WRITE(sc, RT2860_LG_FBK_CFG0, OFDM(6) << 28 | /* 54->48 */ OFDM(5) << 24 | /* 48->36 */ @@ -3325,7 +3325,7 @@ b4inc(uint32_t b32, int8_t delta) b4 = 0; else if (b4 > 0xf) b4 = 0xf; - b32 = b32 >> 4 | b4 << 28; + b32 = b32 >> 4 | (uint32_t)b4 << 28; } return b32; } From owner-svn-src-all@freebsd.org Mon Sep 9 10:44:59 2019 Return-Path: Delivered-To: svn-src-all@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 1DA25F50FE; Mon, 9 Sep 2019 10:44:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RlDB6wvZz3JSy; Mon, 9 Sep 2019 10:44:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCDD2C642; Mon, 9 Sep 2019 10:44:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89Aiw1M037759; Mon, 9 Sep 2019 10:44:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89AiwQV037758; Mon, 9 Sep 2019 10:44:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909091044.x89AiwQV037758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 Sep 2019 10:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352055 - stable/11/contrib/traceroute X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/contrib/traceroute X-SVN-Commit-Revision: 352055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 10:44:59 -0000 Author: tuexen Date: Mon Sep 9 10:44:58 2019 New Revision: 352055 URL: https://svnweb.freebsd.org/changeset/base/352055 Log: The variable names in the description of the port number usage is inconsistent. This patch fixes that and improves the precision of the description. Thanks to Tom Marcoen for reporting the issue and providing an initial patch, on which this change is based. PR: 237723 Reviewed by: bcr@ Differential Revision: https://reviews.freebsd.org/D20708 Modified: stable/11/contrib/traceroute/traceroute.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/traceroute/traceroute.8 ============================================================================== --- stable/11/contrib/traceroute/traceroute.8 Mon Sep 9 03:31:46 2019 (r352054) +++ stable/11/contrib/traceroute/traceroute.8 Mon Sep 9 10:44:58 2019 (r352055) @@ -16,7 +16,7 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.Dd May 31, 2015 +.Dd June 20, 2019 .Dt TRACEROUTE 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Op Fl m Ar max_ttl .Op Fl P Ar proto .Op Fl p Ar port -.Op Fl q Ar nqueries +.Op Fl q Ar nprobes .Op Fl s Ar src_addr .Op Fl t Ar tos .Op Fl w Ar waittime @@ -125,14 +125,14 @@ Traceroute hopes that nothing is listening on UDP port if used by .Nm and supported by the peer) -.Em base + 1 +.Em port + 1 to -.Em base + nhops * nprobes +.Em port + (max_ttl - first_ttl + 1) * nprobes at the destination host (so an ICMP PORT_UNREACHABLE message will be returned to terminate the route tracing). If something is listening on a port in the default range, this option can be used to pick an unused port range. -.It Fl q Ar nqueries +.It Fl q Ar nprobes Set the number of probes per hop (default is 3, unless .Fl D From owner-svn-src-all@freebsd.org Mon Sep 9 11:15:15 2019 Return-Path: Delivered-To: svn-src-all@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 3ACC9F5A5D; Mon, 9 Sep 2019 11:15:15 +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 46Rlv70qF4z3KtV; Mon, 9 Sep 2019 11:15:15 +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 F3E29CBD9; Mon, 9 Sep 2019 11:15:14 +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 x89BFExK055855; Mon, 9 Sep 2019 11:15:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89BFEhg055854; Mon, 9 Sep 2019 11:15:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909091115.x89BFEhg055854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Sep 2019 11:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352056 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 352056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 11:15:15 -0000 Author: kib Date: Mon Sep 9 11:15:14 2019 New Revision: 352056 URL: https://svnweb.freebsd.org/changeset/base/352056 Log: Make snprintf(3) and vscanf(3) definitions available under appropriate POSIX visibility. Reported by: jbeich Reviewed by: jilles PR: 207287 MFC after: 1 week Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Mon Sep 9 10:44:58 2019 (r352055) +++ head/include/stdio.h Mon Sep 9 11:15:14 2019 (r352056) @@ -294,14 +294,16 @@ int vprintf(const char * __restrict, __va_list); int vsprintf(char * __restrict, const char * __restrict, __va_list); -#if __ISO_C_VISIBLE >= 1999 +#if __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE >= 199506 int snprintf(char * __restrict, size_t, const char * __restrict, ...) __printflike(3, 4); +int vsnprintf(char * __restrict, size_t, const char * __restrict, + __va_list) __printflike(3, 0); +#endif +#if __ISO_C_VISIBLE >= 1999 int vfscanf(FILE * __restrict, const char * __restrict, __va_list) __scanflike(2, 0); int vscanf(const char * __restrict, __va_list) __scanflike(1, 0); -int vsnprintf(char * __restrict, size_t, const char * __restrict, - __va_list) __printflike(3, 0); int vsscanf(const char * __restrict, const char * __restrict, __va_list) __scanflike(2, 0); #endif From owner-svn-src-all@freebsd.org Mon Sep 9 11:20:17 2019 Return-Path: Delivered-To: svn-src-all@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 C93BAF5C7E; Mon, 9 Sep 2019 11:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rm0x4zVKz3L6S; Mon, 9 Sep 2019 11:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E32BCBED; Mon, 9 Sep 2019 11:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89BKHHH056169; Mon, 9 Sep 2019 11:20:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89BKGpd056163; Mon, 9 Sep 2019 11:20:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909091120.x89BKGpd056163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 Sep 2019 11:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352057 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 352057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 11:20:17 -0000 Author: tuexen Date: Mon Sep 9 11:20:15 2019 New Revision: 352057 URL: https://svnweb.freebsd.org/changeset/base/352057 Log: MFC r349986: When calling sctp_initialize_auth_params(), the inp must have at least a read lock. To avoid more complex locking dances, just call it in sctp_aloc_assoc() when the write lock is still held. Modified: stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_pcb.h stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet/sctp_input.c Mon Sep 9 11:20:15 2019 (r352057) @@ -2157,8 +2157,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in ntohl(initack_cp->init.initiate_tag), vrf_id, ntohs(initack_cp->init.num_outbound_streams), port, - (struct thread *)NULL - ); + (struct thread *)NULL, + SCTP_DONT_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { struct mbuf *op_err; Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet/sctp_output.c Mon Sep 9 11:20:15 2019 (r352057) @@ -12759,7 +12759,8 @@ sctp_lower_sosend(struct socket *so, stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, - p); + p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Error is setup for us in the call */ goto out_unlocked; @@ -12787,9 +12788,6 @@ sctp_lower_sosend(struct socket *so, asoc = &stcb->asoc; SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); - - /* initialize authentication params for the assoc */ - sctp_initialize_auth_params(inp, stcb); if (control) { if (sctp_process_cmsgs_for_init(stcb, control, &error)) { Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet/sctp_pcb.c Mon Sep 9 11:20:15 2019 (r352057) @@ -4189,8 +4189,8 @@ struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t vrf_id, uint16_t o_streams, uint16_t port, - struct thread *p -) + struct thread *p, + int initialize_auth_params) { /* note the p argument is only valid in unbound sockets */ @@ -4419,6 +4419,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd head = &inp->sctp_tcbhash[SCTP_PCBHASH_ALLADDR(stcb->rport, inp->sctp_hashmark)]; LIST_INSERT_HEAD(head, stcb, sctp_tcbhash); + } + if (initialize_auth_params == SCTP_INITIALIZE_AUTH_PARAMS) { + sctp_initialize_auth_params(inp, stcb); } SCTP_INP_WUNLOCK(inp); SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); Modified: stable/11/sys/netinet/sctp_pcb.h ============================================================================== --- stable/11/sys/netinet/sctp_pcb.h Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet/sctp_pcb.h Mon Sep 9 11:20:15 2019 (r352057) @@ -576,9 +576,13 @@ int sctp_is_address_on_local_host(struct sockaddr *add void sctp_inpcb_free(struct sctp_inpcb *, int, int); +#define SCTP_DONT_INITIALIZE_AUTH_PARAMS 0 +#define SCTP_INITIALIZE_AUTH_PARAMS 1 + struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, - int *, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *); + int *, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *, + int); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet/sctp_usrreq.c Mon Sep 9 11:20:15 2019 (r352057) @@ -1443,8 +1443,8 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, - (struct thread *)p - ); + (struct thread *)p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Gak! no memory */ goto out_now; @@ -1480,9 +1480,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb a_id = (sctp_assoc_t *)optval; *a_id = sctp_get_associd(stcb); - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); - if (delay) { /* doing delayed connection */ stcb->asoc.delayed_connection = 1; @@ -7025,7 +7022,8 @@ sctp_connect(struct socket *so, struct sockaddr *addr, /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, - inp->sctp_ep.port, p); + inp->sctp_ep.port, p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Gak! no memory */ goto out_now; @@ -7037,9 +7035,6 @@ sctp_connect(struct socket *so, struct sockaddr *addr, } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Mon Sep 9 11:15:14 2019 (r352056) +++ stable/11/sys/netinet6/sctp6_usrreq.c Mon Sep 9 11:20:15 2019 (r352057) @@ -913,7 +913,8 @@ sctp6_connect(struct socket *so, struct sockaddr *addr /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, - inp->sctp_ep.port, p); + inp->sctp_ep.port, p, + SCTP_INITIALIZE_AUTH_PARAMS); SCTP_ASOC_CREATE_UNLOCK(inp); if (stcb == NULL) { /* Gak! no memory */ @@ -926,10 +927,6 @@ sctp6_connect(struct socket *so, struct sockaddr *addr } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); - sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); return (error); From owner-svn-src-all@freebsd.org Mon Sep 9 11:22:39 2019 Return-Path: Delivered-To: svn-src-all@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 54156F5E28; Mon, 9 Sep 2019 11:22:39 +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 46Rm3g16dsz3LSD; Mon, 9 Sep 2019 11:22:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09AB1CD9F; Mon, 9 Sep 2019 11:22:39 +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 x89BMcrh061511; Mon, 9 Sep 2019 11:22:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89BMc0D061510; Mon, 9 Sep 2019 11:22:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909091122.x89BMc0D061510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Sep 2019 11:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352058 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 352058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 11:22:39 -0000 Author: kib Date: Mon Sep 9 11:22:38 2019 New Revision: 352058 URL: https://svnweb.freebsd.org/changeset/base/352058 Log: Remove some unneeded vfs_busy() calls in SU code. When softdep_fsync() is running, a caller must already started write for the mount point. Since unmount or remount to ro suspends mount point, it cannot run in parallel with softdep_fsync(), which makes vfs_busy() call there not needed. Doing blocking vfs_busy() there effectively causes lock order reversal between vn_start_write() and setting MNTK_UNMOUNT, because vfs_busy(mp, 0) sleeps waiting for MNTK_UNMOUNT becoming clear, while unmount sets the flag and starts the suspension. Note that all other uses of vfs_busy() in SU code are non-blocking. Reported by: chs by mckusick Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Sep 9 11:20:15 2019 (r352057) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Sep 9 11:22:38 2019 (r352058) @@ -12507,24 +12507,13 @@ restart: FREE_LOCK(ump); if (ffs_vgetf(mp, parentino, LK_NOWAIT | LK_EXCLUSIVE, &pvp, FFSV_FORCEINSMQ)) { - error = vfs_busy(mp, MBF_NOWAIT); - if (error != 0) { - vfs_ref(mp); - VOP_UNLOCK(vp, 0); - error = vfs_busy(mp, 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - vfs_rel(mp); - if (error != 0) - return (ENOENT); - if (vp->v_iflag & VI_DOOMED) { - vfs_unbusy(mp); - return (ENOENT); - } - } + /* + * Unmount cannot proceed after unlock because + * caller must have called vn_start_write(). + */ VOP_UNLOCK(vp, 0); error = ffs_vgetf(mp, parentino, LK_EXCLUSIVE, &pvp, FFSV_FORCEINSMQ); - vfs_unbusy(mp); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { if (error == 0) From owner-svn-src-all@freebsd.org Mon Sep 9 11:29:59 2019 Return-Path: Delivered-To: svn-src-all@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 8DD6DF6060; Mon, 9 Sep 2019 11:29:59 +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 46RmD73C4Pz3LqC; Mon, 9 Sep 2019 11:29:59 +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 4D56BCDE7; Mon, 9 Sep 2019 11:29:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89BTxUE061872; Mon, 9 Sep 2019 11:29:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89BTxvw061871; Mon, 9 Sep 2019 11:29:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909091129.x89BTxvw061871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Sep 2019 11:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352059 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 11:29:59 -0000 Author: kib Date: Mon Sep 9 11:29:58 2019 New Revision: 352059 URL: https://svnweb.freebsd.org/changeset/base/352059 Log: Make timehands count selectable at boottime. Tested by: O'Connor, Daniel Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21563 Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Sep 9 11:22:38 2019 (r352058) +++ head/sys/kern/kern_tc.c Mon Sep 9 11:29:58 2019 (r352059) @@ -83,19 +83,16 @@ struct timehands { struct timehands *th_next; }; -static struct timehands th0; -static struct timehands th1 = { - .th_next = &th0 -}; -static struct timehands th0 = { +static struct timehands ths[16] = { + [0] = { .th_counter = &dummy_timecounter, .th_scale = (uint64_t)-1 / 1000000, .th_offset = { .sec = 1 }, .th_generation = 1, - .th_next = &th1 + }, }; -static struct timehands *volatile timehands = &th0; +static struct timehands *volatile timehands = &ths[0]; struct timecounter *timecounter = &dummy_timecounter; static struct timecounter *timecounters = &dummy_timecounter; @@ -115,6 +112,10 @@ static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, ×tepwarnings, 0, "Log time steps"); +static int timehands_count = 2; +SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, CTLFLAG_RDTUN, + &timehands_count, 0, "Count of timehands in rotation"); + struct bintime bt_timethreshold; struct bintime bt_tickthreshold; sbintime_t sbt_timethreshold; @@ -1960,8 +1961,9 @@ done: static void inittimecounter(void *dummy) { + struct timehands *thp; u_int p; - int tick_rate; + int i, tick_rate; /* * Set the initial timeout to @@ -1987,6 +1989,16 @@ inittimecounter(void *dummy) #ifdef FFCLOCK ffclock_init(); #endif + + /* Set up the requested number of timehands. */ + if (timehands_count < 1) + timehands_count = 1; + if (timehands_count > nitems(ths)) + timehands_count = nitems(ths); + for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) + thp->th_next = &ths[i]; + thp->th_next = &ths[0]; + /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); From owner-svn-src-all@freebsd.org Mon Sep 9 11:56:40 2019 Return-Path: Delivered-To: svn-src-all@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 79AA8F6B82; Mon, 9 Sep 2019 11:56:40 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rmpv4fsCz3NKc; Mon, 9 Sep 2019 11:56:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D56FB3C0199; Mon, 9 Sep 2019 11:56:32 +0000 (UTC) Date: Mon, 9 Sep 2019 11:56:32 +0000 From: Brooks Davis To: Philip Paeps Cc: Warner Losh , Ian Lepore , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351918 - head/sys/kern Message-ID: <20190909115632.GB41333@spindle.one-eyed-alien.net> References: <201909060119.x861JWrG006910@repo.freebsd.org> <4917d7507b6ea6c360dccda261f53052aa085f2b.camel@freebsd.org> <5EE266EE-E650-48D8-9B0E-E674AD026470@freebsd.org> <3cb6429acc7e520932d2c906d1cac47540156355.camel@freebsd.org> <8F03EA29-0F3F-4321-9241-78F7C924FDE1@freebsd.org> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xgyAXRrhYN0wYx8y" Content-Disposition: inline In-Reply-To: <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46Rmpv4fsCz3NKc X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.58)[ip: (-9.34), ipnet: 199.48.128.0/22(-4.65), asn: 36236(-3.86), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 11:56:40 -0000 --xgyAXRrhYN0wYx8y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 07, 2019 at 12:23:03PM +0800, Philip Paeps wrote: > On 2019-09-07 12:06:32 (+0800), Warner Losh wrote: > > On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps =20 > > wrote: > >> On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: > >>> On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: > >>>> On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > >>>>> On Fri, 2019-09-06 at 01:19 +0000, Philip Paeps wrote: > >>>>>> Log: > >>>>>> riscv: default to HZ=3D100 > >>>>> > >>>>> This seems like a bad idea. I've run a 90mhz armv4 chip with=20 > >>>>> HZ=3D1000 and didn't notice any performance hit from doing so. =20 > >>>>> Almost all arm kernel config files set HZ as an option, so that=20 > >>>>> define doesn't do much for arm these days. It probably does still= =20 > >>>>> set HZ for various mips platforms. > >>>>> > >>>>> I would think 1000 is appropriate for anything modern running at=20 > >>>>> 200mhz or more. > >>>>> > >>>>> Setting it to 100 has the bad side effect of making things like=20 > >>>>> msleep(), tsleep(), and pause() (which show up in plenty of=20 > >>>>> drivers) all have a minimum timeout of 10ms, which is a long long= =20 > >>>>> time on modern hardware. > >>>>> > >>>>> What benefit do you think you'll get from the lower number? > >>>> > >>>> On systems running at 10s of MHz (or slower, ick), with HZ=3D1000 yo= u=20 > >>>> spend an awful lot of time servicing the timer interrupt and not=20 > >>>> very much time doing anything else. > >>>> > >>>> My rationale was that most RISC-V systems (including emulation and= =20 > >>>> FPGA prototypes) I've encountered are running slower than the=20 > >>>> tipping point where HZ=3D1000 makes sense. With the default of=20 > >>>> HZ=3D100, faster exceptions can still set HZ=3D1000 in their individ= ual=20 > >>>> configs. > >>>> > >>>> When the RISC-V world evolves to having more actual silicon and=20 > >>>> fewer slow prototypes, I definitely agree this default should be=20 > >>>> flipped again for HZ=3D1000 by default and HZ=3D100 in the config fi= les=20 > >>>> for the exceptions. > >>> > >>> Wait a second... are you saying that the riscv implementation=20 > >>> doesn't support event timers and uses an old-style periodic tick=20 > >>> based on HZ? > >> > >> Depending on the hardware, there may not be an event timer (yet)... > >> > >> As I wrote: I would be more than happy to revert this change when=20 > >> more silicon becomes available. Presently, there is exactly one=20 > >> silicon RISC-V implementation commercially available (HiFive FU540)=20 > >> and even that one is kind of difficult to source. Most people=20 > >> running RISC-V are doing so in emulation or on FPGAs. > >> > >> Given how long these things take to boot to userland (where you=20 > >> really notice how slow things are), HZ=3D100 feels like a more sensibl= e=20 > >> default than HZ=3D1000. > > > > I think it show more that the defaults are bad for MIPS and ARM. All=20 > > the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also=20 > > 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe we= =20 > > need to attend to this as well. Arm !=3Dv5 is also 1000Hz, so it should= =20 > > be changed... > > > >> I don't feel terribly strongly about this though. I've just been=20 > >> bitten several times in the last week on a <15MHz FPGA forgetting to= =20 > >> set HZ=3D100 in config and figured I'd save others the trouble. ;-) > > > > 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the=20 > > time.... How common are these beasts and how well does FreeBSD do on= =20 > > them. I assume these are early prototypes? >=20 > These are early prototypes indeed. >=20 > FreeBSD runs remarkably well on them. Slowly of course. Booting takes= =20 > several minutes and running anything non-trivial can be frustrating. [More context for Warner and others following along.] I don't know what platform Philip is using here, but with architectures supporting CHERI (including MIPS and RISC-V), we typically run on sub-100Mhz FPGA implementations. We also run on simulations or models that range from 100s of MIPS to a few KIPS. Being able to do this is important to help validate that the models we're proving security properties on actually relate to the "more real" implementations we develop on. In all these cases, "run" is a relative thing. We certainly don't expect to self-host until we've got performant hardware (and to the extent that we care about 32-bit, we consider self-hosting an active non-goal.) We often expect to be able to run real software including things like nginx and webkit, but we mostly care about relative performance not interactivity. -- Brooks --xgyAXRrhYN0wYx8y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJddj3wAAoJEKzQXbSebgfADJ8H/1+Tkq0eVRTawWrqyjRBXvVl BV3gNHvoX8jkq+3PzbqDlQvr3E0jXkcJ/EIJgZCbOUy3YeqcCJluj0AjqiIydwV2 QyxTc9lGNGKYET8y2k4PNiARQgUbdt3kH1zBy/MCiEFBIboIv2Z3isizsq4/hNHx rN+b/SuVhAbkhNihQrO4Ayts/zPTBdkS2i9j5oC89x59S98LMpHusRxjNiywqBp8 Hpu+fPWlfbldM/6Swh7T5cjriwbYN0YZSKzQWdwtd9xIheNCk1xukhyttxM6YrtG 8NQl+kMiYGhYYy0PlvJqYkma1C/3TSg8e3YGwKE0DITj1fwBPc2NwKoF8tJGyrU= =C1e4 -----END PGP SIGNATURE----- --xgyAXRrhYN0wYx8y-- From owner-svn-src-all@freebsd.org Mon Sep 9 12:34:40 2019 Return-Path: Delivered-To: svn-src-all@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 01798D101B; Mon, 9 Sep 2019 12:34:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rnfl5wKXz3RKL; Mon, 9 Sep 2019 12:34:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1i7IsJ-000KCu-29; Mon, 09 Sep 2019 15:34:31 +0300 Date: Mon, 9 Sep 2019 15:34:31 +0300 From: Slawa Olhovchenkov To: Mark Johnston Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351673 - in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm Message-ID: <20190909123430.GI3953@zxy.spb.ru> References: <201909012222.x81MMh0F022462@repo.freebsd.org> <79c74018-1329-ee69-3480-e2f99821fa93@FreeBSD.org> <20190903161427.GA38096@zxy.spb.ru> <20190903220106.GB26733@raichu> <20190904144524.GD3953@zxy.spb.ru> <20190907145034.GB6523@spy> <20190907153110.GG3953@zxy.spb.ru> <20190908201819.GA49837@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190908201819.GA49837@raichu> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 46Rnfl5wKXz3RKL X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 12:34:40 -0000 On Sun, Sep 08, 2019 at 04:18:19PM -0400, Mark Johnston wrote: > On Sat, Sep 07, 2019 at 06:31:10PM +0300, Slawa Olhovchenkov wrote: > > On Sat, Sep 07, 2019 at 10:50:34AM -0400, Mark Johnston wrote: > > > > > On Wed, Sep 04, 2019 at 05:45:24PM +0300, Slawa Olhovchenkov wrote: > > > > On Tue, Sep 03, 2019 at 06:01:06PM -0400, Mark Johnston wrote: > > > > > > Mostly problem I am see at this > > > > > > work -- very slowly vm_page_free(). May be currenly this is more > > > > > > speedy... > > > > > > > > > > How did you determine this? > > > > > > > > This is you guess: > > > > > > So was the guess correct? > > > > I am just trust to you. > > How to check this guess? > > You can try to measure time spent in pmap_remove() relative to the rest > of _kmem_unback(). === fbt:kernel:_kmem_unback:entry { self->kts = timestamp; } fbt:kernel:_kmem_unback:return /self->kts/ { @ts["kts"] = sum(timestamp - self->kts); self->kts = 0; } fbt:kernel:pmap_remove:entry /self->kts/ { self->pts = timestamp; } fbt:kernel:pmap_remove:entry /self->kts == 0/ { self->ats = timestamp; } fbt:kernel:pmap_remove:return /self->pts/ { @ts["pts"] = sum(timestamp - self->pts); self->pts = 0; } fbt:kernel:pmap_remove:return /self->ats/ { @ts["ats"] = sum(timestamp - self->ats); self->ats = 0; } tick-1s { printa("%-8s %20@d\n", @ts); printf("\n"); clear(@ts); } === pts 7166680 ats 8143193 kts 16721822 pts 3458647 ats 5393452 kts 10504523 kts 0 pts 0 ats 2758752 pts 3387748 ats 4322653 kts 8100282 pts 4002444 ats 5422748 kts 11761955 pts 1151713 kts 2742176 ats 8242958 pts 34441 kts 145683 ats 4822328 kts 0 pts 0 ats 5357808 pts 16008 kts 148203 ats 4947368 pts 26945 kts 156011 ats 8368502 pts 323620 kts 1154981 ats 10093137 pts 79504 kts 228135 ats 7131059 pts 734062 kts 1747364 ats 4619796 pts 401453 kts 1036605 ats 8751919 > > > If so, IMO the real solution is to avoid kmem_* > > > for data buffers and use ABD instead. > > > > What problem resolve this? > > To allocate buffers larger than PAGE_SIZE the kernel must allocate a > number of physical pages and map them using the page tables. The step > of creating and destroying mappings is expensive and doesn't scale well > to many CPUs. With ABD, ZFS avoids this expense when its caches are > shrunk. > > > ABD any way is slowly vs kmem_*. > > Can we solve this problem instead? slowly ABD? or expensive of creating and destroying mappings? slowly ABD -- don't use ABD and scatter gather. expensive of creating and destroying mappings: - do kernel more NUMA-aware and go mostly alloc and free to zone cache (curenly may be allocation can do from dom1 and freeing in dom0. I am see this.) - calculate sensible working set size of zone cache and aim trim to do nothing - my be do batch removed/unmaped and do TLB shootdown only once at end of batch? > > > > ====== > > > > > while ((slab = SLIST_FIRST(&freeslabs)) != NULL) { > > > > > SLIST_REMOVE(&freeslabs, slab, uma_slab, us_hlink); > > > > > keg_free_slab(keg, slab, keg->uk_ipers); > > > > > } > > > > > 2019 Feb 2 19:49:54.800524364 zio_data_buf_1048576 1032605 cache_reclaim limit 100 dom 0 nitems 1672 imin 298 > > > > > 2019 Feb 2 19:49:54.800524364 zio_data_buf_1048576 1033736 cache_reclaim recla 149 dom 0 nitems 1672 imin 298 > > > > > 2019 Feb 2 19:49:54.802524468 zio_data_buf_1048576 3119710 cache_reclaim limit 100 dom 1 nitems 1 imin 0 > > > > > 2019 Feb 2 19:49:54.802524468 zio_data_buf_1048576 3127550 keg_drain2 > > > > > 2019 Feb 2 19:49:54.803524487 zio_data_buf_1048576 4444219 keg_drain3 > > > > > 2019 Feb 2 19:49:54.838524634 zio_data_buf_1048576 39553705 keg_drain4 > > > > > 2019 Feb 2 19:49:54.838524634 zio_data_buf_1048576 39565323 zone_reclaim:return > > > > > > > > > > 35109.486 ms for last loop, 149 items to freed. > > > > > > > > 35ms to free 149MB (38144 4KB pages), so roughly 1us per page. That > > > > does seem like a lot, but freeing a page (vm_page_free(m)) is much > > > > more expensive than freeing an item to UMA (i.e., uma_zfree()). > > > > Most of that time will be spent in _kmem_unback(). > > > > ====== From owner-svn-src-all@freebsd.org Mon Sep 9 12:42:48 2019 Return-Path: Delivered-To: svn-src-all@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 B894AD1581; Mon, 9 Sep 2019 12:42:48 +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 46Rnr84R7Jz3x96; Mon, 9 Sep 2019 12:42:48 +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 7CFE1DC8B; Mon, 9 Sep 2019 12:42:48 +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 x89CgmMZ008987; Mon, 9 Sep 2019 12:42:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89CgmJr008986; Mon, 9 Sep 2019 12:42:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909091242.x89CgmJr008986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Sep 2019 12:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352060 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 12:42:48 -0000 Author: kib Date: Mon Sep 9 12:42:48 2019 New Revision: 352060 URL: https://svnweb.freebsd.org/changeset/base/352060 Log: Initialize timehands linkage much earlier. Reported and tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Sep 9 11:29:58 2019 (r352059) +++ head/sys/kern/kern_tc.c Mon Sep 9 12:42:48 2019 (r352060) @@ -113,7 +113,8 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, ×tepwarnings, 0, "Log time steps"); static int timehands_count = 2; -SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, CTLFLAG_RDTUN, +SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &timehands_count, 0, "Count of timehands in rotation"); struct bintime bt_timethreshold; @@ -1958,12 +1959,30 @@ done: return (0); } +/* Set up the requested number of timehands. */ static void -inittimecounter(void *dummy) +inittimehands(void *dummy) { struct timehands *thp; + int i; + + TUNABLE_INT_FETCH("kern.timecounter.timehands_count", + &timehands_count); + if (timehands_count < 1) + timehands_count = 1; + if (timehands_count > nitems(ths)) + timehands_count = nitems(ths); + for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) + thp->th_next = &ths[i]; + thp->th_next = &ths[0]; +} +SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL); + +static void +inittimecounter(void *dummy) +{ u_int p; - int i, tick_rate; + int tick_rate; /* * Set the initial timeout to @@ -1989,15 +2008,6 @@ inittimecounter(void *dummy) #ifdef FFCLOCK ffclock_init(); #endif - - /* Set up the requested number of timehands. */ - if (timehands_count < 1) - timehands_count = 1; - if (timehands_count > nitems(ths)) - timehands_count = nitems(ths); - for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) - thp->th_next = &ths[i]; - thp->th_next = &ths[0]; /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); From owner-svn-src-all@freebsd.org Mon Sep 9 14:09:53 2019 Return-Path: Delivered-To: svn-src-all@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 CEC3FD3780; Mon, 9 Sep 2019 14:09:53 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rqmc6r9sz4277; Mon, 9 Sep 2019 14:09:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id d10so10625641lfi.0; Mon, 09 Sep 2019 07:09:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=21hAu61De6Yo0Kgxm8Wo/tJSwLrDXId1wJfeVbWzDdo=; b=Svg0ayICJa7G33ooAcDPyL1LCWgdBffcXPSrex1wHwInLJnWtfPQUb1q3hg2GFIME5 xnmM2sZSorflwCfr0yqIGGzWHDj5IeklFkg98nkdIrIockOpgRbaZj+106dzIBFnOjvE hYwq1bTwt+/4qfQzaEk4k9BFGM4DKfnnAGNccaMU76WXH1GD2L+qVnv7yEQuhuKY8pxw P5VkNbh9n1BLiwEsWvPk2l6U9OtZlPjnToCJyxu/u63v14YnJIvotatcm1zZC3+Lmp2Q T0tXCyL9Bz36/NbcEwHXbZl8JrLYcwhI0eX0ALjM1wPTAUpTSdJjXjSQBGP7ZllBSpnQ 7iXw== X-Gm-Message-State: APjAAAV0L+swwJdfmfx8qxQHzW0ag7Txe0E+/5DSiAO/vIG/OG9x600W GFvtyXQkEUgLtKGC78pnomcdNQCd927M6L6ecM7R6g== X-Google-Smtp-Source: APXvYqwSnqnCrnxQ0bUV72jKiyTDzYz9NvWFGRFy0b+C+dsoMUXscdwr6ziDa7im0RyzjxWpGeqrUWXPsv6SjYa/QlE= X-Received: by 2002:ac2:5399:: with SMTP id g25mr16613252lfh.178.1568038190807; Mon, 09 Sep 2019 07:09:50 -0700 (PDT) MIME-Version: 1.0 References: <201811121552.wACFqjLr002955@repo.freebsd.org> In-Reply-To: <201811121552.wACFqjLr002955@repo.freebsd.org> From: Alan Somers Date: Mon, 9 Sep 2019 08:09:39 -0600 Message-ID: Subject: Re: svn commit: r340363 - in head: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping To: Mariusz Zaborski Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46Rqmc6r9sz4277 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.45 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.24 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; URI_COUNT_ODD(1.00)[3]; IP_SCORE(-1.24)[ip: (-0.56), ipnet: 209.85.128.0/17(-3.32), asn: 15169(-2.27), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[45.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[45.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 14:09:53 -0000 On Mon, Nov 12, 2018 at 8:53 AM Mariusz Zaborski wrote: > Author: oshogbo > Date: Mon Nov 12 15:52:45 2018 > New Revision: 340363 > URL: https://svnweb.freebsd.org/changeset/base/340363 > > Log: > libcasper: ange the name of limits in cap_dns so the intentions are > obvious. > > Reported by: pjd > MFC after: 3 weeks > > Modified: > head/ObsoleteFiles.inc > head/contrib/tcpdump/tcpdump.c > head/contrib/traceroute/traceroute.c > head/lib/libcasper/services/cap_dns/Makefile > head/lib/libcasper/services/cap_dns/cap_dns.3 > head/lib/libcasper/services/cap_dns/cap_dns.c > head/lib/libcasper/services/cap_dns/tests/dns_test.c > head/sbin/ping/ping.c > Are you still planning to MFC this? From owner-svn-src-all@freebsd.org Mon Sep 9 14:16:58 2019 Return-Path: Delivered-To: svn-src-all@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 67E0FD3A63; Mon, 9 Sep 2019 14:16:58 +0000 (UTC) (envelope-from chuck@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 46Rqwp25Bjz42cG; Mon, 9 Sep 2019 14:16:58 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2B57BED73; Mon, 9 Sep 2019 14:16:58 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89EGw3B062669; Mon, 9 Sep 2019 14:16:58 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89EGwM2062668; Mon, 9 Sep 2019 14:16:58 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201909091416.x89EGwM2062668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 9 Sep 2019 14:16: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: r352061 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 352061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 14:16:58 -0000 Author: chuck Date: Mon Sep 9 14:16:57 2019 New Revision: 352061 URL: https://svnweb.freebsd.org/changeset/base/352061 Log: MFC r350077 bhyve: update the NVMe CQ based on the status Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Sep 9 12:42:48 2019 (r352060) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Sep 9 14:16:57 2019 (r352061) @@ -99,6 +99,10 @@ static int nvme_debug = 0; #define NVME_PRP2_ITEMS (PAGE_SIZE/sizeof(uint64_t)) #define NVME_MAX_BLOCKIOVS 512 +/* This is a synthetic status code to indicate there is no status */ +#define NVME_NO_STATUS 0xffff +#define NVME_COMPLETION_VALID(c) ((c).status != NVME_NO_STATUS) + /* helpers */ /* Convert a zero-based value into a one-based value */ @@ -1092,14 +1096,16 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u /* XXX dont care, unhandled for now do_intr |= nvme_opc_async_event_req(sc, cmd, &compl); */ + compl.status = NVME_NO_STATUS; break; default: WPRINTF(("0x%x command is not implemented\r\n", cmd->opc)); + pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); + do_intr |= 1; } - /* for now skip async event generation */ - if (cmd->opc != NVME_OPC_ASYNC_EVENT_REQUEST) { + if (NVME_COMPLETION_VALID(compl)) { struct nvme_completion *cp; int phase; From owner-svn-src-all@freebsd.org Mon Sep 9 14:41:40 2019 Return-Path: Delivered-To: svn-src-all@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 5415BD4119; Mon, 9 Sep 2019 14:41:40 +0000 (UTC) (envelope-from fabient@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 46RrTJ1cBVz43Wh; Mon, 9 Sep 2019 14:41:40 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1B7C9F1CB; Mon, 9 Sep 2019 14:41:40 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89Efdon079157; Mon, 9 Sep 2019 14:41:39 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89Efd27079156; Mon, 9 Sep 2019 14:41:39 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201909091441.x89Efd27079156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Mon, 9 Sep 2019 14:41:39 +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: r352062 - stable/12/sys/netipsec X-SVN-Group: stable-12 X-SVN-Commit-Author: fabient X-SVN-Commit-Paths: stable/12/sys/netipsec X-SVN-Commit-Revision: 352062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 14:41:40 -0000 Author: fabient Date: Mon Sep 9 14:41:39 2019 New Revision: 352062 URL: https://svnweb.freebsd.org/changeset/base/352062 Log: MFC r351935: Fix broken window replay check that will allow old packet to be accepted. This was introduced in r309144. Submitted by: Jean-Francois HREN Approved by: ae@ Modified: stable/12/sys/netipsec/ipsec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netipsec/ipsec.c ============================================================================== --- stable/12/sys/netipsec/ipsec.c Mon Sep 9 14:16:57 2019 (r352061) +++ stable/12/sys/netipsec/ipsec.c Mon Sep 9 14:41:39 2019 (r352062) @@ -1323,6 +1323,8 @@ ok: __func__, replay->overflow, ipsec_sa2str(sav, buf, sizeof(buf)))); } + + replay->count++; return (0); } From owner-svn-src-all@freebsd.org Mon Sep 9 14:51:25 2019 Return-Path: Delivered-To: svn-src-all@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 ED208D4647; Mon, 9 Sep 2019 14:51:25 +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 46RrhY62NGz44Gx; Mon, 9 Sep 2019 14:51:25 +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 B25BEF496; Mon, 9 Sep 2019 14:51:25 +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 x89EpPgN083047; Mon, 9 Sep 2019 14:51:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89EpPqi083046; Mon, 9 Sep 2019 14:51:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091451.x89EpPqi083046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 14:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352063 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 352063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 14:51:26 -0000 Author: emaste Date: Mon Sep 9 14:51:25 2019 New Revision: 352063 URL: https://svnweb.freebsd.org/changeset/base/352063 Log: ci-qemu-test: if firmware is not available, hint at pkg to install uefi-edk2-qemu-x86_64 provides the firmware ci-qemu-test.sh expects to use. Sponsored by: The FreeBSD Foundation Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Mon Sep 9 14:41:39 2019 (r352062) +++ head/tools/boot/ci-qemu-test.sh Mon Sep 9 14:51:25 2019 (r352063) @@ -84,6 +84,7 @@ fi # Locate the uefi firmware file used by qemu. : ${OVMF:=/usr/local/share/uefi-edk2-qemu/QEMU_UEFI_CODE-x86_64.fd} if [ ! -r "${OVMF}" ]; then + echo "NOTE: UEFI firmware available in the uefi-edk2-qemu-x86_64 package" >&2 die "Cannot read UEFI firmware file ${OVMF}" fi From owner-svn-src-all@freebsd.org Mon Sep 9 14:56:07 2019 Return-Path: Delivered-To: svn-src-all@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 79A1FD48E3; Mon, 9 Sep 2019 14:56:07 +0000 (UTC) (envelope-from fabient@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 46Rrnz2bjDz44Vc; Mon, 9 Sep 2019 14:56:07 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3CD97F4FE; Mon, 9 Sep 2019 14:56:07 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89Eu7fb086341; Mon, 9 Sep 2019 14:56:07 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89Eu7Gw086340; Mon, 9 Sep 2019 14:56:07 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201909091456.x89Eu7Gw086340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Mon, 9 Sep 2019 14:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352064 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: fabient X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 352064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 14:56:07 -0000 Author: fabient Date: Mon Sep 9 14:56:06 2019 New Revision: 352064 URL: https://svnweb.freebsd.org/changeset/base/352064 Log: MFC r351935: Fix broken window replay check that will allow old packet to be accepted. This was introduced in r309144. Submitted by: Jean-Francois HREN Approved by: ae@ Modified: stable/11/sys/netipsec/ipsec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec.c ============================================================================== --- stable/11/sys/netipsec/ipsec.c Mon Sep 9 14:51:25 2019 (r352063) +++ stable/11/sys/netipsec/ipsec.c Mon Sep 9 14:56:06 2019 (r352064) @@ -1309,6 +1309,8 @@ ok: __func__, replay->overflow, ipsec_sa2str(sav, buf, sizeof(buf)))); } + + replay->count++; return (0); } From owner-svn-src-all@freebsd.org Mon Sep 9 15:18:06 2019 Return-Path: Delivered-To: svn-src-all@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 2D1D3D5038; Mon, 9 Sep 2019 15:18:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RsHL0Qs5z45YJ; Mon, 9 Sep 2019 15:18:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E71F4F8BB; Mon, 9 Sep 2019 15:18:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89FI5eF098534; Mon, 9 Sep 2019 15:18:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FI4rI098527; Mon, 9 Sep 2019 15:18:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091518.x89FI4rI098527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352065 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:18:06 -0000 Author: bapt Date: Mon Sep 9 15:18:04 2019 New Revision: 352065 URL: https://svnweb.freebsd.org/changeset/base/352065 Log: Import from OpenBSD: -E flag Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+ Help and direction millert@ espie@ anton@ deraadt@ ok espie@ Obtained from: OpenBSD Modified: head/usr.bin/m4/eval.c head/usr.bin/m4/extern.h head/usr.bin/m4/gnum4.c head/usr.bin/m4/m4.1 head/usr.bin/m4/main.c head/usr.bin/m4/misc.c head/usr.bin/m4/tokenizer.l Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/eval.c Mon Sep 9 15:18:04 2019 (r352065) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.74 2015/02/05 12:59:57 millert Exp $ */ +/* $OpenBSD: eval.c,v 1.75 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /*- @@ -275,6 +275,10 @@ expand_builtin(const char *argv[], int argc, int td) warn("%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); exit_code = 1; + if (fatal_warns) { + killdiv(); + exit(exit_code); + } } else err(1, "%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); Modified: head/usr.bin/m4/extern.h ============================================================================== --- head/usr.bin/m4/extern.h Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/extern.h Mon Sep 9 15:18:04 2019 (r352065) @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.54 2014/05/12 19:11:19 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.55 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */ /*- @@ -61,6 +61,8 @@ extern void doesyscmd(const char *); extern void getdivfile(const char *); extern void doformat(const char *[], int); +extern void m4_warnx(const char *, ...); + /* look.c */ #define FLAG_UNTRACED 0 @@ -178,4 +180,5 @@ extern int synch_lines; /* line synchronisation direc extern int mimic_gnu; /* behaves like gnu-m4 */ extern int prefix_builtins; /* prefix builtin macros with m4_ */ - +extern int error_warns; /* make warnings cause exit_code = 1 */ +extern int fatal_warns; /* make warnings fatal */ Modified: head/usr.bin/m4/gnum4.c ============================================================================== --- head/usr.bin/m4/gnum4.c Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/gnum4.c Mon Sep 9 15:18:04 2019 (r352065) @@ -1,4 +1,4 @@ -/* $OpenBSD: gnum4.c,v 1.50 2015/04/29 00:13:26 millert Exp $ */ +/* $OpenBSD: gnum4.c,v 1.51 2017/06/15 13:48:42 bcallah Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -259,11 +260,29 @@ exit_regerror(int er, regex_t *re, const char *source) m4errx(1, "regular expression error in %s: %s.", source, errbuf); } +/* warnx() plus check to see if we need to change exit code or exit . + * -E flag functionality. + */ +void +m4_warnx(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + warnx(fmt, ap); + va_end(ap); + + if (fatal_warns) + exit(1); + if (error_warns) + exit_code = 1; +} + static void add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) { if (n > (int)re->re_nsub) - warnx("No subexpression %d", n); + m4_warnx("No subexpression %d", n); /* Subexpressions that did not match are * not an error. */ else if (pm[n].rm_so != -1 && @@ -446,7 +465,7 @@ void dopatsubst(const char *argv[], int argc) { if (argc <= 3) { - warnx("Too few arguments to patsubst"); + m4_warnx("Too few arguments to patsubst"); return; } /* special case: empty regexp */ @@ -498,7 +517,7 @@ doregexp(const char *argv[], int argc) const char *source; if (argc <= 3) { - warnx("Too few arguments to regexp"); + m4_warnx("Too few arguments to regexp"); return; } /* special gnu case */ Modified: head/usr.bin/m4/m4.1 ============================================================================== --- head/usr.bin/m4/m4.1 Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/m4.1 Mon Sep 9 15:18:04 2019 (r352065) @@ -1,5 +1,5 @@ .\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $ -.\" @(#) $OpenBSD: m4.1,v 1.63 2015/09/14 20:06:58 schwarze Exp $ +.\" @(#) $OpenBSD: m4.1,v 1.64 2017/06/15 13:48:42 bcallah Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd $Mdocdate: September 14 2015 $ +.Dd $Mdocdate: June 15 2017 $ .Dt M4 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Nd macro language processor .Sh SYNOPSIS .Nm -.Op Fl gPs +.Op Fl EgPs .Oo .Sm off .Fl D Ar name Op No = Ar value @@ -130,6 +130,21 @@ turn on all options. .Pp By default, trace is set to .Qq eq . +.It Fl E +Set warnings to be fatal. +When a single +.Fl E +flag is specified, if warnings are issued, execution +continues but +.Nm +will exit with a non-zero exit status. +When multiple +.Fl E +flags are specified, execution will halt upon issuing the +first warning and +.Nm +will exit with a non-zero exit status. +This behaviour matches GNU-m4 1.4.9 and later. .It Fl g Activate GNU-m4 compatibility mode. In this mode, translit handles simple character @@ -437,7 +452,9 @@ Returns the current file's name. .Pp But note that the .Ic m4exit -macro can modify the exit status. +macro can modify the exit status, as can the +.Fl E +flag. .Sh STANDARDS The .Nm @@ -446,7 +463,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl dgIPot +.Op Fl dEgIPot and the macros .Ic builtin , .Ic esyscmd , Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/main.c Mon Sep 9 15:18:04 2019 (r352065) @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.86 2015/11/03 16:21:47 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.87 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- @@ -81,6 +81,8 @@ char scommt[MAXCCHARS+1] = {SCOMMT}; /* start characte char ecommt[MAXCCHARS+1] = {ECOMMT}; /* end character for comment */ int synch_lines = 0; /* line synchronisation for C preprocessor */ int prefix_builtins = 0; /* -P option to prefix builtin keywords */ +int error_warns = 0; /* -E option to make warnings exit_code = 1 */ +int fatal_warns = 0; /* -E -E option to make warnings fatal */ struct keyblk { const char *knam; /* keyword name */ @@ -186,7 +188,7 @@ main(int argc, char *argv[]) outfile = NULL; resizedivs(MAXOUT); - while ((c = getopt(argc, argv, "gst:d:D:U:o:I:P")) != -1) + while ((c = getopt(argc, argv, "gst:d:D:EU:o:I:P")) != -1) switch(c) { case 'D': /* define something..*/ @@ -196,6 +198,12 @@ main(int argc, char *argv[]) if (*p) *p++ = EOS; dodefine(optarg, p); + break; + case 'E': /* like GNU m4 1.4.9+ */ + if (error_warns == 0) + error_warns = 1; + else + fatal_warns = 1; break; case 'I': addtoincludepath(optarg); Modified: head/usr.bin/m4/misc.c ============================================================================== --- head/usr.bin/m4/misc.c Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/misc.c Mon Sep 9 15:18:04 2019 (r352065) @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.46 2015/12/07 14:12:46 espie Exp $ */ +/* $OpenBSD: misc.c,v 1.47 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /*- @@ -386,7 +386,7 @@ xstrdup(const char *s) void usage(void) { - fprintf(stderr, "usage: m4 [-gPs] [-Dname[=value]] [-d flags] " + fprintf(stderr, "usage: m4 [-EgPs] [-Dname[=value]] [-d flags] " "[-I dirname] [-o filename]\n" "\t[-t macro] [-Uname] [file ...]\n"); exit(1); Modified: head/usr.bin/m4/tokenizer.l ============================================================================== --- head/usr.bin/m4/tokenizer.l Mon Sep 9 14:56:06 2019 (r352064) +++ head/usr.bin/m4/tokenizer.l Mon Sep 9 15:18:04 2019 (r352065) @@ -1,6 +1,6 @@ %option nounput noinput %{ -/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie * @@ -25,6 +25,7 @@ #include #include +extern void m4_warnx(const char *, ...); extern int mimic_gnu; extern int32_t yylval; @@ -72,7 +73,7 @@ number(void) l = strtol(yytext, NULL, 0); if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || l > INT32_MAX || l < INT32_MIN) { - fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); + m4_warnx("numeric overflow in expr: %s", yytext); } return l; } @@ -88,7 +89,7 @@ parse_radix(void) l = 0; base = strtol(yytext+2, &next, 0); if (base > 36 || next == NULL) { - fprintf(stderr, "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); } else { next++; while (*next != 0) { @@ -101,8 +102,7 @@ parse_radix(void) d = *next - 'A' + 10; } if (d >= base) { - fprintf(stderr, - "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); return 0; } l = base * l + d; From owner-svn-src-all@freebsd.org Mon Sep 9 15:20:20 2019 Return-Path: Delivered-To: svn-src-all@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 A48EED5154; Mon, 9 Sep 2019 15:20:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RsKw3tMJz45rd; Mon, 9 Sep 2019 15:20:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 686B8F8C3; Mon, 9 Sep 2019 15:20:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89FKKUs098872; Mon, 9 Sep 2019 15:20:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FKJrF098870; Mon, 9 Sep 2019 15:20:19 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091520.x89FKJrF098870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352066 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:20:20 -0000 Author: bapt Date: Mon Sep 9 15:20:19 2019 New Revision: 352066 URL: https://svnweb.freebsd.org/changeset/base/352066 Log: Import from OpenBSD a patch which eliminates the link with -ly or -ly patch by ibara@ Obtained from: OpenBSD Modified: head/usr.bin/m4/Makefile head/usr.bin/m4/tokenizer.l Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Mon Sep 9 15:18:04 2019 (r352065) +++ head/usr.bin/m4/Makefile Mon Sep 9 15:20:19 2019 (r352066) @@ -8,7 +8,7 @@ PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${SRCTOP}/lib/libopenbsd -LIBADD= y l m openbsd +LIBADD= m openbsd NO_WMISSING_VARIABLE_DECLARATIONS= Modified: head/usr.bin/m4/tokenizer.l ============================================================================== --- head/usr.bin/m4/tokenizer.l Mon Sep 9 15:18:04 2019 (r352065) +++ head/usr.bin/m4/tokenizer.l Mon Sep 9 15:20:19 2019 (r352066) @@ -43,6 +43,8 @@ oct 0[0-7]* dec [1-9][0-9]* radix 0[rR][0-9]+:[0-9a-zA-Z]+ +%option noyywrap + %% {ws} {/* just skip it */} {hex}|{oct}|{dec} { yylval = number(); return(NUMBER); } From owner-svn-src-all@freebsd.org Mon Sep 9 15:24:49 2019 Return-Path: Delivered-To: svn-src-all@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 AF951D54F5; Mon, 9 Sep 2019 15:24:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RsR54C7Mz46ZH; Mon, 9 Sep 2019 15:24:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F70EFA77; Mon, 9 Sep 2019 15:24:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89FOnLo004656; Mon, 9 Sep 2019 15:24:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FOnpC004655; Mon, 9 Sep 2019 15:24:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091524.x89FOnpC004655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352067 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:24:49 -0000 Author: bapt Date: Mon Sep 9 15:24:48 2019 New Revision: 352067 URL: https://svnweb.freebsd.org/changeset/base/352067 Log: m4: import patch from OpenBSD Use waitpid()/EINTR idiom for the specific pid, rather than generic wait() Patch by: deraadt@ Obtained from: OpenBSD Modified: head/usr.bin/m4/gnum4.c Modified: head/usr.bin/m4/gnum4.c ============================================================================== --- head/usr.bin/m4/gnum4.c Mon Sep 9 15:20:19 2019 (r352066) +++ head/usr.bin/m4/gnum4.c Mon Sep 9 15:24:48 2019 (r352067) @@ -1,4 +1,4 @@ -/* $OpenBSD: gnum4.c,v 1.51 2017/06/15 13:48:42 bcallah Exp $ */ +/* $OpenBSD: gnum4.c,v 1.52 2017/08/21 21:41:13 deraadt Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -634,7 +634,7 @@ void doesyscmd(const char *cmd) { int p[2]; - pid_t pid, cpid; + pid_t cpid; char *argv[4]; int cc; int status; @@ -672,8 +672,10 @@ doesyscmd(const char *cmd) } while (cc > 0 || (cc == -1 && errno == EINTR)); (void) close(p[0]); - while ((pid = wait(&status)) != cpid && pid >= 0) - continue; + while (waitpid(cpid, &status, 0) == -1) { + if (errno != EINTR) + break; + } pbstr(getstring()); } } From owner-svn-src-all@freebsd.org Mon Sep 9 15:28:23 2019 Return-Path: Delivered-To: svn-src-all@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 45394D55EA; Mon, 9 Sep 2019 15:28:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RsWC0kC9z46pX; Mon, 9 Sep 2019 15:28:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1057FA83; Mon, 9 Sep 2019 15:28:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89FSM3N004965; Mon, 9 Sep 2019 15:28:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FSMd6004964; Mon, 9 Sep 2019 15:28:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091528.x89FSMd6004964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352068 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:28:23 -0000 Author: bapt Date: Mon Sep 9 15:28:22 2019 New Revision: 352068 URL: https://svnweb.freebsd.org/changeset/base/352068 Log: m4: import patch from OpenBSD by espie@ ifelse is special, fix argv parsing to avoid segfault problem noticed by Matthew Green (netbsd), slightly different fix so that argc counting makes more sense. we might want to warn on wrong number of parameters later, but this is somewhat inconsistent depending on the builtin right now. okay millert@ Obtained from: OpenBSD Modified: head/usr.bin/m4/eval.c Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Mon Sep 9 15:24:48 2019 (r352067) +++ head/usr.bin/m4/eval.c Mon Sep 9 15:28:22 2019 (r352068) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.75 2017/06/15 13:48:42 bcallah Exp $ */ +/* $OpenBSD: eval.c,v 1.76 2017/10/23 15:21:19 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /*- @@ -201,8 +201,7 @@ expand_builtin(const char *argv[], int argc, int td) } case IFELTYPE: - if (argc > 4) - doifelse(argv, argc); + doifelse(argv, argc); break; case IFDFTYPE: @@ -695,17 +694,17 @@ dotrace(const char *argv[], int argc, int on) static void doifelse(const char *argv[], int argc) { - cycle { - if (STREQ(argv[2], argv[3])) + while (argc > 4) { + if (STREQ(argv[2], argv[3])) { pbstr(argv[4]); - else if (argc == 6) + break; + } else if (argc == 6) { pbstr(argv[5]); - else if (argc > 6) { + break; + } else { argv += 3; argc -= 3; - continue; } - break; } } From owner-svn-src-all@freebsd.org Mon Sep 9 15:35:35 2019 Return-Path: Delivered-To: svn-src-all@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 61186D594B; Mon, 9 Sep 2019 15:35:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RsgW1dkVz47FZ; Mon, 9 Sep 2019 15:35:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02939FC5E; Mon, 9 Sep 2019 15:35:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89FZYWK010604; Mon, 9 Sep 2019 15:35:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FZYQ3010603; Mon, 9 Sep 2019 15:35:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091535.x89FZYQ3010603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352069 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:35:35 -0000 Author: bapt Date: Mon Sep 9 15:35:34 2019 New Revision: 352069 URL: https://svnweb.freebsd.org/changeset/base/352069 Log: m4: import from OpenBSD patch by espie@ replace sloppy parsing of numeric values with strtonum (incr, decr, divert) still use integers, so use the natural bounds for these. POSIX says m4 should error when these use non numeric values, and now they do. okay millert@ Obtained from: OpenBSD Modified: head/usr.bin/m4/eval.c Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Mon Sep 9 15:28:22 2019 (r352068) +++ head/usr.bin/m4/eval.c Mon Sep 9 15:35:34 2019 (r352069) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.76 2017/10/23 15:21:19 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.77 2017/11/11 12:55:59 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /*- @@ -126,6 +126,7 @@ void expand_builtin(const char *argv[], int argc, int td) { int c, n; + const char *errstr; int ac; static int sysval = 0; @@ -186,13 +187,15 @@ expand_builtin(const char *argv[], int argc, int td) if (argc > 3) { base = strtonum(argv[3], 2, 36, &errstr); if (errstr) { - m4errx(1, "expr: base %s invalid.", argv[3]); + m4errx(1, "expr: base is %s: %s.", + errstr, argv[3]); } } if (argc > 4) { maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); if (errstr) { - m4errx(1, "expr: maxdigits %s invalid.", argv[4]); + m4errx(1, "expr: maxdigits is %s: %s.", + errstr, argv[4]); } } if (argc > 2) @@ -231,8 +234,13 @@ expand_builtin(const char *argv[], int argc, int td) * doincr - increment the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) + 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX-1, &errstr); + if (errstr != NULL) + m4errx(1, "incr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n + 1); + } break; case DECRTYPE: @@ -240,8 +248,13 @@ expand_builtin(const char *argv[], int argc, int td) * dodecr - decrement the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) - 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN+1, INT_MAX, &errstr); + if (errstr) + m4errx(1, "decr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n - 1); + } break; case SYSCTYPE: @@ -342,12 +355,18 @@ expand_builtin(const char *argv[], int argc, int td) break; case DIVRTYPE: - if (argc > 2 && (n = atoi(argv[2])) != 0) - dodiv(n); - else { - active = stdout; - oindex = 0; + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX, &errstr); + if (errstr) + m4errx(1, "divert: argument is %s: %s.", + errstr, argv[2]); + if (n != 0) { + dodiv(n); + break; + } } + active = stdout; + oindex = 0; break; case UNDVTYPE: From owner-svn-src-all@freebsd.org Mon Sep 9 15:37:41 2019 Return-Path: Delivered-To: svn-src-all@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 9370AD59DD; Mon, 9 Sep 2019 15:37:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rsjx31Vxz47Nj; Mon, 9 Sep 2019 15:37:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47276FC5F; Mon, 9 Sep 2019 15:37:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89Fbf8N010736; Mon, 9 Sep 2019 15:37:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FbfIV010735; Mon, 9 Sep 2019 15:37:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909091537.x89FbfIV010735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Sep 2019 15:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352070 - head/usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/m4 X-SVN-Commit-Revision: 352070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:37:41 -0000 Author: bapt Date: Mon Sep 9 15:37:40 2019 New Revision: 352070 URL: https://svnweb.freebsd.org/changeset/base/352070 Log: m4: import from OpenBSD By deraadt@ mkstemp() returns -1 on failure Obtained from: OpenBSD Modified: head/usr.bin/m4/eval.c Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Mon Sep 9 15:35:34 2019 (r352069) +++ head/usr.bin/m4/eval.c Mon Sep 9 15:37:40 2019 (r352070) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.77 2017/11/11 12:55:59 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.78 2019/06/28 05:35:34 deraadt Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /*- @@ -846,7 +846,7 @@ dodiv(int n) if (outfile[n] == NULL) { char fname[] = _PATH_DIVNAME; - if ((fd = mkstemp(fname)) < 0 || + if ((fd = mkstemp(fname)) == -1 || unlink(fname) == -1 || (outfile[n] = fdopen(fd, "w+")) == NULL) err(1, "%s: cannot divert", fname); From owner-svn-src-all@freebsd.org Mon Sep 9 15:57:25 2019 Return-Path: Delivered-To: svn-src-all@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 8497ED6376; Mon, 9 Sep 2019 15:57:25 +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 46Rt8j2Ctlz48QS; Mon, 9 Sep 2019 15:57:25 +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 1193EFFDB; Mon, 9 Sep 2019 15:57:25 +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 x89FvOqw022488; Mon, 9 Sep 2019 15:57:24 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89FvOwd022487; Mon, 9 Sep 2019 15:57:24 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201909091557.x89FvOwd022487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Sep 2019 15:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352071 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 15:57:25 -0000 Author: kp Date: Mon Sep 9 15:57:24 2019 New Revision: 352071 URL: https://svnweb.freebsd.org/changeset/base/352071 Log: riscv: Ensure that BSS is 8-byte aligned This makes clearing it (from locore.S) work without misaligned accesses (which can trap to machine mode, and be slow). Reviewed by: br Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D21538 Modified: head/sys/conf/ldscript.riscv Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Mon Sep 9 15:37:40 2019 (r352070) +++ head/sys/conf/ldscript.riscv Mon Sep 9 15:57:24 2019 (r352071) @@ -99,7 +99,7 @@ SECTIONS /* Ensure __bss_start is associated with the next section in case orphan sections are placed directly after .sdata, as has been seen to happen with LLD. */ - . = .; + . = ALIGN(8); __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : From owner-svn-src-all@freebsd.org Mon Sep 9 16:07:48 2019 Return-Path: Delivered-To: svn-src-all@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 3394FD691F; Mon, 9 Sep 2019 16:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RtNh0YM9z497H; Mon, 9 Sep 2019 16:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9FAB181AD; Mon, 9 Sep 2019 16:07:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89G7lg2028619; Mon, 9 Sep 2019 16:07:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89G7l2x028617; Mon, 9 Sep 2019 16:07:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909091607.x89G7l2x028617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 Sep 2019 16:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352072 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 352072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 16:07:48 -0000 Author: tuexen Date: Mon Sep 9 16:07:47 2019 New Revision: 352072 URL: https://svnweb.freebsd.org/changeset/base/352072 Log: Only update SACK/DSACK lists when a non-empty segment was received. This fixes hitting a KASSERT with a valid packet exchange. Reviewed by: rrs@, Richard Scheffenegger MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21567 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Sep 9 15:57:24 2019 (r352071) +++ head/sys/netinet/tcp_input.c Mon Sep 9 16:07:47 2019 (r352072) @@ -3045,9 +3045,8 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tp->t_flags & TF_SACK_PERMIT) { - if (((tlen == 0) && (save_tlen > 0) && - (SEQ_LT(save_start, save_rnxt)))) { + if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath * above. @@ -3055,20 +3054,20 @@ dodata: /* XXX */ tcp_update_sack_list(tp, save_start, save_start + save_tlen); } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { - /* - * Cleaning sackblks by using zero length - * update. - */ if ((tp->rcv_numsacks >= 1) && (tp->sackblks[0].end == save_start)) { - /* partial overlap, recorded at todrop above */ - tcp_update_sack_list(tp, tp->sackblks[0].start, + /* + * Partial overlap, recorded at todrop + * above. + */ + tcp_update_sack_list(tp, + tp->sackblks[0].start, tp->sackblks[0].end); } else { tcp_update_dsack_list(tp, save_start, save_start + save_tlen); } - } else if ((tlen > 0) && (tlen >= save_tlen)) { + } else if (tlen >= save_tlen) { /* Update of sackblks. */ tcp_update_dsack_list(tp, save_start, save_start + save_tlen); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Sep 9 15:57:24 2019 (r352071) +++ head/sys/netinet/tcp_stacks/rack.c Mon Sep 9 16:07:47 2019 (r352072) @@ -4942,35 +4942,36 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (((tlen == 0) && (save_tlen > 0) && - (SEQ_LT(save_start, save_rnxt)))) { - /* - * DSACK actually handled in the fastpath - * above. - */ - tcp_update_sack_list(tp, save_start, - save_start + save_tlen); - } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { - /* - * Cleaning sackblks by using zero length - * update. - */ - if ((tp->rcv_numsacks >= 1) && - (tp->sackblks[0].end == save_start)) { - /* partial overlap, recorded at todrop above */ - tcp_update_sack_list(tp, tp->sackblks[0].start, - tp->sackblks[0].end); - } else { + if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { + /* + * DSACK actually handled in the fastpath + * above. + */ + tcp_update_sack_list(tp, save_start, + save_start + save_tlen); + } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { + if ((tp->rcv_numsacks >= 1) && + (tp->sackblks[0].end == save_start)) { + /* + * Partial overlap, recorded at todrop + * above. + */ + tcp_update_sack_list(tp, + tp->sackblks[0].start, + tp->sackblks[0].end); + } else { + tcp_update_dsack_list(tp, save_start, + save_start + save_tlen); + } + } else if (tlen >= save_tlen) { + /* Update of sackblks. */ tcp_update_dsack_list(tp, save_start, save_start + save_tlen); + } else if (tlen > 0) { + tcp_update_dsack_list(tp, save_start, + save_start + tlen); } - } else if ((tlen > 0) && (tlen >= save_tlen)) { - /* Update of sackblks. */ - tcp_update_dsack_list(tp, save_start, - save_start + save_tlen); - } else if (tlen > 0) { - tcp_update_dsack_list(tp, save_start, - save_start + tlen); } } else { m_freem(m); From owner-svn-src-all@freebsd.org Mon Sep 9 16:25:10 2019 Return-Path: Delivered-To: svn-src-all@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 690F2D73D4; Mon, 9 Sep 2019 16:25:10 +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 46Rtmk2BN4z4BgV; Mon, 9 Sep 2019 16:25:10 +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 2AA551854F; Mon, 9 Sep 2019 16:25:10 +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 x89GPA1C040572; Mon, 9 Sep 2019 16:25:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89GPAGK040571; Mon, 9 Sep 2019 16:25:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201909091625.x89GPAGK040571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Sep 2019 16:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352073 - head/lib/csu/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/lib/csu/riscv X-SVN-Commit-Revision: 352073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 16:25:10 -0000 Author: kp Date: Mon Sep 9 16:25:09 2019 New Revision: 352073 URL: https://svnweb.freebsd.org/changeset/base/352073 Log: csu: Add the riscv .init call sequence Reviewed by: br Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D21537 Modified: head/lib/csu/riscv/crt.h Modified: head/lib/csu/riscv/crt.h ============================================================================== --- head/lib/csu/riscv/crt.h Mon Sep 9 16:07:47 2019 (r352072) +++ head/lib/csu/riscv/crt.h Mon Sep 9 16:25:09 2019 (r352073) @@ -1,2 +1,9 @@ /* $FreeBSD$ */ -/* Empty so we can include this unconditionally */ + +#ifndef _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS +#define INIT_CALL_SEQ(func) "call " __STRING(func) + +#endif From owner-svn-src-all@freebsd.org Mon Sep 9 16:31:15 2019 Return-Path: Delivered-To: svn-src-all@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 7634BD7653; Mon, 9 Sep 2019 16:31:15 +0000 (UTC) (envelope-from cem@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 46Rtvl2YZVz4C49; Mon, 9 Sep 2019 16:31:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2FB1858D; Mon, 9 Sep 2019 16:31:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89GVFaS044090; Mon, 9 Sep 2019 16:31:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89GVE2A044088; Mon, 9 Sep 2019 16:31:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909091631.x89GVE2A044088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 9 Sep 2019 16:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352074 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 352074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 16:31:15 -0000 Author: cem Date: Mon Sep 9 16:31:14 2019 New Revision: 352074 URL: https://svnweb.freebsd.org/changeset/base/352074 Log: ddb(4): Enhance lexer functionality for specialized commands Add a db_read_token_flags() variant of db_read_token() with configurable parameters. Allow specifying an explicit radix for tNUMBER lexing. It overrides the default inference and db_radix setting. Also provide the option of yielding any lexed whitespace (tWSPACE) (instead of ignoring it). This is useful for whitespace-sensitive CS_OWN commands. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21459 Modified: head/sys/ddb/db_lex.c head/sys/ddb/db_lex.h Modified: head/sys/ddb/db_lex.c ============================================================================== --- head/sys/ddb/db_lex.c Mon Sep 9 16:25:09 2019 (r352073) +++ head/sys/ddb/db_lex.c Mon Sep 9 16:31:14 2019 (r352074) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -45,7 +46,7 @@ __FBSDID("$FreeBSD$"); static char db_line[DB_MAXLINE]; static char * db_lp, *db_endlp; -static int db_lex(void); +static int db_lex(int); static void db_flush_line(void); static int db_read_char(void); static void db_unread_char(int); @@ -124,23 +125,24 @@ db_unread_char(c) static int db_look_token = 0; void -db_unread_token(t) - int t; +db_unread_token(int t) { db_look_token = t; } int -db_read_token() +db_read_token_flags(int flags) { int t; + MPASS((flags & ~(DRT_VALID_FLAGS_MASK)) == 0); + if (db_look_token) { t = db_look_token; db_look_token = 0; } else - t = db_lex(); + t = db_lex(flags); return (t); } @@ -158,22 +160,46 @@ db_flush_lex(void) } static int -db_lex(void) +db_lex(int flags) { - int c; + int c, n, radix_mode; + bool lex_wspace; + switch (flags & DRT_RADIX_MASK) { + case DRT_DEFAULT_RADIX: + radix_mode = -1; + break; + case DRT_OCTAL: + radix_mode = 8; + break; + case DRT_DECIMAL: + radix_mode = 10; + break; + case DRT_HEXADECIMAL: + radix_mode = 16; + break; + } + + lex_wspace = ((flags & DRT_WSPACE) != 0); + c = db_read_char(); - while (c <= ' ' || c > '~') { + for (n = 0; c <= ' ' || c > '~'; n++) { if (c == '\n' || c == -1) return (tEOL); c = db_read_char(); } + if (lex_wspace && n != 0) { + db_unread_char(c); + return (tWSPACE); + } if (c >= '0' && c <= '9') { /* number */ int r, digit = 0; - if (c > '0') + if (radix_mode != -1) + r = radix_mode; + else if (c > '0') r = db_radix; else { c = db_read_char(); Modified: head/sys/ddb/db_lex.h ============================================================================== --- head/sys/ddb/db_lex.h Mon Sep 9 16:25:09 2019 (r352073) +++ head/sys/ddb/db_lex.h Mon Sep 9 16:31:14 2019 (r352074) @@ -38,13 +38,51 @@ /* * Lexical analyzer. */ + +/* + * Options and flags can configure db_read_token() => db_lex() behavior. + * + * When a radix other than DRT_DEFAULT_RADIX is used, it overrides + * auto-detection, as well as the user-specified db_radix, in db_lex() of + * 'tNUMBER' tokens. + */ +enum { + /* Infer or use db_radix using the old logic. */ + DRT_DEFAULT_RADIX = 0, + /* The following set an explicit base for tNUMBER lex. */ + DRT_OCTAL, + DRT_DECIMAL, + DRT_HEXADECIMAL, +}; +#define DRT_RADIX_MASK 0x3 +/* + * Flag bit powers of two for db_read_token_flags. + * The low 2 bits are reserved for radix selection. + */ +enum { + _DRT_WSPACE = 2, +}; +#ifndef BIT +#define BIT(n) (1ull << (n)) +#endif +enum { + DRT_WSPACE = BIT(_DRT_WSPACE), +}; +#define DRT_VALID_FLAGS_MASK ((int)DRT_RADIX_MASK | DRT_WSPACE) + void db_flush_lex(void); char *db_get_line(void); void db_inject_line(const char *command); int db_read_line(void); -int db_read_token(void); +int db_read_token_flags(int); void db_unread_token(int t); +static inline int +db_read_token(void) +{ + return (db_read_token_flags(0)); +} + extern db_expr_t db_tok_number; #define TOK_STRING_SIZE 120 extern char db_tok_string[TOK_STRING_SIZE]; @@ -84,5 +122,6 @@ extern char db_tok_string[TOK_STRING_SIZE]; #define tSTRING 32 #define tQUESTION 33 #define tBIT_NOT 34 +#define tWSPACE 35 #endif /* !_DDB_DB_LEX_H_ */ From owner-svn-src-all@freebsd.org Mon Sep 9 16:32:24 2019 Return-Path: Delivered-To: svn-src-all@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 C8D61D77CD; Mon, 9 Sep 2019 16:32:24 +0000 (UTC) (envelope-from cem@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 46Rtx44qJnz4CQK; Mon, 9 Sep 2019 16:32:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87A0E18715; Mon, 9 Sep 2019 16:32:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89GWOXd046171; Mon, 9 Sep 2019 16:32:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89GWOhK045835; Mon, 9 Sep 2019 16:32:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909091632.x89GWOhK045835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 9 Sep 2019 16:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352075 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 352075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 16:32:24 -0000 Author: cem Date: Mon Sep 9 16:32:23 2019 New Revision: 352075 URL: https://svnweb.freebsd.org/changeset/base/352075 Log: ddb(4): Add some support for lexing IPv6 addresses Allow commands to specify that (hex) numbers may start with A-F, by adding the DRT_HEX flag for db_read_token_flags(). As before, numbers containing invalid digits for the current radix are rejected. Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively. There is a mild conflict here with lexed "identifiers" (tIDENT): ddb identifiers may contain arbitrary colons, and the ddb lexer is greedy. So the identifier lex will swallow any colons it finds inside identifiers, and consumers are still unable to expect the token sequence 'tIDENT tCOLON'. That limitation does not matter for IPv6 addresses, because the lexer always attempts to lex numbers before identifiers. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21509 Modified: head/sys/ddb/db_lex.c head/sys/ddb/db_lex.h Modified: head/sys/ddb/db_lex.c ============================================================================== --- head/sys/ddb/db_lex.c Mon Sep 9 16:31:14 2019 (r352074) +++ head/sys/ddb/db_lex.c Mon Sep 9 16:32:23 2019 (r352075) @@ -163,7 +163,7 @@ static int db_lex(int flags) { int c, n, radix_mode; - bool lex_wspace; + bool lex_wspace, lex_hex_numbers; switch (flags & DRT_RADIX_MASK) { case DRT_DEFAULT_RADIX: @@ -181,6 +181,7 @@ db_lex(int flags) } lex_wspace = ((flags & DRT_WSPACE) != 0); + lex_hex_numbers = ((flags & DRT_HEX) != 0); c = db_read_char(); for (n = 0; c <= ' ' || c > '~'; n++) { @@ -193,13 +194,16 @@ db_lex(int flags) return (tWSPACE); } - if (c >= '0' && c <= '9') { + if ((c >= '0' && c <= '9') || + (lex_hex_numbers && + ((c >= 'a' && c <= 'f') || + (c >= 'A' && c <= 'F')))) { /* number */ int r, digit = 0; if (radix_mode != -1) r = radix_mode; - else if (c > '0') + else if (c != '0') r = db_radix; else { c = db_read_char(); @@ -328,6 +332,12 @@ db_lex(int flags) } db_unread_char(c); return (tEXCL); + case ':': + c = db_read_char(); + if (c == ':') + return (tCOLONCOLON); + db_unread_char(c); + return (tCOLON); case ';': return (tSEMI); case '&': Modified: head/sys/ddb/db_lex.h ============================================================================== --- head/sys/ddb/db_lex.h Mon Sep 9 16:31:14 2019 (r352074) +++ head/sys/ddb/db_lex.h Mon Sep 9 16:32:23 2019 (r352075) @@ -58,17 +58,26 @@ enum { /* * Flag bit powers of two for db_read_token_flags. * The low 2 bits are reserved for radix selection. + * + * WSPACE: Yield explicit tWSPACE tokens when one or more whitespace characters + * is consumed. + * HEX: Allow tNUMBER tokens to start with 'A'-'F' without explicit "0x" + * prefix. */ enum { _DRT_WSPACE = 2, + _DRT_HEX, }; #ifndef BIT #define BIT(n) (1ull << (n)) #endif enum { DRT_WSPACE = BIT(_DRT_WSPACE), + DRT_HEX = BIT(_DRT_HEX), }; -#define DRT_VALID_FLAGS_MASK ((int)DRT_RADIX_MASK | DRT_WSPACE) +#define DRT_VALID_FLAGS_MASK ((int)DRT_RADIX_MASK | \ + DRT_WSPACE | \ + DRT_HEX) void db_flush_lex(void); char *db_get_line(void); @@ -123,5 +132,7 @@ extern char db_tok_string[TOK_STRING_SIZE]; #define tQUESTION 33 #define tBIT_NOT 34 #define tWSPACE 35 +#define tCOLON 36 +#define tCOLONCOLON 37 #endif /* !_DDB_DB_LEX_H_ */ From owner-svn-src-all@freebsd.org Mon Sep 9 16:37:39 2019 Return-Path: Delivered-To: svn-src-all@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 27BDFD7A8A; Mon, 9 Sep 2019 16:37:39 +0000 (UTC) (envelope-from johalun@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 46Rv370F70z4ChK; Mon, 9 Sep 2019 16:37:39 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DFA1C18731; Mon, 9 Sep 2019 16:37:38 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89GbcQW046833; Mon, 9 Sep 2019 16:37:38 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89GbcWm046830; Mon, 9 Sep 2019 16:37:38 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201909091637.x89GbcWm046830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Mon, 9 Sep 2019 16:37: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: r352076 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 352076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 16:37:39 -0000 Author: johalun Date: Mon Sep 9 16:37:38 2019 New Revision: 352076 URL: https://svnweb.freebsd.org/changeset/base/352076 Log: MFC r351701: LinuxKPI: Add sysfs create/remove functions that handles multiple files in one call. Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Sep 9 16:32:23 2019 (r352075) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Sep 9 16:37:38 2019 (r352076) @@ -152,6 +152,29 @@ sysfs_remove_file(struct kobject *kobj, const struct a sysctl_remove_name(kobj->oidp, attr->name, 1, 1); } +static inline int +sysfs_create_files(struct kobject *kobj, const struct attribute * const *attrs) +{ + int error = 0; + int i; + + for (i = 0; attrs[i] && !error; i++) + error = sysfs_create_file(kobj, attrs[i]); + while (error && --i >= 0) + sysfs_remove_file(kobj, attrs[i]); + + return (error); +} + +static inline void +sysfs_remove_files(struct kobject *kobj, const struct attribute * const *attrs) +{ + int i; + + for (i = 0; attrs[i]; i++) + sysfs_remove_file(kobj, attrs[i]); +} + static inline void sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp) { Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Mon Sep 9 16:32:23 2019 (r352075) +++ stable/12/sys/sys/param.h Mon Sep 9 16:37:38 2019 (r352076) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200516 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200517 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 9 17:22:12 2019 Return-Path: Delivered-To: svn-src-all@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 5F7D3D8E7B; Mon, 9 Sep 2019 17:22:12 +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 46Rw2X1nLsz4GLr; Mon, 9 Sep 2019 17:22:12 +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 2059A18FF2; Mon, 9 Sep 2019 17:22:12 +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 x89HMC5j077008; Mon, 9 Sep 2019 17:22:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HMB2h077006; Mon, 9 Sep 2019 17:22:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091722.x89HMB2h077006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:22:11 +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: r352077 - in stable/12/usr.sbin/makefs: . tests X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/usr.sbin/makefs: . tests X-SVN-Commit-Revision: 352077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:22:12 -0000 Author: emaste Date: Mon Sep 9 17:22:11 2019 New Revision: 352077 URL: https://svnweb.freebsd.org/changeset/base/352077 Log: MFC r345281: makefs: Fix "time" mtree attribute handling When processing mtree(5) MANIFEST files, makefs(8) previously threw an error if it encountered an entry whose "time" attribute contained a non-zero subsecond component (e.g. time=1551620152.987220000). Update the handling logic to properly assign the subsecond component if built with nanosecond support, or silently discard it otherwise. Also, re-enable the time attribute for the kyua tests. PR: 194703 Submitted by: mhorne Modified: stable/12/usr.sbin/makefs/mtree.c stable/12/usr.sbin/makefs/tests/makefs_tests_common.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/mtree.c ============================================================================== --- stable/12/usr.sbin/makefs/mtree.c Mon Sep 9 16:37:38 2019 (r352076) +++ stable/12/usr.sbin/makefs/mtree.c Mon Sep 9 17:22:11 2019 (r352077) @@ -644,14 +644,17 @@ read_mtree_keywords(FILE *fp, fsnode *node) st->st_atime = num; st->st_ctime = num; st->st_mtime = num; +#if HAVE_STRUCT_STAT_ST_MTIMENSEC if (p == NULL) break; error = read_number(p, 10, &num, 0, INTMAX_MAX); if (error) break; - if (num != 0) - error = EINVAL; + st->st_atimensec = num; + st->st_ctimensec = num; + st->st_mtimensec = num; +#endif } else if (strcmp(keyword, "type") == 0) { if (value == NULL) { error = ENOATTR; Modified: stable/12/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- stable/12/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Sep 9 16:37:38 2019 (r352076) +++ stable/12/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Sep 9 17:22:11 2019 (r352077) @@ -29,13 +29,7 @@ KB=1024 : ${TMPDIR=/tmp} -# TODO: add mtree `time` support; get a lot of errors like this right now when -# passing generating disk images with keyword mtree support, like: -# -# `[...]/mtree.spec:8: error: time: invalid value '1446458503'` -# -#DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" -DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link" +DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" TEST_IMAGE="$TMPDIR/test.img" TEST_INPUTS_DIR="$TMPDIR/inputs" TEST_MD_DEVICE_FILE="$TMPDIR/md.output" From owner-svn-src-all@freebsd.org Mon Sep 9 17:24:24 2019 Return-Path: Delivered-To: svn-src-all@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 C90C7D8FD8; Mon, 9 Sep 2019 17:24:24 +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 46Rw544wSMz4GZt; Mon, 9 Sep 2019 17:24:24 +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 8CEC41901D; Mon, 9 Sep 2019 17:24:24 +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 x89HOO4D077187; Mon, 9 Sep 2019 17:24:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HOOwq077186; Mon, 9 Sep 2019 17:24:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091724.x89HOOwq077186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:24: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: r352078 - stable/12/usr.sbin/makefs X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/makefs X-SVN-Commit-Revision: 352078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:24:24 -0000 Author: emaste Date: Mon Sep 9 17:24:24 2019 New Revision: 352078 URL: https://svnweb.freebsd.org/changeset/base/352078 Log: MFC r351230: makefs.8: style updates from igor Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.sbin/makefs/makefs.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/12/usr.sbin/makefs/makefs.8 Mon Sep 9 17:22:11 2019 (r352077) +++ stable/12/usr.sbin/makefs/makefs.8 Mon Sep 9 17:24:24 2019 (r352078) @@ -119,7 +119,7 @@ XXX: document these .It Fl F Ar mtree-specfile .Em This is almost certainly not the option you are looking for. To create an image from a list of files in an mtree format manifest, -specify it as the last argument on the commandline, not as a the +specify it as the last argument on the command line, not as a the argument to .Fl F . .Pp @@ -160,10 +160,10 @@ and (in the case of symbolic links). If .Sy time -isn't provided, the current time will be used. +is not provided, the current time will be used. If .Sy flags -isn't provided, the current file flags will be used. +is not provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl f Ar free-files Ensure that a minimum of @@ -331,9 +331,11 @@ The following keywords are supported: Allow the directory structure to exceed the maximum specified in the spec. .It Sy allow-illegal-chars -Allow illegal characters in filenames. This option is not implemented. +Allow illegal characters in filenames. +This option is not implemented. .It Sy allow-lowercase -Allow lowercase characters in filenames. This option is not implemented. +Allow lowercase characters in filenames. +This option is not implemented. .It Sy allow-max-name Allow 37 instead of 33 characters for filenames by omitting the version id. @@ -348,7 +350,8 @@ extension to encode .Tn RISC OS metadata. .It Sy bootimagedir -Boot image directory. This option is not implemented. +Boot image directory. +This option is not implemented. .It Sy chrp-boot Write an MBR partition table to the image to allow older CHRP hardware to boot. From owner-svn-src-all@freebsd.org Mon Sep 9 17:32:43 2019 Return-Path: Delivered-To: svn-src-all@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 625E9D9413; Mon, 9 Sep 2019 17:32: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 46RwGg2cV3z4H6b; Mon, 9 Sep 2019 17:32: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 23634191E6; Mon, 9 Sep 2019 17:32: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 x89HWh6I083289; Mon, 9 Sep 2019 17:32:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HWeTr083276; Mon, 9 Sep 2019 17:32:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091732.x89HWeTr083276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:32:40 +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: r352079 - in stable/12/usr.sbin/makefs: . ffs msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/usr.sbin/makefs: . ffs msdos X-SVN-Commit-Revision: 352079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:32:43 -0000 Author: emaste Date: Mon Sep 9 17:32:40 2019 New Revision: 352079 URL: https://svnweb.freebsd.org/changeset/base/352079 Log: makefs: add msdosfs (FAT) support MFC r351232: makefs.8: expand description of image size Submitted by: ryan_freqlabs.com, Siva Mahadevan MFC r351273: makefs: add msdosfs (FAT) support Add FAT support to makefs by copying some files from sys/fs/msdosfs/ and updating others with changes from NetBSD. The six files copied from sys/fs/msdosfs at r348251 and modified are: denode.h direntry.h fat.h msdosfs_fat.c msdosfs_lookup.c msdosfsmount.h I would prefer to avoid the duplication, but reluctance to doing so was expressed in a previous review (D11197); for now copy the files and revisit in the future. Submitted by: Siva Mahadevan MFC r351275: makefs: avoid "dereferencing 'void *' pointer" warnings On GCC 4.2.1 archs MFC r351302: makefs.8: update history - ported to FreeBSD and first appeared in 8.0 - Christos Zoulas added the FAT support that I imported MFC r351319: makefs: use `char *` not `void *` for buf b_data, drop casts in msdos (The kernel uses caddr_t.) Suggested by: cem MFC r351415 (delphij): Properly update FSInfo block after generation. After populating the filesystem, write a FSInfo block with proper information. Sponsored by: The FreeBSD Foundation Added: stable/12/usr.sbin/makefs/msdos/Makefile.inc - copied unchanged from r351273, head/usr.sbin/makefs/msdos/Makefile.inc stable/12/usr.sbin/makefs/msdos/denode.h - copied unchanged from r351273, head/usr.sbin/makefs/msdos/denode.h stable/12/usr.sbin/makefs/msdos/direntry.h - copied unchanged from r351273, head/usr.sbin/makefs/msdos/direntry.h stable/12/usr.sbin/makefs/msdos/fat.h - copied unchanged from r351273, head/usr.sbin/makefs/msdos/fat.h stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c - copied unchanged from r351273, head/usr.sbin/makefs/msdos/msdosfs_conv.c stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c - copied, changed from r351273, head/usr.sbin/makefs/msdos/msdosfs_fat.c stable/12/usr.sbin/makefs/msdos/msdosfs_lookup.c - copied unchanged from r351273, head/usr.sbin/makefs/msdos/msdosfs_lookup.c stable/12/usr.sbin/makefs/msdos/msdosfsmount.h - copied unchanged from r351273, head/usr.sbin/makefs/msdos/msdosfsmount.h Modified: stable/12/usr.sbin/makefs/Makefile stable/12/usr.sbin/makefs/ffs/buf.h stable/12/usr.sbin/makefs/makefs.8 stable/12/usr.sbin/makefs/makefs.c stable/12/usr.sbin/makefs/makefs.h stable/12/usr.sbin/makefs/msdos.c stable/12/usr.sbin/makefs/msdos.h stable/12/usr.sbin/makefs/msdos/msdosfs_denode.c stable/12/usr.sbin/makefs/msdos/msdosfs_vfsops.c stable/12/usr.sbin/makefs/msdos/msdosfs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/Makefile ============================================================================== --- stable/12/usr.sbin/makefs/Makefile Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/Makefile Mon Sep 9 17:32:40 2019 (r352079) @@ -8,8 +8,10 @@ PROG= makefs CFLAGS+=-I${SRCDIR} -SRCS= cd9660.c ffs.c \ +SRCS= cd9660.c \ + ffs.c \ makefs.c \ + msdos.c \ mtree.c \ walk.c MAN= makefs.8 @@ -18,6 +20,7 @@ WARNS?= 2 .include "${SRCDIR}/cd9660/Makefile.inc" .include "${SRCDIR}/ffs/Makefile.inc" +.include "${SRCDIR}/msdos/Makefile.inc" CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 Modified: stable/12/usr.sbin/makefs/ffs/buf.h ============================================================================== --- stable/12/usr.sbin/makefs/ffs/buf.h Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/ffs/buf.h Mon Sep 9 17:32:40 2019 (r352079) @@ -54,7 +54,7 @@ struct vnode { }; struct buf { - void * b_data; + char * b_data; long b_bufsize; long b_bcount; daddr_t b_blkno; Modified: stable/12/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/12/usr.sbin/makefs/makefs.8 Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/makefs.8 Mon Sep 9 17:32:40 2019 (r352079) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2018 +.Dd August 20, 2019 .Dt MAKEFS 8 .Os .Sh NAME @@ -198,7 +198,9 @@ and Instead of creating the filesystem at the beginning of the file, start at offset. Valid only for -.Sy ffs . +.Sy ffs +and +.Sy msdos . .It Fl o Ar fs-options Set file system specific options. .Ar fs-options @@ -225,6 +227,21 @@ Defaults to 512. .It Fl s Ar image-size Set the size of the file system image to .Ar image-size . +This is equivalent to setting both the minimum +.Fl ( M ) +and the maximum +.Fl ( m ) +sizes to the same value. +For +.Sy ffs +and +.Sy msdos +the +.Ar image-size +does not include the +.Ar offset . +.Ar offset +is not included in that size. .It Fl T Ar timestamp Specify a timestamp to be set for all filesystem files and directories created so that repeatable builds are possible. @@ -247,6 +264,8 @@ The following file system types are supported: BSD fast file system (default). .It Sy cd9660 ISO 9660 file system. +.It Sy msdos +FAT12, FAT16, or FAT32 file system. .El .It Fl x Exclude file system nodes not explicitly listed in the specfile. @@ -410,6 +429,67 @@ Turns on verbose output. .It Sy volumeid Volume set identifier of the image. .El +.Ss msdos-specific options +.Sy msdos +images have MS-DOS-specific optional parameters that may be +provided. +The arguments consist of a keyword, an equal sign +.Pq Ql = , +and a value. +The following keywords are supported (see +.Xr newfs_msdos 8 +for more details): +.Pp +.Bl -tag -width omit-trailing-period -offset indent -compact +.It Cm backup_sector +Location of the backup boot sector. +.It Cm block_size +Block size. +.It Cm bootstrap +Bootstrap file. +.It Cm bytes_per_sector +Bytes per sector. +.It Cm create_size +Create file size. +.It Cm directory_entries +Directory entries. +.It Cm drive_heads +Drive heads. +.It Cm fat_type +FAT type (12, 16, or 32). +.It Cm floppy +Preset drive parameters for standard format floppy disks +(160, 180, 320, 360, 640, 720, 1200, 1232, 1440, or 2880). +.It Cm hidden_sectors +Hidden sectors. +.It Cm info_sector +Location of the info sector. +.It Cm media_descriptor +Media descriptor. +.It Cm num_FAT +Number of FATs. +.It Cm OEM_string +OEM string. +.It Cm offset +Offset in device. +This option will be ignored if +.Fl O +is set to a positive number. +.It Cm reserved_sectors +Reserved sectors. +.It Cm sectors_per_cluster +Sectors per cluster. +.It Cm sectors_per_fat +Sectors per FAT. +.It Cm sectors_per_track +Sectors per track. +.It Cm size +File System size. +.It Cm volume_id +Volume ID. +.It Cm volume_label +Volume Label. +.El .Sh SEE ALSO .Xr mtree 5 , .Xr mtree 8 , @@ -419,6 +499,10 @@ The .Nm utility appeared in .Nx 1.6 . +It was ported to +.Fx +and first appeared in +.Fx 8.0 . .Sh AUTHORS .An Luke Mewburn .Aq Mt lukem@NetBSD.org @@ -428,4 +512,6 @@ utility appeared in .An Ryan Gabrys , .An Alan Perez-Rathke , .An Ram Vedam -(cd9660 support) +(cd9660 support), +.An Christos Zoulas +(msdos support). Modified: stable/12/usr.sbin/makefs/makefs.c ============================================================================== --- stable/12/usr.sbin/makefs/makefs.c Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/makefs.c Mon Sep 9 17:32:40 2019 (r352079) @@ -74,8 +74,9 @@ static fstype_t fstypes[] = { # name, name ## _prep_opts, name ## _parse_opts, \ name ## _cleanup_opts, name ## _makefs \ } - ENTRY(ffs), ENTRY(cd9660), + ENTRY(ffs), + ENTRY(msdos), { .type = NULL }, }; Modified: stable/12/usr.sbin/makefs/makefs.h ============================================================================== --- stable/12/usr.sbin/makefs/makefs.h Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/makefs.h Mon Sep 9 17:32:40 2019 (r352079) @@ -183,8 +183,9 @@ int fs ## _parse_opts(const char *, fsinfo_t *); \ void fs ## _cleanup_opts(fsinfo_t *); \ void fs ## _makefs(const char *, const char *, fsnode *, fsinfo_t *) -DECLARE_FUN(ffs); DECLARE_FUN(cd9660); +DECLARE_FUN(ffs); +DECLARE_FUN(msdos); extern u_int debug; extern int dupsok; @@ -225,6 +226,7 @@ extern struct stat stampst; #define DEBUG_APPLY_SPECFILE 0x04000000 #define DEBUG_APPLY_SPECENTRY 0x08000000 #define DEBUG_APPLY_SPECONLY 0x10000000 +#define DEBUG_MSDOSFS 0x20000000 #define TIMER_START(x) \ Modified: stable/12/usr.sbin/makefs/msdos.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos.c Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/msdos.c Mon Sep 9 17:32:40 2019 (r352079) @@ -50,24 +50,28 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include -#include -#include -#include #include "makefs.h" #include "msdos.h" -#include "mkfs_msdos.h" +#include +#include + +#include "ffs/buf.h" + +#include "msdos/msdosfsmount.h" +#include "msdos/direntry.h" +#include "msdos/denode.h" + static int msdos_populate_dir(const char *, struct denode *, fsnode *, fsnode *, fsinfo_t *); struct msdos_options_ex { struct msdos_options options; - bool utf8; }; void @@ -85,15 +89,13 @@ msdos_prep_opts(fsinfo_t *fsopts) (sizeof(_type) == 4 ? OPT_INT32 : OPT_INT64)))), \ .value = &msdos_opt->options._name, \ .minimum = _min, \ - .maximum = sizeof(_type) == 1 ? 0xff : \ - (sizeof(_type) == 2 ? 0xffff : \ - (sizeof(_type) == 4 ? 0xffffffff : 0xffffffffffffffffLL)), \ - .desc = _desc, \ + .maximum = sizeof(_type) == 1 ? UINT8_MAX : \ + (sizeof(_type) == 2 ? UINT16_MAX : \ + (sizeof(_type) == 4 ? UINT32_MAX : INT64_MAX)), \ + .desc = _desc, \ }, ALLOPTS #undef AOPT - { 'U', "utf8", &msdos_opt->utf8, OPT_BOOL, - 0, 1, "Use UTF8 names" }, { .name = NULL } }; @@ -113,7 +115,6 @@ msdos_parse_opts(const char *option, fsinfo_t *fsopts) { struct msdos_options *msdos_opt = fsopts->fs_specific; option_t *msdos_options = fsopts->fs_options; - int rv; assert(option != NULL); @@ -148,7 +149,7 @@ msdos_makefs(const char *image, const char *dir, fsnod { struct msdos_options_ex *msdos_opt = fsopts->fs_specific; struct vnode vp, rootvp; - struct timeval start; + struct timeval start; struct msdosfsmount *pmp; uint32_t flags; @@ -160,7 +161,8 @@ msdos_makefs(const char *image, const char *dir, fsnod fsopts->size = fsopts->maxsize; msdos_opt->options.create_size = MAX(msdos_opt->options.create_size, fsopts->offset + fsopts->size); - msdos_opt->options.offset = fsopts->offset; + if (fsopts->offset > 0) + msdos_opt->options.offset = fsopts->offset; if (msdos_opt->options.bytes_per_sector == 0) { if (fsopts->sectorsize == -1) fsopts->sectorsize = 512; @@ -173,7 +175,7 @@ msdos_makefs(const char *image, const char *dir, fsnod fsopts->sectorsize, msdos_opt->options.bytes_per_sector); } - /* create image */ + /* create image */ printf("Creating `%s'\n", image); TIMER_START(start); if (mkfs_msdos(image, NULL, &msdos_opt->options) == -1) @@ -184,10 +186,7 @@ msdos_makefs(const char *image, const char *dir, fsnod vp.fs = fsopts; flags = 0; - if (msdos_opt->utf8) - flags |= MSDOSFSMNT_UTF8; - - if ((pmp = msdosfs_mount(&vp, flags)) == NULL) + if ((pmp = msdosfs_mount(&vp)) == NULL) err(1, "msdosfs_mount"); if (msdosfs_root(pmp, &rootvp) != 0) @@ -197,17 +196,19 @@ msdos_makefs(const char *image, const char *dir, fsnod printf("msdos_makefs: image %s directory %s root %p\n", image, dir, root); - /* populate image */ + /* populate image */ printf("Populating `%s'\n", image); TIMER_START(start); if (msdos_populate_dir(dir, VTODE(&rootvp), root, root, fsopts) == -1) errx(1, "Image file `%s' not created.", image); TIMER_RESULTS(start, "msdos_populate_dir"); + if (msdosfs_fsiflush(pmp) != 0) + errx(1, "Unable to update FSInfo block."); if (debug & DEBUG_FS_MAKEFS) putchar('\n'); - /* ensure no outstanding buffers remain */ + /* ensure no outstanding buffers remain */ if (debug & DEBUG_FS_MAKEFS) bcleanup(); Modified: stable/12/usr.sbin/makefs/msdos.h ============================================================================== --- stable/12/usr.sbin/makefs/msdos.h Mon Sep 9 17:24:24 2019 (r352078) +++ stable/12/usr.sbin/makefs/msdos.h Mon Sep 9 17:32:40 2019 (r352079) @@ -30,11 +30,32 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _MAKEFS_MSDOS_H +#define _MAKEFS_MSDOS_H + +#define NOCRED NULL + +#define MSDOSFS_DPRINTF(args) do { \ + if (debug & DEBUG_MSDOSFS) \ + printf args; \ +} while (0); + + struct vnode; struct denode; +struct fsnode; +struct msdosfsmount; -struct msdosfsmount *msdosfs_mount(struct vnode *, int); +struct componentname { + char *cn_nameptr; + size_t cn_namelen; +}; + +int msdosfs_fsiflush(struct msdosfsmount *); +struct msdosfsmount *msdosfs_mount(struct vnode *); int msdosfs_root(struct msdosfsmount *, struct vnode *); struct denode *msdosfs_mkfile(const char *, struct denode *, fsnode *); struct denode *msdosfs_mkdire(const char *, struct denode *, fsnode *); + +#endif Copied: stable/12/usr.sbin/makefs/msdos/Makefile.inc (from r351273, head/usr.sbin/makefs/msdos/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/makefs/msdos/Makefile.inc Mon Sep 9 17:32:40 2019 (r352079, copy of r351273, head/usr.sbin/makefs/msdos/Makefile.inc) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# + +MSDOS= ${SRCTOP}/sys/fs/msdosfs +MSDOS_NEWFS= ${SRCTOP}/sbin/newfs_msdos + +.PATH: ${SRCDIR}/msdos ${MSDOS} ${MSDOS_NEWFS} + +CFLAGS+= -I${MSDOS} -I${MSDOS_NEWFS} + +SRCS+= mkfs_msdos.c +SRCS+= msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c +SRCS+= msdosfs_vnops.c msdosfs_vfsops.c Copied: stable/12/usr.sbin/makefs/msdos/denode.h (from r351273, head/usr.sbin/makefs/msdos/denode.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/makefs/msdos/denode.h Mon Sep 9 17:32:40 2019 (r352079, copy of r351273, head/usr.sbin/makefs/msdos/denode.h) @@ -0,0 +1,237 @@ +/* $FreeBSD$ */ +/* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1995, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ +/*- + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ +#ifndef _FS_MSDOSFS_DENODE_H_ +#define _FS_MSDOSFS_DENODE_H_ + +/* + * This is the pc filesystem specific portion of the vnode structure. + * + * To describe a file uniquely the de_dirclust, de_diroffset, and + * de_StartCluster fields are used. + * + * de_dirclust contains the cluster number of the directory cluster + * containing the entry for a file or directory. + * de_diroffset is the index into the cluster for the entry describing + * a file or directory. + * de_StartCluster is the number of the first cluster of the file or directory. + * + * Now to describe the quirks of the pc filesystem. + * - Clusters 0 and 1 are reserved. + * - The first allocatable cluster is 2. + * - The root directory is of fixed size and all blocks that make it up + * are contiguous. + * - Cluster 0 refers to the root directory when it is found in the + * startcluster field of a directory entry that points to another directory. + * - Cluster 0 implies a 0 length file when found in the start cluster field + * of a directory entry that points to a file. + * - You can't use the cluster number 0 to derive the address of the root + * directory. + * - Multiple directory entries can point to a directory. The entry in the + * parent directory points to a child directory. Any directories in the + * child directory contain a ".." entry that points back to the parent. + * The child directory itself contains a "." entry that points to itself. + * - The root directory does not contain a "." or ".." entry. + * - Directory entries for directories are never changed once they are created + * (except when removed). The size stays 0, and the last modification time + * is never changed. This is because so many directory entries can point to + * the physical clusters that make up a directory. It would lead to an + * update nightmare. + * - The length field in a directory entry pointing to a directory contains 0 + * (always). The only way to find the end of a directory is to follow the + * cluster chain until the "last cluster" marker is found. + * + * My extensions to make this house of cards work. These apply only to the in + * memory copy of the directory entry. + * - A reference count for each denode will be kept since dos doesn't keep such + * things. + */ + +/* + * Internal pseudo-offset for (nonexistent) directory entry for the root + * dir in the root dir + */ +#define MSDOSFSROOT_OFS 0x1fffffff + +/* + * The FAT cache structure. fc_fsrcn is the filesystem relative cluster + * number that corresponds to the file relative cluster number in this + * structure (fc_frcn). + */ +struct fatcache { + u_long fc_frcn; /* file relative cluster number */ + u_long fc_fsrcn; /* filesystem relative cluster number */ +}; + +/* + * The FAT entry cache as it stands helps make extending files a "quick" + * operation by avoiding having to scan the FAT to discover the last + * cluster of the file. The cache also helps sequential reads by + * remembering the last cluster read from the file. This also prevents us + * from having to rescan the FAT to find the next cluster to read. This + * cache is probably pretty worthless if a file is opened by multiple + * processes. + */ +#define FC_SIZE 3 /* number of entries in the cache */ +#define FC_LASTMAP 0 /* entry the last call to pcbmap() resolved + * to */ +#define FC_LASTFC 1 /* entry for the last cluster in the file */ +#define FC_NEXTTOLASTFC 2 /* entry for a close to the last cluster in + * the file */ + +#define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */ + +/* + * Set a slot in the FAT cache. + */ +#define fc_setcache(dep, slot, frcn, fsrcn) \ + (dep)->de_fc[(slot)].fc_frcn = (frcn); \ + (dep)->de_fc[(slot)].fc_fsrcn = (fsrcn); + +/* + * This is the in memory variant of a dos directory entry. It is usually + * contained within a vnode. + */ +struct denode { + struct vnode *de_vnode; /* addr of vnode we are part of */ + u_long de_flag; /* flag bits */ + u_long de_dirclust; /* cluster of the directory file containing this entry */ + u_long de_diroffset; /* offset of this entry in the directory cluster */ + u_long de_fndoffset; /* offset of found dir entry */ + int de_fndcnt; /* number of slots before de_fndoffset */ + long de_refcnt; /* reference count */ + struct msdosfsmount *de_pmp; /* addr of our mount struct */ + u_char de_Name[12]; /* name, from DOS directory entry */ + u_char de_Attributes; /* attributes, from directory entry */ + u_char de_LowerCase; /* NT VFAT lower case flags */ + u_char de_CHun; /* Hundredth of second of CTime*/ + u_short de_CTime; /* creation time */ + u_short de_CDate; /* creation date */ + u_short de_ADate; /* access date */ + u_short de_MTime; /* modification time */ + u_short de_MDate; /* modification date */ + u_long de_StartCluster; /* starting cluster of file */ + u_long de_FileSize; /* size of file in bytes */ + struct fatcache de_fc[FC_SIZE]; /* FAT cache */ + uint64_t de_inode; /* Inode number (really byte offset of direntry) */ +}; + +/* + * Values for the de_flag field of the denode. + */ +#define DE_UPDATE 0x0004 /* Modification time update request */ +#define DE_CREATE 0x0008 /* Creation time update */ +#define DE_ACCESS 0x0010 /* Access time update */ +#define DE_MODIFIED 0x0020 /* Denode has been modified */ +#define DE_RENAME 0x0040 /* Denode is in the process of being renamed */ + +/* Maximum size of a file on a FAT filesystem */ +#define MSDOSFS_FILESIZE_MAX 0xFFFFFFFFLL + +/* + * Transfer directory entries between internal and external form. + * dep is a struct denode * (internal form), + * dp is a struct direntry * (external form). + */ +#define DE_INTERNALIZE32(dep, dp) \ + ((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16) +#define DE_INTERNALIZE(dep, dp) \ + (memcpy((dep)->de_Name, (dp)->deName, 11), \ + (dep)->de_Attributes = (dp)->deAttributes, \ + (dep)->de_LowerCase = (dp)->deLowerCase, \ + (dep)->de_CHun = (dp)->deCHundredth, \ + (dep)->de_CTime = getushort((dp)->deCTime), \ + (dep)->de_CDate = getushort((dp)->deCDate), \ + (dep)->de_ADate = getushort((dp)->deADate), \ + (dep)->de_MTime = getushort((dp)->deMTime), \ + (dep)->de_MDate = getushort((dp)->deMDate), \ + (dep)->de_StartCluster = getushort((dp)->deStartCluster), \ + (dep)->de_FileSize = getulong((dp)->deFileSize), \ + (FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0)) + +#define DE_EXTERNALIZE(dp, dep) \ + (memcpy((dp)->deName, (dep)->de_Name, 11), \ + (dp)->deAttributes = (dep)->de_Attributes, \ + (dp)->deLowerCase = (dep)->de_LowerCase, \ + (dp)->deCHundredth = (dep)->de_CHun, \ + putushort((dp)->deCTime, (dep)->de_CTime), \ + putushort((dp)->deCDate, (dep)->de_CDate), \ + putushort((dp)->deADate, (dep)->de_ADate), \ + putushort((dp)->deMTime, (dep)->de_MTime), \ + putushort((dp)->deMDate, (dep)->de_MDate), \ + putushort((dp)->deStartCluster, (dep)->de_StartCluster), \ + putulong((dp)->deFileSize, \ + ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \ + putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)) + +#define VTODE(vp) ((struct denode *)(vp)->v_data) +#define DETOV(de) ((de)->de_vnode) + +struct buf; +struct msdosfsmount; +struct direntry; +struct componentname; +struct denode; + +/* + * Internal service routine prototypes. + */ +int deget(struct msdosfsmount *, u_long, u_long, struct denode **); +int uniqdosname(struct denode *, struct componentname *, u_char *); + +int readep(struct msdosfsmount *pmp, u_long dirclu, u_long dirofs, struct buf **bpp, struct direntry **epp); +int readde(struct denode *dep, struct buf **bpp, struct direntry **epp); +int deextend(struct denode *dep, u_long length); +int fillinusemap(struct msdosfsmount *pmp); +int createde(struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp); +int removede(struct denode *pdep, struct denode *dep); +int detrunc(struct denode *dep, u_long length, int flags); +#endif /* !_FS_MSDOSFS_DENODE_H_ */ Copied: stable/12/usr.sbin/makefs/msdos/direntry.h (from r351273, head/usr.sbin/makefs/msdos/direntry.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/makefs/msdos/direntry.h Mon Sep 9 17:32:40 2019 (r352079, copy of r351273, head/usr.sbin/makefs/msdos/direntry.h) @@ -0,0 +1,146 @@ +/* $FreeBSD$ */ +/* $NetBSD: direntry.h,v 1.14 1997/11/17 15:36:32 ws Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1995, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ +/*- + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ +#ifndef _FS_MSDOSFS_DIRENTRY_H_ +#define _FS_MSDOSFS_DIRENTRY_H_ + +/* + * Structure of a dos directory entry. + */ +struct direntry { + uint8_t deName[11]; /* filename, blank filled */ +#define SLOT_EMPTY 0x00 /* slot has never been used */ +#define SLOT_E5 0x05 /* the real value is 0xe5 */ +#define SLOT_DELETED 0xe5 /* file in this slot deleted */ + uint8_t deAttributes; /* file attributes */ +#define ATTR_NORMAL 0x00 /* normal file */ +#define ATTR_READONLY 0x01 /* file is readonly */ +#define ATTR_HIDDEN 0x02 /* file is hidden */ +#define ATTR_SYSTEM 0x04 /* file is a system file */ +#define ATTR_VOLUME 0x08 /* entry is a volume label */ +#define ATTR_DIRECTORY 0x10 /* entry is a directory name */ +#define ATTR_ARCHIVE 0x20 /* file is new or modified */ + uint8_t deLowerCase; /* NT VFAT lower case flags */ +#define LCASE_BASE 0x08 /* filename base in lower case */ +#define LCASE_EXT 0x10 /* filename extension in lower case */ + uint8_t deCHundredth; /* hundredth of seconds in CTime */ + uint8_t deCTime[2]; /* create time */ + uint8_t deCDate[2]; /* create date */ + uint8_t deADate[2]; /* access date */ + uint8_t deHighClust[2]; /* high bytes of cluster number */ + uint8_t deMTime[2]; /* last update time */ + uint8_t deMDate[2]; /* last update date */ + uint8_t deStartCluster[2]; /* starting cluster of file */ + uint8_t deFileSize[4]; /* size of file in bytes */ +}; + +/* + * Structure of a Win95 long name directory entry + */ +struct winentry { + uint8_t weCnt; +#define WIN_LAST 0x40 +#define WIN_CNT 0x3f + uint8_t wePart1[10]; + uint8_t weAttributes; +#define ATTR_WIN95 0x0f + uint8_t weReserved1; + uint8_t weChksum; + uint8_t wePart2[12]; + uint16_t weReserved2; + uint8_t wePart3[4]; +}; +#define WIN_CHARS 13 /* Number of chars per winentry */ + +/* + * Maximum number of winentries for a filename. + */ +#define WIN_MAXSUBENTRIES 20 + +/* + * Maximum filename length in Win95 + * Note: Must be < sizeof(dirent.d_name) + */ +#define WIN_MAXLEN 255 + +/* + * This is the format of the contents of the deTime field in the direntry + * structure. + * We don't use bitfields because we don't know how compilers for + * arbitrary machines will lay them out. + */ +#define DT_2SECONDS_MASK 0x1F /* seconds divided by 2 */ +#define DT_2SECONDS_SHIFT 0 +#define DT_MINUTES_MASK 0x7E0 /* minutes */ +#define DT_MINUTES_SHIFT 5 +#define DT_HOURS_MASK 0xF800 /* hours */ +#define DT_HOURS_SHIFT 11 + +/* + * This is the format of the contents of the deDate field in the direntry + * structure. + */ +#define DD_DAY_MASK 0x1F /* day of month */ +#define DD_DAY_SHIFT 0 +#define DD_MONTH_MASK 0x1E0 /* month */ +#define DD_MONTH_SHIFT 5 +#define DD_YEAR_MASK 0xFE00 /* year - 1980 */ +#define DD_YEAR_SHIFT 9 + +uint8_t winChksum(uint8_t *name); +int winSlotCnt(const u_char *un, size_t unlen); +int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen); +int winChkName(const u_char *un, size_t unlen, struct winentry *wep, + int chksum); +int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt, + int chksum); + +#endif /* !_FS_MSDOSFS_DIRENTRY_H_ */ Copied: stable/12/usr.sbin/makefs/msdos/fat.h (from r351273, head/usr.sbin/makefs/msdos/fat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/makefs/msdos/fat.h Mon Sep 9 17:32:40 2019 (r352079, copy of r351273, head/usr.sbin/makefs/msdos/fat.h) @@ -0,0 +1,110 @@ +/* $FreeBSD$ */ +/* $NetBSD: fat.h,v 1.12 1997/11/17 15:36:36 ws Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (C) 1994, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ +/*- + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ + +#ifndef _FS_MSDOSFS_FAT_H_ +#define _FS_MSDOSFS_FAT_H_ +/* + * Some useful cluster numbers. + */ +#define MSDOSFSROOT 0 /* cluster 0 means the root dir */ +#define CLUST_FREE 0 /* cluster 0 also means a free cluster */ +#define MSDOSFSFREE CLUST_FREE +#define CLUST_FIRST 2 /* first legal cluster number */ +#define CLUST_RSRVD 0xfffffff6 /* reserved cluster range */ +#define CLUST_BAD 0xfffffff7 /* a cluster with a defect */ +#define CLUST_EOFS 0xfffffff8 /* start of eof cluster range */ +#define CLUST_EOFE 0xffffffff /* end of eof cluster range */ + +#define FAT12_MASK 0x00000fff /* mask for 12 bit cluster numbers */ +#define FAT16_MASK 0x0000ffff /* mask for 16 bit cluster numbers */ +#define FAT32_MASK 0x0fffffff /* mask for FAT32 cluster numbers */ + +/* + * MSDOSFS: + * Return true if filesystem uses 12 bit FATs. Microsoft Programmer's + * Reference says if the maximum cluster number in a filesystem is greater + * than 4084 ((CLUST_RSRVD - CLUST_FIRST) & FAT12_MASK) then we've got a + * 16 bit FAT filesystem. While mounting, the result of this test is stored + * in pm_fatentrysize. + */ +#define FAT12(pmp) (pmp->pm_fatmask == FAT12_MASK) +#define FAT16(pmp) (pmp->pm_fatmask == FAT16_MASK) +#define FAT32(pmp) (pmp->pm_fatmask == FAT32_MASK) + +#define MSDOSFSEOF(pmp, cn) ((((cn) | ~(pmp)->pm_fatmask) & CLUST_EOFS) == CLUST_EOFS) + +/* + * These are the values for the function argument to the function + * fatentry(). + */ +#define FAT_GET 0x0001 /* get a FAT entry */ +#define FAT_SET 0x0002 /* set a FAT entry */ +#define FAT_GET_AND_SET (FAT_GET | FAT_SET) + +/* + * Flags to extendfile: + */ +#define DE_CLEAR 1 /* Zero out the blocks allocated */ + +struct buf; +struct denode; +struct msdosfsmount; + +int pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int* sp); +int clusterfree(struct msdosfsmount *pmp, u_long cn, u_long *oldcnp); +int clusteralloc(struct msdosfsmount *pmp, u_long start, u_long count, u_long fillwith, u_long *retcluster, u_long *got); +int fatentry(int function, struct msdosfsmount *pmp, u_long cluster, u_long *oldcontents, u_long newcontents); +int freeclusterchain(struct msdosfsmount *pmp, u_long startchain); +int extendfile(struct denode *dep, u_long count, struct buf **bpp, u_long *ncp, int flags); +void fc_purge(struct denode *dep, u_int frcn); + +#endif /* !_FS_MSDOSFS_FAT_H_ */ Copied: stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c (from r351273, head/usr.sbin/makefs/msdos/msdosfs_conv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c Mon Sep 9 17:32:40 2019 (r352079, copy of r351273, head/usr.sbin/makefs/msdos/msdosfs_conv.c) @@ -0,0 +1,508 @@ +/*- + * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1995, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ +/* + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include + +#include + +#include "makefs.h" +#include "msdos.h" + +#include "msdos/denode.h" +#include "msdos/direntry.h" +#include "msdos/fat.h" +#include "msdos/msdosfsmount.h" + +static int char8ucs2str(const uint8_t *in, int n, uint16_t *out, int m); +static void ucs2pad(uint16_t *buf, int len, int size); +static int char8match(uint16_t *w1, uint16_t *w2, int n); + +static const u_char unix2dos[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, /* 00-07 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 08-0f */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 10-17 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 18-1f */ + 0, '!', 0, '#', '$', '%', '&', '\'', /* 20-27 */ + '(', ')', 0, '+', 0, '-', 0, 0, /* 28-2f */ + '0', '1', '2', '3', '4', '5', '6', '7', /* 30-37 */ + '8', '9', 0, 0, 0, 0, 0, 0, /* 38-3f */ + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', /* 40-47 */ + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', /* 48-4f */ + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', /* 50-57 */ + 'X', 'Y', 'Z', 0, 0, 0, '^', '_', /* 58-5f */ + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', /* 60-67 */ + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', /* 68-6f */ + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', /* 70-77 */ + 'X', 'Y', 'Z', '{', 0, '}', '~', 0, /* 78-7f */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 80-87 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 88-8f */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 90-97 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 98-9f */ + 0, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* a0-a7 */ + 0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* a8-af */ + 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* b0-b7 */ + 0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* b8-bf */ + 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* c0-c7 */ + 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* c8-cf */ + 0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, /* d0-d7 */ + 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, /* d8-df */ + 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* e0-e7 */ + 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* e8-ef */ + 0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0xf6, /* f0-f7 */ + 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0x98, /* f8-ff */ +}; + +static const u_char u2l[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 00-07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 08-0f */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Sep 9 17:33:32 2019 Return-Path: Delivered-To: svn-src-all@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 6132DD94AB; Mon, 9 Sep 2019 17:33:32 +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 46RwHc1tpdz4HF6; Mon, 9 Sep 2019 17:33:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2425F191EA; Mon, 9 Sep 2019 17:33:32 +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 x89HXWvt083411; Mon, 9 Sep 2019 17:33:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HXW7F083410; Mon, 9 Sep 2019 17:33:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091733.x89HXW7F083410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:33: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: r352080 - stable/12/usr.sbin/makefs/msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 352080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:33:32 -0000 Author: emaste Date: Mon Sep 9 17:33:31 2019 New Revision: 352080 URL: https://svnweb.freebsd.org/changeset/base/352080 Log: MFC r351347: makefs: Verify that the BPB media descriptor and FAT ID match From r322982 in sys/fs/msdosfs. Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c Mon Sep 9 17:32:40 2019 (r352079) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c Mon Sep 9 17:33:31 2019 (r352080) @@ -888,19 +888,17 @@ fillinusemap(struct msdosfsmount *pmp) * zero. These represent free clusters. */ pmp->pm_freeclustercount = 0; - for (cn = CLUST_FIRST; cn <= pmp->pm_maxcluster; cn++) { + for (cn = 0; cn <= pmp->pm_maxcluster; cn++) { byteoffset = FATOFS(pmp, cn); bo = byteoffset % pmp->pm_fatblocksize; - if (bo == 0 || bp == NULL) { + if (bo == 0) { /* Read new FAT block */ if (bp != NULL) brelse(bp); fatblock(pmp, byteoffset, &bn, &bsize, NULL); error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); - if (error != 0) { - brelse(bp); + if (error != 0) return (error); - } } if (FAT32(pmp)) readcn = getulong(bp->b_data + bo); @@ -910,7 +908,19 @@ fillinusemap(struct msdosfsmount *pmp) readcn >>= 4; readcn &= pmp->pm_fatmask; - if (readcn == CLUST_FREE) + /* + * Check if the FAT ID matches the BPB's media descriptor and + * all other bits are set to 1. + */ + if (cn == 0 && readcn != ((pmp->pm_fatmask & 0xffffff00) | + pmp->pm_bpb.bpbMedia)) { +#ifdef MSDOSFS_DEBUG + printf("mountmsdosfs(): Media descriptor in BPB" + "does not match FAT ID\n"); +#endif + brelse(bp); + return (EINVAL); + } else if (readcn == CLUST_FREE) usemap_free(pmp, cn); } if (bp != NULL) From owner-svn-src-all@freebsd.org Mon Sep 9 17:34:21 2019 Return-Path: Delivered-To: svn-src-all@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 07451D9533; Mon, 9 Sep 2019 17:34:21 +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 46RwJX6QH4z4HMY; Mon, 9 Sep 2019 17:34:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C058F191EB; Mon, 9 Sep 2019 17:34:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89HYKn7083508; Mon, 9 Sep 2019 17:34:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HYJl0083500; Mon, 9 Sep 2019 17:34:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091734.x89HYJl0083500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:34: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: r352081 - stable/12/usr.sbin/makefs/msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 352081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:34:21 -0000 Author: emaste Date: Mon Sep 9 17:34:18 2019 New Revision: 352081 URL: https://svnweb.freebsd.org/changeset/base/352081 Log: MFC r351396: makefs: diff reduction to sys/fs/msdosfs No functional change. Modified: stable/12/usr.sbin/makefs/msdos/direntry.h stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c stable/12/usr.sbin/makefs/msdos/msdosfs_denode.c stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c stable/12/usr.sbin/makefs/msdos/msdosfs_lookup.c stable/12/usr.sbin/makefs/msdos/msdosfs_vfsops.c stable/12/usr.sbin/makefs/msdos/msdosfs_vnops.c stable/12/usr.sbin/makefs/msdos/msdosfsmount.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/msdos/direntry.h ============================================================================== --- stable/12/usr.sbin/makefs/msdos/direntry.h Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/direntry.h Mon Sep 9 17:34:18 2019 (r352081) @@ -135,12 +135,12 @@ struct winentry { #define DD_YEAR_MASK 0xFE00 /* year - 1980 */ #define DD_YEAR_SHIFT 9 -uint8_t winChksum(uint8_t *name); -int winSlotCnt(const u_char *un, size_t unlen); -int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen); -int winChkName(const u_char *un, size_t unlen, struct winentry *wep, - int chksum); -int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt, - int chksum); +int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen); +int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt, + int chksum); +int winChkName(const u_char *un, size_t unlen, struct winentry *wep, + int chksum); +uint8_t winChksum(uint8_t *name); +int winSlotCnt(const u_char *un, size_t unlen); #endif /* !_FS_MSDOSFS_DIRENTRY_H_ */ Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_conv.c Mon Sep 9 17:34:18 2019 (r352081) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -29,7 +31,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_denode.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_denode.c Mon Sep 9 17:34:18 2019 (r352081) @@ -1,6 +1,8 @@ /* $NetBSD: msdosfs_denode.c,v 1.7 2015/03/29 05:52:59 agc Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -31,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote @@ -261,7 +263,7 @@ detrunc(struct denode *dep, u_long length, int flags) if (error) { MSDOSFS_DPRINTF(("detrunc(): pcbmap fails %d\n", error)); - return error; + return (error); } } @@ -282,10 +284,9 @@ detrunc(struct denode *dep, u_long length, int flags) MSDOSFS_DPRINTF(("detrunc(): bread fails %d\n", error)); - return error; + return (error); } - memset((char *)bp->b_data + boff, 0, - pmp->pm_bpcluster - boff); + memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); if (flags & IO_SYNC) bwrite(bp); else @@ -326,7 +327,7 @@ detrunc(struct denode *dep, u_long length, int flags) if (chaintofree != 0 && !MSDOSFSEOF(pmp, chaintofree)) freeclusterchain(pmp, chaintofree); - return allerror; + return (allerror); } /* @@ -343,16 +344,16 @@ deextend(struct denode *dep, u_long length) * The root of a DOS filesystem cannot be extended. */ if (dep->de_vnode != NULL && !FAT32(pmp)) - return EINVAL; + return (EINVAL); /* * Directories cannot be extended. */ if (dep->de_Attributes & ATTR_DIRECTORY) - return EISDIR; + return (EISDIR); if (length <= dep->de_FileSize) - return E2BIG; + return (E2BIG); /* * Compute the number of clusters to allocate. Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_fat.c Mon Sep 9 17:34:18 2019 (r352081) @@ -871,9 +871,11 @@ freeclusterchain(struct msdosfsmount *pmp, u_long clus int fillinusemap(struct msdosfsmount *pmp) { - struct buf *bp = NULL; + struct buf *bp; u_long bn, bo, bsize, byteoffset, cn, readcn; int error; + + bp = NULL; /* * Mark all clusters in use, we mark the free ones in the FAT scan Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_lookup.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_lookup.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_lookup.c Mon Sep 9 17:34:18 2019 (r352081) @@ -278,7 +278,7 @@ uniqdosname(struct denode *dep, struct componentname * return error; } for (dentp = (struct direntry *)bp->b_data; - (char *)dentp < (char *)bp->b_data + blsize; + (char *)dentp < bp->b_data + blsize; dentp++) { if (dentp->deName[0] == SLOT_EMPTY) { /* Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_vfsops.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_vfsops.c Mon Sep 9 17:34:18 2019 (r352081) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -29,7 +31,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote Modified: stable/12/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Sep 9 17:34:18 2019 (r352081) @@ -1,6 +1,8 @@ /* $NetBSD: msdosfs_vnops.c,v 1.19 2017/04/13 17:10:12 christos Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -31,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote @@ -219,7 +221,7 @@ msdosfs_findslot(struct denode *dp, struct componentna for (blkoff = 0; blkoff < blsize; blkoff += sizeof(struct direntry), diroff += sizeof(struct direntry)) { - dep = (struct direntry *)((char *)bp->b_data + blkoff); + dep = (struct direntry *)(bp->b_data + blkoff); /* * If the slot is empty and we are still looking * for an empty then remember this one. If the @@ -495,7 +497,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fs goto out; } cpsize = MIN((nsize - offs), blsize - on); - memcpy((char *)bp->b_data + on, dat + offs, cpsize); + memcpy(bp->b_data + on, dat + offs, cpsize); bwrite(bp); offs += cpsize; } Modified: stable/12/usr.sbin/makefs/msdos/msdosfsmount.h ============================================================================== --- stable/12/usr.sbin/makefs/msdos/msdosfsmount.h Mon Sep 9 17:33:31 2019 (r352080) +++ stable/12/usr.sbin/makefs/msdos/msdosfsmount.h Mon Sep 9 17:34:18 2019 (r352081) @@ -51,7 +51,7 @@ */ #ifndef _MSDOSFS_MSDOSFSMOUNT_H_ -#define _MSDOSFS_MSDOSFSMOUNT_H_ +#define _MSDOSFS_MSDOSFSMOUNT_H_ #include From owner-svn-src-all@freebsd.org Mon Sep 9 17:36:30 2019 Return-Path: Delivered-To: svn-src-all@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 0BF62D9622; Mon, 9 Sep 2019 17:36: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 46RwM2076Fz4HW9; Mon, 9 Sep 2019 17:36: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 BEBB3191EC; Mon, 9 Sep 2019 17:36:29 +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 x89HaTBs083666; Mon, 9 Sep 2019 17:36:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HaTrf083664; Mon, 9 Sep 2019 17:36:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909091736.x89HaTrf083664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Sep 2019 17:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352082 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:36:30 -0000 Author: mav Date: Mon Sep 9 17:36:29 2019 New Revision: 352082 URL: https://svnweb.freebsd.org/changeset/base/352082 Log: Fix number of problems found while testing on SAT devices. - Remove incomplete and dangerous ata_res decoding from ata_do_cmd(). Instead switch all functions that need the result to use get_ata_status(), doing the same, but more careful, also reducing code duplication. - Made get_ata_status() to also decode fixed format sense. In many cases it is still not enough to make it useful, since it can only report results of 28-bit command, but it is slightly better then nothing. - Organize error reporting in ata_do_cmd(), so that if caller specified AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones). - Make HPA/AMA errors not fatal for `identify` subcommand. - Fix reprobe() not being called on HPA/AMA when in quiet mode. - Remove not very useful messages from `format` and `sanitize` commands with -y flag. Once they started, they often can't be stopped any way. MFC after: 5 days Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Sep 9 17:34:18 2019 (r352081) +++ head/sbin/camcontrol/camcontrol.c Mon Sep 9 17:36:29 2019 (r352082) @@ -1751,7 +1751,7 @@ atacapprint(struct ata_params *parm) } static int -scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb, int quiet) +scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb) { struct ata_pass_16 *ata_pass_16; struct ata_cmd ata_cmd; @@ -1774,24 +1774,21 @@ scsi_cam_pass_16_send(struct cam_device *device, union ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s via pass_16", - ata_op_string(&ata_cmd)); - } + warn("error sending ATA %s via pass_16", ata_op_string(&ata_cmd)); return (1); } + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ if (!(ata_pass_16->flags & AP_FLAG_CHK_COND) && (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s via pass_16 failed", - ata_op_string(&ata_cmd)); - } + warnx("ATA %s via pass_16 failed", ata_op_string(&ata_cmd)); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1800,7 +1797,7 @@ scsi_cam_pass_16_send(struct cam_device *device, union static int -ata_cam_send(struct cam_device *device, union ccb *ccb, int quiet) +ata_cam_send(struct cam_device *device, union ccb *ccb) { if (arglist & CAM_ARG_VERBOSE) { warnx("sending ATA %s with timeout of %u msecs", @@ -1815,24 +1812,21 @@ ata_cam_send(struct cam_device *device, union ccb *ccb ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s", - ata_op_string(&(ccb->ataio.cmd))); - } + warn("error sending ATA %s", ata_op_string(&(ccb->ataio.cmd))); return (1); } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s failed: %d", - ata_op_string(&(ccb->ataio.cmd)), quiet); - } - + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ + if (!(ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) && + (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + warnx("ATA %s failed", ata_op_string(&(ccb->ataio.cmd))); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1844,7 +1838,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, u_int8_t tag_action, u_int8_t command, u_int16_t features, u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, - u_int16_t dxfer_len, int timeout, int quiet) + u_int16_t dxfer_len, int timeout) { if (data_ptr != NULL) { if (flags & CAM_DIR_OUT) @@ -1874,7 +1868,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c /*sense_len*/SSD_FULL_SIZE, timeout); - return scsi_cam_pass_16_send(device, ccb, quiet); + return scsi_cam_pass_16_send(device, ccb); } static int @@ -1910,50 +1904,10 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, return (1); if (retval == 1) { - int error; - - /* Try using SCSI Passthrough */ - error = ata_do_pass_16(device, ccb, retries, flags, protocol, + return (ata_do_pass_16(device, ccb, retries, flags, protocol, ata_flags, tag_action, command, features, lba, sector_count, data_ptr, dxfer_len, - timeout, 0); - - if (ata_flags & AP_FLAG_CHK_COND) { - /* Decode ata_res from sense data */ - struct ata_res_pass16 *res_pass16; - struct ata_res *res; - u_int i; - u_int16_t *ptr; - - /* sense_data is 4 byte aligned */ - ptr = (uint16_t*)(uintptr_t)&ccb->csio.sense_data; - for (i = 0; i < sizeof(*res_pass16) / 2; i++) - ptr[i] = le16toh(ptr[i]); - - /* sense_data is 4 byte aligned */ - res_pass16 = (struct ata_res_pass16 *)(uintptr_t) - &ccb->csio.sense_data; - res = &ccb->ataio.res; - res->flags = res_pass16->flags; - res->status = res_pass16->status; - res->error = res_pass16->error; - res->lba_low = res_pass16->lba_low; - res->lba_mid = res_pass16->lba_mid; - res->lba_high = res_pass16->lba_high; - res->device = res_pass16->device; - res->lba_low_exp = res_pass16->lba_low_exp; - res->lba_mid_exp = res_pass16->lba_mid_exp; - res->lba_high_exp = res_pass16->lba_high_exp; - res->sector_count = res_pass16->sector_count; - res->sector_count_exp = res_pass16->sector_count_exp; - ccb->ccb_h.status &= ~CAM_STATUS_MASK; - if (res->status & ATA_STATUS_ERROR) - ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; - else - ccb->ccb_h.status |= CAM_REQ_CMP; - } - - return (error); + timeout)); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); @@ -1974,7 +1928,7 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, if (ata_flags & AP_FLAG_CHK_COND) ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; - return ata_cam_send(device, ccb, 0); + return ata_cam_send(device, ccb); } static void @@ -1994,23 +1948,31 @@ dump_data(uint16_t *ptr, uint32_t len) } static int -atahpa_proc_resp(struct cam_device *device, union ccb *ccb, - int is48bit, u_int64_t *hpasize) +atahpa_proc_resp(struct cam_device *device, union ccb *ccb, u_int64_t *hpasize) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); } + warnx("Can't get ATA command status"); + return (retval); + } - if (res->error & ATA_ERROR_ID_NOT_FOUND) { + if (status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + + if (error & ATA_ERROR_ID_NOT_FOUND) { warnx("Max address has already been set since " "last power-on or hardware reset"); } @@ -2018,28 +1980,10 @@ atahpa_proc_resp(struct cam_device *device, union ccb return (1); } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native max data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); - - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - if (hpasize != NULL) { - if (is48bit) { - *hpasize = (((u_int64_t)((res->lba_high_exp << 16) | - (res->lba_mid_exp << 8) | res->lba_low_exp) << 24) | - ((res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low)) + 1; - } else { - *hpasize = (((res->device & 0x0f) << 24) | - (res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low) + 1; - } + if (retval == 2 || retval == 6) + return (1); + *hpasize = lba; } return (0); @@ -2083,7 +2027,7 @@ ata_read_native_max(struct cam_device *device, int ret if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, hpasize); + return atahpa_proc_resp(device, ccb, hpasize); } static int @@ -2127,7 +2071,7 @@ atahpa_set_max(struct cam_device *device, int retry_co if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int @@ -2135,20 +2079,19 @@ atahpa_password(struct cam_device *device, int retry_c u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_SET_PWD, @@ -2157,31 +2100,25 @@ atahpa_password(struct cam_device *device, int retry_c /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_LOCK, @@ -2190,12 +2127,7 @@ atahpa_lock(struct cam_device *device, int retry_count /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2203,20 +2135,19 @@ atahpa_unlock(struct cam_device *device, int retry_cou u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_UNLOCK, @@ -2225,31 +2156,25 @@ atahpa_unlock(struct cam_device *device, int retry_cou /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_freeze_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_FREEZE, @@ -2258,12 +2183,7 @@ atahpa_freeze_lock(struct cam_device *device, int retr /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2292,7 +2212,7 @@ ata_get_native_max(struct cam_device *device, int retr if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); + return atahpa_proc_resp(device, ccb, nativesize); } static int @@ -2324,21 +2244,20 @@ ataama_set(struct cam_device *device, int retry_count, if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int ataama_freeze(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb) { - int error; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_AMAX_ADDR, /*features*/ATA_AMAX_ADDR_FREEZE, @@ -2347,12 +2266,7 @@ ataama_freeze(struct cam_device *device, int retry_cou /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 30 * 1000, - /*force48bit*/1); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + /*force48bit*/1)); } int @@ -2448,7 +2362,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize, nativesize; + u_int64_t hpasize = 0, nativesize = 0; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2467,22 +2381,12 @@ ataidentify(struct cam_device *device, int retry_count } if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { - if (ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - hpasize = 0; + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); } if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { - if (ata_get_native_max(device, retry_count, timeout, ccb, - &nativesize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - nativesize = 0; + ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); } printf("%s%d: ", device->device_name, device->dev_unit_num); @@ -3003,10 +2907,11 @@ atahpa(struct cam_device *device, int retry_count, int } if (action == ATA_HPA_ACTION_PRINT) { - error = ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize); - if (error == 0) - atahpa_print(ident_buf, hpasize, 1); + hpasize = 0; + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); + atahpa_print(ident_buf, hpasize, 1); cam_freeccb(ccb); free(ident_buf); @@ -3049,12 +2954,14 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, - &ident_buf); - atahpa_print(ident_buf, hpasize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + atahpa_print(ident_buf, hpasize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -3170,10 +3077,11 @@ ataama(struct cam_device *device, int retry_count, int } if (action == ATA_AMA_ACTION_PRINT) { - error = ata_get_native_max(device, retry_count, timeout, ccb, + nativesize = 0; + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) + ata_get_native_max(device, retry_count, timeout, ccb, &nativesize); - if (error == 0) - ataama_print(ident_buf, nativesize, 1); + ataama_print(ident_buf, nativesize, 1); cam_freeccb(ccb); free(ident_buf); @@ -3194,11 +3102,14 @@ ataama(struct cam_device *device, int retry_count, int if (error == 0) { error = ataama_set(device, retry_count, timeout, ccb, maxsize); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, &ident_buf); - ataama_print(ident_buf, nativesize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -5729,16 +5640,21 @@ build_ata_cmd(union ccb *ccb, uint32_t retry_count, ui return (retval); } +/* + * Returns: 0 -- success, 1 -- error, 2 -- lba truncated, + * 4 -- count truncated, 6 -- lba and count truncated. + */ int get_ata_status(struct cam_device *dev, union ccb *ccb, uint8_t *error, uint16_t *count, uint64_t *lba, uint8_t *device, uint8_t *status) { - int retval = 0; + int retval; switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { uint8_t opcode; int error_code = 0, sense_key = 0, asc = 0, ascq = 0; + u_int sense_len; /* * In this case, we have SCSI ATA PASS-THROUGH command, 12 @@ -5750,20 +5666,17 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, opcode = ccb->csio.cdb_io.cdb_bytes[0]; if ((opcode != ATA_PASS_12) && (opcode != ATA_PASS_16)) { - retval = 1; warnx("%s: unsupported opcode %02x", __func__, opcode); - goto bailout; + return (1); } retval = scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq); /* Note: the _ccb() variant returns 0 for an error */ - if (retval == 0) { - retval = 1; - goto bailout; - } else - retval = 0; + if (retval == 0) + return (1); + sense_len = ccb->csio.sense_len - ccb->csio.sense_resid; switch (error_code) { case SSD_DESC_CURRENT_ERROR: case SSD_DESC_DEFERRED_ERROR: { @@ -5774,13 +5687,12 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, sense = (struct scsi_sense_data_desc *) &ccb->csio.sense_data; - desc_ptr = scsi_find_desc(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, SSD_DESC_ATA); + desc_ptr = scsi_find_desc(sense, sense_len, + SSD_DESC_ATA); if (desc_ptr == NULL) { cam_error_print(dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; - goto bailout; + return (1); } desc = (struct scsi_sense_ata_ret_desc *)desc_ptr; @@ -5812,22 +5724,47 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, } case SSD_CURRENT_ERROR: case SSD_DEFERRED_ERROR: { -#if 0 - struct scsi_sense_data_fixed *sense; -#endif + uint64_t val; + /* - * XXX KDM need to support fixed sense data. + * In my understanding of SAT-5 specification, saying: + * "without interpreting the contents of the STATUS", + * this should not happen if CK_COND was set, but it + * does at least for some devices, so try to revert. */ - warnx("%s: Fixed sense data not supported yet", - __func__); - retval = 1; - goto bailout; - break; /*NOTREACHED*/ + if ((sense_key == SSD_KEY_ABORTED_COMMAND) && + (asc == 0) && (ascq == 0)) { + *status = ATA_STATUS_ERROR; + *error = ATA_ERROR_ABORT; + *device = 0; + *count = 0; + *lba = 0; + return (0); + } + + if ((sense_key != SSD_KEY_RECOVERED_ERROR) || + (asc != 0x00) || (ascq != 0x1d)) + return (1); + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_INFO, &val, NULL); + *error = (val >> 24) & 0xff; + *status = (val >> 16) & 0xff; + *device = (val >> 8) & 0xff; + *count = val & 0xff; + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_COMMAND, &val, NULL); + *lba = ((val >> 16) & 0xff) | (val & 0xff00) | + ((val & 0xff) << 16); + + /* Report UPPER NONZERO bits as errors 2, 4 and 6. */ + return ((val >> 28) & 0x06); } default: - retval = 1; - goto bailout; - break; + return (1); } break; @@ -5835,11 +5772,11 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, case XPT_ATA_IO: { struct ata_res *res; - /* - * In this case, we have an ATA command, and we need to - * fill in the requested values from the result register - * set. - */ + /* Only some statuses return ATA result register set. */ + if (cam_ccb_status(ccb) != CAM_REQ_CMP && + cam_ccb_status(ccb) != CAM_ATA_STATUS_ERROR) + return (1); + res = &ccb->ataio.res; *error = res->error; *status = res->status; @@ -5848,7 +5785,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, *lba = (res->lba_high << 16) | (res->lba_mid << 8) | (res->lba_low); - if (res->flags & CAM_ATAIO_48BIT) { + if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) { *count |= (res->sector_count_exp << 8); *lba |= ((uint64_t)res->lba_low_exp << 24) | ((uint64_t)res->lba_mid_exp << 32) | @@ -5859,11 +5796,9 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, break; } default: - retval = 1; - break; + return (1); } -bailout: - return (retval); + return (0); } static void @@ -6461,7 +6396,7 @@ scsiformat(struct cam_device *device, int argc, char * if (reportonly) goto doreport; - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -6702,66 +6637,78 @@ scsiformat_bailout: } static int -sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet, + camcontrol_devtype devtype) { - struct ata_res *res; int retval; - cam_status status; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; u_int val, perc; do { - retval = ata_do_cmd(device, - ccb, - /*retries*/1, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SANITIZE, - /*features*/0x00, /* SANITIZE STATUS EXT */ - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/10000, - /*is48bit*/1); - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + retval = build_ata_cmd(ccb, + /*retries*/ 0, + /*flags*/ CAM_DIR_NONE, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*protocol*/ AP_PROTO_NON_DATA, + /*ata_flags*/ AP_FLAG_CHK_COND, + /*features*/ 0x00, /* SANITIZE STATUS EXT */ + /*sector_count*/ 0, + /*lba*/ 0, + /*command*/ ATA_SANITIZE, + /*auxiliary*/ 0, + /*data_ptr*/ NULL, + /*dxfer_len*/ 0, + /*cdb_storage*/ NULL, + /*cdb_storage_len*/ 0, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 10000, + /*is48bit*/ 1, + /*devtype*/ devtype); + if (retval != 0) { + warnx("%s: build_ata_cmd() failed, likely " + "programmer error", __func__); return (1); } - status = ccb->ccb_h.status & CAM_STATUS_MASK; - if (status == CAM_REQ_CMP) { - res = &ccb->ataio.res; - if (res->sector_count_exp & 0x40) { - if (quiet == 0) { - val = (res->lba_mid << 8) + res->lba_low; - perc = 10000 * val; - fprintf(stdout, - "Sanitizing: %u.%02u%% (%d/%d)\r", - (perc / (0x10000 * 100)), - ((perc / 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } - sleep(1); - } else if ((res->sector_count_exp & 0x80) == 0) { - warnx("Sanitize complete with an error. "); - return (1); - } else - break; + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + retval = cam_send_ccb(device, ccb); + if (retval != 0) { + warn("error sending SANITIZE STATUS EXT command"); + return (1); + } - } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + retval = get_ata_status(device, ccb, &error, &count, &lba, + &ata_device, &status); + if (retval != 0) { + warnx("Can't get SANITIZE STATUS EXT status, " + "sanitize may still run."); + return (retval); + } + if (status & ATA_STATUS_ERROR) { + warnx("SANITIZE STATUS EXT failed, " + "sanitize may still run."); return (1); } + if (count & 0x4000) { + if (quiet == 0) { + val = lba & 0xffff; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((count & 0x8000) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; } while (1); return (0); } @@ -7041,7 +6988,7 @@ sanitize(struct cam_device *device, int argc, char **a } } - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -7169,7 +7116,7 @@ sanitize(struct cam_device *device, int argc, char **a retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_SANITIZE, /*features*/feature, @@ -7226,7 +7173,7 @@ doreport: if (dt == CC_DT_SCSI) { error = sanitize_wait_scsi(device, ccb, task_attr, quiet); } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { - error = sanitize_wait_ata(device, ccb, quiet); + error = sanitize_wait_ata(device, ccb, quiet, dt); } else error = 1; if (error == 0 && quiet == 0) @@ -9199,56 +9146,63 @@ bailout: static int atapm_proc_resp(struct cam_device *device, union ccb *ccb) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); - } + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + warnx("Can't get ATA command status"); + return (retval); + } - return (1); - } + if (status & ATA_STATUS_ERROR) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native check power data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x01: + printf("Standby_y mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0x81: + printf("Idle_a mode\n"); + break; + case 0x82: + printf("Idle_b mode\n"); + break; + case 0x83: + printf("Idle_c mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", count); + break; + } - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - - printf("%s%d: ", device->device_name, device->dev_unit_num); - switch (res->sector_count) { - case 0x00: - printf("Standby mode\n"); - break; - case 0x40: - printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); - break; - case 0x41: - printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); - break; - case 0x80: - printf("Idle mode\n"); - break; - case 0xff: - printf("Active or Idle mode\n"); - break; - default: - printf("Unknown mode 0x%02x\n", res->sector_count); - break; - } - - return (0); + return (0); } static int From owner-svn-src-all@freebsd.org Mon Sep 9 17:37:53 2019 Return-Path: Delivered-To: svn-src-all@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 E8CD1D97B4; Mon, 9 Sep 2019 17:37: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 46RwNd5dhsz4HkL; Mon, 9 Sep 2019 17:37: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 A494B191EF; Mon, 9 Sep 2019 17:37: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 x89HbraB083795; Mon, 9 Sep 2019 17:37:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HbreC083793; Mon, 9 Sep 2019 17:37:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091737.x89HbreC083793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:37: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: r352083 - in stable: 11/lib/libc/mips 11/sys/mips/include 12/lib/libc/mips 12/sys/mips/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/mips 11/sys/mips/include 12/lib/libc/mips 12/sys/mips/include X-SVN-Commit-Revision: 352083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:37:54 -0000 Author: kevans Date: Mon Sep 9 17:37:52 2019 New Revision: 352083 URL: https://svnweb.freebsd.org/changeset/base/352083 Log: MFC r351681: mips: fix some mcount nits The symbol version for _mcount was removed 12 years ago in r169525 from gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked in this, so _mcount has no symver. Add it back to where it should have been, rather than where it would go if it were added today, since we're correcting a historical mistake. Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90 world as it's not getting explicitly thrown into .text, so do this now. This fixes the libc build that was previously failing due to relocations in .mdebug.abi32. This is specifically due to the way clang's integrated AS works and that they emit the .mdebug.abiNN section early in the process. An LLVM bug has been submitted (and since committed) and an agreement has been made that the mips backend should switch to .text following .mdebug.abiNN for compatibility. Modified: stable/12/lib/libc/mips/Symbol.map stable/12/sys/mips/include/profile.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/mips/Symbol.map stable/11/sys/mips/include/profile.h Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/mips/Symbol.map ============================================================================== --- stable/12/lib/libc/mips/Symbol.map Mon Sep 9 17:36:29 2019 (r352082) +++ stable/12/lib/libc/mips/Symbol.map Mon Sep 9 17:37:52 2019 (r352083) @@ -11,6 +11,7 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; + _mcount; _setjmp; _longjmp; alloca; Modified: stable/12/sys/mips/include/profile.h ============================================================================== --- stable/12/sys/mips/include/profile.h Mon Sep 9 17:36:29 2019 (r352082) +++ stable/12/sys/mips/include/profile.h Mon Sep 9 17:37:52 2019 (r352083) @@ -46,7 +46,8 @@ /*XXX This is not MIPS64 safe. */ #define MCOUNT \ - __asm(".globl _mcount;" \ + __asm(".text;" \ + ".globl _mcount;" \ ".type _mcount,@function;" \ "_mcount:;" \ ".set noreorder;" \ From owner-svn-src-all@freebsd.org Mon Sep 9 17:37:53 2019 Return-Path: Delivered-To: svn-src-all@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 5570DD97B0; Mon, 9 Sep 2019 17:37: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 46RwNd1Vl3z4HkK; Mon, 9 Sep 2019 17:37: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 17E31191EE; Mon, 9 Sep 2019 17:37: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 x89Hbq6s083788; Mon, 9 Sep 2019 17:37:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89Hbqq5083786; Mon, 9 Sep 2019 17:37:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091737.x89Hbqq5083786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352083 - in stable: 11/lib/libc/mips 11/sys/mips/include 12/lib/libc/mips 12/sys/mips/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/mips 11/sys/mips/include 12/lib/libc/mips 12/sys/mips/include X-SVN-Commit-Revision: 352083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:37:53 -0000 Author: kevans Date: Mon Sep 9 17:37:52 2019 New Revision: 352083 URL: https://svnweb.freebsd.org/changeset/base/352083 Log: MFC r351681: mips: fix some mcount nits The symbol version for _mcount was removed 12 years ago in r169525 from gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked in this, so _mcount has no symver. Add it back to where it should have been, rather than where it would go if it were added today, since we're correcting a historical mistake. Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90 world as it's not getting explicitly thrown into .text, so do this now. This fixes the libc build that was previously failing due to relocations in .mdebug.abi32. This is specifically due to the way clang's integrated AS works and that they emit the .mdebug.abiNN section early in the process. An LLVM bug has been submitted (and since committed) and an agreement has been made that the mips backend should switch to .text following .mdebug.abiNN for compatibility. Modified: stable/11/lib/libc/mips/Symbol.map stable/11/sys/mips/include/profile.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/mips/Symbol.map stable/12/sys/mips/include/profile.h Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/mips/Symbol.map ============================================================================== --- stable/11/lib/libc/mips/Symbol.map Mon Sep 9 17:36:29 2019 (r352082) +++ stable/11/lib/libc/mips/Symbol.map Mon Sep 9 17:37:52 2019 (r352083) @@ -11,6 +11,7 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; + _mcount; _setjmp; _longjmp; alloca; Modified: stable/11/sys/mips/include/profile.h ============================================================================== --- stable/11/sys/mips/include/profile.h Mon Sep 9 17:36:29 2019 (r352082) +++ stable/11/sys/mips/include/profile.h Mon Sep 9 17:37:52 2019 (r352083) @@ -44,7 +44,8 @@ /*XXX This is not MIPS64 safe. */ #define MCOUNT \ - __asm(".globl _mcount;" \ + __asm(".text;" \ + ".globl _mcount;" \ ".type _mcount,@function;" \ "_mcount:;" \ ".set noreorder;" \ From owner-svn-src-all@freebsd.org Mon Sep 9 17:43:45 2019 Return-Path: Delivered-To: svn-src-all@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 7688DD9B87; Mon, 9 Sep 2019 17:43:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RwWP2KgKz4JJc; Mon, 9 Sep 2019 17:43:45 +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 33292193BB; Mon, 9 Sep 2019 17:43:45 +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 x89HhjTF089338; Mon, 9 Sep 2019 17:43:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89Hhixv089335; Mon, 9 Sep 2019 17:43:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091743.x89Hhixv089335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:43:44 +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: r352084 - in stable/12: lib/geom/part sys/geom/part X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: lib/geom/part sys/geom/part X-SVN-Commit-Revision: 352084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:43:45 -0000 Author: kevans Date: Mon Sep 9 17:43:44 2019 New Revision: 352084 URL: https://svnweb.freebsd.org/changeset/base/352084 Log: MFC r351797: (Optional) Allow more nesting of GEOM partitioning schemes GEOM is supposed to be topology-agnostic, but the GPT and BSD partition code has arbitrary restrictions on nesting that are annoying in cases such as running VMs on raw partitions (since the VM's partitioning scheme is not visible to the host). This patch adds sysctls to disable the restrictions except in the case of BSD label (and similar) partitions with offset 0 (where we need to avoid recursively recognizing the label). Modified: stable/12/lib/geom/part/gpart.8 stable/12/sys/geom/part/g_part.c stable/12/sys/geom/part/g_part_gpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/geom/part/gpart.8 ============================================================================== --- stable/12/lib/geom/part/gpart.8 Mon Sep 9 17:37:52 2019 (r352083) +++ stable/12/lib/geom/part/gpart.8 Mon Sep 9 17:43:44 2019 (r352084) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2018 +.Dd September 3, 2019 .Dt GPART 8 .Os .Sh NAME @@ -1198,7 +1198,13 @@ variables can be used to control the behavior of the GEOM class. The default value is shown next to each variable. .Bl -tag -width indent -.It Va kern.geom.part.auto_resize: No 1 +.It Va kern.geom.part.allow_nesting : No 0 +By default, some schemes (currently BSD, BSD64 and VTOC8) do not permit +further nested partitioning. +This variable overrides this restriction and allows arbitrary nesting (except +within partitions created at offset 0). +Some schemes have their own separate checks, for which see below. +.It Va kern.geom.part.auto_resize : No 1 This variable controls automatic resize behavior of .Nm GEOM class. @@ -1219,6 +1225,9 @@ disk metadata. If some inconsistency is detected, the partition table will be rejected with a diagnostic message: .Sy "GEOM_PART: Integrity check failed (provider, scheme)" . +.It Va kern.geom.part.gpt.allow_nesting : No 0 +By default the GPT scheme is allowed only at the outermost nesting level. +This variable allows this restriction to be removed. .It Va kern.geom.part.ldm.debug : No 0 Debug level of the Logical Disk Manager (LDM) module. This can be set to a number between 0 and 2 inclusive. Modified: stable/12/sys/geom/part/g_part.c ============================================================================== --- stable/12/sys/geom/part/g_part.c Mon Sep 9 17:37:52 2019 (r352083) +++ stable/12/sys/geom/part/g_part.c Mon Sep 9 17:43:44 2019 (r352084) @@ -143,6 +143,10 @@ static u_int auto_resize = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize, CTLFLAG_RWTUN, &auto_resize, 1, "Enable auto resize"); +static u_int allow_nesting = 0; +SYSCTL_UINT(_kern_geom_part, OID_AUTO, allow_nesting, + CTLFLAG_RWTUN, &allow_nesting, 0, + "Allow additional levels of nesting"); /* * The GEOM partitioning class. @@ -2264,7 +2268,13 @@ g_part_start(struct bio *bp) return; if (g_handleattr_int(bp, "GEOM::fwsectors", table->gpt_sectors)) return; - if (g_handleattr_int(bp, "PART::isleaf", table->gpt_isleaf)) + /* + * allow_nesting overrides "isleaf" to false _unless_ the + * provider offset is zero, since otherwise we would recurse. + */ + if (g_handleattr_int(bp, "PART::isleaf", + table->gpt_isleaf && + (allow_nesting == 0 || entry->gpe_offset == 0))) return; if (g_handleattr_int(bp, "PART::depth", table->gpt_depth)) return; Modified: stable/12/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/12/sys/geom/part/g_part_gpt.c Mon Sep 9 17:37:52 2019 (r352083) +++ stable/12/sys/geom/part/g_part_gpt.c Mon Sep 9 17:43:44 2019 (r352084) @@ -53,6 +53,14 @@ __FBSDID("$FreeBSD$"); FEATURE(geom_part_gpt, "GEOM partitioning class for GPT partitions support"); +SYSCTL_DECL(_kern_geom_part); +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, gpt, CTLFLAG_RW, 0, + "GEOM_PART_GPT GUID Partition Table"); + +static u_int allow_nesting = 0; +SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, allow_nesting, + CTLFLAG_RWTUN, &allow_nesting, 0, "Allow GPT to be nested inside other schemes"); + CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); @@ -651,8 +659,8 @@ g_part_gpt_create(struct g_part_table *basetable, stru struct g_part_gpt_table *table; size_t tblsz; - /* We don't nest, which means that our depth should be 0. */ - if (basetable->gpt_depth != 0) + /* Our depth should be 0 unless nesting was explicitly enabled. */ + if (!allow_nesting && basetable->gpt_depth != 0) return (ENXIO); table = (struct g_part_gpt_table *)basetable; @@ -814,8 +822,8 @@ g_part_gpt_probe(struct g_part_table *table, struct g_ u_char *buf; int error, index, pri, res; - /* We don't nest, which means that our depth should be 0. */ - if (table->gpt_depth != 0) + /* Our depth should be 0 unless nesting was explicitly enabled. */ + if (!allow_nesting && table->gpt_depth != 0) return (ENXIO); pp = cp->provider; From owner-svn-src-all@freebsd.org Mon Sep 9 17:44:15 2019 Return-Path: Delivered-To: svn-src-all@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 79972D9BFB; Mon, 9 Sep 2019 17:44:15 +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 46RwWz2fwjz4JQh; Mon, 9 Sep 2019 17:44:15 +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 3EDA9193BC; Mon, 9 Sep 2019 17:44:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89HiF9o089439; Mon, 9 Sep 2019 17:44:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HiF6Z089438; Mon, 9 Sep 2019 17:44:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091744.x89HiF6Z089438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 17:44: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: r352085 - stable/12/usr.sbin/makefs X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/makefs X-SVN-Commit-Revision: 352085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:44:15 -0000 Author: emaste Date: Mon Sep 9 17:44:14 2019 New Revision: 352085 URL: https://svnweb.freebsd.org/changeset/base/352085 Log: MFC r344555 (sobomax): makefs: Improve error handling Bail out if one of the files scheduled to go to the FS image we are making cannot be read (e.g. EPERM). Previous behaviour of issuing a warning but still proceeeding and returning success was definitely not correct: masking out error condition as well as making a slighly inconsistent FS where attempt to access the file in question ends up in EBADF. (More details in review D18584.) Modified: stable/12/usr.sbin/makefs/ffs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/makefs/ffs.c ============================================================================== --- stable/12/usr.sbin/makefs/ffs.c Mon Sep 9 17:43:44 2019 (r352084) +++ stable/12/usr.sbin/makefs/ffs.c Mon Sep 9 17:44:14 2019 (r352085) @@ -932,8 +932,7 @@ ffs_write_file(union dinode *din, uint32_t ino, void * if (isfile) { fbuf = emalloc(ffs_opts->bsize); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { - warn("Can't open `%s' for reading", (char *)buf); - goto leave_ffs_write_file; + err(EXIT_FAILURE, "Can't open `%s' for reading", (char *)buf); } } else { p = buf; @@ -987,8 +986,6 @@ ffs_write_file(union dinode *din, uint32_t ino, void * write_inode_and_leave: ffs_write_inode(&in.i_din, in.i_number, fsopts); - - leave_ffs_write_file: if (fbuf) free(fbuf); if (ffd != -1) From owner-svn-src-all@freebsd.org Mon Sep 9 17:53:16 2019 Return-Path: Delivered-To: svn-src-all@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 48DE6D9EFE; Mon, 9 Sep 2019 17:53:16 +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 46RwkN11KCz4Jrs; Mon, 9 Sep 2019 17:53:16 +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 05ED619576; Mon, 9 Sep 2019 17:53:16 +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 x89HrFtl095267; Mon, 9 Sep 2019 17:53:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HrFCH095266; Mon, 9 Sep 2019 17:53:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091753.x89HrFCH095266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:53: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: r352086 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 352086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:53:16 -0000 Author: kevans Date: Mon Sep 9 17:53:15 2019 New Revision: 352086 URL: https://svnweb.freebsd.org/changeset/base/352086 Log: MFC r345845-r345846: bectl(8) manpage clarity r345845: bectl.8: Clean up & clarify the create subcommand - Improve formatting - Use consistent variable names - Improve the description of the create subcommand (1) PR: 235850 r345846: bectl.8: Bump date after r345845 Modified: stable/12/sbin/bectl/bectl.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Mon Sep 9 17:44:14 2019 (r352085) +++ stable/12/sbin/bectl/bectl.8 Mon Sep 9 17:53:15 2019 (r352086) @@ -18,12 +18,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2019 +.Dd September 9, 2019 .Dt BECTL 8 .Os .Sh NAME .Nm bectl -.Nd Utility to manage Boot Environments on ZFS +.Nd Utility to manage boot environments on ZFS .Sh SYNOPSIS .Nm .Cm activate @@ -32,16 +32,12 @@ .Nm .Cm create .Op Fl r -.Op Fl e Brq Ar nonActiveBe | beName@snapshot -.Ar beName +.Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot +.Ar newBeName .Nm -.Cm create -.Op Fl r -.Ar beName@snapshot -.Nm .Cm destroy .Op Fl \&Fo -.Brq Ar beName | beName@snapshot +.Ar beName Ns Op Cm @ Ns Ar snapshot .Nm .Cm export .Ar sourceBe @@ -50,39 +46,42 @@ .Ar targetBe .Nm .Cm jail -.Brq Fl b | Fl U -.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Ar bootenv +.Op Fl bU +.Oo Bro Fl o Ar key Ns Cm = Ns Ar value | Fl u Ar key Brc Oc Ns ... +.Ar beName .Op Ar utility Op Ar argument ... .Nm .Cm list -.Op Fl DHas +.Op Fl aDHs .Nm .Cm mount .Ar beName -.Op mountpoint +.Op Ar mountpoint .Nm .Cm rename .Ar origBeName .Ar newBeName .Nm .Brq Cm ujail | unjail -.Brq Ar jailID | jailName -.Ar bootenv +.Brq Ar jailId | jailName +.Ar beName .Nm .Brq Cm umount | unmount .Op Fl f .Ar beName +.Pp +.Nm +.Op Fl h\&? .Sh DESCRIPTION The .Nm command is used to setup and interact with ZFS boot environments, which are bootable clones of datasets. .Pp -.Em Boot Environments -allows the system to be upgraded, while preserving the old system environment in +Boot environments +allow the system to be upgraded, while preserving the old system environment in a separate ZFS dataset. -.Sh COMMANDS +.Pp The following commands are supported by .Nm : .Bl -tag -width activate @@ -100,28 +99,27 @@ flag is given, this takes effect only for the next boo .It Xo .Cm create .Op Fl r -.Op Fl e Brq Ar nonActiveBe | beName@snapshot -.Ar beName +.Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot +.Ar newBeName .Xc -Creates a new boot environment named -.Ar beName . +Create a new boot environment named +.Ar newBeName . +.Pp If the -.Fl e -argument is specified, the new environment will be cloned from the given -.Brq Ar nonActiveBe | Ar beName@snapshot . -If the .Fl r flag is given, a recursive boot environment will be made. -.It Xo -.Cm create -.Op Fl r -.Ar beName@snapshot -.Xc -Creates a snapshot of the existing boot environment named -.Ar beName . +.Pp If the -.Fl r -flag is given, a recursive boot environment will be made. +.Fl e +flag is specified, the new environment will be cloned from the given +.Ar nonActiveBe +or +.Ar beName Ns Cm @ Ns Ar snapshot . +Otherwise, the new environment will be created from the currently booted environment. +.Pp +If +.Nm +is creating from another boot environment, a snapshot of that boot environment will be created to clone from. .It Xo .Cm create .Op Fl r @@ -139,14 +137,14 @@ No new boot environment is created with this command. .It Xo .Cm destroy .Op Fl \&Fo -.Brq Ar beName | beName@snapshot +.Ar beName Ns Op Cm @ Ns Ar snapshot .Xc -Destroys the given +Destroy the given .Ar beName boot environment or -.Ar beName@snapshot +.Ar beName Ns Cm @ Ns Ar snapshot snapshot without confirmation, unlike in -.Nm beadm . +.Xr beadm 1 . Specifying .Fl F will automatically unmount without confirmation. @@ -162,22 +160,22 @@ flag may be specified to destroy the origin as well. Export .Ar sourceBe to -.Dv stdout . -.Dv stdout +.Xr stdout 4 . +.Xr stdout 4 must be piped or redirected to a file. .It Cm import Ar targetBe Import .Ar targetBe from -.Dv stdin . +.Xr stdin 4 . .It Xo .Cm jail -.Brq Fl b | Fl U -.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Ao Ar bootenv Ac +.Op Fl bU +.Oo Bro Fl o Ar key Ns Cm = Ns Ar value | Fl u Ar key Brc Oc Ns ... +.Ar beName .Op Ar utility Op Ar argument ... .Xc -Creates a jail of the given boot environment. +Create a jail of the given boot environment. Multiple .Fl o and @@ -216,7 +214,7 @@ and must be set, the default values are specified below. .Pp All -.Ar key Ns = Ns Ar value +.Ar key Ns Cm = Ns Ar value pairs are interpreted as jail parameters as described in .Xr jail 8 . The following default parameters are provided: @@ -224,17 +222,24 @@ The following default parameters are provided: .It Va allow.mount Ta Cm true .It Va allow.mount.devfs Ta Cm true .It Va enforce_statfs Ta Cm 1 -.It Va name Ta jail id +.It Va name Ta Set to jail ID. .It Va host.hostname Ta Va bootenv -.It Va path Ta Set to a path in /tmp generated by +.It Va path Ta Set to a path in Pa /tmp +generated by .Xr libbe 3 . .El .Pp All default parameters may be overwritten. -.It Cm list Op Fl DHas -Displays all boot environments. -The Active field indicates whether the boot environment is active now (N); -active on reboot (R); or both (NR). +.It Cm list Op Fl aDHs +Display all boot environments. +The +.Em Active +field indicates whether the boot environment is active now +.Pq Em \&N ; +active on reboot +.Pq Em \&R ; +or both +.Pq Em \&NR . .Pp If .Fl a @@ -257,14 +262,20 @@ Mount at the specified .Ar mountpoint if provided. .It Cm rename Ar origBeName newBeName -Renames the given +Rename the given .Ar origBeName to the given .Ar newBeName . The boot environment will not be unmounted in order for this rename to occur. -.It Cm unjail Brq Ar jailID | jailName | beName -Destroys the jail created from the given boot environment. +.It Cm ujail Bro Ar jailId | jailName Brc Ar beName +.It Cm unjail Bro Ar jailId | jailName Brc Ar beName +Destroy the jail created from the given boot environment. .It Xo +.Cm umount +.Op Fl f +.Ar beName +.Xc +.It Xo .Cm unmount .Op Fl f .Ar beName @@ -274,12 +285,20 @@ Specifying .Fl f will force the unmount if busy. .El +.Pp +.Nm +prints usage information if +.Fl h +or +.Fl \&? +is specified. .Sh EXAMPLES .Bl -bullet .It To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO +.Xr beinstall.sh 1 , .Xr libbe 3 , .Xr jail 8 , .Xr zfs 8 , @@ -287,7 +306,7 @@ To fill in with jail upgrade example when behavior is .Sh HISTORY .Nm is based on -.Nm beadm +.Xr beadm 1 and was implemented as a project for the 2017 Summer of Code, along with .Xr libbe 3 . .Sh AUTHORS @@ -295,11 +314,11 @@ and was implemented as a project for the 2017 Summer o was written by .An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in . .Pp -.Nm beadm +.Xr beadm 1 was written and is maintained by .An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl . .Pp .An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net wrote the original -.Nm beadm +.Xr beadm 1 manual page that this one is derived from. From owner-svn-src-all@freebsd.org Mon Sep 9 17:56:15 2019 Return-Path: Delivered-To: svn-src-all@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 40D99DA068; Mon, 9 Sep 2019 17:56:15 +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 46Rwnq113zz4K7Q; Mon, 9 Sep 2019 17:56:15 +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 010811957D; Mon, 9 Sep 2019 17:56:14 +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 x89HuElx095662; Mon, 9 Sep 2019 17:56:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HuEYJ095660; Mon, 9 Sep 2019 17:56:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091756.x89HuEYJ095660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:56:14 +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: r352087 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 352087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:56:15 -0000 Author: kevans Date: Mon Sep 9 17:56:14 2019 New Revision: 352087 URL: https://svnweb.freebsd.org/changeset/base/352087 Log: MFC r351813: bectl(8): implement sorting for 'bectl list' output Allow 'bectl list' to sort output by a given property name. The property name is passed in using a command-line flag, '-c' for ascending order and '-C' for descending order. The properties allowed to sort by are: - name (the default output, even if '-c' or '-C' are not used) - creation - origin - used - usedds - usedsnap - usedrefreserv The default output for 'bectl list' is now ascending alphabetical order of BE name. To sort by creation time from earliest to latest, the command would be 'bectl list -c creation' Modified: stable/12/sbin/bectl/bectl.8 stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/bectl_list.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Mon Sep 9 17:53:15 2019 (r352086) +++ stable/12/sbin/bectl/bectl.8 Mon Sep 9 17:56:14 2019 (r352087) @@ -53,6 +53,9 @@ .Nm .Cm list .Op Fl aDHs +.Op Fl c Ar property +.Op Fl C Ar property +.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc .Nm .Cm mount .Ar beName @@ -230,7 +233,12 @@ generated by .El .Pp All default parameters may be overwritten. -.It Cm list Op Fl aDHs +.It Xo +.Cm list +.Op Fl DHas +.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc +.Xc +.Pp Display all boot environments. The .Em Active @@ -241,21 +249,44 @@ active on reboot or both .Pq Em \&NR . .Pp -If -.Fl a -is used, display all datasets. -If -.Fl D -is used, display the full space usage for each boot environment, assuming all +.Bl -tag -width indent +.It Fl a +Display all datasets. +.It Fl D +Display the full space usage for each boot environment, assuming all other boot environments were destroyed. -The -.Fl H -option is used for scripting. -It does not print headers and separate fields by a single tab instead of +.It Fl H +Used for scripting. +Do not print headers and separate fields by a single tab instead of arbitrary white space. -If +.It Fl s +Display all snapshots as well. +.It Fl c Ar property +Sort boot environments by given property name. +The following properties are supported: +.Pp +.Bl -tag -width 4n -offset indent -compact +.It name (default output) +.It creation +.It origin +.It used +.It usedds +.It usedsnap +.It usedrefreserv +.El +.It Fl C Ar property +Same as the +.Fl c +option, but displays in descending order. +.El +.Pp +The +.Fl D +option is ignored when either the .Fl s -is used, display all snapshots as well. +or +.Fl a +option is used. .It Cm mount Ar beName Op Ar mountpoint Temporarily mount the boot environment. Mount at the specified Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Mon Sep 9 17:53:15 2019 (r352086) +++ stable/12/sbin/bectl/bectl.c Mon Sep 9 17:56:14 2019 (r352087) @@ -80,7 +80,7 @@ usage(bool explicit) "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " "{jailID | jailName}\n" "\t bootenv [utility [argument ...]]\n" - "\tbectl list [-DHas]\n" + "\tbectl list [-DHas] [{-c property | -C property}]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" Modified: stable/12/sbin/bectl/bectl_list.c ============================================================================== --- stable/12/sbin/bectl/bectl_list.c Mon Sep 9 17:53:15 2019 (r352086) +++ stable/12/sbin/bectl/bectl_list.c Mon Sep 9 17:56:14 2019 (r352087) @@ -38,6 +38,12 @@ __FBSDID("$FreeBSD$"); #include "bectl.h" +struct sort_column { + char *name; + char *val; + nvlist_t *nvl; +}; + struct printc { int active_colsz_def; int be_colsz; @@ -324,6 +330,74 @@ print_headers(nvlist_t *props, struct printc *pc) printf("\n"); } +/* + * Sort the given nvlist of boot environments by property. + */ +static int +prop_list_sort(nvlist_t *props, char *property, bool reverse) +{ + nvpair_t *nvp; + nvlist_t *nvl; + int i, nvp_count; + uint64_t lval, rval; + struct sort_column sc_prev, sc_next; + + /* a temporary list to work with */ + nvlist_dup(props, &nvl, 0); + + nvp_count = fnvlist_num_pairs(nvl); + for (i = 0; i < nvp_count; i++) { + + nvp = nvlist_next_nvpair(nvl, NULL); + nvpair_value_nvlist(nvp, &sc_prev.nvl); + nvlist_lookup_string(sc_prev.nvl, "name", &sc_prev.name); + nvlist_lookup_string(sc_prev.nvl, property, &sc_prev.val); + + while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) { + + nvpair_value_nvlist(nvp, &sc_next.nvl); + nvlist_lookup_string(sc_next.nvl, "name", &sc_next.name); + nvlist_lookup_string(sc_next.nvl, property, &sc_next.val); + + /* properties that use numerical comparison */ + if (strcmp(property, "creation") == 0 || + strcmp(property, "used") == 0 || + strcmp(property, "usedds") == 0 || + strcmp(property, "usedsnap") == 0 || + strcmp(property, "usedrefreserv") == 0) { + + lval = strtoull(sc_prev.val, NULL, 10); + rval = strtoull(sc_next.val, NULL, 10); + + if ((lval < rval && reverse) || + (lval > rval && !reverse)) + sc_prev = sc_next; + } + + /* properties that use string comparison */ + else if (strcmp(property, "name") == 0 || + strcmp(property, "origin") == 0) { + if ((strcmp(sc_prev.val, sc_next.val) < 0 && reverse) || + (strcmp(sc_prev.val, sc_next.val) > 0 && !reverse)) + sc_prev = sc_next; + } + } + + /* + * The 'props' nvlist has been created to only have unique names. + * When a name is added, any existing nvlist's with the same name + * will be removed. Eventually, all existing nvlist's are replaced + * in sorted order. + */ + nvlist_add_nvlist(props, sc_prev.name, sc_prev.nvl); + nvlist_remove_all(nvl, sc_prev.name); + } + + be_prop_list_free(nvl); + + return 0; +} + int bectl_cmd_list(int argc, char *argv[]) { @@ -331,12 +405,14 @@ bectl_cmd_list(int argc, char *argv[]) nvpair_t *cur; nvlist_t *dsprops, *props; int opt, printed; - boolean_t active_now, active_reboot; + char *column; + bool reverse; + column = NULL; props = NULL; printed = 0; bzero(&pc, sizeof(pc)); - while ((opt = getopt(argc, argv, "aDHs")) != -1) { + while ((opt = getopt(argc, argv, "aDHsc:C:")) != -1) { switch (opt) { case 'a': pc.show_all_datasets = true; @@ -350,6 +426,18 @@ bectl_cmd_list(int argc, char *argv[]) case 's': pc.show_snaps = true; break; + case 'c': + if (column != NULL) + free(column); + column = strdup(optarg); + reverse = false; + break; + case 'C': + if (column != NULL) + free(column); + column = strdup(optarg); + reverse = true; + break; default: fprintf(stderr, "bectl list: unknown option '-%c'\n", optopt); @@ -374,44 +462,33 @@ bectl_cmd_list(int argc, char *argv[]) return (1); } + /* List boot environments in alphabetical order by default */ + if (column == NULL) { + column = strdup("name"); + reverse = false; + } + + prop_list_sort(props, column, reverse); + /* Force -D off if either -a or -s are specified */ if (pc.show_all_datasets || pc.show_snaps) pc.show_space = false; if (!pc.script_fmt) print_headers(props, &pc); - /* Do a first pass to print active and next active first */ - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (!active_now && !active_reboot) - continue; - if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) - printf("\n"); - print_info(nvpair_name(cur), dsprops, &pc); - printed++; - } - - /* Now pull everything else */ + /* Print boot environments */ for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (active_now || active_reboot) - continue; if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) printf("\n"); + print_info(nvpair_name(cur), dsprops, &pc); printed++; } + + free(column); be_prop_list_free(props); return (0); From owner-svn-src-all@freebsd.org Mon Sep 9 17:56:38 2019 Return-Path: Delivered-To: svn-src-all@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 6EB62DA0F8; Mon, 9 Sep 2019 17:56:38 +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 46RwpG2LH2z4KFl; Mon, 9 Sep 2019 17:56:38 +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 3481419581; Mon, 9 Sep 2019 17:56:38 +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 x89HuccW095726; Mon, 9 Sep 2019 17:56:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HubEv095723; Mon, 9 Sep 2019 17:56:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091756.x89HubEv095723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 17:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352088 - stable/11/sbin/bectl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sbin/bectl X-SVN-Commit-Revision: 352088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:56:38 -0000 Author: kevans Date: Mon Sep 9 17:56:37 2019 New Revision: 352088 URL: https://svnweb.freebsd.org/changeset/base/352088 Log: MFC r351813: bectl(8): implement sorting for 'bectl list' output Allow 'bectl list' to sort output by a given property name. The property name is passed in using a command-line flag, '-c' for ascending order and '-C' for descending order. The properties allowed to sort by are: - name (the default output, even if '-c' or '-C' are not used) - creation - origin - used - usedds - usedsnap - usedrefreserv The default output for 'bectl list' is now ascending alphabetical order of BE name. To sort by creation time from earliest to latest, the command would be 'bectl list -c creation' Modified: stable/11/sbin/bectl/bectl.8 stable/11/sbin/bectl/bectl.c stable/11/sbin/bectl/bectl_list.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/bectl/bectl.8 ============================================================================== --- stable/11/sbin/bectl/bectl.8 Mon Sep 9 17:56:14 2019 (r352087) +++ stable/11/sbin/bectl/bectl.8 Mon Sep 9 17:56:37 2019 (r352088) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2019 +.Dd September 4, 2019 .Dt BECTL 8 .Os .Sh NAME @@ -57,6 +57,9 @@ .Nm .Cm list .Op Fl aDHs +.Op Fl c Ar property +.Op Fl C Ar property +.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc .Nm .Cm mount .Ar beName @@ -234,7 +237,12 @@ generated by .El .Pp All default parameters may be overwritten. -.It Cm list Op Fl aDHs +.It Xo +.Cm list +.Op Fl DHas +.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc +.Xc +.Pp Display all boot environments. The .Em Active @@ -245,21 +253,44 @@ active on reboot or both .Pq Em \&NR . .Pp -If -.Fl a -is used, display all datasets. -If -.Fl D -is used, display the full space usage for each boot environment, assuming all +.Bl -tag -width indent +.It Fl a +Display all datasets. +.It Fl D +Display the full space usage for each boot environment, assuming all other boot environments were destroyed. -The -.Fl H -option is used for scripting. -It does not print headers and separate fields by a single tab instead of +.It Fl H +Used for scripting. +Do not print headers and separate fields by a single tab instead of arbitrary white space. -If +.It Fl s +Display all snapshots as well. +.It Fl c Ar property +Sort boot environments by given property name. +The following properties are supported: +.Pp +.Bl -tag -width 4n -offset indent -compact +.It name (default output) +.It creation +.It origin +.It used +.It usedds +.It usedsnap +.It usedrefreserv +.El +.It Fl C Ar property +Same as the +.Fl c +option, but displays in descending order. +.El +.Pp +The +.Fl D +option is ignored when either the .Fl s -is used, display all snapshots as well. +or +.Fl a +option is used. .It Cm mount Ar beName Op Ar mountpoint Temporarily mount the boot environment. Mount at the specified Modified: stable/11/sbin/bectl/bectl.c ============================================================================== --- stable/11/sbin/bectl/bectl.c Mon Sep 9 17:56:14 2019 (r352087) +++ stable/11/sbin/bectl/bectl.c Mon Sep 9 17:56:37 2019 (r352088) @@ -80,7 +80,7 @@ usage(bool explicit) "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " "{jailID | jailName}\n" "\t bootenv [utility [argument ...]]\n" - "\tbectl list [-DHas]\n" + "\tbectl list [-DHas] [{-c property | -C property}]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" Modified: stable/11/sbin/bectl/bectl_list.c ============================================================================== --- stable/11/sbin/bectl/bectl_list.c Mon Sep 9 17:56:14 2019 (r352087) +++ stable/11/sbin/bectl/bectl_list.c Mon Sep 9 17:56:37 2019 (r352088) @@ -38,6 +38,12 @@ __FBSDID("$FreeBSD$"); #include "bectl.h" +struct sort_column { + char *name; + char *val; + nvlist_t *nvl; +}; + struct printc { int active_colsz_def; int be_colsz; @@ -324,6 +330,74 @@ print_headers(nvlist_t *props, struct printc *pc) printf("\n"); } +/* + * Sort the given nvlist of boot environments by property. + */ +static int +prop_list_sort(nvlist_t *props, char *property, bool reverse) +{ + nvpair_t *nvp; + nvlist_t *nvl; + int i, nvp_count; + uint64_t lval, rval; + struct sort_column sc_prev, sc_next; + + /* a temporary list to work with */ + nvlist_dup(props, &nvl, 0); + + nvp_count = fnvlist_num_pairs(nvl); + for (i = 0; i < nvp_count; i++) { + + nvp = nvlist_next_nvpair(nvl, NULL); + nvpair_value_nvlist(nvp, &sc_prev.nvl); + nvlist_lookup_string(sc_prev.nvl, "name", &sc_prev.name); + nvlist_lookup_string(sc_prev.nvl, property, &sc_prev.val); + + while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) { + + nvpair_value_nvlist(nvp, &sc_next.nvl); + nvlist_lookup_string(sc_next.nvl, "name", &sc_next.name); + nvlist_lookup_string(sc_next.nvl, property, &sc_next.val); + + /* properties that use numerical comparison */ + if (strcmp(property, "creation") == 0 || + strcmp(property, "used") == 0 || + strcmp(property, "usedds") == 0 || + strcmp(property, "usedsnap") == 0 || + strcmp(property, "usedrefreserv") == 0) { + + lval = strtoull(sc_prev.val, NULL, 10); + rval = strtoull(sc_next.val, NULL, 10); + + if ((lval < rval && reverse) || + (lval > rval && !reverse)) + sc_prev = sc_next; + } + + /* properties that use string comparison */ + else if (strcmp(property, "name") == 0 || + strcmp(property, "origin") == 0) { + if ((strcmp(sc_prev.val, sc_next.val) < 0 && reverse) || + (strcmp(sc_prev.val, sc_next.val) > 0 && !reverse)) + sc_prev = sc_next; + } + } + + /* + * The 'props' nvlist has been created to only have unique names. + * When a name is added, any existing nvlist's with the same name + * will be removed. Eventually, all existing nvlist's are replaced + * in sorted order. + */ + nvlist_add_nvlist(props, sc_prev.name, sc_prev.nvl); + nvlist_remove_all(nvl, sc_prev.name); + } + + be_prop_list_free(nvl); + + return 0; +} + int bectl_cmd_list(int argc, char *argv[]) { @@ -331,12 +405,14 @@ bectl_cmd_list(int argc, char *argv[]) nvpair_t *cur; nvlist_t *dsprops, *props; int opt, printed; - boolean_t active_now, active_reboot; + char *column; + bool reverse; + column = NULL; props = NULL; printed = 0; bzero(&pc, sizeof(pc)); - while ((opt = getopt(argc, argv, "aDHs")) != -1) { + while ((opt = getopt(argc, argv, "aDHsc:C:")) != -1) { switch (opt) { case 'a': pc.show_all_datasets = true; @@ -350,6 +426,18 @@ bectl_cmd_list(int argc, char *argv[]) case 's': pc.show_snaps = true; break; + case 'c': + if (column != NULL) + free(column); + column = strdup(optarg); + reverse = false; + break; + case 'C': + if (column != NULL) + free(column); + column = strdup(optarg); + reverse = true; + break; default: fprintf(stderr, "bectl list: unknown option '-%c'\n", optopt); @@ -374,44 +462,33 @@ bectl_cmd_list(int argc, char *argv[]) return (1); } + /* List boot environments in alphabetical order by default */ + if (column == NULL) { + column = strdup("name"); + reverse = false; + } + + prop_list_sort(props, column, reverse); + /* Force -D off if either -a or -s are specified */ if (pc.show_all_datasets || pc.show_snaps) pc.show_space = false; if (!pc.script_fmt) print_headers(props, &pc); - /* Do a first pass to print active and next active first */ - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (!active_now && !active_reboot) - continue; - if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) - printf("\n"); - print_info(nvpair_name(cur), dsprops, &pc); - printed++; - } - - /* Now pull everything else */ + /* Print boot environments */ for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (active_now || active_reboot) - continue; if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) printf("\n"); + print_info(nvpair_name(cur), dsprops, &pc); printed++; } + + free(column); be_prop_list_free(props); return (0); From owner-svn-src-all@freebsd.org Mon Sep 9 17:58:27 2019 Return-Path: Delivered-To: svn-src-all@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 6865ADA186; Mon, 9 Sep 2019 17:58:27 +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 46RwrM21mXz4KNZ; Mon, 9 Sep 2019 17:58:27 +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 23AE519582; Mon, 9 Sep 2019 17:58:27 +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 x89HwQIs095862; Mon, 9 Sep 2019 17:58:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HwQ2C095861; Mon, 9 Sep 2019 17:58:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909091758.x89HwQ2C095861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Sep 2019 17:58: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: r352089 - in stable: 11/contrib/llvm/lib/CodeGen 12/contrib/llvm/lib/CodeGen X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/CodeGen 12/contrib/llvm/lib/CodeGen X-SVN-Commit-Revision: 352089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:58:27 -0000 Author: dim Date: Mon Sep 9 17:58:26 2019 New Revision: 352089 URL: https://svnweb.freebsd.org/changeset/base/352089 Log: MFC r351938: Pull in r371111 from upstream llvm trunk (by Eli Friedman): [IfConversion] Fix diamond conversion with unanalyzable branches. The code was incorrectly counting the number of identical instructions, and therefore tried to predicate an instruction which should not have been predicated. This could have various effects: a compiler crash, an assembler failure, a miscompile, or just generating an extra, unnecessary instruction. Instead of depending on TargetInstrInfo::removeBranch, which only works on analyzable branches, just remove all branch instructions. Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and https://bugs.llvm.org/show_bug.cgi?id=41121 . Differential Revision: https://reviews.llvm.org/D67203 This should fix "Unable to predicate BX killed renamable $r0" errors when building the lang/spidermonkey170 and lang/spidermonkey38 ports for armv7 and armv6. PR: 236567 Modified: stable/12/contrib/llvm/lib/CodeGen/IfConversion.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm/lib/CodeGen/IfConversion.cpp ============================================================================== --- stable/12/contrib/llvm/lib/CodeGen/IfConversion.cpp Mon Sep 9 17:56:37 2019 (r352088) +++ stable/12/contrib/llvm/lib/CodeGen/IfConversion.cpp Mon Sep 9 17:58:26 2019 (r352089) @@ -1759,9 +1759,15 @@ bool IfConverter::IfConvertDiamondCommon( if (!BBI1->IsBrAnalyzable) verifySameBranchInstructions(&MBB1, &MBB2); #endif - BBI1->NonPredSize -= TII->removeBranch(*BBI1->BB); - // Remove duplicated instructions. + // Remove duplicated instructions from the tail of MBB1: any branch + // instructions, and the common instructions counted by NumDups2. DI1 = MBB1.end(); + while (DI1 != MBB1.begin()) { + MachineBasicBlock::iterator Prev = std::prev(DI1); + if (!Prev->isBranch() && !Prev->isDebugInstr()) + break; + DI1 = Prev; + } for (unsigned i = 0; i != NumDups2; ) { // NumDups2 only counted non-dbg_value instructions, so this won't // run off the head of the list. From owner-svn-src-all@freebsd.org Mon Sep 9 17:58:27 2019 Return-Path: Delivered-To: svn-src-all@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 A9451DA18A; Mon, 9 Sep 2019 17:58:27 +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 46RwrM41m7z4KNb; Mon, 9 Sep 2019 17:58:27 +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 6D49119583; Mon, 9 Sep 2019 17:58:27 +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 x89HwRsj095868; Mon, 9 Sep 2019 17:58:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89HwRdK095867; Mon, 9 Sep 2019 17:58:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909091758.x89HwRdK095867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Sep 2019 17:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352089 - in stable: 11/contrib/llvm/lib/CodeGen 12/contrib/llvm/lib/CodeGen X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/CodeGen 12/contrib/llvm/lib/CodeGen X-SVN-Commit-Revision: 352089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 17:58:27 -0000 Author: dim Date: Mon Sep 9 17:58:26 2019 New Revision: 352089 URL: https://svnweb.freebsd.org/changeset/base/352089 Log: MFC r351938: Pull in r371111 from upstream llvm trunk (by Eli Friedman): [IfConversion] Fix diamond conversion with unanalyzable branches. The code was incorrectly counting the number of identical instructions, and therefore tried to predicate an instruction which should not have been predicated. This could have various effects: a compiler crash, an assembler failure, a miscompile, or just generating an extra, unnecessary instruction. Instead of depending on TargetInstrInfo::removeBranch, which only works on analyzable branches, just remove all branch instructions. Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and https://bugs.llvm.org/show_bug.cgi?id=41121 . Differential Revision: https://reviews.llvm.org/D67203 This should fix "Unable to predicate BX killed renamable $r0" errors when building the lang/spidermonkey170 and lang/spidermonkey38 ports for armv7 and armv6. PR: 236567 Modified: stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm/lib/CodeGen/IfConversion.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp Mon Sep 9 17:56:37 2019 (r352088) +++ stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp Mon Sep 9 17:58:26 2019 (r352089) @@ -1759,9 +1759,15 @@ bool IfConverter::IfConvertDiamondCommon( if (!BBI1->IsBrAnalyzable) verifySameBranchInstructions(&MBB1, &MBB2); #endif - BBI1->NonPredSize -= TII->removeBranch(*BBI1->BB); - // Remove duplicated instructions. + // Remove duplicated instructions from the tail of MBB1: any branch + // instructions, and the common instructions counted by NumDups2. DI1 = MBB1.end(); + while (DI1 != MBB1.begin()) { + MachineBasicBlock::iterator Prev = std::prev(DI1); + if (!Prev->isBranch() && !Prev->isDebugInstr()) + break; + DI1 = Prev; + } for (unsigned i = 0; i != NumDups2; ) { // NumDups2 only counted non-dbg_value instructions, so this won't // run off the head of the list. From owner-svn-src-all@freebsd.org Mon Sep 9 18:01:08 2019 Return-Path: Delivered-To: svn-src-all@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 5F7EEDA348; Mon, 9 Sep 2019 18:01:08 +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 46RwvS1wX0z4KkC; Mon, 9 Sep 2019 18:01:08 +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 25C5D195C5; Mon, 9 Sep 2019 18:01:08 +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 x89I17Ul097557; Mon, 9 Sep 2019 18:01:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89I171p097556; Mon, 9 Sep 2019 18:01:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091801.x89I171p097556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 18:01:07 +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: r352090 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 352090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:01:08 -0000 Author: kevans Date: Mon Sep 9 18:01:07 2019 New Revision: 352090 URL: https://svnweb.freebsd.org/changeset/base/352090 Log: bectl(8): fix mis-merge r348296 ("add description for create subcommand") apparently failed to merge in the SYNOPSIS addition somehow... correct this mistake now. This is a direct commit to stable/12 for a misfire on previous MFC. Modified: stable/12/sbin/bectl/bectl.8 Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Mon Sep 9 17:58:26 2019 (r352089) +++ stable/12/sbin/bectl/bectl.8 Mon Sep 9 18:01:07 2019 (r352090) @@ -35,6 +35,10 @@ .Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot .Ar newBeName .Nm +.Cm create +.Op Fl r +.Ar beName@snapshot +.Nm .Cm destroy .Op Fl \&Fo .Ar beName Ns Op Cm @ Ns Ar snapshot From owner-svn-src-all@freebsd.org Mon Sep 9 18:07:32 2019 Return-Path: Delivered-To: svn-src-all@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 85F97DA67E; Mon, 9 Sep 2019 18:07:32 +0000 (UTC) (envelope-from erj@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 46Rx2r301jz4LD4; Mon, 9 Sep 2019 18:07:32 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 49CF219774; Mon, 9 Sep 2019 18:07:32 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89I7Ws0002059; Mon, 9 Sep 2019 18:07:32 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89I7W5l002058; Mon, 9 Sep 2019 18:07:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909091807.x89I7W5l002058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 9 Sep 2019 18:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352091 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 352091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:07:32 -0000 Author: erj Date: Mon Sep 9 18:07:31 2019 New Revision: 352091 URL: https://svnweb.freebsd.org/changeset/base/352091 Log: iflib: initialize the STATE_LOCK in iflib_register From Jake: r347197 contained an MFC for r332389, adding the STATE_LOCK to the iflib core driver. Unfortunately, the commit accidentally missed adding the STATE_LOCK_INIT. Without this, if you build a STABLE-11 kernel with INVARIANTS enabled, any mtx_lock of the state lock will result in a panic: panic: mtx_lock() of spin mutex (null) @ /usr/src/sys/net/iflib.c:5522 It actually ends up looking like a panic due to taking a spin mutex when we could be interrupted. However, the real cause is because the lock class was never initialized. Initialize the STATE_LOCK properly during iflib_register to fix this. Submitted by: Jacob Keller Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21540 Modified: stable/11/sys/net/iflib.c Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon Sep 9 18:01:07 2019 (r352090) +++ stable/11/sys/net/iflib.c Mon Sep 9 18:07:31 2019 (r352091) @@ -4758,6 +4758,7 @@ iflib_register(if_ctx_t ctx) _iflib_assert(sctx); CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); + STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); ifp = ctx->ifc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { From owner-svn-src-all@freebsd.org Mon Sep 9 18:17:31 2019 Return-Path: Delivered-To: svn-src-all@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 0EA4ADAE89; Mon, 9 Sep 2019 18:17:31 +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 46RxGL6YJMz4M4B; Mon, 9 Sep 2019 18:17:30 +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 BFDF419943; Mon, 9 Sep 2019 18:17:30 +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 x89IHUtZ008184; Mon, 9 Sep 2019 18:17:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IHUIi008183; Mon, 9 Sep 2019 18:17:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091817.x89IHUIi008183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 18:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352092 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 352092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:17:31 -0000 Author: kevans Date: Mon Sep 9 18:17:30 2019 New Revision: 352092 URL: https://svnweb.freebsd.org/changeset/base/352092 Log: bectl(8): initialize reverse earlier This turns into a warning in GCC 4.2 that 'reverse' may be used uninitialized in this function. While I don't immediately see where it's deciding this from (there's only two paths that make column != NULL, and they both set reverse), initializing reverse earlier is good for clarity. MFC after: 3 days Modified: head/sbin/bectl/bectl_list.c Modified: head/sbin/bectl/bectl_list.c ============================================================================== --- head/sbin/bectl/bectl_list.c Mon Sep 9 18:07:31 2019 (r352091) +++ head/sbin/bectl/bectl_list.c Mon Sep 9 18:17:30 2019 (r352092) @@ -412,6 +412,7 @@ bectl_cmd_list(int argc, char *argv[]) props = NULL; printed = 0; bzero(&pc, sizeof(pc)); + reverse = false; while ((opt = getopt(argc, argv, "aDHsc:C:")) != -1) { switch (opt) { case 'a': @@ -463,10 +464,8 @@ bectl_cmd_list(int argc, char *argv[]) } /* List boot environments in alphabetical order by default */ - if (column == NULL) { + if (column == NULL) column = strdup("name"); - reverse = false; - } prop_list_sort(props, column, reverse); From owner-svn-src-all@freebsd.org Mon Sep 9 18:20:56 2019 Return-Path: Delivered-To: svn-src-all@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 78245DAF80; Mon, 9 Sep 2019 18:20:56 +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 46RxLJ2YSmz4MDJ; Mon, 9 Sep 2019 18:20:56 +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 3ADAE19A7D; Mon, 9 Sep 2019 18:20:56 +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 x89IKucI009894; Mon, 9 Sep 2019 18:20:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IKtv6009891; Mon, 9 Sep 2019 18:20:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091820.x89IKtv6009891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 18:20:55 +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: r352093 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 352093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:20:56 -0000 Author: kevans Date: Mon Sep 9 18:20:55 2019 New Revision: 352093 URL: https://svnweb.freebsd.org/changeset/base/352093 Log: Back out r352087 for now The ancient-gcc -Wno-error series hasn't been MFC'd yet to this branch and some GCC builds seem to have raised a false-positive that wasn't caught due to -Wno-error on head. Back it out for now, will reapply when r352092 becomes eligible for MFC... Modified: stable/12/sbin/bectl/bectl.8 stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/bectl_list.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Mon Sep 9 18:17:30 2019 (r352092) +++ stable/12/sbin/bectl/bectl.8 Mon Sep 9 18:20:55 2019 (r352093) @@ -57,9 +57,6 @@ .Nm .Cm list .Op Fl aDHs -.Op Fl c Ar property -.Op Fl C Ar property -.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc .Nm .Cm mount .Ar beName @@ -237,12 +234,7 @@ generated by .El .Pp All default parameters may be overwritten. -.It Xo -.Cm list -.Op Fl DHas -.Oo Bro Fl c Ar property | Fl C Ar property Brc Oc -.Xc -.Pp +.It Cm list Op Fl aDHs Display all boot environments. The .Em Active @@ -253,44 +245,21 @@ active on reboot or both .Pq Em \&NR . .Pp -.Bl -tag -width indent -.It Fl a -Display all datasets. -.It Fl D -Display the full space usage for each boot environment, assuming all +If +.Fl a +is used, display all datasets. +If +.Fl D +is used, display the full space usage for each boot environment, assuming all other boot environments were destroyed. -.It Fl H -Used for scripting. -Do not print headers and separate fields by a single tab instead of -arbitrary white space. -.It Fl s -Display all snapshots as well. -.It Fl c Ar property -Sort boot environments by given property name. -The following properties are supported: -.Pp -.Bl -tag -width 4n -offset indent -compact -.It name (default output) -.It creation -.It origin -.It used -.It usedds -.It usedsnap -.It usedrefreserv -.El -.It Fl C Ar property -Same as the -.Fl c -option, but displays in descending order. -.El -.Pp The -.Fl D -option is ignored when either the +.Fl H +option is used for scripting. +It does not print headers and separate fields by a single tab instead of +arbitrary white space. +If .Fl s -or -.Fl a -option is used. +is used, display all snapshots as well. .It Cm mount Ar beName Op Ar mountpoint Temporarily mount the boot environment. Mount at the specified Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Mon Sep 9 18:17:30 2019 (r352092) +++ stable/12/sbin/bectl/bectl.c Mon Sep 9 18:20:55 2019 (r352093) @@ -80,7 +80,7 @@ usage(bool explicit) "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " "{jailID | jailName}\n" "\t bootenv [utility [argument ...]]\n" - "\tbectl list [-DHas] [{-c property | -C property}]\n" + "\tbectl list [-DHas]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" Modified: stable/12/sbin/bectl/bectl_list.c ============================================================================== --- stable/12/sbin/bectl/bectl_list.c Mon Sep 9 18:17:30 2019 (r352092) +++ stable/12/sbin/bectl/bectl_list.c Mon Sep 9 18:20:55 2019 (r352093) @@ -38,12 +38,6 @@ __FBSDID("$FreeBSD$"); #include "bectl.h" -struct sort_column { - char *name; - char *val; - nvlist_t *nvl; -}; - struct printc { int active_colsz_def; int be_colsz; @@ -330,74 +324,6 @@ print_headers(nvlist_t *props, struct printc *pc) printf("\n"); } -/* - * Sort the given nvlist of boot environments by property. - */ -static int -prop_list_sort(nvlist_t *props, char *property, bool reverse) -{ - nvpair_t *nvp; - nvlist_t *nvl; - int i, nvp_count; - uint64_t lval, rval; - struct sort_column sc_prev, sc_next; - - /* a temporary list to work with */ - nvlist_dup(props, &nvl, 0); - - nvp_count = fnvlist_num_pairs(nvl); - for (i = 0; i < nvp_count; i++) { - - nvp = nvlist_next_nvpair(nvl, NULL); - nvpair_value_nvlist(nvp, &sc_prev.nvl); - nvlist_lookup_string(sc_prev.nvl, "name", &sc_prev.name); - nvlist_lookup_string(sc_prev.nvl, property, &sc_prev.val); - - while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) { - - nvpair_value_nvlist(nvp, &sc_next.nvl); - nvlist_lookup_string(sc_next.nvl, "name", &sc_next.name); - nvlist_lookup_string(sc_next.nvl, property, &sc_next.val); - - /* properties that use numerical comparison */ - if (strcmp(property, "creation") == 0 || - strcmp(property, "used") == 0 || - strcmp(property, "usedds") == 0 || - strcmp(property, "usedsnap") == 0 || - strcmp(property, "usedrefreserv") == 0) { - - lval = strtoull(sc_prev.val, NULL, 10); - rval = strtoull(sc_next.val, NULL, 10); - - if ((lval < rval && reverse) || - (lval > rval && !reverse)) - sc_prev = sc_next; - } - - /* properties that use string comparison */ - else if (strcmp(property, "name") == 0 || - strcmp(property, "origin") == 0) { - if ((strcmp(sc_prev.val, sc_next.val) < 0 && reverse) || - (strcmp(sc_prev.val, sc_next.val) > 0 && !reverse)) - sc_prev = sc_next; - } - } - - /* - * The 'props' nvlist has been created to only have unique names. - * When a name is added, any existing nvlist's with the same name - * will be removed. Eventually, all existing nvlist's are replaced - * in sorted order. - */ - nvlist_add_nvlist(props, sc_prev.name, sc_prev.nvl); - nvlist_remove_all(nvl, sc_prev.name); - } - - be_prop_list_free(nvl); - - return 0; -} - int bectl_cmd_list(int argc, char *argv[]) { @@ -405,14 +331,12 @@ bectl_cmd_list(int argc, char *argv[]) nvpair_t *cur; nvlist_t *dsprops, *props; int opt, printed; - char *column; - bool reverse; + boolean_t active_now, active_reboot; - column = NULL; props = NULL; printed = 0; bzero(&pc, sizeof(pc)); - while ((opt = getopt(argc, argv, "aDHsc:C:")) != -1) { + while ((opt = getopt(argc, argv, "aDHs")) != -1) { switch (opt) { case 'a': pc.show_all_datasets = true; @@ -426,18 +350,6 @@ bectl_cmd_list(int argc, char *argv[]) case 's': pc.show_snaps = true; break; - case 'c': - if (column != NULL) - free(column); - column = strdup(optarg); - reverse = false; - break; - case 'C': - if (column != NULL) - free(column); - column = strdup(optarg); - reverse = true; - break; default: fprintf(stderr, "bectl list: unknown option '-%c'\n", optopt); @@ -462,33 +374,44 @@ bectl_cmd_list(int argc, char *argv[]) return (1); } - /* List boot environments in alphabetical order by default */ - if (column == NULL) { - column = strdup("name"); - reverse = false; - } - - prop_list_sort(props, column, reverse); - /* Force -D off if either -a or -s are specified */ if (pc.show_all_datasets || pc.show_snaps) pc.show_space = false; if (!pc.script_fmt) print_headers(props, &pc); - - /* Print boot environments */ + /* Do a first pass to print active and next active first */ for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { nvpair_value_nvlist(cur, &dsprops); + active_now = active_reboot = false; + nvlist_lookup_boolean_value(dsprops, "active", &active_now); + nvlist_lookup_boolean_value(dsprops, "nextboot", + &active_reboot); + if (!active_now && !active_reboot) + continue; if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) printf("\n"); - print_info(nvpair_name(cur), dsprops, &pc); printed++; } - free(column); + /* Now pull everything else */ + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + nvpair_value_nvlist(cur, &dsprops); + active_now = active_reboot = false; + + nvlist_lookup_boolean_value(dsprops, "active", &active_now); + nvlist_lookup_boolean_value(dsprops, "nextboot", + &active_reboot); + if (active_now || active_reboot) + continue; + if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) + printf("\n"); + print_info(nvpair_name(cur), dsprops, &pc); + printed++; + } be_prop_list_free(props); return (0); From owner-svn-src-all@freebsd.org Mon Sep 9 18:27:58 2019 Return-Path: Delivered-To: svn-src-all@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 1B83ADB491; Mon, 9 Sep 2019 18:27:58 +0000 (UTC) (envelope-from imp@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 46RxVQ0f2Wz4Mqp; Mon, 9 Sep 2019 18:27:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE4B719B1F; Mon, 9 Sep 2019 18:27:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IRvw6014056; Mon, 9 Sep 2019 18:27:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IRqg6014032; Mon, 9 Sep 2019 18:27:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909091827.x89IRqg6014032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Sep 2019 18:27: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: r352094 - in stable/12: share/mk sys/arm/conf sys/conf sys/modules/linux sys/modules/linux64 sys/powerpc/conf sys/powerpc/conf/dpaa usr.sbin/pmcstudy X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/mk sys/arm/conf sys/conf sys/modules/linux sys/modules/linux64 sys/powerpc/conf sys/powerpc/conf/dpaa usr.sbin/pmcstudy X-SVN-Commit-Revision: 352094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:27:58 -0000 Author: imp Date: Mon Sep 9 18:27:52 2019 New Revision: 352094 URL: https://svnweb.freebsd.org/changeset/base/352094 Log: MFC: r351429,351430,351485,351497,351498 Merge changes to turn off -Werror for gcc 4.2.1 by default as part of the plan to deorbit gcc 4.2.1 from -head before 13.0. Relnotes: Yes Modified: stable/12/share/mk/bsd.sys.mk stable/12/sys/arm/conf/ALPINE stable/12/sys/arm/conf/ARMADA38X stable/12/sys/arm/conf/ARMADAXP stable/12/sys/arm/conf/DB-78XXX stable/12/sys/arm/conf/DB-88F5XXX stable/12/sys/arm/conf/DB-88F6XXX stable/12/sys/arm/conf/RT1310 stable/12/sys/arm/conf/SHEEVAPLUG stable/12/sys/arm/conf/SOCFPGA stable/12/sys/arm/conf/TS7800 stable/12/sys/arm/conf/VYBRID stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.i386 stable/12/sys/conf/kern.pre.mk stable/12/sys/conf/kmod.mk stable/12/sys/modules/linux/Makefile stable/12/sys/modules/linux64/Makefile stable/12/sys/powerpc/conf/MPC85XX stable/12/sys/powerpc/conf/MPC85XXSPE stable/12/sys/powerpc/conf/QORIQ64 stable/12/sys/powerpc/conf/dpaa/DPAA stable/12/usr.sbin/pmcstudy/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/bsd.sys.mk ============================================================================== --- stable/12/share/mk/bsd.sys.mk Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/share/mk/bsd.sys.mk Mon Sep 9 18:27:52 2019 (r352094) @@ -29,6 +29,15 @@ CFLAGS+= -std=${CSTD} CXXFLAGS+= -std=${CXXSTD} .endif +# +# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path out of the +# system, and any warnings specific to it are no longer relevant as there are +# too many false positives. +# +.if ${COMPILER_VERSION} < 50000 +NO_WERROR.gcc= yes +.endif + # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: stable/12/sys/arm/conf/ALPINE ============================================================================== --- stable/12/sys/arm/conf/ALPINE Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/ALPINE Mon Sep 9 18:27:52 2019 (r352094) @@ -23,7 +23,6 @@ include "std.armv7" include "../annapurna/alpine/std.alpine" makeoptions MODULES_OVERRIDE="" -makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options SMP # Enable multiple cores Modified: stable/12/sys/arm/conf/ARMADA38X ============================================================================== --- stable/12/sys/arm/conf/ARMADA38X Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/ARMADA38X Mon Sep 9 18:27:52 2019 (r352094) @@ -11,7 +11,6 @@ ident ARMADA38X options SOC_MV_ARMADA38X -makeoptions WERROR="-Werror" makeoptions MODULES_EXTRA="dtb/mv" options MD_ROOT Modified: stable/12/sys/arm/conf/ARMADAXP ============================================================================== --- stable/12/sys/arm/conf/ARMADAXP Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/ARMADAXP Mon Sep 9 18:27:52 2019 (r352094) @@ -27,8 +27,6 @@ include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP -makeoptions WERROR="-Werror" - options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores Modified: stable/12/sys/arm/conf/DB-78XXX ============================================================================== --- stable/12/sys/arm/conf/DB-78XXX Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/DB-78XXX Mon Sep 9 18:27:52 2019 (r352094) @@ -10,8 +10,6 @@ include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: stable/12/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/12/sys/arm/conf/DB-88F5XXX Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/DB-88F5XXX Mon Sep 9 18:27:52 2019 (r352094) @@ -10,8 +10,6 @@ include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: stable/12/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/12/sys/arm/conf/DB-88F6XXX Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/DB-88F6XXX Mon Sep 9 18:27:52 2019 (r352094) @@ -10,8 +10,6 @@ include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: stable/12/sys/arm/conf/RT1310 ============================================================================== --- stable/12/sys/arm/conf/RT1310 Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/RT1310 Mon Sep 9 18:27:52 2019 (r352094) @@ -16,7 +16,6 @@ makeoptions FDT_DTS_FILE=wzr2-g300n.dts makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking Modified: stable/12/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/12/sys/arm/conf/SHEEVAPLUG Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/SHEEVAPLUG Mon Sep 9 18:27:52 2019 (r352094) @@ -11,8 +11,6 @@ include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions WERROR="-Werror" - options HZ=1000 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking Modified: stable/12/sys/arm/conf/SOCFPGA ============================================================================== --- stable/12/sys/arm/conf/SOCFPGA Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/SOCFPGA Mon Sep 9 18:27:52 2019 (r352094) @@ -24,8 +24,6 @@ include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" -makeoptions WERROR="-Werror" - options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC options SMP # Enable multiple cores Modified: stable/12/sys/arm/conf/TS7800 ============================================================================== --- stable/12/sys/arm/conf/TS7800 Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/TS7800 Mon Sep 9 18:27:52 2019 (r352094) @@ -10,8 +10,6 @@ include "../mv/orion/std.ts7800" options SOC_MV_ORION -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: stable/12/sys/arm/conf/VYBRID ============================================================================== --- stable/12/sys/arm/conf/VYBRID Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/arm/conf/VYBRID Mon Sep 9 18:27:52 2019 (r352094) @@ -22,8 +22,6 @@ ident VYBRID include "std.armv7" include "../freescale/vybrid/std.vybrid" -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options PLATFORM # Platform based SoC #options NANDFS # NAND Filesystem Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/conf/files.amd64 Mon Sep 9 18:27:52 2019 (r352094) @@ -46,7 +46,7 @@ linux32_assym.h optional compat_linux32 \ # linux32_locore.o optional compat_linux32 \ dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.s" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux32_locore.o" # Modified: stable/12/sys/conf/files.i386 ============================================================================== --- stable/12/sys/conf/files.i386 Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/conf/files.i386 Mon Sep 9 18:27:52 2019 (r352094) @@ -33,7 +33,7 @@ linux_assym.h optional compat_linux \ # linux_locore.o optional compat_linux \ dependency "linux_assym.h $S/i386/linux/linux_locore.s" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux_locore.o" # Modified: stable/12/sys/conf/kern.pre.mk ============================================================================== --- stable/12/sys/conf/kern.pre.mk Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/conf/kern.pre.mk Mon Sep 9 18:27:52 2019 (r352094) @@ -93,7 +93,11 @@ CFLAGS.gcc+= -fms-extensions .if defined(CFLAGS_ARCH_PARAMS) CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} .endif -WERROR?= -Werror +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 +WERROR?= -Wno-error +.else +WERROR?= -Werror +.endif # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} Modified: stable/12/sys/conf/kmod.mk ============================================================================== --- stable/12/sys/conf/kmod.mk Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/conf/kmod.mk Mon Sep 9 18:27:52 2019 (r352094) @@ -107,7 +107,12 @@ __KLD_SHARED=no .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+= -fno-strict-aliasing .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 +WERROR?= -Wno-error +.else WERROR?= -Werror +.endif + CFLAGS+= ${WERROR} CFLAGS+= -D_KERNEL CFLAGS+= -DKLD_MODULE Modified: stable/12/sys/modules/linux/Makefile ============================================================================== --- stable/12/sys/modules/linux/Makefile Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/modules/linux/Makefile Mon Sep 9 18:27:52 2019 (r352094) @@ -55,7 +55,7 @@ linux${SFX}_assym.h: linux${SFX}_genassym.o linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s \ - -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc -nostdlib \ + -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -nostdinc -nostdlib \ -fno-omit-frame-pointer -fPIC \ -Wl,-T${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ Modified: stable/12/sys/modules/linux64/Makefile ============================================================================== --- stable/12/sys/modules/linux64/Makefile Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/modules/linux64/Makefile Mon Sep 9 18:27:52 2019 (r352094) @@ -31,7 +31,7 @@ linux_assym.h: linux_genassym.o linux_locore.o: linux_locore.s linux_assym.h ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \ - -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -fPIC -nostdinc \ + -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -fPIC -nostdinc \ -Wl,-T${SRCTOP}/sys/${MACHINE}/linux/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ ${.IMPSRC} -o ${.TARGET} Modified: stable/12/sys/powerpc/conf/MPC85XX ============================================================================== --- stable/12/sys/powerpc/conf/MPC85XX Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/powerpc/conf/MPC85XX Mon Sep 9 18:27:52 2019 (r352094) @@ -13,7 +13,6 @@ machine powerpc powerpc include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU Modified: stable/12/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- stable/12/sys/powerpc/conf/MPC85XXSPE Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/powerpc/conf/MPC85XXSPE Mon Sep 9 18:27:52 2019 (r352094) @@ -13,7 +13,6 @@ machine powerpc powerpcspe include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU Modified: stable/12/sys/powerpc/conf/QORIQ64 ============================================================================== --- stable/12/sys/powerpc/conf/QORIQ64 Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/powerpc/conf/QORIQ64 Mon Sep 9 18:27:52 2019 (r352094) @@ -14,7 +14,7 @@ machine powerpc powerpc64 include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" +#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU Modified: stable/12/sys/powerpc/conf/dpaa/DPAA ============================================================================== --- stable/12/sys/powerpc/conf/dpaa/DPAA Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/sys/powerpc/conf/dpaa/DPAA Mon Sep 9 18:27:52 2019 (r352094) @@ -12,7 +12,7 @@ cpu BOOKE_E500 machine powerpc powerpc #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" +#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" makeoptions NO_MODULES=yes # Platform support Modified: stable/12/usr.sbin/pmcstudy/Makefile ============================================================================== --- stable/12/usr.sbin/pmcstudy/Makefile Mon Sep 9 18:20:55 2019 (r352093) +++ stable/12/usr.sbin/pmcstudy/Makefile Mon Sep 9 18:27:52 2019 (r352094) @@ -4,7 +4,7 @@ PROG= pmcstudy MAN= pmcstudy.8 SRCS= pmcstudy.c eval_expr.c -CFLAGS+= -Wall -Werror +CFLAGS+= -Wall ${WERROR} BINDIR= /usr/bin From owner-svn-src-all@freebsd.org Mon Sep 9 18:31:46 2019 Return-Path: Delivered-To: svn-src-all@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 9C298DB716; Mon, 9 Sep 2019 18:31:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RxZp3dQ7z4N6J; Mon, 9 Sep 2019 18:31:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f51.google.com with SMTP id b136so31132075iof.3; Mon, 09 Sep 2019 11:31:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=dPjwC65Dw8kk+xnc4IxUzGyVYnpw2uP3VQ39HDrW3Pk=; b=YhC8sZIdOB1WRvHWzA2F7FOppQwwKulwqzQBFXsG5nk1bVyNGlMMO+7XliAGYb9fCK 98tJ0S8y6HWPgzoxjUv7OrihCC0TFA/qpV22FU9azJqhg/8SInSSnzrPU4PLlqoGltHk eRWjQZSFDIBCB4GQ6jEU66zLETnW5a0JNJB2cvM/D8VAJDLzK2tkY7ORk6eBEarwhEEl DuIBOj7vs6HJFNY5AjlC/HjQHNtWWzJLCliMU5zQs2avpLvh9QK/y1qxK19NDeYKAbAa gc1WdjyyzlAB/dSPnVA5mO/9GUq3b3th+1haQwVrfWkJm1mUrveyhvNmMdvFL0U04E8o ociQ== X-Gm-Message-State: APjAAAUoSn54iBh+jc5HIZDyA29nkQ2sYbba8i0D5dMvW2Jtat1vDzLY sCjEtPrDJvpgBKnE0FZUzvHCnIst X-Google-Smtp-Source: APXvYqxwp0qGKuS20Jd9Bz6nmXzj002Rxtbim6q/kUlJmaMsmXp5/qQfKYS69RIWf0rtRtzU8U3kPg== X-Received: by 2002:a5e:960f:: with SMTP id a15mr7360448ioq.13.1568053905029; Mon, 09 Sep 2019 11:31:45 -0700 (PDT) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com. [209.85.166.51]) by smtp.gmail.com with ESMTPSA id u10sm16604316ior.81.2019.09.09.11.31.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Sep 2019 11:31:44 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id b136so31131900iof.3; Mon, 09 Sep 2019 11:31:44 -0700 (PDT) X-Received: by 2002:a5d:9346:: with SMTP id i6mr9325167ioo.107.1568053904061; Mon, 09 Sep 2019 11:31:44 -0700 (PDT) MIME-Version: 1.0 References: <201909091129.x89BTxvw061871@repo.freebsd.org> In-Reply-To: <201909091129.x89BTxvw061871@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 9 Sep 2019 11:31:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352059 - head/sys/kern To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46RxZp3dQ7z4N6J X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:31:46 -0000 What=E2=80=99s the motivation for using more timehands? On Mon, Sep 9, 2019 at 04:30 Konstantin Belousov wrote: > Author: kib > Date: Mon Sep 9 11:29:58 2019 > New Revision: 352059 > URL: https://svnweb.freebsd.org/changeset/base/352059 > > Log: > Make timehands count selectable at boottime. > > Tested by: O'Connor, Daniel > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D21563 > > Modified: > head/sys/kern/kern_tc.c > > Modified: head/sys/kern/kern_tc.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_tc.c Mon Sep 9 11:22:38 2019 (r352058) > +++ head/sys/kern/kern_tc.c Mon Sep 9 11:29:58 2019 (r352059) > @@ -83,19 +83,16 @@ struct timehands { > struct timehands *th_next; > }; > > -static struct timehands th0; > -static struct timehands th1 =3D { > - .th_next =3D &th0 > -}; > -static struct timehands th0 =3D { > +static struct timehands ths[16] =3D { > + [0] =3D { > .th_counter =3D &dummy_timecounter, > .th_scale =3D (uint64_t)-1 / 1000000, > .th_offset =3D { .sec =3D 1 }, > .th_generation =3D 1, > - .th_next =3D &th1 > + }, > }; > > -static struct timehands *volatile timehands =3D &th0; > +static struct timehands *volatile timehands =3D &ths[0]; > struct timecounter *timecounter =3D &dummy_timecounter; > static struct timecounter *timecounters =3D &dummy_timecounter; > > @@ -115,6 +112,10 @@ static int timestepwarnings; > SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, > ×tepwarnings, 0, "Log time steps"); > > +static int timehands_count =3D 2; > +SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, CTLFLAG_RDTUN, > + &timehands_count, 0, "Count of timehands in rotation"); > + > struct bintime bt_timethreshold; > struct bintime bt_tickthreshold; > sbintime_t sbt_timethreshold; > @@ -1960,8 +1961,9 @@ done: > static void > inittimecounter(void *dummy) > { > + struct timehands *thp; > u_int p; > - int tick_rate; > + int i, tick_rate; > > /* > * Set the initial timeout to > @@ -1987,6 +1989,16 @@ inittimecounter(void *dummy) > #ifdef FFCLOCK > ffclock_init(); > #endif > + > + /* Set up the requested number of timehands. */ > + if (timehands_count < 1) > + timehands_count =3D 1; > + if (timehands_count > nitems(ths)) > + timehands_count =3D nitems(ths); > + for (i =3D 1, thp =3D &ths[0]; i < timehands_count; thp =3D &ths= [i++]) > + thp->th_next =3D &ths[i]; > + thp->th_next =3D &ths[0]; > + > /* warm up new timecounter (again) and get rolling. */ > (void)timecounter->tc_get_timecount(timecounter); > (void)timecounter->tc_get_timecount(timecounter); > > From owner-svn-src-all@freebsd.org Mon Sep 9 18:32:30 2019 Return-Path: Delivered-To: svn-src-all@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 05E36DB7DE; Mon, 9 Sep 2019 18:32:30 +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 46Rxbd6RXWz4NPB; Mon, 9 Sep 2019 18:32:29 +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 C1ACA19CD2; Mon, 9 Sep 2019 18:32:29 +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 x89IWTKq019771; Mon, 9 Sep 2019 18:32:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IWTHj019770; Mon, 9 Sep 2019 18:32:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091832.x89IWTHj019770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 18:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352095 - head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Commit-Revision: 352095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:32:30 -0000 Author: emaste Date: Mon Sep 9 18:32:29 2019 New Revision: 352095 URL: https://svnweb.freebsd.org/changeset/base/352095 Log: compiler-rt: use more __sanitizer_time_t on FreeBSD A few structs were using long for time_t members. Obtained from: LLVM r370755 Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Mon Sep 9 18:27:52 2019 (r352094) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Mon Sep 9 18:32:29 2019 (r352095) @@ -115,15 +115,21 @@ namespace __sanitizer { long key; }; +#if defined(__LP64___) + typedef long long __sanitizer_time_t; +#else + typedef long __sanitizer_time_t; +#endif + struct __sanitizer_shmid_ds { __sanitizer_ipc_perm shm_perm; unsigned long shm_segsz; unsigned int shm_lpid; unsigned int shm_cpid; int shm_nattch; - unsigned long shm_atime; - unsigned long shm_dtime; - unsigned long shm_ctime; + __sanitizer_time_t shm_atime; + __sanitizer_time_t shm_dtime; + __sanitizer_time_t shm_ctime; }; extern unsigned struct_msqid_ds_sz; @@ -154,12 +160,12 @@ namespace __sanitizer { char *pw_passwd; int pw_uid; int pw_gid; - long pw_change; + __sanitizer_time_t pw_change; char *pw_class; char *pw_gecos; char *pw_dir; char *pw_shell; - long pw_expire; + __sanitizer_time_t pw_expire; int pw_fields; }; @@ -169,12 +175,6 @@ namespace __sanitizer { int gr_gid; char **gr_mem; }; - -#if defined(__LP64___) - typedef long long __sanitizer_time_t; -#else - typedef long __sanitizer_time_t; -#endif typedef long __sanitizer_suseconds_t; From owner-svn-src-all@freebsd.org Mon Sep 9 18:33:16 2019 Return-Path: Delivered-To: svn-src-all@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 6236EDB86E; Mon, 9 Sep 2019 18:33:16 +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 46RxcX1vSBz4NXB; Mon, 9 Sep 2019 18:33:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24B9C19CE0; Mon, 9 Sep 2019 18:33:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IXGSU019872; Mon, 9 Sep 2019 18:33:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IXGtA019871; Mon, 9 Sep 2019 18:33:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091833.x89IXGtA019871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 18:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352096 - head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Commit-Revision: 352096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:33:16 -0000 Author: emaste Date: Mon Sep 9 18:33:15 2019 New Revision: 352096 URL: https://svnweb.freebsd.org/changeset/base/352096 Log: compiler-rt: use 64-bit time_t for all FreeBSD archs except i386 Obtained from: LLVM r370756 Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Mon Sep 9 18:32:29 2019 (r352095) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h Mon Sep 9 18:33:15 2019 (r352096) @@ -115,7 +115,7 @@ namespace __sanitizer { long key; }; -#if defined(__LP64___) +#if !defined(__i386__) typedef long long __sanitizer_time_t; #else typedef long __sanitizer_time_t; From owner-svn-src-all@freebsd.org Mon Sep 9 18:35:18 2019 Return-Path: Delivered-To: svn-src-all@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 AB0CBDB93B; Mon, 9 Sep 2019 18:35:18 +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 46Rxft41fjz4NgM; Mon, 9 Sep 2019 18:35:18 +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 69DCA19CE1; Mon, 9 Sep 2019 18:35:18 +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 x89IZIg0020023; Mon, 9 Sep 2019 18:35:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IZIBT020022; Mon, 9 Sep 2019 18:35:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909091835.x89IZIBT020022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 18:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352097 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 352097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:35:18 -0000 Author: emaste Date: Mon Sep 9 18:35:17 2019 New Revision: 352097 URL: https://svnweb.freebsd.org/changeset/base/352097 Log: msdosfsmount.h: fix ifdef comment Modified: head/sys/fs/msdosfs/msdosfsmount.h Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Mon Sep 9 18:33:15 2019 (r352096) +++ head/sys/fs/msdosfs/msdosfsmount.h Mon Sep 9 18:35:17 2019 (r352097) @@ -222,7 +222,7 @@ struct msdosfs_fileno { #define MSDOSFS_ASSERT_MP_LOCKED(pmp) \ lockmgr_assert(&(pmp)->pm_fatlock, KA_XLOCKED) -#endif /* _KERNEL */ +#endif /* _KERNEL || MAKEFS */ #ifndef MAKEFS /* From owner-svn-src-all@freebsd.org Mon Sep 9 18:45:53 2019 Return-Path: Delivered-To: svn-src-all@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 4DFF5DBDB9; Mon, 9 Sep 2019 18:45:53 +0000 (UTC) (envelope-from imp@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 46Rxv51LYQz4PPw; Mon, 9 Sep 2019 18:45:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED0ED19EA6; Mon, 9 Sep 2019 18:45:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IjqvP026116; Mon, 9 Sep 2019 18:45:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IjqFY026115; Mon, 9 Sep 2019 18:45:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909091845.x89IjqFY026115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Sep 2019 18:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352099 - head/tools/tools/nanobsd/embedded X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd/embedded X-SVN-Commit-Revision: 352099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:45:53 -0000 Author: imp Date: Mon Sep 9 18:45:52 2019 New Revision: 352099 URL: https://svnweb.freebsd.org/changeset/base/352099 Log: These should have been removed when we removed atmel port before 12. Deleted: head/tools/tools/nanobsd/embedded/sam9260ek.cfg head/tools/tools/nanobsd/embedded/sam9g20ek.cfg From owner-svn-src-all@freebsd.org Mon Sep 9 18:46:29 2019 Return-Path: Delivered-To: svn-src-all@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 024F7DBE6A; Mon, 9 Sep 2019 18:46:29 +0000 (UTC) (envelope-from imp@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 46Rxvm6JtBz4PXt; Mon, 9 Sep 2019 18:46:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC85419EA8; Mon, 9 Sep 2019 18:46:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IkSdf026203; Mon, 9 Sep 2019 18:46:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IkSlW026202; Mon, 9 Sep 2019 18:46:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909091846.x89IkSlW026202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Sep 2019 18:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352100 - in head/tools/tools/nanobsd: dhcpd embedded X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/tools/tools/nanobsd: dhcpd embedded X-SVN-Commit-Revision: 352100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:46:29 -0000 Author: imp Date: Mon Sep 9 18:46:28 2019 New Revision: 352100 URL: https://svnweb.freebsd.org/changeset/base/352100 Log: Remove obsolete WITHOUT names that are no longer in the system. Noticed by: swills@ Modified: head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Mon Sep 9 18:45:52 2019 (r352099) +++ head/tools/tools/nanobsd/dhcpd/common Mon Sep 9 18:46:28 2019 (r352100) @@ -103,23 +103,14 @@ CONF_BUILD=" WITHOUT_ACPI=true WITHOUT_ATM=true WITHOUT_AUDIT=true -WITHOUT_BIND_DNSSEC=true -WITHOUT_BIND_ETC=true -WITHOUT_BIND_LIBS_LWRES=true WITHOUT_BLUETOOTH=true WITHOUT_CALENDAR=true -WITHOUT_CVS=true WITHOUT_DICT=true WITHOUT_EXAMPLES=true -WITHOUT_FORTRAN=true WITHOUT_GAMES=true WITHOUT_GCOV=true -WITHOUT_GPIB=true WITHOUT_HTML=true -WITHOUT_I4B=true WITHOUT_IPFILTER=true -WITHOUT_IPX=true -WITHOUT_LIBKSE=true WITHOUT_LOCALES=true WITHOUT_LPR=true WITHOUT_MAN=true @@ -127,7 +118,6 @@ WITHOUT_NETCAT=true WITHOUT_NIS=true WITHOUT_NLS=true WITHOUT_NS_CACHING=true -WITHOUT_OBJC=true WITHOUT_PROFILE=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true @@ -142,15 +132,9 @@ NO_INSTALL_MANPAGES=t # The following would help... # WITHOUT_TOOLCHAIN=true can't build ports # WITHOUT_INSTALLLIB=true libgcc.a -# -# from the build -# WITHOUT_INFO=true makeinfo -# WITHOUT_RCS=true PKG_ONLY_MAKE_CONF=" WITHOUT_TOOLCHAIN=true WITHOUT_INSTALLLIB=true -WITHOUT_INFO=true -WITHOUT_RCS=true " NANO_PACKAGE_ONLY=1 Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Mon Sep 9 18:45:52 2019 (r352099) +++ head/tools/tools/nanobsd/embedded/common Mon Sep 9 18:46:28 2019 (r352100) @@ -134,23 +134,14 @@ LOCAL_XTOOL_DIRS=usr.bin/mkimg WITHOUT_ACPI=true WITHOUT_ATM=true WITHOUT_AUDIT=true -WITHOUT_BIND_DNSSEC=true -WITHOUT_BIND_ETC=true -WITHOUT_BIND_LIBS_LWRES=true WITHOUT_BLUETOOTH=true WITHOUT_CALENDAR=true -WITHOUT_CVS=true WITHOUT_DICT=true WITHOUT_EXAMPLES=true -WITHOUT_FORTRAN=true WITHOUT_GAMES=true WITHOUT_GCOV=true -WITHOUT_GPIB=true WITHOUT_HTML=true -WITHOUT_I4B=true WITHOUT_IPFILTER=true -WITHOUT_IPX=true -WITHOUT_LIBKSE=true WITHOUT_LOCALES=true WITHOUT_LPR=true WITHOUT_MAN=true @@ -158,7 +149,6 @@ WITHOUT_NETCAT=true WITHOUT_NIS=true WITHOUT_NLS=true WITHOUT_NS_CACHING=true -WITHOUT_OBJC=true WITHOUT_PROFILE=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true @@ -178,13 +168,9 @@ NO_INSTALL_MANPAGES=t # WITHOUT_INSTALLLIB=true libgcc.a # # from the build -# WITHOUT_INFO=true makeinfo -# WITHOUT_RCS=true PKG_ONLY_MAKE_CONF=" WITHOUT_TOOLCHAIN=true WITHOUT_INSTALLLIB=true -WITHOUT_INFO=true -WITHOUT_RCS=true " NANO_PACKAGE_ONLY=1 From owner-svn-src-all@freebsd.org Mon Sep 9 18:48:13 2019 Return-Path: Delivered-To: svn-src-all@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 7FC44DBF2C; Mon, 9 Sep 2019 18:48:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Rxxn1s6rz4Pgx; Mon, 9 Sep 2019 18:48:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x89Im5Ue083856 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 9 Sep 2019 21:48:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x89Im5Ue083856 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x89Im5iB083855; Mon, 9 Sep 2019 21:48:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Sep 2019 21:48:05 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352059 - head/sys/kern Message-ID: <20190909184805.GV2559@kib.kiev.ua> References: <201909091129.x89BTxvw061871@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46Rxxn1s6rz4Pgx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:48:13 -0000 On Mon, Sep 09, 2019 at 11:31:32AM -0700, Conrad Meyer wrote: > What’s the motivation for using more timehands? See the thread titled 'Is it a good idea to use a usb-serial adapter for PPS input? Yes, it is.' on arm@ and usb@. In short, there are some reports of timecounters misbehaving on single-core systems when only two timehands are enabled. The change eases the experimentation and provides a workaround which does not require modifying the sources to apply. > > On Mon, Sep 9, 2019 at 04:30 Konstantin Belousov wrote: > > > Author: kib > > Date: Mon Sep 9 11:29:58 2019 > > New Revision: 352059 > > URL: https://svnweb.freebsd.org/changeset/base/352059 > > > > Log: > > Make timehands count selectable at boottime. > > > > Tested by: O'Connor, Daniel > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D21563 > > > > Modified: > > head/sys/kern/kern_tc.c > > > > Modified: head/sys/kern/kern_tc.c > > > > ============================================================================== > > --- head/sys/kern/kern_tc.c Mon Sep 9 11:22:38 2019 (r352058) > > +++ head/sys/kern/kern_tc.c Mon Sep 9 11:29:58 2019 (r352059) > > @@ -83,19 +83,16 @@ struct timehands { > > struct timehands *th_next; > > }; > > > > -static struct timehands th0; > > -static struct timehands th1 = { > > - .th_next = &th0 > > -}; > > -static struct timehands th0 = { > > +static struct timehands ths[16] = { > > + [0] = { > > .th_counter = &dummy_timecounter, > > .th_scale = (uint64_t)-1 / 1000000, > > .th_offset = { .sec = 1 }, > > .th_generation = 1, > > - .th_next = &th1 > > + }, > > }; > > > > -static struct timehands *volatile timehands = &th0; > > +static struct timehands *volatile timehands = &ths[0]; > > struct timecounter *timecounter = &dummy_timecounter; > > static struct timecounter *timecounters = &dummy_timecounter; > > > > @@ -115,6 +112,10 @@ static int timestepwarnings; > > SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, > > ×tepwarnings, 0, "Log time steps"); > > > > +static int timehands_count = 2; > > +SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, CTLFLAG_RDTUN, > > + &timehands_count, 0, "Count of timehands in rotation"); > > + > > struct bintime bt_timethreshold; > > struct bintime bt_tickthreshold; > > sbintime_t sbt_timethreshold; > > @@ -1960,8 +1961,9 @@ done: > > static void > > inittimecounter(void *dummy) > > { > > + struct timehands *thp; > > u_int p; > > - int tick_rate; > > + int i, tick_rate; > > > > /* > > * Set the initial timeout to > > @@ -1987,6 +1989,16 @@ inittimecounter(void *dummy) > > #ifdef FFCLOCK > > ffclock_init(); > > #endif > > + > > + /* Set up the requested number of timehands. */ > > + if (timehands_count < 1) > > + timehands_count = 1; > > + if (timehands_count > nitems(ths)) > > + timehands_count = nitems(ths); > > + for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) > > + thp->th_next = &ths[i]; > > + thp->th_next = &ths[0]; > > + > > /* warm up new timecounter (again) and get rolling. */ > > (void)timecounter->tc_get_timecount(timecounter); > > (void)timecounter->tc_get_timecount(timecounter); > > > > From owner-svn-src-all@freebsd.org Mon Sep 9 18:50:39 2019 Return-Path: Delivered-To: svn-src-all@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 7D0D8DBFC6; Mon, 9 Sep 2019 18:50:39 +0000 (UTC) (envelope-from wulf@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 46Ry0b3Qhzz4Pqh; Mon, 9 Sep 2019 18:50:39 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 59DEE19EAE; Mon, 9 Sep 2019 18:50:39 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IodBN027180; Mon, 9 Sep 2019 18:50:39 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IocFv027176; Mon, 9 Sep 2019 18:50:38 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201909091850.x89IocFv027176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 9 Sep 2019 18:50: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: r352101 - in stable/12/sys: conf modules/netgraph/bluetooth/ubt netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12/sys: conf modules/netgraph/bluetooth/ubt netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 352101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:50:39 -0000 Author: wulf Date: Mon Sep 9 18:50:38 2019 New Revision: 352101 URL: https://svnweb.freebsd.org/changeset/base/352101 Log: MFC r351196, r351324, r351326: ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode. Add helper function for synchronous execution of HCI commands at probe stage and use this function to check firmware state of Intel Wireless 8260/8265 bluetooth devices found in many post 2016 year laptops. Attempt to initialize FreeBSD bluetooth stack while such a device is in bootloader mode locks the adapter hardly so it requires power on/off cycle to restore. This change blocks ng_ubt attachment unless operational firmware is loaded thus preventing the lock up. PR: 237083 Reviewed by: hps, emax MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21071 Added: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c - copied unchanged from r351196, head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c Modified: stable/12/sys/conf/files stable/12/sys/modules/netgraph/bluetooth/ubt/Makefile stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Mon Sep 9 18:46:28 2019 (r352100) +++ stable/12/sys/conf/files Mon Sep 9 18:50:38 2019 (r352101) @@ -4235,6 +4235,7 @@ netgraph/bluetooth/common/ng_bluetooth.c optional netg netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c optional netgraph_bluetooth_bt3c netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4 netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb +netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci Modified: stable/12/sys/modules/netgraph/bluetooth/ubt/Makefile ============================================================================== --- stable/12/sys/modules/netgraph/bluetooth/ubt/Makefile Mon Sep 9 18:46:28 2019 (r352100) +++ stable/12/sys/modules/netgraph/bluetooth/ubt/Makefile Mon Sep 9 18:50:38 2019 (r352101) @@ -7,7 +7,7 @@ CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \ -I${SRCTOP}/sys/netgraph/bluetooth/drivers/ubt KMOD= ng_ubt -SRCS= ng_ubt.c opt_bus.h opt_usb.h device_if.h bus_if.h \ - usb_if.h usbdevs.h +SRCS= ng_ubt.c ng_ubt_intel.c opt_bus.h opt_usb.h device_if.h \ + bus_if.h usb_if.h usbdevs.h .include Modified: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Sep 9 18:46:28 2019 (r352100) +++ stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Sep 9 18:50:38 2019 (r352101) @@ -252,6 +252,7 @@ static struct ng_type typestruct = ****************************************************************************/ /* USB methods */ +static usb_callback_t ubt_probe_intr_callback; static usb_callback_t ubt_ctrl_write_callback; static usb_callback_t ubt_intr_read_callback; static usb_callback_t ubt_bulk_read_callback; @@ -421,6 +422,13 @@ static const STRUCT_USB_HOST_ID ubt_ignore_devs[] = /* Atheros AR5BBU12 with sflash firmware */ { USB_VPI(0x0489, 0xe03c, 0), USB_DEV_BCD_LTEQ(1) }, { USB_VPI(0x0489, 0xe036, 0), USB_DEV_BCD_LTEQ(1) }, + + /* Intel Wireless 8260 and successors are handled in ng_ubt_intel.c */ + { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0025, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0026, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0029, 0) }, }; /* List of supported bluetooth devices */ @@ -503,6 +511,79 @@ static const STRUCT_USB_HOST_ID ubt_devs[] = }; /* + * Does a synchronous (waits for completion event) execution of HCI command. + * Size of both command and response buffers are passed in length field of + * corresponding structures in "Parameter Total Length" format i.e. + * not including HCI packet headers. + * + * Must not be used after USB transfers have been configured in attach routine. + */ + +usb_error_t +ubt_do_hci_request(struct usb_device *udev, struct ubt_hci_cmd *cmd, + void *evt, usb_timeout_t timeout) +{ + static const struct usb_config ubt_probe_config = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .bufsize = UBT_INTR_BUFFER_SIZE, + .callback = &ubt_probe_intr_callback, + }; + struct usb_device_request req; + struct usb_xfer *xfer[1]; + struct mtx mtx; + usb_error_t error = USB_ERR_NORMAL_COMPLETION; + uint8_t iface_index = 0; + + /* Initialize a USB control request and then do it */ + bzero(&req, sizeof(req)); + req.bmRequestType = UBT_HCI_REQUEST; + req.wIndex[0] = iface_index; + USETW(req.wLength, UBT_HCI_CMD_SIZE(cmd)); + + error = usbd_do_request(udev, NULL, &req, cmd); + if (error != USB_ERR_NORMAL_COMPLETION) { + printf("ng_ubt: usbd_do_request error=%s\n", + usbd_errstr(error)); + return (error); + } + + if (evt == NULL) + return (USB_ERR_NORMAL_COMPLETION); + + /* Initialize INTR endpoint xfer and wait for response */ + mtx_init(&mtx, "ubt pb", NULL, MTX_DEF | MTX_NEW); + + error = usbd_transfer_setup(udev, &iface_index, xfer, + &ubt_probe_config, 1, evt, &mtx); + if (error == USB_ERR_NORMAL_COMPLETION) { + + mtx_lock(&mtx); + usbd_transfer_start(*xfer); + + if (msleep_sbt(evt, &mtx, 0, "ubt pb", SBT_1MS * timeout, + 0, C_HARDCLOCK) == EWOULDBLOCK) { + printf("ng_ubt: HCI command 0x%04x timed out\n", + le16toh(cmd->opcode)); + error = USB_ERR_TIMEOUT; + } + + usbd_transfer_stop(*xfer); + mtx_unlock(&mtx); + + usbd_transfer_unsetup(xfer, 1); + } else + printf("ng_ubt: usbd_transfer_setup error=%s\n", + usbd_errstr(error)); + + mtx_destroy(&mtx); + + return (error); +} + +/* * Probe for a USB Bluetooth device. * USB context. */ @@ -717,6 +798,49 @@ ubt_detach(device_t dev) return (0); } /* ubt_detach */ +/* + * Called when incoming interrupt transfer (HCI event) has completed, i.e. + * HCI event was received from the device during device probe stage. + * USB context. + */ + +static void +ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct ubt_hci_event *evt = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + if (actlen > UBT_HCI_EVENT_SIZE(evt)) + actlen = UBT_HCI_EVENT_SIZE(evt); + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, evt, actlen); + /* OneShot mode */ + wakeup(evt); + break; + + case USB_ST_SETUP: +submit_next: + /* Try clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + break; + + default: + if (error != USB_ERR_CANCELLED) { + printf("ng_ubt: interrupt transfer failed: %s\n", + usbd_errstr(error)); + goto submit_next; + } + break; + } +} /* ubt_probe_intr_callback */ + /* * Called when outgoing control request (HCI command) has completed, i.e. * HCI command was sent to the device. @@ -1852,7 +1976,7 @@ ubt_modevent(module_t mod, int event, void *data) return (error); } /* ubt_modevent */ -static devclass_t ubt_devclass; +devclass_t ubt_devclass; static device_method_t ubt_methods[] = { @@ -1862,7 +1986,7 @@ static device_method_t ubt_methods[] = DEVMETHOD_END }; -static driver_t ubt_driver = +driver_t ubt_driver = { .name = "ubt", .methods = ubt_methods, Copied: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c (from r351196, head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c Mon Sep 9 18:50:38 2019 (r352101, copy of r351196, head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c) @@ -0,0 +1,161 @@ +/* + * ng_ubt_intel.c + */ + +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Vladimir Kondratyev + * + * 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$ + */ + +/* + * Attempt to initialize FreeBSD bluetooth stack while Intel Wireless 8260/8265 + * device is in bootloader mode locks the adapter hardly so it requires power + * on/off cycle to restore. This driver blocks ng_ubt attachment until + * operational firmware is loaded by iwmbtfw utility thus avoiding the lock up. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "usbdevs.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static device_probe_t ubt_intel_probe; + +/* + * List of supported bluetooth devices. If you add a new device PID here ensure + * that it is blacklisted in ng_ubt.c and is supported by iwmbtfw utility. + */ + +static const STRUCT_USB_HOST_ID ubt_intel_devs[] = +{ + /* Intel Wireless 8260/8265 and successors */ + { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0025, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0026, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0029, 0) }, +}; + +/* + * Find if the Intel Wireless 8260/8265 device is in bootloader mode or is + * running operational firmware with checking of 4-th byte "Intel version" + * HCI command response. The value 0x23 identifies the operational firmware. + */ + +static bool +ubt_intel_check_firmware_state(struct usb_device *udev) +{ +#define UBT_INTEL_VER_LEN 13 +#define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ + struct ubt_hci_event_command_compl *evt; + uint8_t buf[offsetof(struct ubt_hci_event, data) + UBT_INTEL_VER_LEN]; + static struct ubt_hci_cmd cmd = { + .opcode = htole16(NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05)), + .length = 0, + }; + usb_error_t error; + + bzero(buf, sizeof(buf)); + evt = (struct ubt_hci_event_command_compl *)buf; + evt->header.length = UBT_INTEL_VER_LEN; + + error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); + if (error != USB_ERR_NORMAL_COMPLETION) + return false; + + return (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && + evt->header.length == UBT_INTEL_VER_LEN && + evt->data[4] == 0x23); +} + +/* + * Probe for a Intel Wireless Bluetooth device. + */ + +static int +ubt_intel_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + error = usbd_lookup_id_by_uaa(ubt_intel_devs, sizeof(ubt_intel_devs), + uaa); + if (error != 0) + return (error); + + if (!ubt_intel_check_firmware_state(uaa->device)) + return (ENXIO); + + return (BUS_PROBE_DEFAULT); +} + +/* + * Module interface. Attach and detach methods, netgraph node type + * registration and PNP string are inherited from ng_ubt.c driver. + */ + +static device_method_t ubt_intel_methods[] = +{ + DEVMETHOD(device_probe, ubt_intel_probe), + DEVMETHOD_END +}; + +static kobj_class_t ubt_baseclasses[] = { &ubt_driver, NULL }; +static driver_t ubt_intel_driver = +{ + .name = "ubt", + .methods = ubt_intel_methods, + .size = sizeof(struct ubt_softc), + .baseclasses = ubt_baseclasses, +}; + +DRIVER_MODULE(ng_ubt_intel, uhub, ubt_intel_driver, ubt_devclass, 0, 0); +MODULE_VERSION(ng_ubt_intel, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_intel, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); +MODULE_DEPEND(ng_ubt_intel, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_intel, usb, 1, 1, 1); Modified: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h ============================================================================== --- stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h Mon Sep 9 18:46:28 2019 (r352100) +++ stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h Mon Sep 9 18:50:38 2019 (r352101) @@ -74,6 +74,35 @@ enum { UBT_N_TRANSFER, /* total number of transfers */ }; +/* USB control request (HCI command) structure */ +struct ubt_hci_cmd { + uint16_t opcode; + uint8_t length; + uint8_t data[]; +} __attribute__ ((packed)); +#define UBT_HCI_CMD_SIZE(cmd) \ + ((cmd)->length + offsetof(struct ubt_hci_cmd, data)) + +/* USB interrupt transfer HCI event header structure */ +struct ubt_hci_evhdr { + uint8_t event; + uint8_t length; +} __attribute__ ((packed)); +/* USB interrupt transfer (generic HCI event) structure */ +struct ubt_hci_event { + struct ubt_hci_evhdr header; + uint8_t data[]; +} __attribute__ ((packed)); +/* USB interrupt transfer (HCI command completion event) structure */ +struct ubt_hci_event_command_compl { + struct ubt_hci_evhdr header; + uint8_t numpkt; + uint16_t opcode; + uint8_t data[]; +} __attribute__ ((packed)); +#define UBT_HCI_EVENT_SIZE(evt) \ + ((evt)->header.length + offsetof(struct ubt_hci_event, data)) + /* USB device softc structure */ struct ubt_softc { device_t sc_dev; /* for debug printf */ @@ -128,6 +157,12 @@ struct ubt_softc { }; typedef struct ubt_softc ubt_softc_t; typedef struct ubt_softc * ubt_softc_p; + +usb_error_t ubt_do_hci_request(struct usb_device *, struct ubt_hci_cmd *, + void *, usb_timeout_t); + +extern devclass_t ubt_devclass; +extern driver_t ubt_driver; #endif /* ndef _NG_UBT_VAR_H_ */ From owner-svn-src-all@freebsd.org Mon Sep 9 18:57:18 2019 Return-Path: Delivered-To: svn-src-all@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 B81FDDC205; Mon, 9 Sep 2019 18:57:18 +0000 (UTC) (envelope-from wulf@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 46Ry8G4Rqqz4QDQ; Mon, 9 Sep 2019 18:57:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7BB091A081; Mon, 9 Sep 2019 18:57:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IvIqY032211; Mon, 9 Sep 2019 18:57:18 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IvHoV032206; Mon, 9 Sep 2019 18:57:17 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201909091857.x89IvHoV032206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 9 Sep 2019 18:57: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: r352102 - in stable/12: targets/pseudo/userland tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/iwmbtfw X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12: targets/pseudo/userland tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/iwmbtfw X-SVN-Commit-Revision: 352102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:57:18 -0000 Author: wulf Date: Mon Sep 9 18:57:17 2019 New Revision: 352102 URL: https://svnweb.freebsd.org/changeset/base/352102 Log: MFC r351197, r351199: iwmbtfw: Firmware loader for Intel Wireless 8260 based Bluetooth USB devices Currently supported models are: 8260, 8265, 9560, 9260 and 22161. Firmware files can be installed with comms/iwmbt-firmware port. PR: 237083 Reviewed by: hps, emax Differential Revision: https://reviews.freebsd.org/D21071 Added: stable/12/usr.sbin/bluetooth/iwmbtfw/ - copied from r351197, head/usr.sbin/bluetooth/iwmbtfw/ Modified: stable/12/targets/pseudo/userland/Makefile.depend stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.sbin/bluetooth/Makefile stable/12/usr.sbin/bluetooth/iwmbtfw/Makefile stable/12/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c Directory Properties: stable/12/ (props changed) Modified: stable/12/targets/pseudo/userland/Makefile.depend ============================================================================== --- stable/12/targets/pseudo/userland/Makefile.depend Mon Sep 9 18:50:38 2019 (r352101) +++ stable/12/targets/pseudo/userland/Makefile.depend Mon Sep 9 18:57:17 2019 (r352102) @@ -443,6 +443,7 @@ DIRDEPS+= \ usr.sbin/bluetooth/hccontrol \ usr.sbin/bluetooth/hcsecd \ usr.sbin/bluetooth/hcseriald \ + usr.sbin/bluetooth/iwmbtfw \ usr.sbin/bluetooth/l2control \ usr.sbin/bluetooth/l2ping \ usr.sbin/bluetooth/rfcomm_pppd \ Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Mon Sep 9 18:50:38 2019 (r352101) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Mon Sep 9 18:57:17 2019 (r352102) @@ -459,6 +459,7 @@ OLD_FILES+=etc/bluetooth/hcsecd.conf OLD_FILES+=etc/bluetooth/hosts OLD_FILES+=etc/bluetooth/protocols OLD_FILES+=etc/defaults/bluetooth.device.conf +OLD_FILES+=etc/devd/iwmbtfw.conf OLD_DIRS+=etc/bluetooth OLD_FILES+=etc/rc.d/bluetooth OLD_FILES+=etc/rc.d/bthidd @@ -512,6 +513,7 @@ OLD_FILES+=usr/sbin/btpand OLD_FILES+=usr/sbin/hccontrol OLD_FILES+=usr/sbin/hcsecd OLD_FILES+=usr/sbin/hcseriald +OLD_FILES+=usr/sbin/iwmbtfw OLD_FILES+=usr/sbin/l2control OLD_FILES+=usr/sbin/l2ping OLD_FILES+=usr/sbin/rfcomm_pppd @@ -589,6 +591,7 @@ OLD_FILES+=usr/share/man/man8/btpand.8.gz OLD_FILES+=usr/share/man/man8/hccontrol.8.gz OLD_FILES+=usr/share/man/man8/hcsecd.8.gz OLD_FILES+=usr/share/man/man8/hcseriald.8.gz +OLD_FILES+=usr/share/man/man8/iwmbtfw.8.gz OLD_FILES+=usr/share/man/man8/l2control.8.gz OLD_FILES+=usr/share/man/man8/l2ping.8.gz OLD_FILES+=usr/share/man/man8/rfcomm_pppd.8.gz Modified: stable/12/usr.sbin/bluetooth/Makefile ============================================================================== --- stable/12/usr.sbin/bluetooth/Makefile Mon Sep 9 18:50:38 2019 (r352101) +++ stable/12/usr.sbin/bluetooth/Makefile Mon Sep 9 18:57:17 2019 (r352102) @@ -21,6 +21,7 @@ SUBDIR+= ath3kfw SUBDIR+= bcmfw SUBDIR+= bthidcontrol SUBDIR+= bthidd +SUBDIR+= iwmbtfw .endif .include Modified: stable/12/usr.sbin/bluetooth/iwmbtfw/Makefile ============================================================================== --- head/usr.sbin/bluetooth/iwmbtfw/Makefile Sun Aug 18 22:20:28 2019 (r351197) +++ stable/12/usr.sbin/bluetooth/iwmbtfw/Makefile Mon Sep 9 18:57:17 2019 (r352102) @@ -1,6 +1,5 @@ # $FreeBSD$ -PACKAGE= bluetooth CONFS= iwmbtfw.conf CONFSDIR= /etc/devd PROG= iwmbtfw Modified: stable/12/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c ============================================================================== --- head/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c Sun Aug 18 22:20:28 2019 (r351197) +++ stable/12/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c Mon Sep 9 18:57:17 2019 (r352102) @@ -68,7 +68,7 @@ iwmbt_send_fragment(struct libusb_device_handle *hdl, &transferred, timeout); - if (ret < 0 || transferred != IWMBT_HCI_CMD_SIZE(cmd)) { + if (ret < 0 || transferred != (int)IWMBT_HCI_CMD_SIZE(cmd)) { iwmbt_err("libusb_bulk_transfer() failed: err=%s, size=%zu", libusb_strerror(ret), IWMBT_HCI_CMD_SIZE(cmd)); From owner-svn-src-all@freebsd.org Mon Sep 9 19:00:37 2019 Return-Path: Delivered-To: svn-src-all@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 A5687DC2E9; Mon, 9 Sep 2019 19:00:37 +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 46RyD53ywmz4QP0; Mon, 9 Sep 2019 19:00:37 +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 6BF881A0A2; Mon, 9 Sep 2019 19:00:37 +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 x89J0bk8033206; Mon, 9 Sep 2019 19:00:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89J0bTh033205; Mon, 9 Sep 2019 19:00:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909091900.x89J0bTh033205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Sep 2019 19:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352103 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 19:00:37 -0000 Author: mav Date: Mon Sep 9 19:00:37 2019 New Revision: 352103 URL: https://svnweb.freebsd.org/changeset/base/352103 Log: Add one more error message to r352082. MFC after: 5 days Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Sep 9 18:57:17 2019 (r352102) +++ head/sbin/camcontrol/camcontrol.c Mon Sep 9 19:00:37 2019 (r352103) @@ -1975,7 +1975,8 @@ atahpa_proc_resp(struct cam_device *device, union ccb if (error & ATA_ERROR_ID_NOT_FOUND) { warnx("Max address has already been set since " "last power-on or hardware reset"); - } + } else if (hpasize == NULL) + warnx("Command failed with ATA error"); return (1); } From owner-svn-src-all@freebsd.org Mon Sep 9 19:14:33 2019 Return-Path: Delivered-To: svn-src-all@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 BCBC2DC7E7; Mon, 9 Sep 2019 19:14:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RyX86cxNz4R8q; Mon, 9 Sep 2019 19:14:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id k5so6138625iol.5; Mon, 09 Sep 2019 12:14:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=hhI2X15jCro7PjYxaaelw82ZDtzGul8ubBpzdgkWasQ=; b=DpJV3PMX0Qq1BjM4CbaJjfQXpuDejjM5J3PeiTizaWt9j9Nn3V0H3mU+msHRQrBGJn RT5Zrv/crqRVixgtKEcRUVbucrCJ4FtBkw3cAduP8DL2dWWao3g5lu90lb2pvAtRSqKP O/NXclvKzhRDvmNNaPvHbL+JyEDpUiIZCfiLYfeUmagJjaAO7gRdvDPFZ4P9WHRmdaHo AJz0jDYpwMdqHOdxEBqL0S3JTyRz/Nywdq7HMjNZsvEppdDpmc+WOMMcEUMtdIm0T77z W+6jCCOPZFVcqK8zyVdymJ8gTT2MSal/qtl0iKmDjF2p6WYZnJfNd+eR1Iu+jLlFL7J8 PuLQ== X-Gm-Message-State: APjAAAX2LP/hLwkmcwmraoYBBK6V9sWVwmqtgSkTtQmmZhM0p71+4uzo AdcsA+V9b9rxyiLOIFE67h/6mOwq X-Google-Smtp-Source: APXvYqzNAjas1wDJ5fU5UmV+bHmFWJ6FKG+hO9NU1FWwAC+uQvSs+xeQ87e1VIW/WUfK1eJE5mw6Ow== X-Received: by 2002:a02:c94b:: with SMTP id u11mr23154011jao.35.1568056471276; Mon, 09 Sep 2019 12:14:31 -0700 (PDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id x5sm9129663ior.46.2019.09.09.12.14.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Sep 2019 12:14:30 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id h144so31379447iof.7; Mon, 09 Sep 2019 12:14:30 -0700 (PDT) X-Received: by 2002:a02:cb51:: with SMTP id k17mr26435922jap.119.1568056470389; Mon, 09 Sep 2019 12:14:30 -0700 (PDT) MIME-Version: 1.0 References: <201909091129.x89BTxvw061871@repo.freebsd.org> <20190909184805.GV2559@kib.kiev.ua> In-Reply-To: <20190909184805.GV2559@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 9 Sep 2019 12:14:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352059 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46RyX86cxNz4R8q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.46 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[46.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.33)[ip: (-6.03), ipnet: 209.85.128.0/17(-3.32), asn: 15169(-2.26), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[46.166.85.209.rep.mailspike.net : 127.0.0.17]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 19:14:33 -0000 Thanks! On Mon, Sep 9, 2019 at 11:48 AM Konstantin Belousov w= rote: > > On Mon, Sep 09, 2019 at 11:31:32AM -0700, Conrad Meyer wrote: > > What=E2=80=99s the motivation for using more timehands? > See the thread titled 'Is it a good idea to use a usb-serial adapter > for PPS input? Yes, it is.' on arm@ and usb@. In short, there are some > reports of timecounters misbehaving on single-core systems when only two > timehands are enabled. > > The change eases the experimentation and provides a workaround which does > not require modifying the sources to apply. > > > > > On Mon, Sep 9, 2019 at 04:30 Konstantin Belousov wrot= e: > > > > > Author: kib > > > Date: Mon Sep 9 11:29:58 2019 > > > New Revision: 352059 > > > URL: https://svnweb.freebsd.org/changeset/base/352059 > > > > > > Log: > > > Make timehands count selectable at boottime. > > > > > > Tested by: O'Connor, Daniel > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D21563 > > > > > > Modified: > > > head/sys/kern/kern_tc.c > > > > > > Modified: head/sys/kern/kern_tc.c > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/kern/kern_tc.c Mon Sep 9 11:22:38 2019 (r352= 058) > > > +++ head/sys/kern/kern_tc.c Mon Sep 9 11:29:58 2019 (r352= 059) > > > @@ -83,19 +83,16 @@ struct timehands { > > > struct timehands *th_next; > > > }; > > > > > > -static struct timehands th0; > > > -static struct timehands th1 =3D { > > > - .th_next =3D &th0 > > > -}; > > > -static struct timehands th0 =3D { > > > +static struct timehands ths[16] =3D { > > > + [0] =3D { > > > .th_counter =3D &dummy_timecounter, > > > .th_scale =3D (uint64_t)-1 / 1000000, > > > .th_offset =3D { .sec =3D 1 }, > > > .th_generation =3D 1, > > > - .th_next =3D &th1 > > > + }, > > > }; > > > > > > -static struct timehands *volatile timehands =3D &th0; > > > +static struct timehands *volatile timehands =3D &ths[0]; > > > struct timecounter *timecounter =3D &dummy_timecounter; > > > static struct timecounter *timecounters =3D &dummy_timecounter; > > > > > > @@ -115,6 +112,10 @@ static int timestepwarnings; > > > SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, > > > ×tepwarnings, 0, "Log time steps"); > > > > > > +static int timehands_count =3D 2; > > > +SYSCTL_INT(_kern_timecounter, OID_AUTO, timehands_count, CTLFLAG_RDT= UN, > > > + &timehands_count, 0, "Count of timehands in rotation"); > > > + > > > struct bintime bt_timethreshold; > > > struct bintime bt_tickthreshold; > > > sbintime_t sbt_timethreshold; > > > @@ -1960,8 +1961,9 @@ done: > > > static void > > > inittimecounter(void *dummy) > > > { > > > + struct timehands *thp; > > > u_int p; > > > - int tick_rate; > > > + int i, tick_rate; > > > > > > /* > > > * Set the initial timeout to > > > @@ -1987,6 +1989,16 @@ inittimecounter(void *dummy) > > > #ifdef FFCLOCK > > > ffclock_init(); > > > #endif > > > + > > > + /* Set up the requested number of timehands. */ > > > + if (timehands_count < 1) > > > + timehands_count =3D 1; > > > + if (timehands_count > nitems(ths)) > > > + timehands_count =3D nitems(ths); > > > + for (i =3D 1, thp =3D &ths[0]; i < timehands_count; thp =3D = &ths[i++]) > > > + thp->th_next =3D &ths[i]; > > > + thp->th_next =3D &ths[0]; > > > + > > > /* warm up new timecounter (again) and get rolling. */ > > > (void)timecounter->tc_get_timecount(timecounter); > > > (void)timecounter->tc_get_timecount(timecounter); > > > > > > From owner-svn-src-all@freebsd.org Mon Sep 9 19:50:05 2019 Return-Path: Delivered-To: svn-src-all@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 21A25DE0D1 for ; Mon, 9 Sep 2019 19:50:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RzK81ynWz4WwD for ; Mon, 9 Sep 2019 19:50:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id l22so17673314qtp.10 for ; Mon, 09 Sep 2019 12:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uAwszEWT091EsN6hk9eivi1UoupE3LUFB6Rxr/EM77M=; b=TfD0bEFPFuTjSBHPdMcXUG0ZGBZwQw+NOoTZZ017/YXe7RsBA30Vad+E6KKcrrwZTe khJSbZEwIhUFLpm5ANNLaSZL2kN23ua6MX6VwQZXcuaWkAhcB0fVoi1+Dlr8BByOIlvm +5RSiAq5+aJuYrEHcFGajy7+6WywTvIq+1gcbPYIT1sSeaMqH48wjJGTCC78CtmrhIRO x7sF6PDNE3Q/nZtLRzOALVlZJALbnxqFGQ5+C+v5OIBQJLI+vE+QP5HFkJXC2dYYcvH9 2CbZcOaVCtn/J/PVNt9euJ//Zb6XbOMxARZspH3y+20SUKFie1P/vLV20PMM3LIHsNxS LyJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uAwszEWT091EsN6hk9eivi1UoupE3LUFB6Rxr/EM77M=; b=uHL+Zz/cLdmBG2wqr9kjhAJigZu5qlZwJ2uNnDWQuwaSqOdcGwcN4rdu60SHAlQCH5 KgkeWLV+D8rUkPd3vfqkz6t2Px+AALM4+s5OAHOUBCwXJKkDuF8W2c65hwAWpWKFC0R4 qnsCv0Dd9QJ1jrwPgGio5Dn7hX6o9AIeafJDrJX7TlxVTQLwoxZgnKYRTcvvc/1N2DXS 0jP2k9i7xYp0pRnhzdGDYxuGNxS8HM+ClZ37FPuQpfuGmYdusPYiiZi/+39IV5LeAAZS 9ljqh/NE5wnOZkuMB01XAvhaRwxnsTlwoczyi+M+HogfXWY/DnpN9HLfiClStdv+N2nK XEsg== X-Gm-Message-State: APjAAAVc677cBqHmgbLoVoQTkjMyHsQAnJYX1nlFXIooFOORaBmbKxFm 2zr0Mi3db+B2C14a2tma2MddtrdvMG08i3K8Q8BbXg== X-Google-Smtp-Source: APXvYqxFMcGZRAFUa8QRX4Tu99tX3nqg6iFfQMcUvdc/Rd68hJA2613VByg5SEi31jR+iTEs7Gus8wzX2N/8AMEiWWY= X-Received: by 2002:a05:6214:70c:: with SMTP id b12mr15864399qvz.87.1568058603096; Mon, 09 Sep 2019 12:50:03 -0700 (PDT) MIME-Version: 1.0 References: <201909060119.x861JWrG006910@repo.freebsd.org> <4917d7507b6ea6c360dccda261f53052aa085f2b.camel@freebsd.org> <5EE266EE-E650-48D8-9B0E-E674AD026470@freebsd.org> <3cb6429acc7e520932d2c906d1cac47540156355.camel@freebsd.org> <8F03EA29-0F3F-4321-9241-78F7C924FDE1@freebsd.org> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> <20190909115632.GB41333@spindle.one-eyed-alien.net> In-Reply-To: <20190909115632.GB41333@spindle.one-eyed-alien.net> From: Warner Losh Date: Mon, 9 Sep 2019 13:49:50 -0600 Message-ID: Subject: Re: svn commit: r351918 - head/sys/kern To: Brooks Davis Cc: Philip Paeps , Ian Lepore , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46RzK81ynWz4WwD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=TfD0bEFP; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.50)[ip: (2.56), ipnet: 2607:f8b0::/32(-2.74), asn: 15169(-2.26), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 19:50:05 -0000 On Mon, Sep 9, 2019, 5:56 AM Brooks Davis wrote: > On Sat, Sep 07, 2019 at 12:23:03PM +0800, Philip Paeps wrote: > > On 2019-09-07 12:06:32 (+0800), Warner Losh wrote: > > > On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps > > > wrote: > > >> On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: > > >>> On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: > > >>>> On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > > >>>>> On Fri, 2019-09-06 at 01:19 +0000, Philip Paeps wrote: > > >>>>>> Log: > > >>>>>> riscv: default to HZ=100 > > >>>>> > > >>>>> This seems like a bad idea. I've run a 90mhz armv4 chip with > > >>>>> HZ=1000 and didn't notice any performance hit from doing so. > > >>>>> Almost all arm kernel config files set HZ as an option, so that > > >>>>> define doesn't do much for arm these days. It probably does still > > >>>>> set HZ for various mips platforms. > > >>>>> > > >>>>> I would think 1000 is appropriate for anything modern running at > > >>>>> 200mhz or more. > > >>>>> > > >>>>> Setting it to 100 has the bad side effect of making things like > > >>>>> msleep(), tsleep(), and pause() (which show up in plenty of > > >>>>> drivers) all have a minimum timeout of 10ms, which is a long long > > >>>>> time on modern hardware. > > >>>>> > > >>>>> What benefit do you think you'll get from the lower number? > > >>>> > > >>>> On systems running at 10s of MHz (or slower, ick), with HZ=1000 you > > >>>> spend an awful lot of time servicing the timer interrupt and not > > >>>> very much time doing anything else. > > >>>> > > >>>> My rationale was that most RISC-V systems (including emulation and > > >>>> FPGA prototypes) I've encountered are running slower than the > > >>>> tipping point where HZ=1000 makes sense. With the default of > > >>>> HZ=100, faster exceptions can still set HZ=1000 in their individual > > >>>> configs. > > >>>> > > >>>> When the RISC-V world evolves to having more actual silicon and > > >>>> fewer slow prototypes, I definitely agree this default should be > > >>>> flipped again for HZ=1000 by default and HZ=100 in the config files > > >>>> for the exceptions. > > >>> > > >>> Wait a second... are you saying that the riscv implementation > > >>> doesn't support event timers and uses an old-style periodic tick > > >>> based on HZ? > > >> > > >> Depending on the hardware, there may not be an event timer (yet)... > > >> > > >> As I wrote: I would be more than happy to revert this change when > > >> more silicon becomes available. Presently, there is exactly one > > >> silicon RISC-V implementation commercially available (HiFive FU540) > > >> and even that one is kind of difficult to source. Most people > > >> running RISC-V are doing so in emulation or on FPGAs. > > >> > > >> Given how long these things take to boot to userland (where you > > >> really notice how slow things are), HZ=100 feels like a more sensible > > >> default than HZ=1000. > > > > > > I think it show more that the defaults are bad for MIPS and ARM. All > > > the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also > > > 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe we > > > need to attend to this as well. Arm !=v5 is also 1000Hz, so it should > > > be changed... > > > > > >> I don't feel terribly strongly about this though. I've just been > > >> bitten several times in the last week on a <15MHz FPGA forgetting to > > >> set HZ=100 in config and figured I'd save others the trouble. ;-) > > > > > > 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the > > > time.... How common are these beasts and how well does FreeBSD do on > > > them. I assume these are early prototypes? > > > > These are early prototypes indeed. > > > > FreeBSD runs remarkably well on them. Slowly of course. Booting takes > > several minutes and running anything non-trivial can be frustrating. > > [More context for Warner and others following along.] > > I don't know what platform Philip is using here, but with architectures > supporting CHERI (including MIPS and RISC-V), we typically run on > sub-100Mhz FPGA implementations. > > We also run on simulations or models that range from 100s of MIPS to a > few KIPS. Being able to do this is important to help validate that the > models we're proving security properties on actually relate to the > "more real" implementations we develop on. > > In all these cases, "run" is a relative thing. We certainly don't > expect to self-host until we've got performant hardware (and to the > extent that we care about 32-bit, we consider self-hosting an active > non-goal.) We often expect to be able to run real software including > things like nginx and webkit, but we mostly care about relative > performance not interactivity. > Would your needs be adequately covered by the current mechanisms to set HZ? This just covers the defaults for the whole platform. As always, these can be overridden in the boot loader or kernel config file... Warner > From owner-svn-src-all@freebsd.org Mon Sep 9 20:04:46 2019 Return-Path: Delivered-To: svn-src-all@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 65F97DEBCF; Mon, 9 Sep 2019 20:04:46 +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 46Rzf61v6bz4YWh; Mon, 9 Sep 2019 20:04:46 +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 2572F1AD5D; Mon, 9 Sep 2019 20:04:46 +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 x89K4kwr078790; Mon, 9 Sep 2019 20:04:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89K4kvA078789; Mon, 9 Sep 2019 20:04:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909092004.x89K4kvA078789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Sep 2019 20:04: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: r352106 - stable/12/usr.bin/ar X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/ar X-SVN-Commit-Revision: 352106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 20:04:46 -0000 Author: emaste Date: Mon Sep 9 20:04:45 2019 New Revision: 352106 URL: https://svnweb.freebsd.org/changeset/base/352106 Log: MFC r351663: ar: use more correct size_t type for loop index Submitted by: cem Modified: stable/12/usr.bin/ar/write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ar/write.c ============================================================================== --- stable/12/usr.bin/ar/write.c Mon Sep 9 19:58:46 2019 (r352105) +++ stable/12/usr.bin/ar/write.c Mon Sep 9 20:04:45 2019 (r352106) @@ -615,9 +615,9 @@ write_objs(struct bsdar *bsdar) size_t s_sz; /* size of archive symbol table. */ size_t pm_sz; /* size of pseudo members */ size_t w_sz; /* size of words in symbol table */ + size_t i; uint64_t nr; uint32_t nr32; - int i; if (elf_version(EV_CURRENT) == EV_NONE) bsdar_errc(bsdar, EX_SOFTWARE, 0, @@ -671,7 +671,7 @@ write_objs(struct bsdar *bsdar) bsdar->s_sn_sz; pm_sz += s_sz; /* Convert to big-endian. */ - for (i = 0; (size_t)i < bsdar->s_cnt; i++) + for (i = 0; i < bsdar->s_cnt; i++) bsdar->s_so[i] = htobe64(bsdar->s_so[i] + pm_sz); } else { @@ -679,7 +679,7 @@ write_objs(struct bsdar *bsdar) * Convert to big-endian and shuffle in-place to * the front of the allocation. XXX UB */ - for (i = 0; (size_t)i < bsdar->s_cnt; i++) + for (i = 0; i < bsdar->s_cnt; i++) ((uint32_t *)(bsdar->s_so))[i] = htobe32(bsdar->s_so[i] + pm_sz); } From owner-svn-src-all@freebsd.org Mon Sep 9 20:48:12 2019 Return-Path: Delivered-To: svn-src-all@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 C1B2FE0C7A; Mon, 9 Sep 2019 20:48:12 +0000 (UTC) (envelope-from crees@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 46S0cD4hGwz4cv4; Mon, 9 Sep 2019 20:48:12 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 83E781B4DB; Mon, 9 Sep 2019 20:48:12 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89KmCf9003511; Mon, 9 Sep 2019 20:48:12 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89KmCb0003510; Mon, 9 Sep 2019 20:48:12 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201909092048.x89KmCb0003510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Mon, 9 Sep 2019 20:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352107 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: crees X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 352107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 20:48:12 -0000 Author: crees (doc,ports committer) Date: Mon Sep 9 20:48:12 2019 New Revision: 352107 URL: https://svnweb.freebsd.org/changeset/base/352107 Log: Reverse the referenced tables. If ipv4_prefer is specified, Section 10.3 is relevant. If ipv6_prefer is specified, Section 2.1 is relevant. This change makes the corresponding options/sections 'respective' PR: docs/234249 Submitted by: David Fiander Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 9 20:04:45 2019 (r352106) +++ head/share/man/man5/rc.conf.5 Mon Sep 9 20:48:12 2019 (r352107) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd September 9, 2019 .Dt RC.CONF 5 .Os .Sh NAME @@ -1779,10 +1779,10 @@ or .Dq Li ipv6_prefer is specified, .Xr ip6addrctl 8 -installs a pre-defined policy table described in Section 2.1 -.Pq IPv6-preferred -or 10.3 +installs a pre-defined policy table described in Section 10.3 .Pq IPv4-preferred +or 2.1 +.Pq IPv6-preferred of RFC 3484. .Pp If From owner-svn-src-all@freebsd.org Mon Sep 9 20:49:38 2019 Return-Path: Delivered-To: svn-src-all@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 7AAA3E0E90; Mon, 9 Sep 2019 20:49:38 +0000 (UTC) (envelope-from scottph@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 46S0dt2f35z4d8c; Mon, 9 Sep 2019 20:49:38 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3E5021B4E4; Mon, 9 Sep 2019 20:49:38 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89KncsN003634; Mon, 9 Sep 2019 20:49:38 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89Knb5L003633; Mon, 9 Sep 2019 20:49:37 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <201909092049.x89Knb5L003633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Mon, 9 Sep 2019 20:49:37 +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: r352108 - in stable/12/sys/dev: acpica nvdimm X-SVN-Group: stable-12 X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: in stable/12/sys/dev: acpica nvdimm X-SVN-Commit-Revision: 352108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 20:49:38 -0000 Author: scottph Date: Mon Sep 9 20:49:37 2019 New Revision: 352108 URL: https://svnweb.freebsd.org/changeset/base/352108 Log: MFC 348757,351225: acpi and nvdimm location_str updates 348757: nvdimm: Provide nvdimm location information Provide the acpi handle path as the location string for the nvdimm children of the nvdimm_root device. 351225: Don't set the string "unknown" as a device's location_str Return an empty string when the location is unknown instead of the string "unknown". This ensures that all location entries are of the form key=val. Approved by: scottl (mentor) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20644 Modified: stable/12/sys/dev/acpica/acpi.c stable/12/sys/dev/nvdimm/nvdimm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi.c ============================================================================== --- stable/12/sys/dev/acpica/acpi.c Mon Sep 9 20:48:12 2019 (r352107) +++ stable/12/sys/dev/acpica/acpi.c Mon Sep 9 20:49:37 2019 (r352108) @@ -869,7 +869,7 @@ acpi_child_location_str_method(device_t cbdev, device_ strlcat(buf, buf2, buflen); } } else { - snprintf(buf, buflen, "unknown"); + snprintf(buf, buflen, ""); } return (0); } Modified: stable/12/sys/dev/nvdimm/nvdimm.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm.c Mon Sep 9 20:48:12 2019 (r352107) +++ stable/12/sys/dev/nvdimm/nvdimm.c Mon Sep 9 20:49:37 2019 (r352108) @@ -560,6 +560,24 @@ nvdimm_root_write_ivar(device_t dev, device_t child, i return (0); } +static int +nvdimm_root_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + ACPI_HANDLE handle; + int res; + + handle = nvdimm_root_get_acpi_handle(child); + if (handle != NULL) + res = snprintf(buf, buflen, "handle=%s", acpi_name(handle)); + else + res = snprintf(buf, buflen, ""); + + if (res >= buflen) + return (EOVERFLOW); + return (0); +} + static device_method_t nvdimm_methods[] = { DEVMETHOD(device_probe, nvdimm_probe), DEVMETHOD(device_attach, nvdimm_attach), @@ -582,6 +600,7 @@ static device_method_t nvdimm_root_methods[] = { DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), + DEVMETHOD(bus_child_location_str, nvdimm_root_child_location_str), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Mon Sep 9 21:03:08 2019 Return-Path: Delivered-To: svn-src-all@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 F1A3FE1361; Mon, 9 Sep 2019 21:03:08 +0000 (UTC) (envelope-from scottph@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 46S0xS60xDz4dqZ; Mon, 9 Sep 2019 21:03:08 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B19C91B868; Mon, 9 Sep 2019 21:03:08 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89L38gT015278; Mon, 9 Sep 2019 21:03:08 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89L38h1015277; Mon, 9 Sep 2019 21:03:08 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <201909092103.x89L38h1015277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Mon, 9 Sep 2019 21:03: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: r352109 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 352109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 21:03:09 -0000 Author: scottph Date: Mon Sep 9 21:03:08 2019 New Revision: 352109 URL: https://svnweb.freebsd.org/changeset/base/352109 Log: MFC 351897: nvdimm(4): Add description of NVDIMM Namespace support Approved by: scottl (mentor) Sponsored by: Intel Corporation Modified: stable/12/share/man/man4/nvdimm.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvdimm.4 ============================================================================== --- stable/12/share/man/man4/nvdimm.4 Mon Sep 9 20:49:37 2019 (r352108) +++ stable/12/share/man/man4/nvdimm.4 Mon Sep 9 21:03:08 2019 (r352109) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2019 +.Dd September 5, 2019 .Dt NVDIMM 4 .Os .Sh NAME @@ -75,7 +75,7 @@ the device. .Pp Also, for each SPA, the geom provider .Pa spaNNN -is created, which can be used to create a conventional filesystem (e.g. +is created, which can be used to create a conventional filesystem (e.g., by .Xr newfs 8 ) and @@ -86,6 +86,18 @@ Content accessible by and .Pa /dev/spaNNN is coherent. +.Pp +The +.Nm +driver has support for reading NVDIMM namespaces (if supported by your +hardware and already configured by some other mechanism, e.g., a BIOS +configuration screen). +The driver will provide a +.Pa /dev/nvdimm_spaNNNnsMMM +device node and +.Pa spaNNNnsMMM +geom provider for each namespace in a SPA, which behave analogously to their +full-SPA cousins described above. .Sh SEE ALSO .Xr ACPI 4 , .Xr GEOM 4 , From owner-svn-src-all@freebsd.org Mon Sep 9 21:32:51 2019 Return-Path: Delivered-To: svn-src-all@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 90CB5E235D; Mon, 9 Sep 2019 21:32:51 +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 46S1bl437mz4h7C; Mon, 9 Sep 2019 21:32:51 +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 6E3591BDC8; Mon, 9 Sep 2019 21:32:51 +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 x89LWpNJ034313; Mon, 9 Sep 2019 21:32:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89LWhBH034270; Mon, 9 Sep 2019 21:32:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909092132.x89LWhBH034270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Sep 2019 21:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352110 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/sgx sys/amd64/vmm sys/arm/arm sys/arm/nvidia/drm2 sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/l... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/amd64/sgx sys/amd64/vmm sys/arm/arm sys/arm/nvidia/drm2 sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linuxkpi/common/include/li... X-SVN-Commit-Revision: 352110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 21:32:51 -0000 Author: markj Date: Mon Sep 9 21:32:42 2019 New Revision: 352110 URL: https://svnweb.freebsd.org/changeset/base/352110 Log: Change synchonization rules for vm_page reference counting. There are several mechanisms by which a vm_page reference is held, preventing the page from being freed back to the page allocator. In particular, holding the page's object lock is sufficient to prevent the page from being freed; holding the busy lock or a wiring is sufficent as well. These references are protected by the page lock, which must therefore be acquired for many per-page operations. This results in false sharing since the page locks are external to the vm_page structures themselves and each lock protects multiple structures. Transition to using an atomically updated per-page reference counter. The object's reference is counted using a flag bit in the counter. A second flag bit is used to atomically block new references via pmap_extract_and_hold() while removing managed mappings of a page. Thus, the reference count of a page is guaranteed not to increase if the page is unbusied, unmapped, and the object's write lock is held. As a consequence of this, the page lock no longer protects a page's identity; operations which move pages between objects are now synchronized solely by the objects' locks. The vm_page_wire() and vm_page_unwire() KPIs are changed. The former requires that either the object lock or the busy lock is held. The latter no longer has a return value and may free the page if it releases the last reference to that page. vm_page_unwire_noq() behaves the same as before; the caller is responsible for checking its return value and freeing or enqueuing the page as appropriate. vm_page_wire_mapped() is introduced for use in pmap_extract_and_hold(). It fails if the page is concurrently being unmapped, typically triggering a fallback to the fault handler. vm_page_wire() no longer requires the page lock and vm_page_unwire() now internally acquires the page lock when releasing the last wiring of a page (since the page lock still protects a page's queue state). In particular, synchronization details are no longer leaked into the caller. The change excises the page lock from several frequently executed code paths. In particular, vm_object_terminate() no longer bounces between page locks as it releases an object's pages, and direct I/O and sendfile(SF_NOCACHE) completions no longer require the page lock. In these latter cases we now get linear scalability in the common scenario where different threads are operating on different files. __FreeBSD_version is bumped. The DRM ports have been updated to accomodate the KPI changes. Reviewed by: jeff (earlier version) Tested by: gallatin (earlier version), pho Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20486 Modified: head/share/man/man9/Makefile head/share/man/man9/vm_page_wire.9 head/sys/amd64/amd64/efirt_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/sgx/sgx.c head/sys/amd64/vmm/vmm.c head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/pmap-v6.c head/sys/arm/nvidia/drm2/tegra_bo.c head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/arm64/pmap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/dev/drm2/ttm/ttm_page_alloc.c head/sys/dev/drm2/ttm/ttm_tt.c head/sys/dev/md/md.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/xen/gntdev/gntdev.c head/sys/dev/xen/privcmd/privcmd.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/i386/i386/pmap.c head/sys/kern/kern_exec.c head/sys/kern/kern_kcov.c head/sys/kern/kern_sendfile.c head/sys/kern/sys_process.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_shm.c head/sys/mips/mips/pmap.c head/sys/net/bpf_zerocopy.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sys/param.h head/sys/vm/device_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_swapout.c Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Sep 9 21:03:08 2019 (r352109) +++ head/share/man/man9/Makefile Mon Sep 9 21:32:42 2019 (r352110) @@ -2223,7 +2223,9 @@ MLINKS+=vm_map_lookup.9 vm_map_lookup_done.9 MLINKS+=vm_map_max.9 vm_map_min.9 \ vm_map_max.9 vm_map_pmap.9 MLINKS+=vm_map_stack.9 vm_map_growstack.9 -MLINKS+=vm_map_wire.9 vm_map_unwire.9 +MLINKS+=vm_map_wire.9 vm_map_wire_mapped.9 \ + vm_page_wire.9 vm_page_unwire.9 \ + vm_page_wire.9 vm_page_unwire_noq.9 MLINKS+=vm_page_bits.9 vm_page_clear_dirty.9 \ vm_page_bits.9 vm_page_dirty.9 \ vm_page_bits.9 vm_page_is_valid.9 \ Modified: head/share/man/man9/vm_page_wire.9 ============================================================================== --- head/share/man/man9/vm_page_wire.9 Mon Sep 9 21:03:08 2019 (r352109) +++ head/share/man/man9/vm_page_wire.9 Mon Sep 9 21:32:42 2019 (r352110) @@ -26,12 +26,13 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2001 +.Dd September 9, 2019 .Dt VM_PAGE_WIRE 9 .Os .Sh NAME .Nm vm_page_wire , -.Nm vm_page_unwire +.Nm vm_page_unwire , +.Nm vm_page_unwire_noq .Nd "wire and unwire pages" .Sh SYNOPSIS .In sys/param.h @@ -39,29 +40,44 @@ .In vm/vm_page.h .Ft void .Fn vm_page_wire "vm_page_t m" +.Ft bool +.Fn vm_page_wire_mapped "vm_page_t m" .Ft void -.Fn vm_page_unwire "vm_page_t m" "int activate" +.Fn vm_page_unwire "vm_page_t m" "int queue" +.Ft bool +.Fn vm_page_unwire_noq "vm_page_t m" .Sh DESCRIPTION The .Fn vm_page_wire -function increments the wire count on a page, and removes it from -whatever queue it is on. +and +.Fn vm_page_wire_mapped +function wire the page, prevent it from being reclaimed by the page +daemon or when its containing object is destroyed. +Both functions require that the page belong to an object. +The +.Fn vm_page_wire_mapped +function is for use by the +.Xr pmap 9 +layer following a lookup. +This function may fail if mappings of the page are concurrently +being destroyed, in which case it will return false. .Pp The .Fn vm_page_unwire -function releases one of the wirings on the page. -When -.Va write_count -reaches zero the page is placed back onto either the active queue -(if -.Fa activate -is non-zero) or onto the inactive queue (if -.Fa activate -is zero). -If the page is unmanaged -.Dv ( PG_UNMANAGED -is set) then the page is left on -.Dv PQ_NONE . +and +.Fn vm_page_unwire_noq +functions release a wiring of a page. +The +.Fn vm_page_unwire +function takes a queue index and will insert the page into the +corresponding page queue upon releasing its last wiring. +If the page does not belong to an object and no other references +to the page exist, +.Fn vm_page_unwire +will free the page. +.Fn vm_page_unwire_noq +releases the wiring and returns true if it was the last wiring +of the page. .Sh AUTHORS This manual page was written by .An Chad David Aq Mt davidc@acns.ab.ca . Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/amd64/amd64/efirt_machdep.c Mon Sep 9 21:32:42 2019 (r352110) @@ -74,7 +74,7 @@ efi_destroy_1t1_map(void) if (obj_1t1_pt != NULL) { VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) - m->wire_count = 0; + m->wire_count = VPRC_OBJREF; vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/amd64/amd64/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -3071,31 +3071,23 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ m = NULL; PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); + PMAP_LOCK(pmap); -retry: pdep = pmap_pde(pmap, va); if (pdep != NULL && (pde = *pdep)) { if (pde & PG_PS) { - if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { - if (vm_page_pa_tryrelock(pmap, (pde & - PG_PS_FRAME) | (va & PDRMASK), &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pa); - } + if ((pde & PG_RW) != 0 || (prot & VM_PROT_WRITE) == 0) + m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | + (va & PDRMASK)); } else { pte = *pmap_pde_to_pte(pdep, va); - if ((pte & PG_V) && - ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, - &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pa); - } + if ((pte & PG_V) != 0 && + ((pte & PG_RW) != 0 || (prot & VM_PROT_WRITE) == 0)) + m = PHYS_TO_VM_PAGE(pte & PG_FRAME); } - if (m != NULL) - vm_page_wire(m); + if (m != NULL && !vm_page_wire_mapped(m)) + m = NULL; } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/amd64/sgx/sgx.c ============================================================================== --- head/sys/amd64/sgx/sgx.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/amd64/sgx/sgx.c Mon Sep 9 21:32:42 2019 (r352110) @@ -357,9 +357,7 @@ sgx_page_remove(struct sgx_softc *sc, vm_page_t p) vm_paddr_t pa; uint64_t offs; - vm_page_lock(p); (void)vm_page_remove(p); - vm_page_unlock(p); dprintf("%s: p->pidx %ld\n", __func__, p->pindex); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/amd64/vmm/vmm.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1002,9 +1002,7 @@ vm_gpa_release(void *cookie) { vm_page_t m = cookie; - vm_page_lock(m); vm_page_unwire(m, PQ_ACTIVE); - vm_page_unlock(m); } int Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/arm/arm/pmap-v4.c Mon Sep 9 21:32:42 2019 (r352110) @@ -3415,14 +3415,14 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ struct l2_dtable *l2; pd_entry_t l1pd; pt_entry_t *ptep, pte; - vm_paddr_t pa, paddr; - vm_page_t m = NULL; + vm_paddr_t pa; + vm_page_t m; u_int l1idx; + l1idx = L1_IDX(va); - paddr = 0; + m = NULL; PMAP_LOCK(pmap); -retry: l1pd = pmap->pm_l1->l1_kva[l1idx]; if (l1pte_section_p(l1pd)) { /* @@ -3434,11 +3434,10 @@ retry: pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); else pa = (l1pd & L1_S_FRAME) | (va & L1_S_OFFSET); - if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) - goto retry; if (l1pd & L1_S_PROT_W || (prot & VM_PROT_WRITE) == 0) { m = PHYS_TO_VM_PAGE(pa); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } else { /* @@ -3466,15 +3465,12 @@ retry: pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) - goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } - PMAP_UNLOCK(pmap); - PA_UNLOCK_COND(paddr); return (m); } Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/arm/arm/pmap-v6.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1986,23 +1986,20 @@ pmap_extract(pmap_t pmap, vm_offset_t va) vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { - vm_paddr_t pa, lockpa; + vm_paddr_t pa; pt1_entry_t pte1; pt2_entry_t pte2, *pte2p; vm_page_t m; - lockpa = 0; m = NULL; PMAP_LOCK(pmap); -retry: pte1 = pte1_load(pmap_pte1(pmap, va)); if (pte1_is_section(pte1)) { if (!(pte1 & PTE1_RO) || !(prot & VM_PROT_WRITE)) { pa = pte1_pa(pte1) | (va & PTE1_OFFSET); - if (vm_page_pa_tryrelock(pmap, pa, &lockpa)) - goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } else if (pte1_is_link(pte1)) { pte2p = pmap_pte2(pmap, va); @@ -2011,13 +2008,11 @@ retry: if (pte2_is_valid(pte2) && (!(pte2 & PTE2_RO) || !(prot & VM_PROT_WRITE))) { pa = pte2_pa(pte2); - if (vm_page_pa_tryrelock(pmap, pa, &lockpa)) - goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } - PA_UNLOCK_COND(lockpa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/arm/nvidia/drm2/tegra_bo.c ============================================================================== --- head/sys/arm/nvidia/drm2/tegra_bo.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/arm/nvidia/drm2/tegra_bo.c Mon Sep 9 21:32:42 2019 (r352110) @@ -65,11 +65,9 @@ tegra_bo_destruct(struct tegra_bo *bo) for (i = 0; i < bo->npages; i++) { m = bo->m[i]; cdev_pager_free_page(bo->cdev_pager, m); - vm_page_lock(m); m->flags &= ~PG_FICTITIOUS; vm_page_unwire_noq(m); vm_page_free(m); - vm_page_unlock(m); } VM_OBJECT_WUNLOCK(bo->cdev_pager); Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/arm64/arm64/efirt_machdep.c Mon Sep 9 21:32:42 2019 (r352110) @@ -74,7 +74,7 @@ efi_destroy_1t1_map(void) if (obj_1t1_pt != NULL) { VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) - m->wire_count = 0; + m->wire_count = VPRC_OBJREF; vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/arm64/arm64/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1079,14 +1079,11 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ { pt_entry_t *pte, tpte; vm_offset_t off; - vm_paddr_t pa; vm_page_t m; int lvl; - pa = 0; m = NULL; PMAP_LOCK(pmap); -retry: pte = pmap_pte(pmap, va, &lvl); if (pte != NULL) { tpte = pmap_load(pte); @@ -1111,14 +1108,11 @@ retry: default: off = 0; } - if (vm_page_pa_tryrelock(pmap, - (tpte & ~ATTR_MASK) | off, &pa)) - goto retry; m = PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Sep 9 21:32:42 2019 (r352110) @@ -481,9 +481,7 @@ page_wire(vnode_t *vp, int64_t start) } ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); - vm_page_lock(pp); vm_page_wire(pp); - vm_page_unlock(pp); } else pp = NULL; break; @@ -495,9 +493,7 @@ static void page_unwire(vm_page_t pp) { - vm_page_lock(pp); vm_page_unwire(pp, PQ_ACTIVE); - vm_page_unlock(pp); } /* @@ -591,16 +587,16 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio) zfs_unmap_page(sf); zfs_vmobject_wlock(obj); vm_page_sunbusy(pp); - vm_page_lock(pp); if (error) { - if (!vm_page_wired(pp) && pp->valid == 0 && - !vm_page_busied(pp)) + if (!vm_page_busied(pp) && !vm_page_wired(pp) && + pp->valid == 0) vm_page_free(pp); } else { pp->valid = VM_PAGE_BITS_ALL; + vm_page_lock(pp); vm_page_activate(pp); + vm_page_unlock(pp); } - vm_page_unlock(pp); } else { ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); vm_page_sunbusy(pp); Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Sep 9 21:32:42 2019 (r352110) @@ -227,9 +227,7 @@ mark_page_accessed(struct vm_page *page) static inline void get_page(struct vm_page *page) { - vm_page_lock(page); vm_page_wire(page); - vm_page_unlock(page); } extern long @@ -250,10 +248,7 @@ get_user_pages_remote(struct task_struct *, struct mm_ static inline void put_page(struct vm_page *page) { - vm_page_lock(page); - if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL) - vm_page_free(page); - vm_page_unlock(page); + vm_page_unwire(page, PQ_ACTIVE); } #define copy_highpage(to, from) pmap_copy_page(from, to) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Sep 9 21:32:42 2019 (r352110) @@ -511,9 +511,7 @@ linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_ vm_page_replace_checked(page, vm_obj, (*mres)->pindex, *mres); - vm_page_lock(*mres); vm_page_free(*mres); - vm_page_unlock(*mres); *mres = page; } page->valid = VM_PAGE_BITS_ALL; Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 9 21:32:42 2019 (r352110) @@ -154,10 +154,8 @@ linux_free_pages(vm_page_t page, unsigned int order) for (x = 0; x != npages; x++) { vm_page_t pgo = page + x; - vm_page_lock(pgo); if (vm_page_unwire_noq(pgo)) vm_page_free(pgo); - vm_page_unlock(pgo); } } else { vm_offset_t vaddr; @@ -295,10 +293,8 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int if (vm_pager_has_page(obj, pindex, NULL, NULL)) { rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { - vm_page_lock(page); vm_page_unwire_noq(page); vm_page_free(page); - vm_page_unlock(page); VM_OBJECT_WUNLOCK(obj); return (ERR_PTR(-EINVAL)); } Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Sep 9 21:32:42 2019 (r352110) @@ -377,10 +377,7 @@ vchiq_platform_handle_timeout(VCHIQ_STATE_T *state) static void pagelist_page_free(vm_page_t pp) { - vm_page_lock(pp); - if (vm_page_unwire(pp, PQ_INACTIVE) && pp->object == NULL) - vm_page_free(pp); - vm_page_unlock(pp); + vm_page_unwire(pp, PQ_INACTIVE); } /* There is a potential problem with partial cache lines (pages?) Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/agp/agp.c Mon Sep 9 21:32:42 2019 (r352110) @@ -616,9 +616,7 @@ bad: m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k)); if (k >= i) vm_page_xunbusy(m); - vm_page_lock(m); vm_page_unwire(m, PQ_INACTIVE); - vm_page_unlock(m); } VM_OBJECT_WUNLOCK(mem->am_obj); @@ -653,9 +651,7 @@ agp_generic_unbind_memory(device_t dev, struct agp_mem VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); - vm_page_lock(m); vm_page_unwire(m, PQ_INACTIVE); - vm_page_unlock(m); } VM_OBJECT_WUNLOCK(mem->am_obj); @@ -1003,7 +999,7 @@ agp_bind_pages(device_t dev, vm_page_t *pages, vm_size mtx_lock(&sc->as_lock); for (i = 0; i < size; i += PAGE_SIZE) { m = pages[OFF_TO_IDX(i)]; - KASSERT(m->wire_count > 0, + KASSERT(vm_page_wired(m), ("agp_bind_pages: page %p hasn't been wired", m)); /* Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/agp/agp_i810.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1795,9 +1795,7 @@ agp_i810_free_memory(device_t dev, struct agp_memory * */ VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_lookup(mem->am_obj, 0); - vm_page_lock(m); vm_page_unwire(m, PQ_INACTIVE); - vm_page_unlock(m); VM_OBJECT_WUNLOCK(mem->am_obj); } else { contigfree(sc->argb_cursor, mem->am_size, M_AGP); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1910,7 +1910,6 @@ aiotx_free_pgs(struct mbuf *m) { struct mbuf_ext_pgs *ext_pgs; struct kaiocb *job; - struct mtx *mtx; vm_page_t pg; MBUF_EXT_PGS_ASSERT(m); @@ -1921,14 +1920,10 @@ aiotx_free_pgs(struct mbuf *m) m->m_len, jobtotid(job)); #endif - mtx = NULL; for (int i = 0; i < ext_pgs->npgs; i++) { pg = PHYS_TO_VM_PAGE(ext_pgs->pa[i]); - vm_page_change_lock(pg, &mtx); vm_page_unwire(pg, PQ_ACTIVE); } - if (mtx != NULL) - mtx_unlock(mtx); aiotx_free_job(job); } Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Mon Sep 9 21:32:42 2019 (r352110) @@ -114,9 +114,7 @@ free_pageset(struct tom_data *td, struct pageset *ps) for (i = 0; i < ps->npages; i++) { p = ps->pages[i]; - vm_page_lock(p); vm_page_unwire(p, PQ_INACTIVE); - vm_page_unlock(p); } mtx_lock(&ddp_orphan_pagesets_lock); TAILQ_INSERT_TAIL(&ddp_orphan_pagesets, ps, link); Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Mon Sep 9 21:32:42 2019 (r352110) @@ -114,9 +114,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_ooffset_t offse vm_object_pip_add(vm_obj, 1); if (*mres != NULL) { - vm_page_lock(*mres); (void)vm_page_remove(*mres); - vm_page_unlock(*mres); } retry: VM_OBJECT_WUNLOCK(vm_obj); @@ -261,9 +259,7 @@ reserve: vm_page_xbusy(m); if (*mres != NULL) { KASSERT(*mres != m, ("losing %p %p", *mres, m)); - vm_page_lock(*mres); vm_page_free(*mres); - vm_page_unlock(*mres); } *mres = m; Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Mon Sep 9 21:32:42 2019 (r352110) @@ -132,7 +132,7 @@ ttm_vm_page_free(vm_page_t m) { KASSERT(m->object == NULL, ("ttm page %p is owned", m)); - KASSERT(m->wire_count == 1, ("ttm lost wire %p", m)); + KASSERT(vm_page_wired(m), ("ttm lost wire %p", m)); KASSERT((m->flags & PG_FICTITIOUS) != 0, ("ttm lost fictitious %p", m)); KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m)); m->flags &= ~PG_FICTITIOUS; Modified: head/sys/dev/drm2/ttm/ttm_tt.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_tt.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/drm2/ttm/ttm_tt.c Mon Sep 9 21:32:42 2019 (r352110) @@ -294,9 +294,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) rv = vm_pager_get_pages(obj, &from_page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { - vm_page_lock(from_page); vm_page_free(from_page); - vm_page_unlock(from_page); ret = -EIO; goto err_ret; } Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/md/md.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1029,9 +1029,7 @@ md_swap_page_free(vm_page_t m) { vm_page_xunbusy(m); - vm_page_lock(m); vm_page_free(m); - vm_page_unlock(m); } static int Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1052,9 +1052,7 @@ netmap_dev_pager_fault(vm_object_t object, vm_ooffset_ VM_OBJECT_WUNLOCK(object); page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); - vm_page_lock(*mres); vm_page_free(*mres); - vm_page_unlock(*mres); *mres = page; vm_page_insert(page, object, pidx); } Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/xen/gntdev/gntdev.c Mon Sep 9 21:32:42 2019 (r352110) @@ -826,14 +826,12 @@ gntdev_gmap_pg_fault(vm_object_t object, vm_ooffset_t KASSERT((page->flags & PG_FICTITIOUS) != 0, ("not fictitious %p", page)); - KASSERT(page->wire_count == 1, ("wire_count not 1 %p", page)); - KASSERT(vm_page_busied(page) == 0, ("page %p is busy", page)); + KASSERT(vm_page_wired(page), ("page %p is not wired", page)); + KASSERT(!vm_page_busied(page), ("page %p is busy", page)); if (*mres != NULL) { oldm = *mres; - vm_page_lock(oldm); vm_page_free(oldm); - vm_page_unlock(oldm); *mres = NULL; } Modified: head/sys/dev/xen/privcmd/privcmd.c ============================================================================== --- head/sys/dev/xen/privcmd/privcmd.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/dev/xen/privcmd/privcmd.c Mon Sep 9 21:32:42 2019 (r352110) @@ -169,14 +169,12 @@ privcmd_pg_fault(vm_object_t object, vm_ooffset_t offs KASSERT((page->flags & PG_FICTITIOUS) != 0, ("not fictitious %p", page)); - KASSERT(page->wire_count == 1, ("wire_count not 1 %p", page)); - KASSERT(vm_page_busied(page) == 0, ("page %p is busy", page)); + KASSERT(vm_page_wired(page), ("page %p not wired", page)); + KASSERT(!vm_page_busied(page), ("page %p is busy", page)); if (*mres != NULL) { oldm = *mres; - vm_page_lock(oldm); vm_page_free(oldm); - vm_page_unlock(oldm); *mres = NULL; } Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1418,7 +1418,6 @@ retry: goto retry; rv = vm_pager_get_pages(uobj, &m, 1, NULL, NULL); - vm_page_lock(m); if (rv == VM_PAGER_OK) { /* * Since the page was not resident, @@ -1428,12 +1427,12 @@ retry: * current operation is not regarded * as an access. */ + vm_page_lock(m); vm_page_launder(m); vm_page_unlock(m); vm_page_xunbusy(m); } else { vm_page_free(m); - vm_page_unlock(m); if (ignerr) m = NULL; else { Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/i386/i386/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1690,35 +1690,24 @@ __CONCAT(PMTYPE, extract_and_hold)(pmap_t pmap, vm_off pd_entry_t pde; pt_entry_t pte; vm_page_t m; - vm_paddr_t pa; - pa = 0; m = NULL; PMAP_LOCK(pmap); -retry: pde = *pmap_pde(pmap, va); if (pde != 0) { if (pde & PG_PS) { - if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { - if (vm_page_pa_tryrelock(pmap, (pde & - PG_PS_FRAME) | (va & PDRMASK), &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pa); - } + if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) + m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | + (va & PDRMASK)); } else { pte = pmap_pte_ufast(pmap, va, pde); if (pte != 0 && - ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, - &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pa); - } + ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) + m = PHYS_TO_VM_PAGE(pte & PG_FRAME); } - if (m != NULL) - vm_page_wire(m); + if (m != NULL && !vm_page_wire_mapped(m)) + m = NULL; } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/kern_exec.c Mon Sep 9 21:32:42 2019 (r352110) @@ -981,10 +981,8 @@ exec_map_first_page(struct image_params *imgp) if (ma[0]->valid != VM_PAGE_BITS_ALL) { vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { - vm_page_lock(ma[0]); vm_page_unwire_noq(ma[0]); vm_page_free(ma[0]); - vm_page_unlock(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1008,13 +1006,9 @@ exec_map_first_page(struct image_params *imgp) initial_pagein = i; rv = vm_pager_get_pages(object, ma, initial_pagein, NULL, NULL); if (rv != VM_PAGER_OK) { - for (i = 0; i < initial_pagein; i++) { - vm_page_lock(ma[i]); - if (i == 0) - vm_page_unwire_noq(ma[i]); + vm_page_unwire_noq(ma[0]); + for (i = 0; i < initial_pagein; i++) vm_page_free(ma[i]); - vm_page_unlock(ma[i]); - } VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1039,9 +1033,7 @@ exec_unmap_first_page(struct image_params *imgp) m = sf_buf_page(imgp->firstpage); sf_buf_free(imgp->firstpage); imgp->firstpage = NULL; - vm_page_lock(m); vm_page_unwire(m, PQ_ACTIVE); - vm_page_unlock(m); } } Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/kern_kcov.c Mon Sep 9 21:32:42 2019 (r352110) @@ -408,10 +408,7 @@ kcov_free(struct kcov_info *info) VM_OBJECT_WLOCK(info->bufobj); m = vm_page_lookup(info->bufobj, 0); for (i = 0; i < info->bufsize / PAGE_SIZE; i++) { - vm_page_lock(m); vm_page_unwire_noq(m); - vm_page_unlock(m); - m = vm_page_next(m); } VM_OBJECT_WUNLOCK(info->bufobj); Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/kern_sendfile.c Mon Sep 9 21:32:42 2019 (r352110) @@ -415,11 +415,8 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, i &sendfile_iodone, sfio); if (rv != VM_PAGER_OK) { for (j = i; j < i + count; j++) { - if (pa[j] != bogus_page) { - vm_page_lock(pa[j]); + if (pa[j] != bogus_page) vm_page_unwire(pa[j], PQ_INACTIVE); - vm_page_unlock(pa[j]); - } } VM_OBJECT_WUNLOCK(obj); return (EIO); @@ -932,11 +929,8 @@ retry_space: m != NULL ? SFB_NOWAIT : SFB_CATCH); if (sf == NULL) { SFSTAT_INC(sf_allocfail); - for (int j = i; j < npages; j++) { - vm_page_lock(pa[j]); + for (int j = i; j < npages; j++) vm_page_unwire(pa[j], PQ_INACTIVE); - vm_page_unlock(pa[j]); - } if (m == NULL) softerr = ENOBUFS; fixspace(npages, i, off, &space); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/sys_process.c Mon Sep 9 21:32:42 2019 (r352110) @@ -312,10 +312,7 @@ proc_rwmem(struct proc *p, struct uio *uio) /* * Release the page. */ - vm_page_lock(m); - if (vm_page_unwire(m, PQ_ACTIVE) && m->object == NULL) - vm_page_free(m); - vm_page_unlock(m); + vm_page_unwire(m, PQ_ACTIVE); } while (error == 0 && uio->uio_resid > 0); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/uipc_mbuf.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1621,10 +1621,6 @@ mb_free_mext_pgs(struct mbuf *m) ext_pgs = m->m_ext.ext_pgs; for (int i = 0; i < ext_pgs->npgs; i++) { pg = PHYS_TO_VM_PAGE(ext_pgs->pa[i]); - /* - * Note: page is not locked, as it has no - * object and is not on any queues. - */ vm_page_unwire_noq(pg); vm_page_free(pg); } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/kern/uipc_shm.c Mon Sep 9 21:32:42 2019 (r352110) @@ -198,10 +198,8 @@ uiomove_object_page(vm_object_t obj, size_t len, struc printf( "uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n", obj, idx, m->valid, rv); - vm_page_lock(m); vm_page_unwire_noq(m); vm_page_free(m); - vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); return (EIO); } @@ -217,9 +215,7 @@ uiomove_object_page(vm_object_t obj, size_t len, struc vm_pager_page_unswapped(m); VM_OBJECT_WUNLOCK(obj); } - vm_page_lock(m); vm_page_unwire(m, PQ_ACTIVE); - vm_page_unlock(m); return (error); } @@ -474,7 +470,6 @@ retry: goto retry; rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - vm_page_lock(m); if (rv == VM_PAGER_OK) { /* * Since the page was not resident, @@ -485,11 +480,9 @@ retry: * as an access. */ vm_page_launder(m); - vm_page_unlock(m); vm_page_xunbusy(m); } else { vm_page_free(m); - vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); return (EIO); } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/mips/mips/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -796,26 +796,22 @@ vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { pt_entry_t pte, *ptep; - vm_paddr_t pa, pte_pa; + vm_paddr_t pa; vm_page_t m; m = NULL; - pa = 0; PMAP_LOCK(pmap); -retry: ptep = pmap_pte(pmap, va); if (ptep != NULL) { pte = *ptep; if (pte_test(&pte, PTE_V) && (!pte_test(&pte, PTE_RO) || (prot & VM_PROT_WRITE) == 0)) { - pte_pa = TLBLO_PTE_TO_PA(pte); - if (vm_page_pa_tryrelock(pmap, pte_pa, &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pte_pa); - vm_page_wire(m); + pa = TLBLO_PTE_TO_PA(pte); + m = PHYS_TO_VM_PAGE(pa); + if (!vm_page_wire_mapped(m)) + m = NULL; } } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/net/bpf_zerocopy.c Mon Sep 9 21:32:42 2019 (r352110) @@ -115,10 +115,7 @@ static void zbuf_page_free(vm_page_t pp) { - vm_page_lock(pp); - if (vm_page_unwire(pp, PQ_INACTIVE) && pp->object == NULL) - vm_page_free(pp); - vm_page_unlock(pp); + vm_page_unwire(pp, PQ_INACTIVE); } /* Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/powerpc/aim/mmu_oea.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1264,22 +1264,17 @@ moea_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_offse { struct pvo_entry *pvo; vm_page_t m; - vm_paddr_t pa; m = NULL; - pa = 0; PMAP_LOCK(pmap); -retry: pvo = moea_pvo_find_va(pmap, va & ~ADDR_POFF, NULL); if (pvo != NULL && (pvo->pvo_pte.pte.pte_hi & PTE_VALID) && ((pvo->pvo_pte.pte.pte_lo & PTE_PP) == PTE_RW || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, pvo->pvo_pte.pte.pte_lo & PTE_RPGN, &pa)) - goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pte.pte_lo & PTE_RPGN); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Sep 9 21:32:42 2019 (r352110) @@ -1578,21 +1578,15 @@ moea64_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_off { struct pvo_entry *pvo; vm_page_t m; - vm_paddr_t pa; m = NULL; - pa = 0; PMAP_LOCK(pmap); -retry: pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); if (pvo != NULL && (pvo->pvo_pte.prot & prot) == prot) { - if (vm_page_pa_tryrelock(pmap, - pvo->pvo_pte.pa & LPTE_RPGN, &pa)) - goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/powerpc/booke/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -2790,12 +2790,9 @@ mmu_booke_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_ pte_t *pte; vm_page_t m; uint32_t pte_wbit; - vm_paddr_t pa; - + m = NULL; - pa = 0; PMAP_LOCK(pmap); -retry: pte = pte_find(mmu, pmap, va); if ((pte != NULL) && PTE_ISVALID(pte)) { if (pmap == kernel_pmap) @@ -2803,15 +2800,12 @@ retry: else pte_wbit = PTE_UW; - if ((*pte & pte_wbit) || ((prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, PTE_PA(pte), &pa)) - goto retry; + if ((*pte & pte_wbit) != 0 || (prot & VM_PROT_WRITE) == 0) { m = PHYS_TO_VM_PAGE(PTE_PA(pte)); - vm_page_wire(m); + if (!vm_page_wire_mapped(m)) + m = NULL; } } - - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Sep 9 21:03:08 2019 (r352109) +++ head/sys/riscv/riscv/pmap.c Mon Sep 9 21:32:42 2019 (r352110) @@ -870,24 +870,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ { pt_entry_t *l3p, l3; vm_paddr_t phys; - vm_paddr_t pa; vm_page_t m; - pa = 0; m = NULL; PMAP_LOCK(pmap); -retry: l3p = pmap_l3(pmap, va); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Sep 9 22:08:22 2019 Return-Path: Delivered-To: svn-src-all@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 CA870E3156; Mon, 9 Sep 2019 22:08:22 +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 46S2Nk4xsGz4jm7; Mon, 9 Sep 2019 22:08:22 +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 8DFBB1C34B; Mon, 9 Sep 2019 22:08:22 +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 x89M8M6m052151; Mon, 9 Sep 2019 22:08:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89M8M60052150; Mon, 9 Sep 2019 22:08:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909092208.x89M8M60052150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Sep 2019 22:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352111 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 22:08:22 -0000 Author: mav Date: Mon Sep 9 22:08:22 2019 New Revision: 352111 URL: https://svnweb.freebsd.org/changeset/base/352111 Log: Initialize page/subpage in case of `modepage -d`. Previously without -m parameter it worked mostly by concodence. While there, make page/subpage values validation more strict. MFC after: 5 days Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Sep 9 21:32:42 2019 (r352110) +++ head/sbin/camcontrol/camcontrol.c Mon Sep 9 22:08:22 2019 (r352111) @@ -4549,7 +4549,7 @@ modepage(struct cam_device *device, int argc, char **a int task_attr, int retry_count, int timeout) { char *str_subpage; - int c, page = -1, subpage = -1, pc = 0, llbaa = 0; + int c, page = -1, subpage = 0, pc = 0, llbaa = 0; int binary = 0, cdb_len = 10, dbd = 0, desc = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { @@ -4575,11 +4575,9 @@ modepage(struct cam_device *device, int argc, char **a page = strtol(optarg, NULL, 0); if (str_subpage) subpage = strtol(str_subpage, NULL, 0); - else - subpage = 0; - if (page < 0) + if (page < 0 || page > 0x3f) errx(1, "invalid mode page %d", page); - if (subpage < 0) + if (subpage < 0 || subpage > 0xff) errx(1, "invalid mode subpage %d", subpage); break; case 'D': @@ -4598,7 +4596,10 @@ modepage(struct cam_device *device, int argc, char **a } } - if (page == -1 && desc == 0 && list == 0) + if (desc && page == -1) + page = SMS_ALL_PAGES_PAGE; + + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); if (dbd && desc) From owner-svn-src-all@freebsd.org Mon Sep 9 22:54:27 2019 Return-Path: Delivered-To: svn-src-all@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 F333FE431B; Mon, 9 Sep 2019 22:54:27 +0000 (UTC) (envelope-from cem@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 46S3Pv5fVxz4ltY; Mon, 9 Sep 2019 22:54:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A63461CC64; Mon, 9 Sep 2019 22:54:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89MsRZI081400; Mon, 9 Sep 2019 22:54:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89MsRaX081398; Mon, 9 Sep 2019 22:54:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909092254.x89MsRaX081398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 9 Sep 2019 22:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352112 - in head: share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/net X-SVN-Commit-Revision: 352112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 22:54:28 -0000 Author: cem Date: Mon Sep 9 22:54:27 2019 New Revision: 352112 URL: https://svnweb.freebsd.org/changeset/base/352112 Log: ddb(4): Add 'show route ' and 'show routetable []' These commands show the route resolved for a specified destination, or print out the entire routing table for a given address family (or all families, if none is explicitly provided). Discussed with: emaste Differential Revision: https://reviews.freebsd.org/D21510 Modified: head/share/man/man4/ddb.4 head/sys/net/rtsock.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon Sep 9 22:08:22 2019 (r352111) +++ head/share/man/man4/ddb.4 Mon Sep 9 22:54:27 2019 (r352112) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2018 +.Dd September 9, 2019 .Dt DDB 4 .Os .Sh NAME @@ -953,6 +953,20 @@ at address .Ar addr . Addresses of particular pointers can be gathered with "show allrman" command. +.\" +.Pp +.It Ic show Cm route Ar addr +Show route table result for destination +.Ar addr . +At this time, INET and INET6 formatted addresses are supported. +.\" +.Pp +.It Ic show Cm routetable Oo Ar af Oc +Show full route table or tables. +If +.Ar af +is specified, show only routes for the given numeric address family. +If no argument is specified, dump the route table for all address families. .\" .Pp .It Ic show Cm rtc Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Sep 9 22:08:22 2019 (r352111) +++ head/sys/net/rtsock.c Mon Sep 9 22:54:27 2019 (r352112) @@ -31,6 +31,7 @@ * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 * $FreeBSD$ */ +#include "opt_ddb.h" #include "opt_mpath.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -53,6 +54,11 @@ #include #include +#ifdef DDB +#include +#include +#endif + #include #include #include @@ -1995,3 +2001,404 @@ static struct domain routedomain = { }; VNET_DOMAIN_SET(route); + +#ifdef DDB +/* + * Unfortunately, RTF_ values are expressed as raw masks rather than powers of + * 2, so we cannot use them as nice C99 initializer indices below. + */ +static const char * const rtf_flag_strings[] = { + "UP", + "GATEWAY", + "HOST", + "REJECT", + "DYNAMIC", + "MODIFIED", + "DONE", + "UNUSED_0x80", + "UNUSED_0x100", + "XRESOLVE", + "LLDATA", + "STATIC", + "BLACKHOLE", + "UNUSED_0x2000", + "PROTO2", + "PROTO1", + "UNUSED_0x10000", + "UNUSED_0x20000", + "PROTO3", + "FIXEDMTU", + "PINNED", + "LOCAL", + "BROADCAST", + "MULTICAST", + /* Big gap. */ + [28] = "STICKY", + [30] = "RNH_LOCKED", + [31] = "GWFLAG_COMPAT", +}; + +static const char * __pure +rt_flag_name(unsigned idx) +{ + if (idx >= nitems(rtf_flag_strings)) + return ("INVALID_FLAG"); + if (rtf_flag_strings[idx] == NULL) + return ("UNKNOWN"); + return (rtf_flag_strings[idx]); +} + +static void +rt_dumpaddr_ddb(const char *name, const struct sockaddr *sa) +{ + char buf[INET6_ADDRSTRLEN], *res; + + res = NULL; + if (sa == NULL) + res = "NULL"; + else if (sa->sa_family == AF_INET) { + res = inet_ntop(AF_INET, + &((const struct sockaddr_in *)sa)->sin_addr, + buf, sizeof(buf)); + } else if (sa->sa_family == AF_INET6) { + res = inet_ntop(AF_INET6, + &((const struct sockaddr_in6 *)sa)->sin6_addr, + buf, sizeof(buf)); + } else if (sa->sa_family == AF_LINK) { + res = "on link"; + } + + if (res != NULL) { + db_printf("%s <%s> ", name, res); + return; + } + + db_printf("%s ", name, sa->sa_family); +} + +static int +rt_dumpentry_ddb(struct radix_node *rn, void *arg __unused) +{ + struct sockaddr_storage ss; + struct rtentry *rt; + int flags, idx; + + /* If RNTORT is important, put it in a header. */ + rt = (void *)rn; + + rt_dumpaddr_ddb("dst", rt_key(rt)); + rt_dumpaddr_ddb("gateway", rt->rt_gateway); + rt_dumpaddr_ddb("netmask", rtsock_fix_netmask(rt_key(rt), rt_mask(rt), + &ss)); + if (rt->rt_ifp != NULL && (rt->rt_ifp->if_flags & IFF_DYING) == 0) { + rt_dumpaddr_ddb("ifp", rt->rt_ifp->if_addr->ifa_addr); + rt_dumpaddr_ddb("ifa", rt->rt_ifa->ifa_addr); + } + + db_printf("flags "); + flags = rt->rt_flags; + if (flags == 0) + db_printf("none"); + + while ((idx = ffs(flags)) > 0) { + idx--; + + if (flags != rt->rt_flags) + db_printf(","); + db_printf(rt_flag_name(idx)); + + flags &= ~(1ul << idx); + } + + db_printf("\n"); + return (0); +} + +DB_SHOW_COMMAND(routetable, db_show_routetable_cmd) +{ + struct rib_head *rnh; + int error, i, lim; + + if (have_addr) + i = lim = addr; + else { + i = 1; + lim = AF_MAX; + } + + for (; i <= lim; i++) { + rnh = rt_tables_get_rnh(0, i); + if (rnh == NULL) { + if (have_addr) { + db_printf("%s: AF %d not supported?\n", + __func__, i); + break; + } + continue; + } + + if (!have_addr && i > 1) + db_printf("\n"); + + db_printf("Route table for AF %d%s%s%s:\n", i, + (i == AF_INET || i == AF_INET6) ? " (" : "", + (i == AF_INET) ? "INET" : (i == AF_INET6) ? "INET6" : "", + (i == AF_INET || i == AF_INET6) ? ")" : ""); + + error = rnh->rnh_walktree(&rnh->head, rt_dumpentry_ddb, NULL); + if (error != 0) + db_printf("%s: walktree(%d): %d\n", __func__, i, + error); + } +} + +_DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL) +{ + char buf[INET6_ADDRSTRLEN], *bp; + const void *dst_addrp; + struct sockaddr *dstp; + struct rtentry *rt; + union { + struct sockaddr_in dest_sin; + struct sockaddr_in6 dest_sin6; + } u; + uint16_t hextets[8]; + unsigned i, tets; + int t, af, exp, tokflags; + + /* + * Undecoded address family. No double-colon expansion seen yet. + */ + af = -1; + exp = -1; + /* Assume INET6 to start; we can work back if guess was wrong. */ + tokflags = DRT_WSPACE | DRT_HEX | DRT_HEXADECIMAL; + + /* + * db_command has lexed 'show route' for us. + */ + t = db_read_token_flags(tokflags); + if (t == tWSPACE) + t = db_read_token_flags(tokflags); + + /* + * tEOL: Just 'show route' isn't a valid mode. + * tMINUS: It's either '-h' or some invalid option. Regardless, usage. + */ + if (t == tEOL || t == tMINUS) + goto usage; + + db_unread_token(t); + + tets = nitems(hextets); + + /* + * Each loop iteration, we expect to read one octet (v4) or hextet + * (v6), followed by an appropriate field separator ('.' or ':' or + * '::'). + * + * At the start of each loop, we're looking for a number (octet or + * hextet). + * + * INET6 addresses have a special case where they may begin with '::'. + */ + for (i = 0; i < tets; i++) { + t = db_read_token_flags(tokflags); + + if (t == tCOLONCOLON) { + /* INET6 with leading '::' or invalid. */ + if (i != 0) { + db_printf("Parse error: unexpected extra " + "colons.\n"); + goto exit; + } + + af = AF_INET6; + exp = i; + hextets[i] = 0; + continue; + } else if (t == tNUMBER) { + /* + * Lexer separates out '-' as tMINUS, but make the + * assumption explicit here. + */ + MPASS(db_tok_number >= 0); + + if (af == AF_INET && db_tok_number > UINT8_MAX) { + db_printf("Not a valid v4 octet: %ld\n", + db_tok_number); + goto exit; + } + hextets[i] = db_tok_number; + } else if (t == tEOL) { + /* + * We can only detect the end of an IPv6 address in + * compact representation with EOL. + */ + if (af != AF_INET6 || exp < 0) { + db_printf("Parse failed. Got unexpected EOF " + "when the address is not a compact-" + "representation IPv6 address.\n"); + goto exit; + } + break; + } else { + db_printf("Parse failed. Unexpected token %d.\n", t); + goto exit; + } + + /* Next, look for a separator, if appropriate. */ + if (i == tets - 1) + continue; + + t = db_read_token_flags(tokflags); + if (af < 0) { + if (t == tCOLON) { + af = AF_INET6; + continue; + } + if (t == tCOLONCOLON) { + af = AF_INET6; + i++; + hextets[i] = 0; + exp = i; + continue; + } + if (t == tDOT) { + unsigned hn, dn; + + af = AF_INET; + /* Need to fixup the first parsed number. */ + if (hextets[0] > 0x255 || + (hextets[0] & 0xf0) > 0x90 || + (hextets[0] & 0xf) > 9) { + db_printf("Not a valid v4 octet: %x\n", + hextets[0]); + goto exit; + } + + hn = hextets[0]; + dn = (hn >> 8) * 100 + + ((hn >> 4) & 0xf) * 10 + + (hn & 0xf); + + hextets[0] = dn; + + /* Switch to decimal for remaining octets. */ + tokflags &= ~DRT_RADIX_MASK; + tokflags |= DRT_DECIMAL; + + tets = 4; + continue; + } + + db_printf("Parse error. Unexpected token %d.\n", t); + goto exit; + } else if (af == AF_INET) { + if (t == tDOT) + continue; + db_printf("Expected '.' (%d) between octets but got " + "(%d).\n", tDOT, t); + goto exit; + + } else if (af == AF_INET6) { + if (t == tCOLON) + continue; + if (t == tCOLONCOLON) { + if (exp < 0) { + i++; + hextets[i] = 0; + exp = i; + continue; + } + db_printf("Got bogus second '::' in v6 " + "address.\n"); + goto exit; + } + if (t == tEOL) { + /* + * Handle in the earlier part of the loop + * because we need to handle trailing :: too. + */ + db_unread_token(t); + continue; + } + + db_printf("Expected ':' (%d) or '::' (%d) between " + "hextets but got (%d).\n", tCOLON, tCOLONCOLON, t); + goto exit; + } + } + + /* Check for trailing garbage. */ + if (i == tets) { + t = db_read_token_flags(tokflags); + if (t != tEOL) { + db_printf("Got unexpected garbage after address " + "(%d).\n", t); + goto exit; + } + } + + /* + * Need to expand compact INET6 addresses. + * + * Technically '::' for a single ':0:' is MUST NOT but just in case, + * don't bother expanding that form (exp >= 0 && i == tets case). + */ + if (af == AF_INET6 && exp >= 0 && i < tets) { + if (exp + 1 < i) { + memmove(&hextets[exp + 1 + (nitems(hextets) - i)], + &hextets[exp + 1], + (i - (exp + 1)) * sizeof(hextets[0])); + } + memset(&hextets[exp + 1], 0, (nitems(hextets) - i) * + sizeof(hextets[0])); + } + + memset(&u, 0, sizeof(u)); + if (af == AF_INET) { + u.dest_sin.sin_family = AF_INET; + u.dest_sin.sin_len = sizeof(u.dest_sin); + u.dest_sin.sin_addr.s_addr = htonl( + ((uint32_t)hextets[0] << 24) | + ((uint32_t)hextets[1] << 16) | + ((uint32_t)hextets[2] << 8) | + (uint32_t)hextets[3]); + dstp = (void *)&u.dest_sin; + dst_addrp = &u.dest_sin.sin_addr; + } else if (af == AF_INET6) { + u.dest_sin6.sin6_family = AF_INET6; + u.dest_sin6.sin6_len = sizeof(u.dest_sin6); + for (i = 0; i < nitems(hextets); i++) + u.dest_sin6.sin6_addr.s6_addr16[i] = htons(hextets[i]); + dstp = (void *)&u.dest_sin6; + dst_addrp = &u.dest_sin6.sin6_addr; + } else + MPASS(false); + + bp = inet_ntop(af, dst_addrp, buf, sizeof(buf)); + if (bp != NULL) + db_printf("Looking up route to destination '%s'\n", bp); + + CURVNET_SET(vnet0); + rt = rtalloc1(dstp, 0, RTF_RNH_LOCKED); + CURVNET_RESTORE(); + + if (rt == NULL) { + db_printf("Could not get route for that server.\n"); + return; + } + + rt_dumpentry_ddb((void *)rt, NULL); + RTFREE_LOCKED(rt); + + return; +usage: + db_printf("Usage: 'show route
'\n" + " Currently accepts only dotted-decimal INET or colon-separated\n" + " hextet INET6 addresses.\n"); +exit: + db_skip_to_eol(); +} +#endif From owner-svn-src-all@freebsd.org Tue Sep 10 00:38:55 2019 Return-Path: Delivered-To: svn-src-all@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 421DCE65DC for ; Tue, 10 Sep 2019 00:38:55 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46S5kQ6WRwz4qfD; Tue, 10 Sep 2019 00:38:54 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x8A0calI042867 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2019 00:38:39 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x8A0cVQo024814 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 10 Sep 2019 07:38:31 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r351918 - head/sys/kern To: Warner Losh , Brooks Davis References: <201909060119.x861JWrG006910@repo.freebsd.org> <4917d7507b6ea6c360dccda261f53052aa085f2b.camel@freebsd.org> <5EE266EE-E650-48D8-9B0E-E674AD026470@freebsd.org> <3cb6429acc7e520932d2c906d1cac47540156355.camel@freebsd.org> <8F03EA29-0F3F-4321-9241-78F7C924FDE1@freebsd.org> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> <20190909115632.GB41333@spindle.one-eyed-alien.net> Cc: Philip Paeps , Ian Lepore , src-committers , svn-src-all , svn-src-head From: Eugene Grosbein Message-ID: <788f91ca-be0e-7307-71ca-d29475e386fb@grosbein.net> Date: Tue, 10 Sep 2019 07:38:25 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 46S5kQ6WRwz4qfD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.61)[ip: (-4.30), ipnet: 2a01:4f8::/29(-1.97), asn: 24940(-1.79), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 00:38:55 -0000 10.09.2019 2:49, Warner Losh wrote: > Would your needs be adequately covered by the current mechanisms to set HZ? > This just covers the defaults for the whole platform. > As always, these can be overridden in the boot loader or kernel config file... Several years ago I experimented with FreeBSD/MIPS32 using some real hardware that was both slow and had very small integrated flash, 8MB in total and 128KB for local configuration changes (template overrides). It used compressed root file system and standard /etc/rc.initdiskless script and its /conf/T/M/extract schema to extract local config overrides from the NVRAM very early at startup (called from /etc/rc), before /etc/rc.conf is read and before rcNG starts. Still, it's too late to change kern.hz currently. And that hardware used MIPS32 U-Boot and system had no /boot/loader at all. Maybe we could enable changing kern.hz for single user mode early at startup? From owner-svn-src-all@freebsd.org Tue Sep 10 01:39:58 2019 Return-Path: Delivered-To: svn-src-all@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 08B1EE8BD2; Tue, 10 Sep 2019 01:39:58 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bsdio.com (muon.bluestop.org [65.103.231.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46S74s5R9Kz4vJF; Tue, 10 Sep 2019 01:39:57 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bsdio.com (localhost [127.0.0.1]) by muon.bsdio.com (Postfix) with ESMTP id 8859C108580; Mon, 9 Sep 2019 19:40:02 -0600 (MDT) Received: from muon.bsdio.com ([127.0.0.1]) by muon.bsdio.com (muon.bsdio.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id T1A7zOxQ0qC7; Mon, 9 Sep 2019 19:40:02 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.120]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by muon.bsdio.com (Postfix) with ESMTPSA; Mon, 9 Sep 2019 19:40:01 -0600 (MDT) Subject: Re: svn commit: r352112 - in head: share/man/man4 sys/net To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909092254.x89MsRaX081398@repo.freebsd.org> From: Rebecca Cran Autocrypt: addr=bcran@freebsd.org; keydata= mQINBFrUMZ4BEADI1yUEGeZeXeTCPay1ZpTBdDEpGPAw1dq2VCSTc1VhsnrEBa1iZxAfaeSv Uu5Ti7jlhQ/3sQMl0bJMKGB/RtmIW7k8h2w476oZmG8gChk8su5ZEx/pV1gdqInyFmmJKTYc gabJz8pL+m82w07qPv+oalepZ4dbj+HF++RAK/iEju+q9UHlsjj8e3mMNsvtrOz1K6bnpveO jZ+ms/2H3Hs5a4k8y6buwe2RvwhJQaXa13cR3LhzL+nwj4B9PHZZEa2WpEyYpw/bI0V9YSQN QgC1CYRzDyakZge6BCM6wHOgZSUzRPufGilrNKUwIVbRoIBR9/85+0wR+PlFUOUOfOc6ox7T dWcIx6PuPhek48rh4uwmmwsPtPiH4Z3T5p+GmWQ9NLFZKA1YnEdaSkWtYZsDxwVZZeYG2plt MfhXP0Hj4rf9Y3eoUenCaGioxAbUOBCtXdTGNAhNjz1g5NGDBVyhjKkzwJQvt9UrYTseERit 5dX2CMTy8hYLvSXd/Ivy+HylUS5IslfZxW5z9LgWX7Z97kILgkH3N0ewtLkygkG+Y+x7uaAV dFqp9ASOyzaiwKbJdeOI+WxRSh+AqeCR0S+bpkcLudLmbjrPmaFwjKycy1H85Z5R2J3YHyXY oT6OYjD8vLbUU2GWp6Onkcy1Pu8EMbRuzKil6HnpYg3BexbPFwARAQABtCBSZWJlY2NhIENy YW4gPGJjcmFuQGZyZWVic2Qub3JnPokCVAQTAQgAPhYhBB+5fZtkTdO940Yr4g0CK1MRvhAg BQJa2B8pAhsjBQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEA0CK1MRvhAgAe0P /R65umdPBVFCYKPZ91HMqlZtn0EWOGwycWEK/feWI+jaYOa+8+VVxFau4gwnBmgCdf5XOAJW QugUlPte9T+dP9QXmgm8z3KMLCj2PATYlmqmQfvIleJPf8w7BFBw/kkd6ZxoEQXaEyZwWuJc vY58uFYizZ8s1gMjD7uV3eg2UuGYd4loBZ3MSanWrhE6mmxAjzcYYb0KTsaTH9ON4uctcTYG 4FN0KzRx5d4nAhnS/yaL+3OI23vUDt+XnOCx8tIOczScOEN5NFChgyvTxzwi7hTVNB7uUCha mN6vcjtrrzi03zHXooldE4gRJ5G+SzuH9yHKrrwYXUeKi8sG8uXVoWwzsLbCxHRe7T9Ow7Im 92Aep3DEIE9whG6Fg3hRQ4/d/9OVCGrV3XwRMEstCvamJQc69ZsULo1ssGmPvcLn8fNaLNeP ICCLQj4JLcYvKKfLIQ/Cm0Orsy8rJGhwF4W1mBUbTdR6pk2azEkrhE7KZDylgikpNNqshKV3 1nD/5SNrTDl0P8rTnu0OKT0IbozIsaz9FD2xMPHPUMPnVSTB96+PhgoBIQlHcys19gftotuN 1tlLs4Ny93xWLSjKWoW5l9E9LbIh+M8gD3A7JyyV9DRZkHdbOt3pGjpaozchDPCpRkcsFXp4 9zSbXtxnbAWfZwoSYQTvznmXpzHMzoLMWf/guQINBFrUMZ4BEADkc4mvMcMcDF1tdNxNQuIB E1F243oZamG3LACCKfc1Yur3CPzHwIk5LXCUmbq23iE5bowxMWw3mlVT0p5xM0WnUidIBwCK u4kRyy/fY4NyWWBuwy9srpTdmUcKRBRNB8zEZE8xIlidD1ijjgqLBfeM7n9ylawAxHLxwU96 sdpdHFzb7Z0yKY2e/bzDaHiG0fUvcCmkgLf+uwKKZid1j8zR5PzKpgPqfy/PF01eKyGV3MNu 8Y90xMoiEMWfCI2IB1m+hTuzZoboFvGV54SiMuvfWK/VMQjhsL6K2ddOqwVuy2nIMI4G3xDQ W/v8KVyn43OSIAyW1eaklhzu0Ir2sO60PXRkvbTUrouvmSvpJfIQS49rU0M/X6FSDgXQLKrZ 3my94+g8ptz9KoVml6s4OAwYVz+sb49nuSxipFKkU5FwhKOLmzbsBxCtytcUJoLmjuJPJPDQ ue6YJiIXyc86GVY2pH3DjemKdbB4dSgqAJIp+lCzKSJzz7bgueh2Ox8vzx1tSxKj7V8Nal+U TKKbkxPmMh+e20YZ4esAVifO3bS6IJP/aDnfagghB71vA7+aWGXPbjPlc2UHpCBiRSsl+Igo QXvdvZBsKRyfBx8neODa2C6JIE5vcaCjilSeKF8SzsFXvimnndhQNhAPU/DwQwSXdCl4gTsF Vi5d8Oxq1sce+wARAQABiQI8BBgBCAAmFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAlrUMZ4C GwwFCQlmAYAACgkQDQIrUxG+ECAWnRAAsmZX+KgNxW3v7R/76Tz4Wjmh4AGeE+Ji3p5QsdTY ny1B6vYBL9vCzPJ/AK8pgKMDRaweUP5eZQpfrdWC8Q7SNGgi4Q+97KEs+i2xZLQ+WJb8a+WE EIc716u0y4ITiHfOgM5jWcFO4MXQATbJgv0drLLesa+LQCvZgPBqupt307EsCubQs+Sxt+RV jf6rOUolp1GJXEQYwGsKklVd6yqLC8M1BSG53/WE5tSv5GzBZ8fp6EtmjT7leuidFtEvKYHQ z4DqG9ELpHUF0X0UUCBK/MgXe3kCVLKE060UrJ4M6uPSx57rmVFA2MvwQR8M7GsWC5UsSM4P YwPWBhwxE7vcx0691YKAHT/5q8LxRVBdUyzPSprMhSQFttsBt+ygm6wRi3Pi3TuCEARNubPk QefyeC34yr40SAUCkOl3eWxSXPF4NfXFQb4AAzZSE5hv3qbDuwo3lrL0LqpIpEQPAz+JZ1QZ 6mMFQ5/JD9Gukj54kZc0X8w3sQt0a8vyE/qrJg8vKgv2rCHrPc5MeDkEUEFiiJiCEDdkJtMy oRlU3S4NrnbyLOLEcHE8fGe3hStPX8hY62id2ecdQ5WZ7vLZW5SFeLarbUciuHIkVL6MHnUj bV7XlY50N7ebeFCIdlCWhdum2FJs/Ni+SSxbZC564vrokwlBBGSo6WTPQTa8IWx1DtU= Message-ID: Date: Mon, 9 Sep 2019 19:39:50 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201909092254.x89MsRaX081398@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PPMcIKryI2z5mDsojUt5AJ7li27NvvTWF" X-Rspamd-Queue-Id: 46S74s5R9Kz4vJF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 01:39:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PPMcIKryI2z5mDsojUt5AJ7li27NvvTWF Content-Type: multipart/mixed; boundary="JqG3mVWdLCdGA3RereGazQqDe44LiwmMB"; protected-headers="v1" From: Rebecca Cran To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r352112 - in head: share/man/man4 sys/net References: <201909092254.x89MsRaX081398@repo.freebsd.org> In-Reply-To: <201909092254.x89MsRaX081398@repo.freebsd.org> --JqG3mVWdLCdGA3RereGazQqDe44LiwmMB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Content-Language: en-US T24gMjAxOS0wOS0wOSAxNjo1NCwgQ29ucmFkIE1leWVyIHdyb3RlOgo+IEF1dGhvcjogY2Vt Cj4gICBoZWFkL3NoYXJlL21hbi9tYW40L2RkYi40Cj4gICBoZWFkL3N5cy9uZXQvcnRzb2Nr LmMKCkknbSBzZWVpbmcgdGhlIGZvbGxvd2luZyBlcnJvcnMgd2hlbiBidWlsZGluZzoKCgot LS0gcnRzb2NrLm8gLS0tCnBvaW50ZXItc2lnbiAtV25vLWVycm9yLXNoaWZ0LW5lZ2F0aXZl LXZhbHVlCi1Xbm8tYWRkcmVzcy1vZi1wYWNrZWQtbWVtYmVyIC1Xbm8tZm9ybWF0LXplcm8t bGVuZ3RowqAgLW1uby1hZXMKLW1uby1hdnjCoCAtc3RkPWlzbzk4OTk6MTk5OSAtV2Vycm9y wqAgL3Vzci9zcmMvc3lzL25ldC9ydHNvY2suYwovdXNyL3NyYy9zeXMvbmV0L3J0c29jay5j OjIxMDg6MTM6IGVycm9yOiBmb3JtYXQgc3RyaW5nIGlzIG5vdCBhIHN0cmluZwpsaXRlcmFs IChwb3RlbnRpYWxseSBpbnNlY3VyZSkgWy1XZXJyb3IsLVdmb3JtYXQtc2VjdXJpdHldCsKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBkYl9wcmludGYocnRfZmxhZ19uYW1lKGlk eCkpOwrCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oCBefn5+fn5+fn5+fn5+fn5+fgovdXNyL3NyYy9zeXMvbmV0L3J0c29jay5jOjIxMDg6MTM6 IG5vdGU6IHRyZWF0IHRoZSBzdHJpbmcgYXMgYW4gYXJndW1lbnQKdG8gYXZvaWQgdGhpcwrC oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgZGJfcHJpbnRmKHJ0X2ZsYWdfbmFtZShp ZHgpKTsKwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqAgXgrCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oCAiJXMiLAovdXNyL3NyYy9zeXMvbmV0L3J0c29jay5jOjIzNzA6MTM6IGVycm9yOiB2YXJp YWJsZSAnZHN0cCcgaXMgdXNlZAp1bmluaXRpYWxpemVkIHdoZW5ldmVyICdpZicgY29uZGl0 aW9uIGlzIGZhbHNlClstV2Vycm9yLC1Xc29tZXRpbWVzLXVuaW5pdGlhbGl6ZWRdCsKgwqDC oMKgwqDCoMKgIH0gZWxzZSBpZiAoYWYgPT0gQUZfSU5FVDYpIHsKwqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgIF5+fn5+fn5+fn5+fn5+Ci91c3Ivc3JjL3N5cy9uZXQv cnRzb2NrLmM6MjM4NToxNjogbm90ZTogdW5pbml0aWFsaXplZCB1c2Ugb2NjdXJzIGhlcmUK wqDCoMKgwqDCoMKgwqAgcnQgPSBydGFsbG9jMShkc3RwLCAwLCBSVEZfUk5IX0xPQ0tFRCk7 CsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBefn5+CgotLSAK ClJlYmVjY2EgQ3JhbgoK --JqG3mVWdLCdGA3RereGazQqDe44LiwmMB-- --PPMcIKryI2z5mDsojUt5AJ7li27NvvTWF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAl12/uoACgkQDQIrUxG+ ECB3HA//UrWrr+KZo2Z9cORVByPYnoDenB8iROBcerUq+l96UCc0of9vwboeoP6O oEs89b9uWx/8rKoLPliRJPd/hiYV3xWqJm5IffBBPRYHWgLBXUyXAndmA3JxshhX tFUCX1cBKTqHoTZE3B9cpLJZ70UMrUwZC3CAbRWJHzuhKoT/Uwj7AhfWon/l6dzW LeJK3xtrWXIRsFm3ckbjUfizyZzUeqNlQ2w1o5gO+uRhwwQsV/pQ/l+KgQnPCMat fLbJVLFlKFlSuzPbW5R6XKl7ISceWO78Xr5uoVzqSRSI9y66vZvWHioYlIEQIxvO WL3NS2FfgG8mVgOHpIU5GbVBwfVPqKU+TdJ+tTPKzCZWL0/3OwP2fmCm5WedjasA UwdB1DS7aj0/grSrcsKVYAhsfxKgrqeNCFZ/V7W7khgMfF8rdNzG5efltZ53nBve vc2HYEsg6UJ0aKU22dwC/KFYGPBV9mVytLMii/g3GUtWDDC3+F9BxnbaYXyDiOS/ 8GWbI3Wh2ECk/Zkk1u60ud/FcA8vhGzgSYEXdHmGR+i3V6dbOqwkV+seTY959BJz RWgjKJx2+YkggViDK7YQAaV+yt3F7YZflhz5a+1LDk/Q/pb2Jtl0C/W+9ReiPwNR NIt3E0Y9ruI3toLnfmFeYeHMvNXiLlwm8Ow+XQDVa0qR7JFshpk= =SdYg -----END PGP SIGNATURE----- --PPMcIKryI2z5mDsojUt5AJ7li27NvvTWF-- From owner-svn-src-all@freebsd.org Tue Sep 10 01:56:47 2019 Return-Path: Delivered-To: svn-src-all@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 AB7B9E9ABA; Tue, 10 Sep 2019 01:56:47 +0000 (UTC) (envelope-from cem@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 46S7SH45J9z3CRG; Tue, 10 Sep 2019 01:56:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 711AD1ED99; Tue, 10 Sep 2019 01:56:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A1ul7F087904; Tue, 10 Sep 2019 01:56:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A1ulJx087903; Tue, 10 Sep 2019 01:56:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909100156.x8A1ulJx087903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 10 Sep 2019 01:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352113 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 352113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 01:56:47 -0000 Author: cem Date: Tue Sep 10 01:56:47 2019 New Revision: 352113 URL: https://svnweb.freebsd.org/changeset/base/352113 Log: Appease Clang false-positive Werrors in r352112 Reported by: bcran Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Sep 9 22:54:27 2019 (r352112) +++ head/sys/net/rtsock.c Tue Sep 10 01:56:47 2019 (r352113) @@ -2105,7 +2105,7 @@ rt_dumpentry_ddb(struct radix_node *rn, void *arg __un if (flags != rt->rt_flags) db_printf(","); - db_printf(rt_flag_name(idx)); + db_printf("%s", rt_flag_name(idx)); flags &= ~(1ul << idx); } @@ -2374,8 +2374,12 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl u.dest_sin6.sin6_addr.s6_addr16[i] = htons(hextets[i]); dstp = (void *)&u.dest_sin6; dst_addrp = &u.dest_sin6.sin6_addr; - } else + } else { MPASS(false); + /* UNREACHABLE */ + /* Appease Clang false positive: */ + dstp = NULL; + } bp = inet_ntop(af, dst_addrp, buf, sizeof(buf)); if (bp != NULL) From owner-svn-src-all@freebsd.org Tue Sep 10 02:21:18 2019 Return-Path: Delivered-To: svn-src-all@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 D4983EAD5C; Tue, 10 Sep 2019 02:21:18 +0000 (UTC) (envelope-from johalun@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 46S80Z51sLz3Dyj; Tue, 10 Sep 2019 02:21:18 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8FCD01F1AD; Tue, 10 Sep 2019 02:21:18 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A2LI9f000740; Tue, 10 Sep 2019 02:21:18 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A2LHD4000737; Tue, 10 Sep 2019 02:21:17 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201909100221.x8A2LHD4000737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 10 Sep 2019 02:21: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: r352114 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 352114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 02:21:18 -0000 Author: johalun Date: Tue Sep 10 02:21:17 2019 New Revision: 352114 URL: https://svnweb.freebsd.org/changeset/base/352114 Log: MFC r351937: LinuxKPI: Improve sysfs support. - Add functions for creating and merging sysfs groups. - Add sysfs_streq function to compare strings ignoring newline from the sysctl userland call. - Add a call to sysfs_create_groups in device_add. - Remove duplicate header include. - Bump __FreeBSD_version. Reviewed by: hselasky Approved by: imp (mentor), hselasky Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/device.h Tue Sep 10 01:56:47 2019 (r352113) +++ stable/12/sys/compat/linuxkpi/common/include/linux/device.h Tue Sep 10 02:21:17 2019 (r352114) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -316,6 +315,10 @@ device_add(struct device *dev) dev->devt = makedev(0, device_get_unit(dev->bsddev)); } kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); + + if (dev->groups) + return (sysfs_create_groups(&dev->kobj, dev->groups)); + return (0); } Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Tue Sep 10 01:56:47 2019 (r352113) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Tue Sep 10 02:21:17 2019 (r352114) @@ -175,6 +175,27 @@ sysfs_remove_files(struct kobject *kobj, const struct sysfs_remove_file(kobj, attrs[i]); } +static inline int +sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) +{ + struct attribute **attr; + struct sysctl_oid *oidp; + + /* Don't create the group node if grp->name is undefined. */ + if (grp->name) + oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp), + OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name); + else + oidp = kobj->oidp; + for (attr = grp->attrs; *attr != NULL; attr++) { + SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, + (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, + kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", ""); + } + + return (0); +} + static inline void sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp) { @@ -184,20 +205,40 @@ sysfs_remove_group(struct kobject *kobj, const struct } static inline int -sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) +sysfs_create_groups(struct kobject *kobj, const struct attribute_group **grps) { + int error = 0; + int i; + + for (i = 0; grps[i] && !error; i++) + error = sysfs_create_group(kobj, grps[i]); + while (error && --i >= 0) + sysfs_remove_group(kobj, grps[i]); + + return (error); +} + +static inline int +sysfs_merge_group(struct kobject *kobj, const struct attribute_group *grp) +{ + + /* Really expected behavior is to return failure if group exists. */ + return (sysfs_create_group(kobj, grp)); +} + +static inline void +sysfs_unmerge_group(struct kobject *kobj, const struct attribute_group *grp) +{ struct attribute **attr; struct sysctl_oid *oidp; - oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp), - OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name); - for (attr = grp->attrs; *attr != NULL; attr++) { - SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, - (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, - kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", ""); + SLIST_FOREACH(oidp, SYSCTL_CHILDREN(kobj->oidp), oid_link) { + if (strcmp(oidp->oid_name, grp->name) != 0) + continue; + for (attr = grp->attrs; *attr != NULL; attr++) { + sysctl_remove_name(oidp, (*attr)->name, 1, 1); + } } - - return (0); } static inline int @@ -222,6 +263,22 @@ sysfs_remove_dir(struct kobject *kobj) if (kobj->oidp == NULL) return; sysctl_remove_oid(kobj->oidp, 1, 1); +} + +static inline bool +sysfs_streq(const char *s1, const char *s2) +{ + int l1, l2; + + l1 = strlen(s1); + l2 = strlen(s2); + + if (l1 != 0 && s1[l1-1] == '\n') + l1--; + if (l2 != 0 && s2[l2-1] == '\n') + l2--; + + return (l1 == l2 && strncmp(s1, s2, l1) == 0); } #define sysfs_attr_init(attr) do {} while(0) Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue Sep 10 01:56:47 2019 (r352113) +++ stable/12/sys/sys/param.h Tue Sep 10 02:21:17 2019 (r352114) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200517 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200518 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Sep 10 04:01:41 2019 Return-Path: Delivered-To: svn-src-all@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 D5082EEF70; Tue, 10 Sep 2019 04:01:41 +0000 (UTC) (envelope-from glebius@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 46SBDP5N56z3Lly; Tue, 10 Sep 2019 04:01:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D1732052A; Tue, 10 Sep 2019 04:01:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A41fef063067; Tue, 10 Sep 2019 04:01:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A41f3N063065; Tue, 10 Sep 2019 04:01:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909100401.x8A41f3N063065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 10 Sep 2019 04:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352115 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 352115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 04:01:41 -0000 Author: glebius Date: Tue Sep 10 04:01:41 2019 New Revision: 352115 URL: https://svnweb.freebsd.org/changeset/base/352115 Log: Remove pointless playing with LC_TIME, which should have been done in r205821. Modified: head/usr.bin/calendar/day.c Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Tue Sep 10 02:21:17 2019 (r352114) +++ head/usr.bin/calendar/day.c Tue Sep 10 04:01:41 2019 (r352115) @@ -50,7 +50,6 @@ int year1, year2; void settimes(time_t now, int before, int after, int friday, struct tm *tp1, struct tm *tp2) { - char *oldl, *lbufp; struct tm tp; localtime_r(&now, &tp); @@ -67,15 +66,6 @@ settimes(time_t now, int before, int after, int friday year2 = 1900 + tp2->tm_year; strftime(dayname, sizeof(dayname) - 1, "%A, %d %B %Y", tp1); - - oldl = NULL; - lbufp = setlocale(LC_TIME, NULL); - if (lbufp != NULL && (oldl = strdup(lbufp)) == NULL) - errx(1, "cannot allocate memory"); - (void)setlocale(LC_TIME, "C"); - (void)setlocale(LC_TIME, (oldl != NULL ? oldl : "")); - if (oldl != NULL) - free(oldl); setnnames(); } From owner-svn-src-all@freebsd.org Tue Sep 10 04:21:50 2019 Return-Path: Delivered-To: svn-src-all@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 3A218EFB25; Tue, 10 Sep 2019 04:21:50 +0000 (UTC) (envelope-from glebius@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 46SBgf0mT1z3MhM; Tue, 10 Sep 2019 04:21:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8EC920A07; Tue, 10 Sep 2019 04:21:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A4Lnos074512; Tue, 10 Sep 2019 04:21:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A4LnQv074510; Tue, 10 Sep 2019 04:21:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909100421.x8A4LnQv074510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 10 Sep 2019 04:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352116 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 352116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 04:21:50 -0000 Author: glebius Date: Tue Sep 10 04:21:48 2019 New Revision: 352116 URL: https://svnweb.freebsd.org/changeset/base/352116 Log: Fix 'calendar -a' in several ways. o Do not run any iconv() processing in -a. The locale of root user is not what is desired by most of the users who receive their calendar mail. Just assume that users store their calendars in a format that is readable to them. This fixes regression from r344340. o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG set inside a calendar file mostly excessive, as we will pick up user's login class LANG. o This also executes complex function cal() that parses user owned files with appropriate user privileges. Previously it was run with privileges dropped only temporary for execution of cal(), and fully dropped only before invoking sendmail (see r22473). Reviewed by: bapt (older version of patch) Modified: head/usr.bin/calendar/Makefile head/usr.bin/calendar/calendar.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Tue Sep 10 04:01:41 2019 (r352115) +++ head/usr.bin/calendar/Makefile Tue Sep 10 04:21:48 2019 (r352116) @@ -6,7 +6,7 @@ PROG= calendar SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \ ostern.c paskha.c pom.c sunpos.c -LIBADD= m +LIBADD= m util INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_FR.ISO8859-1 \ hr_HR.ISO8859-2 hu_HU.ISO8859-2 pt_BR.ISO8859-1 \ pt_BR.UTF-8 ru_RU.KOI8-R ru_RU.UTF-8 uk_UA.KOI8-U Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Tue Sep 10 04:01:41 2019 (r352115) +++ head/usr.bin/calendar/calendar.c Tue Sep 10 04:21:48 2019 (r352116) @@ -44,9 +44,11 @@ static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) #include __FBSDID("$FreeBSD$"); +#include #include #include #include +#include #include #include #include @@ -68,7 +70,7 @@ static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; #ifdef WITH_ICONV -const char *outputEncoding; +const char *outputEncoding = NULL; #endif static void usage(void) __dead2; @@ -84,12 +86,6 @@ main(int argc, char *argv[]) struct tm tp1, tp2; (void)setlocale(LC_ALL, ""); -#ifdef WITH_ICONV - /* save the information about the encoding used in the terminal */ - outputEncoding = strdup(nl_langinfo(CODESET)); - if (outputEncoding == NULL) - errx(1, "cannot allocate memory"); -#endif while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1) switch (ch) { @@ -218,15 +214,33 @@ main(int argc, char *argv[]) if (doall) while ((pw = getpwent()) != NULL) { - (void)setegid(pw->pw_gid); - (void)initgroups(pw->pw_name, pw->pw_gid); - (void)seteuid(pw->pw_uid); - if (!chdir(pw->pw_dir)) + pid_t pid; + + if (chdir(pw->pw_dir) == -1) + continue; + pid = fork(); + if (pid < 0) + err(1, "fork"); + if (pid == 0) { + login_cap_t *lc; + + lc = login_getpwclass(pw); + if (setusercontext(lc, pw, pw->pw_uid, + LOGIN_SETALL) != 0) + errx(1, "setusercontext"); cal(); - (void)seteuid(0); + exit(0); + } } - else + else { +#ifdef WITH_ICONV + /* Save the information about the encoding used in the terminal. */ + outputEncoding = strdup(nl_langinfo(CODESET)); + if (outputEncoding == NULL) + errx(1, "cannot allocate memory"); +#endif cal(); + } exit(0); } Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Tue Sep 10 04:01:41 2019 (r352115) +++ head/usr.bin/calendar/io.c Tue Sep 10 04:21:48 2019 (r352116) @@ -290,16 +290,24 @@ cal_parse(FILE *in, FILE *out) if (buf[0] == '\0') continue; - /* Parse special definitions: LANG, Easter, Paskha etc */ + /* + * Setting LANG in user's calendar was an old workaround + * for 'calendar -a' being run with C locale to properly + * print user's calendars in their native languages. + * Now that 'calendar -a' does fork with setusercontext(), + * and does not run iconv(), this variable has little use. + */ if (strncmp(buf, "LANG=", 5) == 0) { (void)setlocale(LC_ALL, buf + 5); d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); #ifdef WITH_ICONV - set_new_encoding(); + if (!doall) + set_new_encoding(); #endif setnnames(); continue; } + /* Parse special definitions: Easter, Paskha etc */ REPLACE("Easter=", 7, neaster); REPLACE("Paskha=", 7, npaskha); REPLACE("ChineseNewYear=", 15, ncny); @@ -445,7 +453,6 @@ opencalout(void) void closecal(FILE *fp) { - uid_t uid; struct stat sbuf; int nread, pdes[2], status; char buf[1024]; @@ -470,19 +477,6 @@ closecal(FILE *fp) (void)close(pdes[0]); } (void)close(pdes[1]); - uid = geteuid(); - if (setuid(getuid()) < 0) { - warnx("setuid failed"); - _exit(1); - } - if (setgid(getegid()) < 0) { - warnx("setgid failed"); - _exit(1); - } - if (setuid(uid) < 0) { - warnx("setuid failed"); - _exit(1); - } execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F", "\"Reminder Service\"", (char *)NULL); warn(_PATH_SENDMAIL); From owner-svn-src-all@freebsd.org Tue Sep 10 06:45:46 2019 Return-Path: Delivered-To: svn-src-all@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 D20B1F350E; Tue, 10 Sep 2019 06:45:46 +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 46SFsk56cjz40mn; Tue, 10 Sep 2019 06:45:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F2DB2237E; Tue, 10 Sep 2019 06:45:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A6jklL060875; Tue, 10 Sep 2019 06:45:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A6jilL060867; Tue, 10 Sep 2019 06:45:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909100645.x8A6jilL060867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Sep 2019 06:45:44 +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: r352117 - in stable/12: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 352117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 06:45:46 -0000 Author: kib Date: Tue Sep 10 06:45:44 2019 New Revision: 352117 URL: https://svnweb.freebsd.org/changeset/base/352117 Log: MFC r351773: Add procctl(PROC_STACKGAP_CTL). PR: 239894 Modified: stable/12/lib/libc/sys/procctl.2 stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/kern/kern_exec.c stable/12/sys/kern/kern_fork.c stable/12/sys/kern/kern_procctl.c stable/12/sys/sys/proc.h stable/12/sys/sys/procctl.h stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/procctl.2 ============================================================================== --- stable/12/lib/libc/sys/procctl.2 Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/lib/libc/sys/procctl.2 Tue Sep 10 06:45:44 2019 (r352117) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2019 +.Dd August 31, 2019 .Dt PROCCTL 2 .Os .Sh NAME @@ -462,6 +462,67 @@ must point to a memory location that can hold a value .Vt int . If signal delivery has not been requested, it will contain zero on return. +.It Dv PROC_STACKGAP_CTL +Controls the stack gaps in the specified process. +A stack gap is the part of the growth area for a +.Dv MAP_STACK +mapped region that is reserved and never filled by memory. +Instead, the process is guaranteed to receive a +.Dv SIGSEGV +signal on accessing pages in the gap. +Gaps protect against stack overflow corrupting memory adjacent +to the stack. +.Pp +The +.Fa data +argument must point to an integer variable containing flags. +The following flags are allowed: +.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC +.It Dv PROC_STACKGAP_ENABLE +This flag is only accepted for consistency with +.Dv PROC_STACKGAP_STATUS . +If stack gaps are enabled, the flag is ignored. +If disabled, the flag causes an +.Ev EINVAL +error to be returned. +After gaps are disabled in a process, they can only be re-enabled when an +.Xr execve 2 +is performed. +.It Dv PROC_STACKGAP_DISABLE +Disable stack gaps for the process. +For existing stacks, the gap is no longer a reserved part of the growth +area and can be filled by memory on access. +.It Dv PROC_STACKGAP_ENABLE_EXEC +Enable stack gaps for programs started after an +.Xr execve 2 +by the specified process. +.It Dv PROC_STACKGAP_DISABLE_EXEC +Inherit disabled stack gaps state after +.Xr execve 2 . +In other words, if the currently executing program has stack gaps disabled, +they are kept disabled on exec. +If gaps were enabled, they are kept enabled after exec. +.El +.Pp +The stack gap state is inherited from the parent on +.Xr fork 2 . +.It Dv PROC_STACKGAP_STATUS +Returns the current stack gap state for the specified process. +.Fa data +must point to an integer variable, which is used to return a bitmask +consisting of the following flags: +.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC +.It Dv PROC_STACKGAP_ENABLE +Stack gaps are enabled. +.It Dv PROC_STACKGAP_DISABLE +Stack gaps are disabled. +.It Dv PROC_STACKGAP_ENABLE_EXEC +Stack gaps are enabled in the process after +.Xr execve 2 . +.It Dv PROC_STACKGAP_DISABLE_EXEC +Stack gaps are disabled in the process after +.Xr execve 2 . +.El .El .Sh NOTES Disabling tracing on a process should not be considered a security Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 06:45:44 2019 (r352117) @@ -3360,6 +3360,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ switch (uap->com) { case PROC_ASLR_CTL: case PROC_SPROTECT: + case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); @@ -3391,6 +3392,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ data = &x.rk; break; case PROC_ASLR_STATUS: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: data = &flags; @@ -3420,6 +3422,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ error = error1; break; case PROC_ASLR_STATUS: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: if (error == 0) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/kern/kern_exec.c Tue Sep 10 06:45:44 2019 (r352117) @@ -756,6 +756,8 @@ interpret: p->p_flag |= P_EXEC; if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0) p->p_flag2 &= ~P2_NOTRACE; + if ((p->p_flag2 & P2_STKGAP_DISABLE_EXEC) == 0) + p->p_flag2 &= ~P2_STKGAP_DISABLE; if (p->p_flag & P_PPWAIT) { p->p_flag &= ~(P_PPWAIT | P_PPTRACE); cv_broadcast(&p->p_pwait); Modified: stable/12/sys/kern/kern_fork.c ============================================================================== --- stable/12/sys/kern/kern_fork.c Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/kern/kern_fork.c Tue Sep 10 06:45:44 2019 (r352117) @@ -508,7 +508,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct */ p2->p_flag = P_INMEM; p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE | - P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP); + P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | + P2_TRAPCAP | + P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); Modified: stable/12/sys/kern/kern_procctl.c ============================================================================== --- stable/12/sys/kern/kern_procctl.c Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/kern/kern_procctl.c Tue Sep 10 06:45:44 2019 (r352117) @@ -474,6 +474,55 @@ aslr_status(struct thread *td, struct proc *p, int *da return (0); } +static int +stackgap_ctl(struct thread *td, struct proc *p, int state) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((state & ~(PROC_STACKGAP_ENABLE | PROC_STACKGAP_DISABLE | + PROC_STACKGAP_ENABLE_EXEC | PROC_STACKGAP_DISABLE_EXEC)) != 0) + return (EINVAL); + switch (state & (PROC_STACKGAP_ENABLE | PROC_STACKGAP_DISABLE)) { + case PROC_STACKGAP_ENABLE: + if ((p->p_flag2 & P2_STKGAP_DISABLE) != 0) + return (EINVAL); + break; + case PROC_STACKGAP_DISABLE: + p->p_flag2 |= P2_STKGAP_DISABLE; + break; + case 0: + break; + default: + return (EINVAL); + } + switch (state & (PROC_STACKGAP_ENABLE_EXEC | + PROC_STACKGAP_DISABLE_EXEC)) { + case PROC_STACKGAP_ENABLE_EXEC: + p->p_flag2 &= ~P2_STKGAP_DISABLE_EXEC; + break; + case PROC_STACKGAP_DISABLE_EXEC: + p->p_flag2 |= P2_STKGAP_DISABLE_EXEC; + break; + case 0: + break; + default: + return (EINVAL); + } + return (0); +} + +static int +stackgap_status(struct thread *td, struct proc *p, int *data) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + + *data = (p->p_flag2 & P2_STKGAP_DISABLE) != 0 ? PROC_STACKGAP_DISABLE : + PROC_STACKGAP_ENABLE; + *data |= (p->p_flag2 & P2_STKGAP_DISABLE_EXEC) != 0 ? + PROC_STACKGAP_DISABLE_EXEC : PROC_STACKGAP_ENABLE_EXEC; + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct procctl_args { idtype_t idtype; @@ -501,6 +550,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua switch (uap->com) { case PROC_ASLR_CTL: case PROC_SPROTECT: + case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: error = copyin(uap->data, &flags, sizeof(flags)); @@ -530,6 +580,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua data = &x.rk; break; case PROC_ASLR_STATUS: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: data = &flags; @@ -558,6 +609,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua error = error1; break; case PROC_ASLR_STATUS: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: if (error == 0) @@ -583,6 +635,10 @@ kern_procctl_single(struct thread *td, struct proc *p, return (aslr_status(td, p, data)); case PROC_SPROTECT: return (protect_set(td, p, *(int *)data)); + case PROC_STACKGAP_CTL: + return (stackgap_ctl(td, p, *(int *)data)); + case PROC_STACKGAP_STATUS: + return (stackgap_status(td, p, data)); case PROC_REAP_ACQUIRE: return (reap_acquire(td, p)); case PROC_REAP_RELEASE: @@ -623,6 +679,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t case PROC_REAP_STATUS: case PROC_REAP_GETPIDS: case PROC_REAP_KILL: + case PROC_STACKGAP_CTL: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_PDEATHSIG_CTL: @@ -669,6 +727,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t break; case PROC_ASLR_CTL: case PROC_ASLR_STATUS: + case PROC_STACKGAP_CTL: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: tree_locked = false; Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/sys/proc.h Tue Sep 10 06:45:44 2019 (r352117) @@ -763,6 +763,8 @@ struct proc { #define P2_ASLR_ENABLE 0x00000040 /* Force enable ASLR. */ #define P2_ASLR_DISABLE 0x00000080 /* Force disable ASLR. */ #define P2_ASLR_IGNSTART 0x00000100 /* Enable ASLR to consume sbrk area. */ +#define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for MAP_STACK */ +#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled after exec */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ Modified: stable/12/sys/sys/procctl.h ============================================================================== --- stable/12/sys/sys/procctl.h Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/sys/procctl.h Tue Sep 10 06:45:44 2019 (r352117) @@ -59,6 +59,8 @@ #define PROC_PDEATHSIG_STATUS 12 /* get parent death signal */ #define PROC_ASLR_CTL 13 /* en/dis ASLR */ #define PROC_ASLR_STATUS 14 /* query ASLR status */ +#define PROC_STACKGAP_CTL 17 /* en/dis stack gap on MAP_STACK */ +#define PROC_STACKGAP_STATUS 18 /* query stack gap */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -126,6 +128,11 @@ struct procctl_reaper_kill { #define PROC_ASLR_FORCE_DISABLE 2 #define PROC_ASLR_NOFORCE 3 #define PROC_ASLR_ACTIVE 0x80000000 + +#define PROC_STACKGAP_ENABLE 0x0001 +#define PROC_STACKGAP_DISABLE 0x0002 +#define PROC_STACKGAP_ENABLE_EXEC 0x0004 +#define PROC_STACKGAP_DISABLE_EXEC 0x0008 #ifndef _KERNEL __BEGIN_DECLS Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Tue Sep 10 04:21:48 2019 (r352116) +++ stable/12/sys/vm/vm_map.c Tue Sep 10 06:45:44 2019 (r352117) @@ -4102,7 +4102,8 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, addrbos + max_ssize > vm_map_max(map) || addrbos + max_ssize <= addrbos) return (KERN_INVALID_ADDRESS); - sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; + sgp = (curproc->p_flag2 & P2_STKGAP_DISABLE) != 0 ? 0 : + (vm_size_t)stack_guard_page * PAGE_SIZE; if (sgp >= max_ssize) return (KERN_INVALID_ARGUMENT); @@ -4153,6 +4154,8 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, ("new entry lacks MAP_ENTRY_GROWS_UP")); + if (gap_bot == gap_top) + return (KERN_SUCCESS); rv = vm_map_insert(map, NULL, 0, gap_bot, gap_top, VM_PROT_NONE, VM_PROT_NONE, MAP_CREATE_GUARD | (orient == MAP_STACK_GROWS_DOWN ? MAP_CREATE_STACK_GAP_DN : MAP_CREATE_STACK_GAP_UP)); @@ -4236,7 +4239,8 @@ retry: } else { return (KERN_FAILURE); } - guard = gap_entry->next_read; + guard = (curproc->p_flag2 & P2_STKGAP_DISABLE) != 0 ? 0 : + gap_entry->next_read; max_grow = gap_entry->end - gap_entry->start; if (guard > max_grow) return (KERN_NO_SPACE); From owner-svn-src-all@freebsd.org Tue Sep 10 06:47:40 2019 Return-Path: Delivered-To: svn-src-all@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 F288CF3673; Tue, 10 Sep 2019 06:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SFvw68Yfz40yx; Tue, 10 Sep 2019 06:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C6D02238D; Tue, 10 Sep 2019 06:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A6leC3061036; Tue, 10 Sep 2019 06:47:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A6leDt061035; Tue, 10 Sep 2019 06:47:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909100647.x8A6leDt061035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Sep 2019 06:47:40 +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: r352118 - stable/12/usr.bin/proccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/proccontrol X-SVN-Commit-Revision: 352118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 06:47:41 -0000 Author: kib Date: Tue Sep 10 06:47:40 2019 New Revision: 352118 URL: https://svnweb.freebsd.org/changeset/base/352118 Log: MFC r351774: Add stackgap control mode to proccontrol(1). PR: 239894 Modified: stable/12/usr.bin/proccontrol/proccontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/proccontrol/proccontrol.c ============================================================================== --- stable/12/usr.bin/proccontrol/proccontrol.c Tue Sep 10 06:45:44 2019 (r352117) +++ stable/12/usr.bin/proccontrol/proccontrol.c Tue Sep 10 06:47:40 2019 (r352118) @@ -43,6 +43,7 @@ enum { MODE_INVALID, MODE_TRACE, MODE_TRAPCAP, + MODE_STACKGAP, #ifdef PROC_KPTI_CTL MODE_KPTI, #endif @@ -72,8 +73,8 @@ static void __dead2 usage(void) { - fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap" - KPTI_USAGE") [-q] " + fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap|" + "stackgap"KPTI_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -98,6 +99,8 @@ main(int argc, char *argv[]) mode = MODE_TRACE; else if (strcmp(optarg, "trapcap") == 0) mode = MODE_TRAPCAP; + else if (strcmp(optarg, "stackgap") == 0) + mode = MODE_STACKGAP; #ifdef PROC_KPTI_CTL else if (strcmp(optarg, "kpti") == 0) mode = MODE_KPTI; @@ -147,6 +150,9 @@ main(int argc, char *argv[]) case MODE_TRAPCAP: error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, &arg); break; + case MODE_STACKGAP: + error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); @@ -194,6 +200,26 @@ main(int argc, char *argv[]) break; } break; + case MODE_STACKGAP: + switch (arg & (PROC_STACKGAP_ENABLE | + PROC_STACKGAP_DISABLE)) { + case PROC_STACKGAP_ENABLE: + printf("enabled\n"); + break; + case PROC_STACKGAP_DISABLE: + printf("disabled\n"); + break; + } + switch (arg & (PROC_STACKGAP_ENABLE_EXEC | + PROC_STACKGAP_DISABLE_EXEC)) { + case PROC_STACKGAP_ENABLE_EXEC: + printf("enabled after exec\n"); + break; + case PROC_STACKGAP_DISABLE_EXEC: + printf("disabled after exec\n"); + break; + } + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: switch (arg & ~PROC_KPTI_STATUS_ACTIVE) { @@ -227,6 +253,12 @@ main(int argc, char *argv[]) arg = enable ? PROC_TRAPCAP_CTL_ENABLE : PROC_TRAPCAP_CTL_DISABLE; error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, &arg); + break; + case MODE_STACKGAP: + arg = enable ? PROC_STACKGAP_ENABLE_EXEC : + (PROC_STACKGAP_DISABLE | + PROC_STACKGAP_DISABLE_EXEC); + error = procctl(P_PID, pid, PROC_STACKGAP_CTL, &arg); break; #ifdef PROC_KPTI_CTL case MODE_KPTI: From owner-svn-src-all@freebsd.org Tue Sep 10 07:14:40 2019 Return-Path: Delivered-To: svn-src-all@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 82479F43C0; Tue, 10 Sep 2019 07:14:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGW42w4Bz42th; Tue, 10 Sep 2019 07:14:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4802222956; Tue, 10 Sep 2019 07:14:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7EePC079364; Tue, 10 Sep 2019 07:14:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7EekW079363; Tue, 10 Sep 2019 07:14:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100714.x8A7EekW079363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352119 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 352119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:14:40 -0000 Author: bapt Date: Tue Sep 10 07:14:39 2019 New Revision: 352119 URL: https://svnweb.freebsd.org/changeset/base/352119 Log: config: do not link against libl, it is not needed MFC after: 3 days Modified: head/usr.sbin/config/Makefile Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Tue Sep 10 06:47:40 2019 (r352118) +++ head/usr.sbin/config/Makefile Tue Sep 10 07:14:39 2019 (r352119) @@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l nv sbuf +LIBADD= nv sbuf CLEANFILES+= kernconf.c From owner-svn-src-all@freebsd.org Tue Sep 10 07:20:33 2019 Return-Path: Delivered-To: svn-src-all@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 596B3F45D1; Tue, 10 Sep 2019 07:20:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGds1gdSz439x; Tue, 10 Sep 2019 07:20:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1898A2295D; Tue, 10 Sep 2019 07:20:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7KWrR079711; Tue, 10 Sep 2019 07:20:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7KWqq079710; Tue, 10 Sep 2019 07:20:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100720.x8A7KWqq079710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352120 - head/usr.sbin/rrenumd X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/rrenumd X-SVN-Commit-Revision: 352120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:20:33 -0000 Author: bapt Date: Tue Sep 10 07:20:32 2019 New Revision: 352120 URL: https://svnweb.freebsd.org/changeset/base/352120 Log: by specifyng we do not use yywrap we can avoid linking to libl and liby MFC after: 3 days Modified: head/usr.sbin/rrenumd/Makefile head/usr.sbin/rrenumd/lexer.l Modified: head/usr.sbin/rrenumd/Makefile ============================================================================== --- head/usr.sbin/rrenumd/Makefile Tue Sep 10 07:14:39 2019 (r352119) +++ head/usr.sbin/rrenumd/Makefile Tue Sep 10 07:20:32 2019 (r352120) @@ -23,7 +23,7 @@ YFLAGS= -d WARNS?= 2 -LIBADD= ipsec l y +LIBADD= ipsec CLEANFILES= y.tab.h SRCS+= y.tab.h Modified: head/usr.sbin/rrenumd/lexer.l ============================================================================== --- head/usr.sbin/rrenumd/lexer.l Tue Sep 10 07:14:39 2019 (r352119) +++ head/usr.sbin/rrenumd/lexer.l Tue Sep 10 07:20:32 2019 (r352120) @@ -60,6 +60,7 @@ void yyerror(const char *); int yylex(void); %} +%option noyywrap %option nounput /* common section */ From owner-svn-src-all@freebsd.org Tue Sep 10 07:23:02 2019 Return-Path: Delivered-To: svn-src-all@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 779BAF4844; Tue, 10 Sep 2019 07:23:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGhk2cy8z43Yn; Tue, 10 Sep 2019 07:23:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DD4C22B29; Tue, 10 Sep 2019 07:23:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7N2Yr085093; Tue, 10 Sep 2019 07:23:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7N1lf085092; Tue, 10 Sep 2019 07:23:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100723.x8A7N1lf085092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352121 - head/usr.sbin/apmd X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/apmd X-SVN-Commit-Revision: 352121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:23:02 -0000 Author: bapt Date: Tue Sep 10 07:23:01 2019 New Revision: 352121 URL: https://svnweb.freebsd.org/changeset/base/352121 Log: Stop linking to libl by specifying we do not need yywrap MFC after: 3 days Modified: head/usr.sbin/apmd/Makefile head/usr.sbin/apmd/apmdlex.l Modified: head/usr.sbin/apmd/Makefile ============================================================================== --- head/usr.sbin/apmd/Makefile Tue Sep 10 07:20:32 2019 (r352120) +++ head/usr.sbin/apmd/Makefile Tue Sep 10 07:23:01 2019 (r352121) @@ -10,8 +10,6 @@ PACKAGE=apm WARNS?= 3 -LIBADD= l - CFLAGS+= -I${.CURDIR} test: Modified: head/usr.sbin/apmd/apmdlex.l ============================================================================== --- head/usr.sbin/apmd/apmdlex.l Tue Sep 10 07:20:32 2019 (r352120) +++ head/usr.sbin/apmd/apmdlex.l Tue Sep 10 07:23:01 2019 (r352121) @@ -44,6 +44,7 @@ int first_time; %} /* We don't need it, avoid the warning. */ +%option noyywrap %option nounput %option noinput From owner-svn-src-all@freebsd.org Tue Sep 10 07:25:38 2019 Return-Path: Delivered-To: svn-src-all@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 D7404F4953; Tue, 10 Sep 2019 07:25:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGlk5NyGz43l0; Tue, 10 Sep 2019 07:25:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C2FF22B36; Tue, 10 Sep 2019 07:25:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7Pc6E085262; Tue, 10 Sep 2019 07:25:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7PcYb085260; Tue, 10 Sep 2019 07:25:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100725.x8A7PcYb085260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352122 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 352122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:25:38 -0000 Author: bapt Date: Tue Sep 10 07:25:37 2019 New Revision: 352122 URL: https://svnweb.freebsd.org/changeset/base/352122 Log: Stop linking to libl by specifying we do not need yywrap MFC after: 3 days Modified: head/usr.sbin/jail/Makefile head/usr.sbin/jail/jaillex.l Modified: head/usr.sbin/jail/Makefile ============================================================================== --- head/usr.sbin/jail/Makefile Tue Sep 10 07:23:01 2019 (r352121) +++ head/usr.sbin/jail/Makefile Tue Sep 10 07:25:37 2019 (r352122) @@ -6,7 +6,7 @@ PROG= jail MAN= jail.8 jail.conf.5 SRCS= jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h -LIBADD= jail kvm util l +LIBADD= jail kvm util PACKAGE=jail Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Tue Sep 10 07:23:01 2019 (r352121) +++ head/usr.sbin/jail/jaillex.l Tue Sep 10 07:25:37 2019 (r352122) @@ -48,6 +48,7 @@ static int lineno = 1; #define YY_DECL int yylex(void) %} +%option noyywrap %option noinput %option nounput From owner-svn-src-all@freebsd.org Tue Sep 10 07:26:38 2019 Return-Path: Delivered-To: svn-src-all@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 E6B3CF49E6; Tue, 10 Sep 2019 07:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGmt5pG2z43tF; Tue, 10 Sep 2019 07:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB1922B38; Tue, 10 Sep 2019 07:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7QcO6085350; Tue, 10 Sep 2019 07:26:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7QcIZ085348; Tue, 10 Sep 2019 07:26:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100726.x8A7QcIZ085348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352123 - head/usr.sbin/kbdcontrol X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/kbdcontrol X-SVN-Commit-Revision: 352123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:26:39 -0000 Author: bapt Date: Tue Sep 10 07:26:38 2019 New Revision: 352123 URL: https://svnweb.freebsd.org/changeset/base/352123 Log: Stop linking to libl by specifying we do not need yywrap MFC after: 3 days Modified: head/usr.sbin/kbdcontrol/Makefile head/usr.sbin/kbdcontrol/lex.l Modified: head/usr.sbin/kbdcontrol/Makefile ============================================================================== --- head/usr.sbin/kbdcontrol/Makefile Tue Sep 10 07:25:37 2019 (r352122) +++ head/usr.sbin/kbdcontrol/Makefile Tue Sep 10 07:26:38 2019 (r352123) @@ -8,6 +8,4 @@ SRCS= kbdcontrol.c lex.l WARNS?= 4 CFLAGS+= -I${.CURDIR} -LIBADD= l - .include Modified: head/usr.sbin/kbdcontrol/lex.l ============================================================================== --- head/usr.sbin/kbdcontrol/lex.l Tue Sep 10 07:25:37 2019 (r352122) +++ head/usr.sbin/kbdcontrol/lex.l Tue Sep 10 07:26:38 2019 (r352123) @@ -36,6 +36,7 @@ %} +%option noyywrap %option nounput %option noinput From owner-svn-src-all@freebsd.org Tue Sep 10 07:28:28 2019 Return-Path: Delivered-To: svn-src-all@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 C0A35F4B46; Tue, 10 Sep 2019 07:28:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGq04ZTcz446y; Tue, 10 Sep 2019 07:28:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A5AB22B39; Tue, 10 Sep 2019 07:28:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7SSpp085480; Tue, 10 Sep 2019 07:28:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7SRPP085477; Tue, 10 Sep 2019 07:28:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100728.x8A7SRPP085477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352124 - in head/usr.sbin: ctld ndiscvt X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/usr.sbin: ctld ndiscvt X-SVN-Commit-Revision: 352124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:28:28 -0000 Author: bapt Date: Tue Sep 10 07:28:27 2019 New Revision: 352124 URL: https://svnweb.freebsd.org/changeset/base/352124 Log: Stop linking to libl by specifying we do not need yywrap MFC after: 3 days Modified: head/usr.sbin/ctld/Makefile head/usr.sbin/ctld/token.l head/usr.sbin/ndiscvt/Makefile head/usr.sbin/ndiscvt/inf-token.l Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Tue Sep 10 07:26:38 2019 (r352123) +++ head/usr.sbin/ctld/Makefile Tue Sep 10 07:28:27 2019 (r352124) @@ -15,7 +15,7 @@ CFLAGS+= -I${SRCTOP}/sys/dev/iscsi #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -LIBADD= bsdxml l md sbuf util ucl m nv +LIBADD= bsdxml md sbuf util ucl m nv YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Tue Sep 10 07:26:38 2019 (r352123) +++ head/usr.sbin/ctld/token.l Tue Sep 10 07:28:27 2019 (r352124) @@ -45,6 +45,7 @@ extern int yylex(void); %} +%option noyywrap %option noinput %option nounput Modified: head/usr.sbin/ndiscvt/Makefile ============================================================================== --- head/usr.sbin/ndiscvt/Makefile Tue Sep 10 07:26:38 2019 (r352123) +++ head/usr.sbin/ndiscvt/Makefile Tue Sep 10 07:28:27 2019 (r352124) @@ -13,8 +13,6 @@ MAN+= ndisgen.8 WARNS?= 4 NO_WCAST_ALIGN= -LIBADD= l - YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -I${SRCTOP}/sys Modified: head/usr.sbin/ndiscvt/inf-token.l ============================================================================== --- head/usr.sbin/ndiscvt/inf-token.l Tue Sep 10 07:26:38 2019 (r352123) +++ head/usr.sbin/ndiscvt/inf-token.l Tue Sep 10 07:28:27 2019 (r352124) @@ -59,6 +59,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput From owner-svn-src-all@freebsd.org Tue Sep 10 07:29:23 2019 Return-Path: Delivered-To: svn-src-all@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 ED97EF4C20; Tue, 10 Sep 2019 07:29:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SGr362G9z44Gs; Tue, 10 Sep 2019 07:29:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B267D22B3D; Tue, 10 Sep 2019 07:29:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7TNOB085578; Tue, 10 Sep 2019 07:29:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7TMlL085569; Tue, 10 Sep 2019 07:29:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909100729.x8A7TMlL085569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Sep 2019 07:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352125 - in stable/11: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 352125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:29:24 -0000 Author: kib Date: Tue Sep 10 07:29:21 2019 New Revision: 352125 URL: https://svnweb.freebsd.org/changeset/base/352125 Log: MFC r351773: Add procctl(PROC_STACKGAP_CTL). PR: 239894 Modified: stable/11/lib/libc/sys/procctl.2 stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/kern/kern_exec.c stable/11/sys/kern/kern_fork.c stable/11/sys/kern/kern_procctl.c stable/11/sys/sys/proc.h stable/11/sys/sys/procctl.h stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/procctl.2 ============================================================================== --- stable/11/lib/libc/sys/procctl.2 Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/lib/libc/sys/procctl.2 Tue Sep 10 07:29:21 2019 (r352125) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2019 +.Dd August 31, 2019 .Dt PROCCTL 2 .Os .Sh NAME @@ -422,6 +422,67 @@ must point to a memory location that can hold a value .Vt int . If signal delivery has not been requested, it will contain zero on return. +.It Dv PROC_STACKGAP_CTL +Controls the stack gaps in the specified process. +A stack gap is the part of the growth area for a +.Dv MAP_STACK +mapped region that is reserved and never filled by memory. +Instead, the process is guaranteed to receive a +.Dv SIGSEGV +signal on accessing pages in the gap. +Gaps protect against stack overflow corrupting memory adjacent +to the stack. +.Pp +The +.Fa data +argument must point to an integer variable containing flags. +The following flags are allowed: +.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC +.It Dv PROC_STACKGAP_ENABLE +This flag is only accepted for consistency with +.Dv PROC_STACKGAP_STATUS . +If stack gaps are enabled, the flag is ignored. +If disabled, the flag causes an +.Ev EINVAL +error to be returned. +After gaps are disabled in a process, they can only be re-enabled when an +.Xr execve 2 +is performed. +.It Dv PROC_STACKGAP_DISABLE +Disable stack gaps for the process. +For existing stacks, the gap is no longer a reserved part of the growth +area and can be filled by memory on access. +.It Dv PROC_STACKGAP_ENABLE_EXEC +Enable stack gaps for programs started after an +.Xr execve 2 +by the specified process. +.It Dv PROC_STACKGAP_DISABLE_EXEC +Inherit disabled stack gaps state after +.Xr execve 2 . +In other words, if the currently executing program has stack gaps disabled, +they are kept disabled on exec. +If gaps were enabled, they are kept enabled after exec. +.El +.Pp +The stack gap state is inherited from the parent on +.Xr fork 2 . +.It Dv PROC_STACKGAP_STATUS +Returns the current stack gap state for the specified process. +.Fa data +must point to an integer variable, which is used to return a bitmask +consisting of the following flags: +.Bl -tag -width PROC_STACKGAP_DISABLE_EXEC +.It Dv PROC_STACKGAP_ENABLE +Stack gaps are enabled. +.It Dv PROC_STACKGAP_DISABLE +Stack gaps are disabled. +.It Dv PROC_STACKGAP_ENABLE_EXEC +Stack gaps are enabled in the process after +.Xr execve 2 . +.It Dv PROC_STACKGAP_DISABLE_EXEC +Stack gaps are disabled in the process after +.Xr execve 2 . +.El .El .Sh NOTES Disabling tracing on a process should not be considered a security Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 10 07:29:21 2019 (r352125) @@ -3107,6 +3107,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ switch (uap->com) { case PROC_SPROTECT: + case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); @@ -3137,6 +3138,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ return (error); data = &x.rk; break; + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: data = &flags; @@ -3165,6 +3167,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ if (error == 0) error = error1; break; + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: if (error == 0) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/kern/kern_exec.c Tue Sep 10 07:29:21 2019 (r352125) @@ -762,6 +762,8 @@ interpret: p->p_flag |= P_EXEC; if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0) p->p_flag2 &= ~P2_NOTRACE; + if ((p->p_flag2 & P2_STKGAP_DISABLE_EXEC) == 0) + p->p_flag2 &= ~P2_STKGAP_DISABLE; if (p->p_flag & P_PPWAIT) { p->p_flag &= ~(P_PPWAIT | P_PPTRACE); cv_broadcast(&p->p_pwait); Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/kern/kern_fork.c Tue Sep 10 07:29:21 2019 (r352125) @@ -513,7 +513,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct * Increase reference counts on shared objects. */ p2->p_flag = P_INMEM; - p2->p_flag2 = p1->p_flag2 & (P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP); + p2->p_flag2 = p1->p_flag2 & (P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP | + P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); Modified: stable/11/sys/kern/kern_procctl.c ============================================================================== --- stable/11/sys/kern/kern_procctl.c Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/kern/kern_procctl.c Tue Sep 10 07:29:21 2019 (r352125) @@ -413,6 +413,55 @@ trapcap_status(struct thread *td, struct proc *p, int return (0); } +static int +stackgap_ctl(struct thread *td, struct proc *p, int state) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((state & ~(PROC_STACKGAP_ENABLE | PROC_STACKGAP_DISABLE | + PROC_STACKGAP_ENABLE_EXEC | PROC_STACKGAP_DISABLE_EXEC)) != 0) + return (EINVAL); + switch (state & (PROC_STACKGAP_ENABLE | PROC_STACKGAP_DISABLE)) { + case PROC_STACKGAP_ENABLE: + if ((p->p_flag2 & P2_STKGAP_DISABLE) != 0) + return (EINVAL); + break; + case PROC_STACKGAP_DISABLE: + p->p_flag2 |= P2_STKGAP_DISABLE; + break; + case 0: + break; + default: + return (EINVAL); + } + switch (state & (PROC_STACKGAP_ENABLE_EXEC | + PROC_STACKGAP_DISABLE_EXEC)) { + case PROC_STACKGAP_ENABLE_EXEC: + p->p_flag2 &= ~P2_STKGAP_DISABLE_EXEC; + break; + case PROC_STACKGAP_DISABLE_EXEC: + p->p_flag2 |= P2_STKGAP_DISABLE_EXEC; + break; + case 0: + break; + default: + return (EINVAL); + } + return (0); +} + +static int +stackgap_status(struct thread *td, struct proc *p, int *data) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + + *data = (p->p_flag2 & P2_STKGAP_DISABLE) != 0 ? PROC_STACKGAP_DISABLE : + PROC_STACKGAP_ENABLE; + *data |= (p->p_flag2 & P2_STKGAP_DISABLE_EXEC) != 0 ? + PROC_STACKGAP_DISABLE_EXEC : PROC_STACKGAP_ENABLE_EXEC; + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct procctl_args { idtype_t idtype; @@ -435,6 +484,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua switch (uap->com) { case PROC_SPROTECT: + case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: error = copyin(uap->data, &flags, sizeof(flags)); @@ -463,6 +513,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua return (error); data = &x.rk; break; + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: data = &flags; @@ -490,6 +541,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua if (error == 0) error = error1; break; + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: if (error == 0) @@ -511,6 +563,10 @@ kern_procctl_single(struct thread *td, struct proc *p, switch (com) { case PROC_SPROTECT: return (protect_set(td, p, *(int *)data)); + case PROC_STACKGAP_CTL: + return (stackgap_ctl(td, p, *(int *)data)); + case PROC_STACKGAP_STATUS: + return (stackgap_status(td, p, data)); case PROC_REAP_ACQUIRE: return (reap_acquire(td, p)); case PROC_REAP_RELEASE: @@ -549,6 +605,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t case PROC_REAP_STATUS: case PROC_REAP_GETPIDS: case PROC_REAP_KILL: + case PROC_STACKGAP_CTL: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_PDEATHSIG_CTL: @@ -593,6 +651,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t sx_xlock(&proctree_lock); tree_locked = true; break; + case PROC_STACKGAP_CTL: + case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: tree_locked = false; Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/sys/proc.h Tue Sep 10 07:29:21 2019 (r352125) @@ -745,6 +745,8 @@ struct proc { #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ #define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not yet handled. */ #define P2_TRAPCAP 0x00000020 /* SIGTRAP on ENOTCAPABLE */ +#define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for MAP_STACK */ +#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled after exec */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ Modified: stable/11/sys/sys/procctl.h ============================================================================== --- stable/11/sys/sys/procctl.h Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/sys/procctl.h Tue Sep 10 07:29:21 2019 (r352125) @@ -51,6 +51,8 @@ #define PROC_TRAPCAP_STATUS 10 /* query trap capability status */ #define PROC_PDEATHSIG_CTL 11 /* set parent death signal */ #define PROC_PDEATHSIG_STATUS 12 /* get parent death signal */ +#define PROC_STACKGAP_CTL 17 /* en/dis stack gap on MAP_STACK */ +#define PROC_STACKGAP_STATUS 18 /* query stack gap */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -113,6 +115,11 @@ struct procctl_reaper_kill { #define PROC_TRAPCAP_CTL_ENABLE 1 #define PROC_TRAPCAP_CTL_DISABLE 2 + +#define PROC_STACKGAP_ENABLE 0x0001 +#define PROC_STACKGAP_DISABLE 0x0002 +#define PROC_STACKGAP_ENABLE_EXEC 0x0004 +#define PROC_STACKGAP_DISABLE_EXEC 0x0008 #ifndef _KERNEL __BEGIN_DECLS Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Tue Sep 10 07:28:27 2019 (r352124) +++ stable/11/sys/vm/vm_map.c Tue Sep 10 07:29:21 2019 (r352125) @@ -3632,7 +3632,8 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, addrbos + max_ssize > vm_map_max(map) || addrbos + max_ssize <= addrbos) return (KERN_INVALID_ADDRESS); - sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; + sgp = (curproc->p_flag2 & P2_STKGAP_DISABLE) != 0 ? 0 : + (vm_size_t)stack_guard_page * PAGE_SIZE; if (sgp >= max_ssize) return (KERN_INVALID_ARGUMENT); @@ -3683,6 +3684,8 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, ("new entry lacks MAP_ENTRY_GROWS_UP")); + if (gap_bot == gap_top) + return (KERN_SUCCESS); rv = vm_map_insert(map, NULL, 0, gap_bot, gap_top, VM_PROT_NONE, VM_PROT_NONE, MAP_CREATE_GUARD | (orient == MAP_STACK_GROWS_DOWN ? MAP_CREATE_STACK_GAP_DN : MAP_CREATE_STACK_GAP_UP)); @@ -3766,7 +3769,8 @@ retry: } else { return (KERN_FAILURE); } - guard = gap_entry->next_read; + guard = (curproc->p_flag2 & P2_STKGAP_DISABLE) != 0 ? 0 : + gap_entry->next_read; max_grow = gap_entry->end - gap_entry->start; if (guard > max_grow) return (KERN_NO_SPACE); From owner-svn-src-all@freebsd.org Tue Sep 10 07:40:46 2019 Return-Path: Delivered-To: svn-src-all@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 276C7F5042; Tue, 10 Sep 2019 07:40:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SH596Zglz44r4; Tue, 10 Sep 2019 07:40:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C673522D28; Tue, 10 Sep 2019 07:40:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7ejjw092138; Tue, 10 Sep 2019 07:40:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7ejlB092137; Tue, 10 Sep 2019 07:40:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100740.x8A7ejlB092137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352126 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 352126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:40:46 -0000 Author: bapt Date: Tue Sep 10 07:40:45 2019 New Revision: 352126 URL: https://svnweb.freebsd.org/changeset/base/352126 Log: Remove reference to mklocale regarding the nls directory mklocale never had anything to do with the content of this directory MFC after: 3 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Tue Sep 10 07:29:21 2019 (r352125) +++ head/share/man/man7/hier.7 Tue Sep 10 07:40:45 2019 (r352126) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 6, 2018 +.Dd September 10, 2019 .Dt HIER 7 .Os .Sh NAME @@ -533,9 +533,7 @@ templates for make; see .Xr make 1 .It Pa nls/ -national language support files; -see -.Xr mklocale 1 +national language support files .It Pa security/ data files for security policies such as .Xr mac_lomac 4 From owner-svn-src-all@freebsd.org Tue Sep 10 07:47:53 2019 Return-Path: Delivered-To: svn-src-all@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 D17A9F5380; Tue, 10 Sep 2019 07:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHFP4vZnz45Kp; Tue, 10 Sep 2019 07:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87D3122ED7; Tue, 10 Sep 2019 07:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7lr4B097640; Tue, 10 Sep 2019 07:47:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7lqZC097637; Tue, 10 Sep 2019 07:47:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100747.x8A7lqZC097637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352127 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 352127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:47:53 -0000 Author: bapt Date: Tue Sep 10 07:47:52 2019 New Revision: 352127 URL: https://svnweb.freebsd.org/changeset/base/352127 Log: In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1) tools to generate the locales data. state it in the libc manpages. MFC after: 3 days Modified: head/lib/libc/locale/euc.5 head/lib/libc/locale/multibyte.3 head/lib/libc/locale/setlocale.3 Modified: head/lib/libc/locale/euc.5 ============================================================================== --- head/lib/libc/locale/euc.5 Tue Sep 10 07:40:45 2019 (r352126) +++ head/lib/libc/locale/euc.5 Tue Sep 10 07:47:52 2019 (r352127) @@ -31,7 +31,7 @@ .\" @(#)euc.4 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 8, 2003 +.Dd September 9, 2019 .Dt EUC 5 .Os .Sh NAME @@ -58,7 +58,7 @@ .\".Ux .\"based systems. .\"See -.\".Xr mklocale 1 +.\".Xr localedef 1 .\"for a complete description of the .\".Ev LC_CTYPE .\"source file format. @@ -130,5 +130,5 @@ Notice that the global is set to 0x8080, this implies that from those 2 bits the codeset can be determined. .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 Modified: head/lib/libc/locale/multibyte.3 ============================================================================== --- head/lib/libc/locale/multibyte.3 Tue Sep 10 07:40:45 2019 (r352126) +++ head/lib/libc/locale/multibyte.3 Tue Sep 10 07:47:52 2019 (r352127) @@ -32,7 +32,7 @@ .\" @(#)multibyte.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 8, 2004 +.Dd September 9, 2019 .Dt MULTIBYTE 3 .Os .Sh NAME @@ -127,7 +127,7 @@ multibyte characters: .It Xr wctomb 3 Ta "convert a wide-character code to a character" .El .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 , .Xr stdio 3 , .Xr big5 5 , Modified: head/lib/libc/locale/setlocale.3 ============================================================================== --- head/lib/libc/locale/setlocale.3 Tue Sep 10 07:40:45 2019 (r352126) +++ head/lib/libc/locale/setlocale.3 Tue Sep 10 07:47:52 2019 (r352127) @@ -31,7 +31,7 @@ .\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd November 21, 2003 +.Dd September 9, 2019 .Dt SETLOCALE 3 .Os .Sh NAME @@ -150,8 +150,7 @@ and the category .Sh ERRORS No errors are defined. .Sh SEE ALSO -.Xr colldef 1 , -.Xr mklocale 1 , +.Xr localedef 1 , .Xr catopen 3 , .Xr ctype 3 , .Xr localeconv 3 , From owner-svn-src-all@freebsd.org Tue Sep 10 07:54:50 2019 Return-Path: Delivered-To: svn-src-all@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 1A10EF57D4; Tue, 10 Sep 2019 07:54:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHPP6xg4z45rw; Tue, 10 Sep 2019 07:54:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1FE6230AA; Tue, 10 Sep 2019 07:54:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7snop003253; Tue, 10 Sep 2019 07:54:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7sncQ003252; Tue, 10 Sep 2019 07:54:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100754.x8A7sncQ003252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352128 - in head: . usr.bin usr.bin/colldef usr.bin/mklocale X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . usr.bin usr.bin/colldef usr.bin/mklocale X-SVN-Commit-Revision: 352128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:54:50 -0000 Author: bapt Date: Tue Sep 10 07:54:49 2019 New Revision: 352128 URL: https://svnweb.freebsd.org/changeset/base/352128 Log: Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11 In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1) has been replaced by localedef(1) (a note has been added to the manpage to state it). mklocale(1) and colldef(1) has been kept around to be able to build older versions of FreeBSD. None of the version requiring those tools are supported anymore so it is time to remove them from base Deleted: head/usr.bin/colldef/ head/usr.bin/mklocale/ Modified: head/ObsoleteFiles.inc head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Sep 10 07:47:52 2019 (r352127) +++ head/ObsoleteFiles.inc Tue Sep 10 07:54:49 2019 (r352128) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20190910: mklocale(1) and colldef(1) removed +OLD_FILES+=usr.bin/mklocale +OLD_FILES+=usr/share/man/man1/mklocale.1.gz +OLD_FILES+=usr.bin/colldef +OLD_FILES+=usr/share/man/man1/colldef.1.gz # 20190904: Remove boot1.efifat OLD_FILES+=boot/boot1.efifat # 20190903: pc-sysinstall(8) removed Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Sep 10 07:47:52 2019 (r352127) +++ head/usr.bin/Makefile Tue Sep 10 07:54:49 2019 (r352128) @@ -20,7 +20,6 @@ SUBDIR= alias \ cksum \ cmp \ col \ - colldef \ colrm \ column \ comm \ @@ -94,7 +93,6 @@ SUBDIR= alias \ mkdep \ mkfifo \ mkimg \ - mklocale \ mktemp \ mkuzip \ mt \ From owner-svn-src-all@freebsd.org Tue Sep 10 07:56:58 2019 Return-Path: Delivered-To: svn-src-all@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 82185F589E; Tue, 10 Sep 2019 07:56:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHRt2sZvz461f; Tue, 10 Sep 2019 07:56:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45BF1230B0; Tue, 10 Sep 2019 07:56:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A7uwAp003419; Tue, 10 Sep 2019 07:56:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A7uwxm003418; Tue, 10 Sep 2019 07:56:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100756.x8A7uwxm003418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 07:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352129 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 07:56:58 -0000 Author: bapt Date: Tue Sep 10 07:56:57 2019 New Revision: 352129 URL: https://svnweb.freebsd.org/changeset/base/352129 Log: Remove a blankline wrongly added in r351781 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Sep 10 07:54:49 2019 (r352128) +++ head/ObsoleteFiles.inc Tue Sep 10 07:56:57 2019 (r352129) @@ -125,7 +125,6 @@ OLD_DIRS+=usr/share/pc-sysinstall/conf/license OLD_DIRS+=usr/share/pc-sysinstall/conf OLD_DIRS+=usr/share/pc-sysinstall/doc OLD_DIRS+=usr/share/pc-sysinstall - # 20190825: zlib 1.0.4 removed from kernel OLD_FILES+=usr/include/sys/zlib.h OLD_FILES+=usr/include/sys/zutil.h From owner-svn-src-all@freebsd.org Tue Sep 10 08:12:56 2019 Return-Path: Delivered-To: svn-src-all@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 0722EF6ABB; Tue, 10 Sep 2019 08:12:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHpH1CD0z47NJ; Tue, 10 Sep 2019 08:12:54 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0FF493C0199; Tue, 10 Sep 2019 08:12:54 +0000 (UTC) Date: Tue, 10 Sep 2019 08:12:54 +0000 From: Brooks Davis To: Warner Losh Cc: Philip Paeps , Ian Lepore , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351918 - head/sys/kern Message-ID: <20190910081254.GC41333@spindle.one-eyed-alien.net> References: <201909060119.x861JWrG006910@repo.freebsd.org> <4917d7507b6ea6c360dccda261f53052aa085f2b.camel@freebsd.org> <5EE266EE-E650-48D8-9B0E-E674AD026470@freebsd.org> <3cb6429acc7e520932d2c906d1cac47540156355.camel@freebsd.org> <8F03EA29-0F3F-4321-9241-78F7C924FDE1@freebsd.org> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> <20190909115632.GB41333@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JgQwtEuHJzHdouWu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46SHpH1CD0z47NJ X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.58)[ip: (-9.35), ipnet: 199.48.128.0/22(-4.66), asn: 36236(-3.86), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:12:56 -0000 --JgQwtEuHJzHdouWu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 09, 2019 at 01:49:50PM -0600, Warner Losh wrote: > On Mon, Sep 9, 2019, 5:56 AM Brooks Davis wrote: >=20 > > On Sat, Sep 07, 2019 at 12:23:03PM +0800, Philip Paeps wrote: > > > On 2019-09-07 12:06:32 (+0800), Warner Losh wrote: > > > > On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps > > > > wrote: > > > >> On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: > > > >>> On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: > > > >>>> On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > > > >>>>> On Fri, 2019-09-06 at 01:19 +0000, Philip Paeps wrote: > > > >>>>>> Log: > > > >>>>>> riscv: default to HZ=3D100 > > > >>>>> > > > >>>>> This seems like a bad idea. I've run a 90mhz armv4 chip with > > > >>>>> HZ=3D1000 and didn't notice any performance hit from doing so. > > > >>>>> Almost all arm kernel config files set HZ as an option, so that > > > >>>>> define doesn't do much for arm these days. It probably does st= ill > > > >>>>> set HZ for various mips platforms. > > > >>>>> > > > >>>>> I would think 1000 is appropriate for anything modern running at > > > >>>>> 200mhz or more. > > > >>>>> > > > >>>>> Setting it to 100 has the bad side effect of making things like > > > >>>>> msleep(), tsleep(), and pause() (which show up in plenty of > > > >>>>> drivers) all have a minimum timeout of 10ms, which is a long lo= ng > > > >>>>> time on modern hardware. > > > >>>>> > > > >>>>> What benefit do you think you'll get from the lower number? > > > >>>> > > > >>>> On systems running at 10s of MHz (or slower, ick), with HZ=3D100= 0 you > > > >>>> spend an awful lot of time servicing the timer interrupt and not > > > >>>> very much time doing anything else. > > > >>>> > > > >>>> My rationale was that most RISC-V systems (including emulation a= nd > > > >>>> FPGA prototypes) I've encountered are running slower than the > > > >>>> tipping point where HZ=3D1000 makes sense. With the default of > > > >>>> HZ=3D100, faster exceptions can still set HZ=3D1000 in their ind= ividual > > > >>>> configs. > > > >>>> > > > >>>> When the RISC-V world evolves to having more actual silicon and > > > >>>> fewer slow prototypes, I definitely agree this default should be > > > >>>> flipped again for HZ=3D1000 by default and HZ=3D100 in the confi= g files > > > >>>> for the exceptions. > > > >>> > > > >>> Wait a second... are you saying that the riscv implementation > > > >>> doesn't support event timers and uses an old-style periodic tick > > > >>> based on HZ? > > > >> > > > >> Depending on the hardware, there may not be an event timer (yet)... > > > >> > > > >> As I wrote: I would be more than happy to revert this change when > > > >> more silicon becomes available. Presently, there is exactly one > > > >> silicon RISC-V implementation commercially available (HiFive FU540) > > > >> and even that one is kind of difficult to source. Most people > > > >> running RISC-V are doing so in emulation or on FPGAs. > > > >> > > > >> Given how long these things take to boot to userland (where you > > > >> really notice how slow things are), HZ=3D100 feels like a more sen= sible > > > >> default than HZ=3D1000. > > > > > > > > I think it show more that the defaults are bad for MIPS and ARM. All > > > > the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also > > > > 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe= we > > > > need to attend to this as well. Arm !=3Dv5 is also 1000Hz, so it sh= ould > > > > be changed... > > > > > > > >> I don't feel terribly strongly about this though. I've just been > > > >> bitten several times in the last week on a <15MHz FPGA forgetting = to > > > >> set HZ=3D100 in config and figured I'd save others the trouble. ;-) > > > > > > > > 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the > > > > time.... How common are these beasts and how well does FreeBSD do = on > > > > them. I assume these are early prototypes? > > > > > > These are early prototypes indeed. > > > > > > FreeBSD runs remarkably well on them. Slowly of course. Booting tak= es > > > several minutes and running anything non-trivial can be frustrating. > > > > [More context for Warner and others following along.] > > > > I don't know what platform Philip is using here, but with architectures > > supporting CHERI (including MIPS and RISC-V), we typically run on > > sub-100Mhz FPGA implementations. > > > > We also run on simulations or models that range from 100s of MIPS to a > > few KIPS. Being able to do this is important to help validate that the > > models we're proving security properties on actually relate to the > > "more real" implementations we develop on. > > > > In all these cases, "run" is a relative thing. We certainly don't > > expect to self-host until we've got performant hardware (and to the > > extent that we care about 32-bit, we consider self-hosting an active > > non-goal.) We often expect to be able to run real software including > > things like nginx and webkit, but we mostly care about relative > > performance not interactivity. >=20 > Would your needs be adequately covered by the current mechanisms to set H= Z? > This just covers the defaults for the whole platform. As always, these can > be overridden in the boot loader or kernel config file... Yeah, the current mechanisms are fine. I just wanted to clarify that we're asking different things from the platform then we did of a 25MHz i386. -- Brooks --JgQwtEuHJzHdouWu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdd1sFAAoJEKzQXbSebgfA5rsH/3FnBhgLccO5ab/LWKIqVNra s0E8LeG0NVshi46Ooyh9g2g5qhsV7Z+2cyG8OBBkFvWfYiM4JNI29k6GmkfReNAq njJASuniOwR49q6tiR0qy79gnXq8GpfNJ2X6NM9jTrdRsTL1Q4XLX92eWNZnZTZz uTREBt2koi0tQe0hZ40tZJOxt+wy/mnxtuh183ouO64zK8DSIhvlTNwssS9zqPzJ UmTZQuuXJO1vJhdJjWHVX2krn1IfgL4P2FbdeQPFLXi8qDKpojNMO/oqMd4XMIbp HIN1XybfoInX/+92uvtaAoFJPMx1yoVOqFsFLTWjzNA+Nn4hEGgqX32WW6FfULs= =t4lh -----END PGP SIGNATURE----- --JgQwtEuHJzHdouWu-- From owner-svn-src-all@freebsd.org Tue Sep 10 08:19:47 2019 Return-Path: Delivered-To: svn-src-all@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 E21E4F6CCC; Tue, 10 Sep 2019 08:19:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHyC5DlLz47dM; Tue, 10 Sep 2019 08:19:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9700023469; Tue, 10 Sep 2019 08:19:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A8Jli4015710; Tue, 10 Sep 2019 08:19:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A8JlH4015708; Tue, 10 Sep 2019 08:19:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100819.x8A8JlH4015708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 08:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352130 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 352130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:19:47 -0000 Author: bapt Date: Tue Sep 10 08:19:46 2019 New Revision: 352130 URL: https://svnweb.freebsd.org/changeset/base/352130 Log: Stop linking to libl by specifying we do not need yywrap MFC after: 3 days Modified: head/sbin/devd/Makefile head/sbin/devd/token.l Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Tue Sep 10 07:56:57 2019 (r352129) +++ head/sbin/devd/Makefile Tue Sep 10 08:19:46 2019 (r352130) @@ -34,7 +34,7 @@ MAN= devd.8 devd.conf.5 NO_SHARED?=YES -LIBADD= l util +LIBADD= util YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} Modified: head/sbin/devd/token.l ============================================================================== --- head/sbin/devd/token.l Tue Sep 10 07:56:57 2019 (r352129) +++ head/sbin/devd/token.l Tue Sep 10 08:19:46 2019 (r352130) @@ -50,6 +50,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput From owner-svn-src-all@freebsd.org Tue Sep 10 08:20:16 2019 Return-Path: Delivered-To: svn-src-all@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 DC6A2F6D2F for ; Tue, 10 Sep 2019 08:20:16 +0000 (UTC) (envelope-from stllsimons@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SHym1HLdz47m7 for ; Tue, 10 Sep 2019 08:20:15 +0000 (UTC) (envelope-from stllsimons@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id q14so18202867wrm.9 for ; Tue, 10 Sep 2019 01:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:subject:from:to:mime-version :content-transfer-encoding; bh=tw6ugPlZD3US7Gy6HBakoY/sSbaaYGhXX+Im7HOq7v0=; b=DmJGFesiqWCy7+9GoMVA2WYUntS2eGa6xf8r7JOOyEKsqc8tc/Ka+KO00n1+oB0zJl +gXLyxlEeSINjzpL3wBxqGJ9Ri34L2txjGgMs9l7axYYJY1Nui45PX1xuq0PwpjWaJ7R kMjWV5TYfohRRN9Hba5NJtRP9AA0jqouwrzda53eIbuISO6TvCWs+le+GGulNQTpkIwT Ociuor6xuL7waMQiaWsBN+s5It+L6yx0fS6kPgPQ5W3l6aH9oTAHGhD3LGkT20C4Qtz7 wyzfDekV3oTMqEWP7r3+HBU526RmfogVnKMYrX/6N9lMgdHZ0RfqGBVnCIbI2Mjtss7U 5Daw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:subject:from:to:mime-version :content-transfer-encoding; bh=tw6ugPlZD3US7Gy6HBakoY/sSbaaYGhXX+Im7HOq7v0=; b=SWSxfPSY+bIqOSK84D8GBaNQIkHqI+rxTkqGJJnRNChNm/ZrZk0WExiPWvskoIZCuY YazLgLCYydaMiWv7MOSgLrL+TwKvS7daT2oTnAFFq8M7aVCHw4wZGTOBJoZCT8ndbL62 ZDEIXKFmLYpsMkd1SL2S529KmUx1NIbVVgm1gqW0wuDFS/D7qgQn5R7BxuhJu0Yaizxj K1l0qxsUjmguLu2FRh9Z/pihCYNATktJoXUyOtHXNhlPE1glWb9yLY9AJBCFC9spV9nV eR+yddmvozTjmsDkU2XYurvOa0cdFczd8+2sONt4zi4VQJOZxYSgk9IhoQy8xLVzF+cs M69g== X-Gm-Message-State: APjAAAWaiqbUjXd8fMy/oHfzHhb8ul+3s9QIM/aLOAZixf3ha7w0refK 8j8XCmPs0uvwAltFJNUSlejUMzNU X-Google-Smtp-Source: APXvYqxnw7IMdDoKGnDm/45/7HALvFWL0Icxs09VSibpvUiI/BeyBgzcM8iJWab5AQngwE17DpHTJQ== X-Received: by 2002:a5d:53ce:: with SMTP id a14mr16066072wrw.169.1568103614766; Tue, 10 Sep 2019 01:20:14 -0700 (PDT) Received: from [127.0.0.1] (178.165.129.62.wireless.dyn.drei.com. [178.165.129.62]) by smtp.gmail.com with ESMTPSA id k9sm32444950wrd.7.2019.09.10.01.20.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 01:20:14 -0700 (PDT) Message-ID: <51dc278a628bebe1d2e39a7b0e4021d7@swift.generated> Date: Tue, 10 Sep 2019 10:20:12 +0200 Subject: De unieke domeinnaam publie.nl wordt verkocht From: Stella Simons To: "" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46SHym1HLdz47m7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=DmJGFesi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of stllsimons@gmail.com designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=stllsimons@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[62.129.165.178.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (3.40), ipnet: 2a00:1450::/32(-2.97), asn: 15169(-2.26), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:20:16 -0000 Geachte dames en heren, Graag maken wij u erop attent dat de domein: p= ublie.nl wordt verkocht. Heeft U interesse? Met vriendelijke groet,= Stella Simons From owner-svn-src-all@freebsd.org Tue Sep 10 08:22:45 2019 Return-Path: Delivered-To: svn-src-all@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 876CDF6F8D; Tue, 10 Sep 2019 08:22:45 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46SJ1d2zVwz4859; Tue, 10 Sep 2019 08:22:45 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 46SJ1T0jQXz3c7b; Tue, 10 Sep 2019 08:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1568103755; bh=l3d8pdl3nagaWEgmfiVRb3HM kutxyIaup9+ku2kJmog=; b=NN4U0VUmIUxDQUsPaF8Xvzj+667nyirpStDOHGaC hnXNpwA/j2V8iUtVc64sm44O3Sy0Q9/6D0/y86cKje4Yyz1hRa2OAnDQXgiHVYqx +FDAphQxXY6y5bW4usqZCC8Jit53IggtRv7GIU9ya9bNdkpZ8ahJ8PG/3VVHXdmt yoc= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id Ua967t-GjHUM; Tue, 10 Sep 2019 08:22:35 +0000 (UTC) Received: from garnet.daemonic.se (host-90-233-173-70.mobileonline.telia.com [90.233.173.70]) by mail.daemonic.se (Postfix) with ESMTPSA id 46SJ1R4hL3z3c7Z; Tue, 10 Sep 2019 08:22:35 +0000 (UTC) Subject: Re: svn commit: r352128 - in head: . usr.bin usr.bin/colldef usr.bin/mklocale To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909100754.x8A7sncQ003252@repo.freebsd.org> From: Niclas Zeising Message-ID: <157d6234-19c4-3e0f-34f8-bc73c28da925@daemonic.se> Date: Tue, 10 Sep 2019 10:22:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <201909100754.x8A7sncQ003252@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46SJ1d2zVwz4859 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[freebsd] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:22:45 -0000 On 2019-09-10 09:54, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Sep 10 07:54:49 2019 > New Revision: 352128 > URL: https://svnweb.freebsd.org/changeset/base/352128 > > Log: > Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11 > > In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1) > has been replaced by localedef(1) (a note has been added to the manpage to state > it). > mklocale(1) and colldef(1) has been kept around to be able to build older > versions of FreeBSD. None of the version requiring those tools are supported > anymore so it is time to remove them from base > > Deleted: > head/usr.bin/colldef/ > head/usr.bin/mklocale/ > Modified: > head/ObsoleteFiles.inc > head/usr.bin/Makefile > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Tue Sep 10 07:47:52 2019 (r352127) > +++ head/ObsoleteFiles.inc Tue Sep 10 07:54:49 2019 (r352128) > @@ -38,6 +38,11 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20190910: mklocale(1) and colldef(1) removed > +OLD_FILES+=usr.bin/mklocale ^^^^^^^^^^ should be usr/bin/mklocale > +OLD_FILES+=usr/share/man/man1/mklocale.1.gz > +OLD_FILES+=usr.bin/colldef ^^^^^^^^^^ should be usr/bin/colldef > +OLD_FILES+=usr/share/man/man1/colldef.1.gz > # 20190904: Remove boot1.efifat > OLD_FILES+=boot/boot1.efifat > # 20190903: pc-sysinstall(8) removed Regards -- Niclas From owner-svn-src-all@freebsd.org Tue Sep 10 08:28:45 2019 Return-Path: Delivered-To: svn-src-all@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 1CDDCF70D8; Tue, 10 Sep 2019 08:28:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SJ8X71zVz48JF; Tue, 10 Sep 2019 08:28:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D5C2362B; Tue, 10 Sep 2019 08:28:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A8SiLU021341; Tue, 10 Sep 2019 08:28:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A8SiZO021340; Tue, 10 Sep 2019 08:28:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909100828.x8A8SiZO021340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 08:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352131 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:28:45 -0000 Author: bapt Date: Tue Sep 10 08:28:44 2019 New Revision: 352131 URL: https://svnweb.freebsd.org/changeset/base/352131 Log: Fix bad path Reported by: zeising Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Sep 10 08:19:46 2019 (r352130) +++ head/ObsoleteFiles.inc Tue Sep 10 08:28:44 2019 (r352131) @@ -39,9 +39,9 @@ # done # 20190910: mklocale(1) and colldef(1) removed -OLD_FILES+=usr.bin/mklocale +OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz -OLD_FILES+=usr.bin/colldef +OLD_FILES+=usr/bin/colldef OLD_FILES+=usr/share/man/man1/colldef.1.gz # 20190904: Remove boot1.efifat OLD_FILES+=boot/boot1.efifat From owner-svn-src-all@freebsd.org Tue Sep 10 08:51:11 2019 Return-Path: Delivered-To: svn-src-all@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 EC331F7D0A; Tue, 10 Sep 2019 08:51:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SJfR5fW3z4BBJ; Tue, 10 Sep 2019 08:51:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A544B23A12; Tue, 10 Sep 2019 08:51:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8A8pB80036536; Tue, 10 Sep 2019 08:51:11 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A8pB6X036505; Tue, 10 Sep 2019 08:51:11 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909100851.x8A8pB6X036505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 10 Sep 2019 08:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352132 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 352132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 08:51:12 -0000 Author: lwhsu Date: Tue Sep 10 08:51:11 2019 New Revision: 352132 URL: https://svnweb.freebsd.org/changeset/base/352132 Log: Fix build for the platforms where db_expr_t is not long Sponsored by: The FreeBSD Foundation Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Sep 10 08:28:44 2019 (r352131) +++ head/sys/net/rtsock.c Tue Sep 10 08:51:11 2019 (r352132) @@ -2226,7 +2226,7 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl if (af == AF_INET && db_tok_number > UINT8_MAX) { db_printf("Not a valid v4 octet: %ld\n", - db_tok_number); + (long)db_tok_number); goto exit; } hextets[i] = db_tok_number; From owner-svn-src-all@freebsd.org Tue Sep 10 09:57:25 2019 Return-Path: Delivered-To: svn-src-all@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 6E8CCD1AD8; Tue, 10 Sep 2019 09:57:25 +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 46SL6s2LPbz4Fy4; Tue, 10 Sep 2019 09:57:25 +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 2F5CB2466D; Tue, 10 Sep 2019 09:57:25 +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 x8A9vPMT075159; Tue, 10 Sep 2019 09:57:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8A9vPXn075158; Tue, 10 Sep 2019 09:57:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909100957.x8A9vPXn075158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Sep 2019 09:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352133 - stable/11/usr.bin/proccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/usr.bin/proccontrol X-SVN-Commit-Revision: 352133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 09:57:25 -0000 Author: kib Date: Tue Sep 10 09:57:24 2019 New Revision: 352133 URL: https://svnweb.freebsd.org/changeset/base/352133 Log: MFC r351774: Add stackgap control mode to proccontrol(1). PR: 239894 Modified: stable/11/usr.bin/proccontrol/proccontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/proccontrol/proccontrol.c ============================================================================== --- stable/11/usr.bin/proccontrol/proccontrol.c Tue Sep 10 08:51:11 2019 (r352132) +++ stable/11/usr.bin/proccontrol/proccontrol.c Tue Sep 10 09:57:24 2019 (r352133) @@ -42,6 +42,7 @@ enum { MODE_INVALID, MODE_TRACE, MODE_TRAPCAP, + MODE_STACKGAP, }; static pid_t @@ -62,7 +63,7 @@ static void __dead2 usage(void) { - fprintf(stderr, "Usage: proccontrol -m (trace|trapcap) [-q] " + fprintf(stderr, "Usage: proccontrol -m (trace|trapcap|stackgap) [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -85,6 +86,8 @@ main(int argc, char *argv[]) mode = MODE_TRACE; else if (strcmp(optarg, "trapcap") == 0) mode = MODE_TRAPCAP; + else if (strcmp(optarg, "stackgap") == 0) + mode = MODE_STACKGAP; else usage(); break; @@ -127,6 +130,9 @@ main(int argc, char *argv[]) case MODE_TRAPCAP: error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, &arg); break; + case MODE_STACKGAP: + error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, &arg); + break; default: usage(); break; @@ -152,6 +158,26 @@ main(int argc, char *argv[]) break; } break; + case MODE_STACKGAP: + switch (arg & (PROC_STACKGAP_ENABLE | + PROC_STACKGAP_DISABLE)) { + case PROC_STACKGAP_ENABLE: + printf("enabled\n"); + break; + case PROC_STACKGAP_DISABLE: + printf("disabled\n"); + break; + } + switch (arg & (PROC_STACKGAP_ENABLE_EXEC | + PROC_STACKGAP_DISABLE_EXEC)) { + case PROC_STACKGAP_ENABLE_EXEC: + printf("enabled after exec\n"); + break; + case PROC_STACKGAP_DISABLE_EXEC: + printf("disabled after exec\n"); + break; + } + break; } } else { switch (mode) { @@ -164,6 +190,12 @@ main(int argc, char *argv[]) arg = enable ? PROC_TRAPCAP_CTL_ENABLE : PROC_TRAPCAP_CTL_DISABLE; error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, &arg); + break; + case MODE_STACKGAP: + arg = enable ? PROC_STACKGAP_ENABLE_EXEC : + (PROC_STACKGAP_DISABLE | + PROC_STACKGAP_DISABLE_EXEC); + error = procctl(P_PID, pid, PROC_STACKGAP_CTL, &arg); break; default: usage(); From owner-svn-src-all@freebsd.org Tue Sep 10 13:55:47 2019 Return-Path: Delivered-To: svn-src-all@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 09A68D7125; Tue, 10 Sep 2019 13:55:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SRPv06fcz4SqZ; Tue, 10 Sep 2019 13:55:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E5F2713E; Tue, 10 Sep 2019 13:55:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ADtkeK017379; Tue, 10 Sep 2019 13:55:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ADtiSm017368; Tue, 10 Sep 2019 13:55:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909101355.x8ADtiSm017368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 13:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352134 - in vendor/NetBSD/libedit/dist: . TEST readline X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/NetBSD/libedit/dist: . TEST readline X-SVN-Commit-Revision: 352134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 13:55:47 -0000 Author: bapt Date: Tue Sep 10 13:55:44 2019 New Revision: 352134 URL: https://svnweb.freebsd.org/changeset/base/352134 Log: Update libedit to snapshot 2019-09-10 Added: vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c (contents, props changed) Modified: vendor/NetBSD/libedit/dist/TEST/Makefile vendor/NetBSD/libedit/dist/chared.c vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/dist/common.c vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/dist/el.h vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/dist/filecomplete.c vendor/NetBSD/libedit/dist/hist.c vendor/NetBSD/libedit/dist/history.c vendor/NetBSD/libedit/dist/keymacro.c vendor/NetBSD/libedit/dist/literal.c vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/dist/parse.c vendor/NetBSD/libedit/dist/read.c vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/dist/refresh.c vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/dist/terminal.c vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/dist/tty.h vendor/NetBSD/libedit/dist/vi.c Modified: vendor/NetBSD/libedit/dist/TEST/Makefile ============================================================================== --- vendor/NetBSD/libedit/dist/TEST/Makefile Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/TEST/Makefile Tue Sep 10 13:55:44 2019 (r352134) @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.7 2016/03/23 22:27:48 christos Exp $ +# $NetBSD: Makefile,v 1.8 2017/10/15 18:59:00 abhinav Exp $ NOMAN=1 -PROG=wtc1 +PROG=wtc1 test_filecompletion CPPFLAGS=-I${.CURDIR}/.. LDADD+=-ledit -ltermlib DPADD+=${LIBEDIT} ${LIBTERMLIB} Added: vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c Tue Sep 10 13:55:44 2019 (r352134) @@ -0,0 +1,553 @@ +/* $NetBSD: test_filecompletion.c,v 1.5 2019/09/08 05:50:58 abhinav Exp $ */ + +/*- + * Copyright (c) 2017 Abhinav Upadhyay + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "filecomplete.h" +#include "el.h" + +typedef struct { + const wchar_t *user_typed_text; /* The actual text typed by the user on the terminal */ + const char *completion_function_input ; /*the text received by fn_filename_completion_function */ + const char *expanded_text[2]; /* the value to which completion_function_input should be expanded */ + const wchar_t *escaped_output; /* expected escaped value of expanded_text */ +} test_input; + +static test_input inputs[] = { + { + /* simple test for escaping angular brackets */ + L"ls ang", + "ang", + {"angtest", NULL}, + L"ls ang\\test " + }, + { + /* test angular bracket inside double quotes: ls "dq_ang */ + L"ls \"dq_ang", + "dq_ang", + {"dq_angtest", NULL}, + L"ls \"dq_angtest\"" + }, + { + /* test angular bracket inside singlq quotes: ls "sq_ang */ + L"ls 'sq_ang", + "sq_ang", + {"sq_angtest", NULL}, + L"ls 'sq_angtest'" + }, + { + /* simple test for backslash */ + L"ls back", + "back", + {"backslash\\test", NULL}, + L"ls backslash\\\\test " + }, + { + /* backslash inside single quotes */ + L"ls 'sback", + "sback", + {"sbackslash\\test", NULL}, + L"ls 'sbackslash\\test'" + }, + { + /* backslash inside double quotes */ + L"ls \"dback", + "dback", + {"dbackslash\\test", NULL}, + L"ls \"dbackslash\\\\test\"" + }, + { + /* test braces */ + L"ls br", + "br", + {"braces{test}", NULL}, + L"ls braces\\{test\\} " + }, + { + /* test braces inside single quotes */ + L"ls 'sbr", + "sbr", + {"sbraces{test}", NULL}, + L"ls 'sbraces{test}'" + }, + { + /* test braces inside double quotes */ + L"ls \"dbr", + "dbr", + {"dbraces{test}", NULL}, + L"ls \"dbraces{test}\"" + }, + { + /* test dollar */ + L"ls doll", + "doll", + {"doll$artest", NULL}, + L"ls doll\\$artest " + }, + { + /* test dollar inside single quotes */ + L"ls 'sdoll", + "sdoll", + {"sdoll$artest", NULL}, + L"ls 'sdoll$artest'" + }, + { + /* test dollar inside double quotes */ + L"ls \"ddoll", + "ddoll", + {"ddoll$artest", NULL}, + L"ls \"ddoll\\$artest\"" + }, + { + /* test equals */ + L"ls eq", + "eq", + {"equals==test", NULL}, + L"ls equals\\=\\=test " + }, + { + /* test equals inside sinqle quotes */ + L"ls 'seq", + "seq", + {"sequals==test", NULL}, + L"ls 'sequals==test'" + }, + { + /* test equals inside double quotes */ + L"ls \"deq", + "deq", + {"dequals==test", NULL}, + L"ls \"dequals==test\"" + }, + { + /* test \n */ + L"ls new", + "new", + {"new\\nline", NULL}, + L"ls new\\\\nline " + }, + { + /* test \n inside single quotes */ + L"ls 'snew", + "snew", + {"snew\nline", NULL}, + L"ls 'snew\nline'" + }, + { + /* test \n inside double quotes */ + L"ls \"dnew", + "dnew", + {"dnew\nline", NULL}, + L"ls \"dnew\nline\"" + }, + { + /* test single space */ + L"ls spac", + "spac", + {"space test", NULL}, + L"ls space\\ test " + }, + { + /* test single space inside singlq quotes */ + L"ls 's_spac", + "s_spac", + {"s_space test", NULL}, + L"ls 's_space test'" + }, + { + /* test single space inside double quotes */ + L"ls \"d_spac", + "d_spac", + {"d_space test", NULL}, + L"ls \"d_space test\"" + }, + { + /* test multiple spaces */ + L"ls multi", + "multi", + {"multi space test", NULL}, + L"ls multi\\ space\\ \\ test " + }, + { + /* test multiple spaces inside single quotes */ + L"ls 's_multi", + "s_multi", + {"s_multi space test", NULL}, + L"ls 's_multi space test'" + }, + { + /* test multiple spaces inside double quotes */ + L"ls \"d_multi", + "d_multi", + {"d_multi space test", NULL}, + L"ls \"d_multi space test\"" + }, + { + /* test double quotes */ + L"ls doub", + "doub", + {"doub\"quotes", NULL}, + L"ls doub\\\"quotes " + }, + { + /* test double quotes inside single quotes */ + L"ls 's_doub", + "s_doub", + {"s_doub\"quotes", NULL}, + L"ls 's_doub\"quotes'" + }, + { + /* test double quotes inside double quotes */ + L"ls \"d_doub", + "d_doub", + {"d_doub\"quotes", NULL}, + L"ls \"d_doub\\\"quotes\"" + }, + { + /* test multiple double quotes */ + L"ls mud", + "mud", + {"mud\"qu\"otes\"", NULL}, + L"ls mud\\\"qu\\\"otes\\\" " + }, + { + /* test multiple double quotes inside single quotes */ + L"ls 'smud", + "smud", + {"smud\"qu\"otes\"", NULL}, + L"ls 'smud\"qu\"otes\"'" + }, + { + /* test multiple double quotes inside double quotes */ + L"ls \"dmud", + "dmud", + {"dmud\"qu\"otes\"", NULL}, + L"ls \"dmud\\\"qu\\\"otes\\\"\"" + }, + { + /* test one single quote */ + L"ls sing", + "sing", + {"single'quote", NULL}, + L"ls single\\'quote " + }, + { + /* test one single quote inside single quote */ + L"ls 'ssing", + "ssing", + {"ssingle'quote", NULL}, + L"ls 'ssingle'\\''quote'" + }, + { + /* test one single quote inside double quote */ + L"ls \"dsing", + "dsing", + {"dsingle'quote", NULL}, + L"ls \"dsingle'quote\"" + }, + { + /* test multiple single quotes */ + L"ls mu_sing", + "mu_sing", + {"mu_single''quotes''", NULL}, + L"ls mu_single\\'\\'quotes\\'\\' " + }, + { + /* test multiple single quotes inside single quote */ + L"ls 'smu_sing", + "smu_sing", + {"smu_single''quotes''", NULL}, + L"ls 'smu_single'\\'''\\''quotes'\\\'''\\'''" + }, + { + /* test multiple single quotes inside double quote */ + L"ls \"dmu_sing", + "dmu_sing", + {"dmu_single''quotes''", NULL}, + L"ls \"dmu_single''quotes''\"" + }, + { + /* test parenthesis */ + L"ls paren", + "paren", + {"paren(test)", NULL}, + L"ls paren\\(test\\) " + }, + { + /* test parenthesis inside single quote */ + L"ls 'sparen", + "sparen", + {"sparen(test)", NULL}, + L"ls 'sparen(test)'" + }, + { + /* test parenthesis inside double quote */ + L"ls \"dparen", + "dparen", + {"dparen(test)", NULL}, + L"ls \"dparen(test)\"" + }, + { + /* test pipe */ + L"ls pip", + "pip", + {"pipe|test", NULL}, + L"ls pipe\\|test " + }, + { + /* test pipe inside single quote */ + L"ls 'spip", + "spip", + {"spipe|test", NULL}, + L"ls 'spipe|test'", + }, + { + /* test pipe inside double quote */ + L"ls \"dpip", + "dpip", + {"dpipe|test", NULL}, + L"ls \"dpipe|test\"" + }, + { + /* test tab */ + L"ls ta", + "ta", + {"tab\ttest", NULL}, + L"ls tab\\\ttest " + }, + { + /* test tab inside single quote */ + L"ls 'sta", + "sta", + {"stab\ttest", NULL}, + L"ls 'stab\ttest'" + }, + { + /* test tab inside double quote */ + L"ls \"dta", + "dta", + {"dtab\ttest", NULL}, + L"ls \"dtab\ttest\"" + }, + { + /* test back tick */ + L"ls tic", + "tic", + {"tick`test`", NULL}, + L"ls tick\\`test\\` " + }, + { + /* test back tick inside single quote */ + L"ls 'stic", + "stic", + {"stick`test`", NULL}, + L"ls 'stick`test`'" + }, + { + /* test back tick inside double quote */ + L"ls \"dtic", + "dtic", + {"dtick`test`", NULL}, + L"ls \"dtick\\`test\\`\"" + }, + { + /* test for @ */ + L"ls at", + "at", + {"atthe@rate", NULL}, + L"ls atthe\\@rate " + }, + { + /* test for @ inside single quote */ + L"ls 'sat", + "sat", + {"satthe@rate", NULL}, + L"ls 'satthe@rate'" + }, + { + /* test for @ inside double quote */ + L"ls \"dat", + "dat", + {"datthe@rate", NULL}, + L"ls \"datthe@rate\"" + }, + { + /* test ; */ + L"ls semi", + "semi", + {"semi;colon;test", NULL}, + L"ls semi\\;colon\\;test " + }, + { + /* test ; inside single quote */ + L"ls 'ssemi", + "ssemi", + {"ssemi;colon;test", NULL}, + L"ls 'ssemi;colon;test'" + }, + { + /* test ; inside double quote */ + L"ls \"dsemi", + "dsemi", + {"dsemi;colon;test", NULL}, + L"ls \"dsemi;colon;test\"" + }, + { + /* test & */ + L"ls amp", + "amp", + {"ampers&and", NULL}, + L"ls ampers\\&and " + }, + { + /* test & inside single quote */ + L"ls 'samp", + "samp", + {"sampers&and", NULL}, + L"ls 'sampers&and'" + }, + { + /* test & inside double quote */ + L"ls \"damp", + "damp", + {"dampers&and", NULL}, + L"ls \"dampers&and\"" + }, + { + /* test completion when cursor at \ */ + L"ls foo\\", + "foo", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test completion when cursor at single quote */ + L"ls foo'", + "foo'", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test completion when cursor at double quote */ + L"ls foo\"", + "foo\"", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test multiple completion matches */ + L"ls fo", + "fo", + {"foo bar", "foo baz"}, + L"ls foo\\ ba" + }, + { + L"ls ba", + "ba", + {"bar ", "bar "}, + L"ls bar\\ \\<=;|&{("; + +/* + * Custom completion function passed to fn_complet, NULLe. + * The function returns hardcoded completion matches + * based on the test cases present in inputs[] (above) + */ +static char * +mycomplet_func(const char *text, int index) +{ + static int last_index = 0; + size_t i = 0; + if (last_index == 2) { + last_index = 0; + return NULL; + } + + for (i = 0; i < sizeof(inputs)/sizeof(inputs[0]); i++) { + if (strcmp(text, inputs[i].completion_function_input) == 0) { + if (inputs[i].expanded_text[last_index] != NULL) + return strdup(inputs[i].expanded_text[last_index++]); + else { + last_index = 0; + return NULL; + } + } + } + + return NULL; +} + +int +main(int argc, char **argv) +{ + EditLine *el = el_init(argv[0], stdin, stdout, stderr); + size_t i; + size_t input_len; + el_line_t line; + wchar_t *buffer = malloc(64 * sizeof(*buffer)); + if (buffer == NULL) + err(EXIT_FAILURE, "malloc failed"); + + for (i = 0; i < sizeof(inputs)/sizeof(inputs[0]); i++) { + memset(buffer, 0, 64 * sizeof(*buffer)); + input_len = wcslen(inputs[i].user_typed_text); + wmemcpy(buffer, inputs[i].user_typed_text, input_len); + buffer[input_len] = 0; + line.buffer = buffer; + line.cursor = line.buffer + input_len ; + line.lastchar = line.cursor - 1; + line.limit = line.buffer + 64 * sizeof(*buffer); + el->el_line = line; + fn_complete(el, mycomplet_func, NULL, break_chars, NULL, NULL, 10, NULL, NULL, NULL, NULL); + + /* + * fn_complete would have expanded and escaped the input in el->el_line.buffer. + * We need to assert that it matches with the expected value in our test data + */ + printf("User input: %ls\t Expected output: %ls\t Generated output: %ls\n", + inputs[i].user_typed_text, inputs[i].escaped_output, el->el_line.buffer); + assert(wcscmp(el->el_line.buffer, inputs[i].escaped_output) == 0); + } + el_end(el); + return 0; + +} Modified: vendor/NetBSD/libedit/dist/chared.c ============================================================================== --- vendor/NetBSD/libedit/dist/chared.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/chared.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.56 2016/05/22 19:44:26 christos Exp $ */ +/* $NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.56 2016/05/22 19:44:26 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -174,7 +174,7 @@ c_delbefore(EditLine *el, int num) wchar_t *cp; for (cp = el->el_line.cursor - num; - cp <= el->el_line.lastchar; + &cp[num] <= el->el_line.lastchar; cp++) *cp = cp[num]; @@ -396,26 +396,22 @@ cv__endword(wchar_t *p, wchar_t *high, int n, int (*wt libedit_private int ch_init(EditLine *el) { - el->el_line.buffer = el_malloc(EL_BUFSIZ * + el->el_line.buffer = el_calloc(EL_BUFSIZ, sizeof(*el->el_line.buffer)); if (el->el_line.buffer == NULL) return -1; - (void) memset(el->el_line.buffer, 0, EL_BUFSIZ * - sizeof(*el->el_line.buffer)); el->el_line.cursor = el->el_line.buffer; el->el_line.lastchar = el->el_line.buffer; el->el_line.limit = &el->el_line.buffer[EL_BUFSIZ - EL_LEAVE]; - el->el_chared.c_undo.buf = el_malloc(EL_BUFSIZ * + el->el_chared.c_undo.buf = el_calloc(EL_BUFSIZ, sizeof(*el->el_chared.c_undo.buf)); if (el->el_chared.c_undo.buf == NULL) return -1; - (void) memset(el->el_chared.c_undo.buf, 0, EL_BUFSIZ * - sizeof(*el->el_chared.c_undo.buf)); el->el_chared.c_undo.len = -1; el->el_chared.c_undo.cursor = 0; - el->el_chared.c_redo.buf = el_malloc(EL_BUFSIZ * + el->el_chared.c_redo.buf = el_calloc(EL_BUFSIZ, sizeof(*el->el_chared.c_redo.buf)); if (el->el_chared.c_redo.buf == NULL) return -1; @@ -426,12 +422,10 @@ ch_init(EditLine *el) el->el_chared.c_vcmd.action = NOP; el->el_chared.c_vcmd.pos = el->el_line.buffer; - el->el_chared.c_kill.buf = el_malloc(EL_BUFSIZ * + el->el_chared.c_kill.buf = el_calloc(EL_BUFSIZ, sizeof(*el->el_chared.c_kill.buf)); if (el->el_chared.c_kill.buf == NULL) return -1; - (void) memset(el->el_chared.c_kill.buf, 0, EL_BUFSIZ * - sizeof(*el->el_chared.c_kill.buf)); el->el_chared.c_kill.mark = el->el_line.buffer; el->el_chared.c_kill.last = el->el_chared.c_kill.buf; el->el_chared.c_resizefun = NULL; @@ -591,7 +585,7 @@ ch_end(EditLine *el) /* el_insertstr(): - * Insert string at cursorI + * Insert string at cursor */ int el_winsertstr(EditLine *el, const wchar_t *s) Modified: vendor/NetBSD/libedit/dist/chartype.c ============================================================================== --- vendor/NetBSD/libedit/dist/chartype.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/chartype.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.31 2017/01/09 02:54:18 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.35 2019/07/23 10:18:52 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -31,10 +31,11 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.31 2017/01/09 02:54:18 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.35 2019/07/23 10:18:52 christos Exp $"); #endif /* not lint && not SCCSID */ #include +#include #include #include @@ -156,7 +157,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) return NULL; - wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv)); + wargv = el_calloc((size_t)(argc + 1), sizeof(*wargv)); for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { /* don't pass null pointers to mbstowcs */ @@ -183,17 +184,14 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer libedit_private size_t ct_enc_width(wchar_t c) { - /* UTF-8 encoding specific values */ - if (c < 0x80) - return 1; - else if (c < 0x0800) - return 2; - else if (c < 0x10000) - return 3; - else if (c < 0x110000) - return 4; - else - return 0; /* not a valid codepoint */ + mbstate_t mbs; + char buf[MB_LEN_MAX]; + size_t size; + memset(&mbs, 0, sizeof(mbs)); + + if ((size = wcrtomb(buf, c, &mbs)) == (size_t)-1) + return 0; + return size; } libedit_private ssize_t Modified: vendor/NetBSD/libedit/dist/common.c ============================================================================== --- vendor/NetBSD/libedit/dist/common.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/common.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.47 2016/05/22 19:44:26 christos Exp $ */ +/* $NetBSD: common.c,v 1.48 2018/02/26 17:36:14 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: common.c,v 1.47 2016/05/22 19:44:26 christos Exp $"); +__RCSID("$NetBSD: common.c,v 1.48 2018/02/26 17:36:14 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -363,15 +363,17 @@ ed_prev_char(EditLine *el, wint_t c __attribute__((__u * [^V] [^V] */ libedit_private el_action_t -ed_quoted_insert(EditLine *el, wint_t c) +/*ARGSUSED*/ +ed_quoted_insert(EditLine *el, wint_t c __attribute__((__unused__))) { int num; + wchar_t ch; tty_quotemode(el); - num = el_wgetc(el, &c); + num = el_wgetc(el, &ch); tty_noquotemode(el); if (num == 1) - return ed_insert(el, c); + return ed_insert(el, ch); else return ed_end_of_file(el, 0); } Modified: vendor/NetBSD/libedit/dist/editline.3 ============================================================================== --- vendor/NetBSD/libedit/dist/editline.3 Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/editline.3 Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.98 2017/09/02 06:48:10 wiz Exp $ +.\" $NetBSD: editline.3,v 1.99 2018/11/18 17:09:39 christos Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 1, 2017 +.Dd November 9, 2018 .Dt EDITLINE 3 .Os .Sh NAME @@ -181,8 +181,6 @@ library respects the locale set by the application program and never uses .Xr setlocale 3 to change the locale. -The only locales supported are UTF-8 and the default C or POSIX locale. -If any other locale is set, behaviour is undefined. .Sh LINE EDITING FUNCTIONS The line editing functions use a common data structure, .Fa EditLine , Modified: vendor/NetBSD/libedit/dist/el.c ============================================================================== --- vendor/NetBSD/libedit/dist/el.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/el.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.95 2017/09/05 18:07:59 christos Exp $ */ +/* $NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.95 2017/09/05 18:07:59 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -71,13 +71,11 @@ libedit_private EditLine * el_init_internal(const char *prog, FILE *fin, FILE *fout, FILE *ferr, int fdin, int fdout, int fderr, int flags) { - EditLine *el = el_malloc(sizeof(*el)); + EditLine *el = el_calloc(1, sizeof(*el)); if (el == NULL) return NULL; - memset(el, 0, sizeof(EditLine)); - el->el_infile = fin; el->el_outfile = fout; el->el_errfile = ferr; @@ -96,10 +94,6 @@ el_init_internal(const char *prog, FILE *fin, FILE *fo * Initialize all the modules. Order is important!!! */ el->el_flags = flags; - if (setlocale(LC_CTYPE, NULL) != NULL){ - if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) - el->el_flags |= CHARSET_IS_UTF8; - } if (terminal_init(el) == -1) { el_free(el->el_prog); @@ -146,7 +140,7 @@ el_end(EditLine *el) keymacro_end(el); map_end(el); if (!(el->el_flags & NO_TTY)) - tty_end(el); + tty_end(el, TCSAFLUSH); ch_end(el); read_end(el->el_read); search_end(el); @@ -301,7 +295,7 @@ el_wset(EditLine *el, int op, ...) void *ptr = va_arg(ap, void *); rv = hist_set(el, func, ptr); - if (!(el->el_flags & CHARSET_IS_UTF8)) + if (MB_CUR_MAX == 1) el->el_flags &= ~NARROW_HISTORY; break; } @@ -443,15 +437,11 @@ el_wget(EditLine *el, int op, ...) case EL_GETTC: { static char name[] = "gettc"; - char *argv[20]; - int i; - - for (i = 1; i < (int)__arraycount(argv); i++) - if ((argv[i] = va_arg(ap, char *)) == NULL) - break; - + char *argv[3]; argv[0] = name; - rv = terminal_gettc(el, i, argv); + argv[1] = va_arg(ap, char *); + argv[2] = va_arg(ap, void *); + rv = terminal_gettc(el, 3, argv); break; } @@ -542,7 +532,7 @@ el_source(EditLine *el, const char *fname) if ((ptr = getenv("HOME")) == NULL) return -1; plen += strlen(ptr); - if ((path = el_malloc(plen * sizeof(*path))) == NULL) + if ((path = el_calloc(plen, sizeof(*path))) == NULL) return -1; (void)snprintf(path, plen, "%s%s", ptr, elpath + (*ptr == '\0')); Modified: vendor/NetBSD/libedit/dist/el.h ============================================================================== --- vendor/NetBSD/libedit/dist/el.h Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/el.h Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: el.h,v 1.43 2017/09/05 18:07:59 christos Exp $ */ +/* $NetBSD: el.h,v 1.45 2019/07/23 10:18:52 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -55,7 +55,6 @@ #define NO_TTY 0x02 #define EDIT_DISABLED 0x04 #define UNBUFFERED 0x08 -#define CHARSET_IS_UTF8 0x10 #define NARROW_HISTORY 0x40 #define NO_RESET 0x80 @@ -90,6 +89,7 @@ typedef struct el_state_t { * Until we come up with something better... */ #define el_malloc(a) malloc(a) +#define el_calloc(a,b) calloc(a, b) #define el_realloc(a,b) realloc(a, b) #define el_free(a) free(a) Modified: vendor/NetBSD/libedit/dist/eln.c ============================================================================== --- vendor/NetBSD/libedit/dist/eln.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/eln.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $ */ +/* $NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -321,14 +321,12 @@ el_get(EditLine *el, int op, ...) break; case EL_GETTC: { - char *argv[20]; + char *argv[3]; static char gettc[] = "gettc"; - int i; - for (i = 1; i < (int)__arraycount(argv); ++i) - if ((argv[i] = va_arg(ap, char *)) == NULL) - break; argv[0] = gettc; - ret = terminal_gettc(el, i, argv); + argv[1] = va_arg(ap, char *); + argv[2] = va_arg(ap, void *); + ret = terminal_gettc(el, 3, argv); break; } Modified: vendor/NetBSD/libedit/dist/filecomplete.c ============================================================================== --- vendor/NetBSD/libedit/dist/filecomplete.c Tue Sep 10 09:57:24 2019 (r352133) +++ vendor/NetBSD/libedit/dist/filecomplete.c Tue Sep 10 13:55:44 2019 (r352134) @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.45 2017/04/21 05:38:03 abhinav Exp $ */ +/* $NetBSD: filecomplete.c,v 1.58 2019/09/08 05:50:58 abhinav Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: filecomplete.c,v 1.45 2017/04/21 05:38:03 abhinav Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.58 2019/09/08 05:50:58 abhinav Exp $"); #endif /* not lint && not SCCSID */ #include @@ -83,7 +83,7 @@ fn_tilde_expand(const char *txt) } else { /* text until string after slash */ len = (size_t)(temp - txt + 1); - temp = el_malloc(len * sizeof(*temp)); + temp = el_calloc(len, sizeof(*temp)); if (temp == NULL) return NULL; (void)strncpy(temp, txt + 1, len - 2); @@ -118,7 +118,7 @@ fn_tilde_expand(const char *txt) txt += len; len = strlen(pass->pw_dir) + 1 + strlen(txt) + 1; - temp = el_malloc(len * sizeof(*temp)); + temp = el_calloc(len, sizeof(*temp)); if (temp == NULL) return NULL; (void)snprintf(temp, len, "%s/%s", pass->pw_dir, txt); @@ -126,7 +126,193 @@ fn_tilde_expand(const char *txt) return temp; } +static int +needs_escaping(char c) +{ + switch (c) { + case '\'': + case '"': + case '(': + case ')': + case '\\': + case '<': + case '>': + case '$': + case '#': + case ' ': + case '\n': + case '\t': + case '?': + case ';': + case '`': + case '@': + case '=': + case '|': + case '{': + case '}': + case '&': + case '*': + case '[': + return 1; + default: + return 0; + } +} +static int +needs_dquote_escaping(char c) +{ + switch (c) { + case '"': + case '\\': + case '`': + case '$': + return 1; + default: + return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 13:56:37 2019 Return-Path: Delivered-To: svn-src-all@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 DD6D3D71C8; Tue, 10 Sep 2019 13:56:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SRQs6HjMz4Sy7; Tue, 10 Sep 2019 13:56:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1B9327140; Tue, 10 Sep 2019 13:56:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ADubER017467; Tue, 10 Sep 2019 13:56:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ADubYs017463; Tue, 10 Sep 2019 13:56:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909101356.x8ADubYs017463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 13:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352135 - in vendor/NetBSD/libedit/2019-09-10: . TEST readline X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/NetBSD/libedit/2019-09-10: . TEST readline X-SVN-Commit-Revision: 352135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 13:56:37 -0000 Author: bapt Date: Tue Sep 10 13:56:36 2019 New Revision: 352135 URL: https://svnweb.freebsd.org/changeset/base/352135 Log: Tag import of libedit snapshot 2019-09-10 Added: vendor/NetBSD/libedit/2019-09-10/ - copied from r338453, vendor/NetBSD/libedit/dist/ vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c Replaced: vendor/NetBSD/libedit/2019-09-10/TEST/Makefile - copied unchanged from r352134, vendor/NetBSD/libedit/dist/TEST/Makefile vendor/NetBSD/libedit/2019-09-10/chared.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/chared.c vendor/NetBSD/libedit/2019-09-10/chartype.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/2019-09-10/common.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/common.c vendor/NetBSD/libedit/2019-09-10/editline.3 - copied unchanged from r352134, vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/2019-09-10/el.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/2019-09-10/el.h - copied unchanged from r352134, vendor/NetBSD/libedit/dist/el.h vendor/NetBSD/libedit/2019-09-10/eln.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/2019-09-10/filecomplete.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/filecomplete.c vendor/NetBSD/libedit/2019-09-10/hist.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/hist.c vendor/NetBSD/libedit/2019-09-10/history.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/history.c vendor/NetBSD/libedit/2019-09-10/keymacro.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/keymacro.c vendor/NetBSD/libedit/2019-09-10/literal.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/literal.c vendor/NetBSD/libedit/2019-09-10/map.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/2019-09-10/parse.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/parse.c vendor/NetBSD/libedit/2019-09-10/read.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/read.c vendor/NetBSD/libedit/2019-09-10/readline.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/2019-09-10/readline/readline.h - copied unchanged from r352134, vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/2019-09-10/refresh.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/refresh.c vendor/NetBSD/libedit/2019-09-10/search.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/2019-09-10/shlib_version - copied unchanged from r286801, vendor/NetBSD/libedit/dist/shlib_version vendor/NetBSD/libedit/2019-09-10/terminal.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/terminal.c vendor/NetBSD/libedit/2019-09-10/tty.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/2019-09-10/tty.h - copied unchanged from r352134, vendor/NetBSD/libedit/dist/tty.h vendor/NetBSD/libedit/2019-09-10/vi.c - copied unchanged from r352134, vendor/NetBSD/libedit/dist/vi.c Copied: vendor/NetBSD/libedit/2019-09-10/TEST/Makefile (from r352134, vendor/NetBSD/libedit/dist/TEST/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2019-09-10/TEST/Makefile Tue Sep 10 13:56:36 2019 (r352135, copy of r352134, vendor/NetBSD/libedit/dist/TEST/Makefile) @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.8 2017/10/15 18:59:00 abhinav Exp $ + +NOMAN=1 +PROG=wtc1 test_filecompletion +CPPFLAGS=-I${.CURDIR}/.. +LDADD+=-ledit -ltermlib +DPADD+=${LIBEDIT} ${LIBTERMLIB} + +.ifdef DEBUG +CPPFLAGS+=-DDEBUG +.endif + +.include Copied: vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c (from r352134, vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2019-09-10/TEST/test_filecompletion.c Tue Sep 10 13:56:36 2019 (r352135, copy of r352134, vendor/NetBSD/libedit/dist/TEST/test_filecompletion.c) @@ -0,0 +1,553 @@ +/* $NetBSD: test_filecompletion.c,v 1.5 2019/09/08 05:50:58 abhinav Exp $ */ + +/*- + * Copyright (c) 2017 Abhinav Upadhyay + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "filecomplete.h" +#include "el.h" + +typedef struct { + const wchar_t *user_typed_text; /* The actual text typed by the user on the terminal */ + const char *completion_function_input ; /*the text received by fn_filename_completion_function */ + const char *expanded_text[2]; /* the value to which completion_function_input should be expanded */ + const wchar_t *escaped_output; /* expected escaped value of expanded_text */ +} test_input; + +static test_input inputs[] = { + { + /* simple test for escaping angular brackets */ + L"ls ang", + "ang", + {"angtest", NULL}, + L"ls ang\\test " + }, + { + /* test angular bracket inside double quotes: ls "dq_ang */ + L"ls \"dq_ang", + "dq_ang", + {"dq_angtest", NULL}, + L"ls \"dq_angtest\"" + }, + { + /* test angular bracket inside singlq quotes: ls "sq_ang */ + L"ls 'sq_ang", + "sq_ang", + {"sq_angtest", NULL}, + L"ls 'sq_angtest'" + }, + { + /* simple test for backslash */ + L"ls back", + "back", + {"backslash\\test", NULL}, + L"ls backslash\\\\test " + }, + { + /* backslash inside single quotes */ + L"ls 'sback", + "sback", + {"sbackslash\\test", NULL}, + L"ls 'sbackslash\\test'" + }, + { + /* backslash inside double quotes */ + L"ls \"dback", + "dback", + {"dbackslash\\test", NULL}, + L"ls \"dbackslash\\\\test\"" + }, + { + /* test braces */ + L"ls br", + "br", + {"braces{test}", NULL}, + L"ls braces\\{test\\} " + }, + { + /* test braces inside single quotes */ + L"ls 'sbr", + "sbr", + {"sbraces{test}", NULL}, + L"ls 'sbraces{test}'" + }, + { + /* test braces inside double quotes */ + L"ls \"dbr", + "dbr", + {"dbraces{test}", NULL}, + L"ls \"dbraces{test}\"" + }, + { + /* test dollar */ + L"ls doll", + "doll", + {"doll$artest", NULL}, + L"ls doll\\$artest " + }, + { + /* test dollar inside single quotes */ + L"ls 'sdoll", + "sdoll", + {"sdoll$artest", NULL}, + L"ls 'sdoll$artest'" + }, + { + /* test dollar inside double quotes */ + L"ls \"ddoll", + "ddoll", + {"ddoll$artest", NULL}, + L"ls \"ddoll\\$artest\"" + }, + { + /* test equals */ + L"ls eq", + "eq", + {"equals==test", NULL}, + L"ls equals\\=\\=test " + }, + { + /* test equals inside sinqle quotes */ + L"ls 'seq", + "seq", + {"sequals==test", NULL}, + L"ls 'sequals==test'" + }, + { + /* test equals inside double quotes */ + L"ls \"deq", + "deq", + {"dequals==test", NULL}, + L"ls \"dequals==test\"" + }, + { + /* test \n */ + L"ls new", + "new", + {"new\\nline", NULL}, + L"ls new\\\\nline " + }, + { + /* test \n inside single quotes */ + L"ls 'snew", + "snew", + {"snew\nline", NULL}, + L"ls 'snew\nline'" + }, + { + /* test \n inside double quotes */ + L"ls \"dnew", + "dnew", + {"dnew\nline", NULL}, + L"ls \"dnew\nline\"" + }, + { + /* test single space */ + L"ls spac", + "spac", + {"space test", NULL}, + L"ls space\\ test " + }, + { + /* test single space inside singlq quotes */ + L"ls 's_spac", + "s_spac", + {"s_space test", NULL}, + L"ls 's_space test'" + }, + { + /* test single space inside double quotes */ + L"ls \"d_spac", + "d_spac", + {"d_space test", NULL}, + L"ls \"d_space test\"" + }, + { + /* test multiple spaces */ + L"ls multi", + "multi", + {"multi space test", NULL}, + L"ls multi\\ space\\ \\ test " + }, + { + /* test multiple spaces inside single quotes */ + L"ls 's_multi", + "s_multi", + {"s_multi space test", NULL}, + L"ls 's_multi space test'" + }, + { + /* test multiple spaces inside double quotes */ + L"ls \"d_multi", + "d_multi", + {"d_multi space test", NULL}, + L"ls \"d_multi space test\"" + }, + { + /* test double quotes */ + L"ls doub", + "doub", + {"doub\"quotes", NULL}, + L"ls doub\\\"quotes " + }, + { + /* test double quotes inside single quotes */ + L"ls 's_doub", + "s_doub", + {"s_doub\"quotes", NULL}, + L"ls 's_doub\"quotes'" + }, + { + /* test double quotes inside double quotes */ + L"ls \"d_doub", + "d_doub", + {"d_doub\"quotes", NULL}, + L"ls \"d_doub\\\"quotes\"" + }, + { + /* test multiple double quotes */ + L"ls mud", + "mud", + {"mud\"qu\"otes\"", NULL}, + L"ls mud\\\"qu\\\"otes\\\" " + }, + { + /* test multiple double quotes inside single quotes */ + L"ls 'smud", + "smud", + {"smud\"qu\"otes\"", NULL}, + L"ls 'smud\"qu\"otes\"'" + }, + { + /* test multiple double quotes inside double quotes */ + L"ls \"dmud", + "dmud", + {"dmud\"qu\"otes\"", NULL}, + L"ls \"dmud\\\"qu\\\"otes\\\"\"" + }, + { + /* test one single quote */ + L"ls sing", + "sing", + {"single'quote", NULL}, + L"ls single\\'quote " + }, + { + /* test one single quote inside single quote */ + L"ls 'ssing", + "ssing", + {"ssingle'quote", NULL}, + L"ls 'ssingle'\\''quote'" + }, + { + /* test one single quote inside double quote */ + L"ls \"dsing", + "dsing", + {"dsingle'quote", NULL}, + L"ls \"dsingle'quote\"" + }, + { + /* test multiple single quotes */ + L"ls mu_sing", + "mu_sing", + {"mu_single''quotes''", NULL}, + L"ls mu_single\\'\\'quotes\\'\\' " + }, + { + /* test multiple single quotes inside single quote */ + L"ls 'smu_sing", + "smu_sing", + {"smu_single''quotes''", NULL}, + L"ls 'smu_single'\\'''\\''quotes'\\\'''\\'''" + }, + { + /* test multiple single quotes inside double quote */ + L"ls \"dmu_sing", + "dmu_sing", + {"dmu_single''quotes''", NULL}, + L"ls \"dmu_single''quotes''\"" + }, + { + /* test parenthesis */ + L"ls paren", + "paren", + {"paren(test)", NULL}, + L"ls paren\\(test\\) " + }, + { + /* test parenthesis inside single quote */ + L"ls 'sparen", + "sparen", + {"sparen(test)", NULL}, + L"ls 'sparen(test)'" + }, + { + /* test parenthesis inside double quote */ + L"ls \"dparen", + "dparen", + {"dparen(test)", NULL}, + L"ls \"dparen(test)\"" + }, + { + /* test pipe */ + L"ls pip", + "pip", + {"pipe|test", NULL}, + L"ls pipe\\|test " + }, + { + /* test pipe inside single quote */ + L"ls 'spip", + "spip", + {"spipe|test", NULL}, + L"ls 'spipe|test'", + }, + { + /* test pipe inside double quote */ + L"ls \"dpip", + "dpip", + {"dpipe|test", NULL}, + L"ls \"dpipe|test\"" + }, + { + /* test tab */ + L"ls ta", + "ta", + {"tab\ttest", NULL}, + L"ls tab\\\ttest " + }, + { + /* test tab inside single quote */ + L"ls 'sta", + "sta", + {"stab\ttest", NULL}, + L"ls 'stab\ttest'" + }, + { + /* test tab inside double quote */ + L"ls \"dta", + "dta", + {"dtab\ttest", NULL}, + L"ls \"dtab\ttest\"" + }, + { + /* test back tick */ + L"ls tic", + "tic", + {"tick`test`", NULL}, + L"ls tick\\`test\\` " + }, + { + /* test back tick inside single quote */ + L"ls 'stic", + "stic", + {"stick`test`", NULL}, + L"ls 'stick`test`'" + }, + { + /* test back tick inside double quote */ + L"ls \"dtic", + "dtic", + {"dtick`test`", NULL}, + L"ls \"dtick\\`test\\`\"" + }, + { + /* test for @ */ + L"ls at", + "at", + {"atthe@rate", NULL}, + L"ls atthe\\@rate " + }, + { + /* test for @ inside single quote */ + L"ls 'sat", + "sat", + {"satthe@rate", NULL}, + L"ls 'satthe@rate'" + }, + { + /* test for @ inside double quote */ + L"ls \"dat", + "dat", + {"datthe@rate", NULL}, + L"ls \"datthe@rate\"" + }, + { + /* test ; */ + L"ls semi", + "semi", + {"semi;colon;test", NULL}, + L"ls semi\\;colon\\;test " + }, + { + /* test ; inside single quote */ + L"ls 'ssemi", + "ssemi", + {"ssemi;colon;test", NULL}, + L"ls 'ssemi;colon;test'" + }, + { + /* test ; inside double quote */ + L"ls \"dsemi", + "dsemi", + {"dsemi;colon;test", NULL}, + L"ls \"dsemi;colon;test\"" + }, + { + /* test & */ + L"ls amp", + "amp", + {"ampers&and", NULL}, + L"ls ampers\\&and " + }, + { + /* test & inside single quote */ + L"ls 'samp", + "samp", + {"sampers&and", NULL}, + L"ls 'sampers&and'" + }, + { + /* test & inside double quote */ + L"ls \"damp", + "damp", + {"dampers&and", NULL}, + L"ls \"dampers&and\"" + }, + { + /* test completion when cursor at \ */ + L"ls foo\\", + "foo", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test completion when cursor at single quote */ + L"ls foo'", + "foo'", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test completion when cursor at double quote */ + L"ls foo\"", + "foo\"", + {"foo bar", NULL}, + L"ls foo\\ bar " + }, + { + /* test multiple completion matches */ + L"ls fo", + "fo", + {"foo bar", "foo baz"}, + L"ls foo\\ ba" + }, + { + L"ls ba", + "ba", + {"bar ", "bar "}, + L"ls bar\\ \\<=;|&{("; + +/* + * Custom completion function passed to fn_complet, NULLe. + * The function returns hardcoded completion matches + * based on the test cases present in inputs[] (above) + */ +static char * +mycomplet_func(const char *text, int index) +{ + static int last_index = 0; + size_t i = 0; + if (last_index == 2) { + last_index = 0; + return NULL; + } + + for (i = 0; i < sizeof(inputs)/sizeof(inputs[0]); i++) { + if (strcmp(text, inputs[i].completion_function_input) == 0) { + if (inputs[i].expanded_text[last_index] != NULL) + return strdup(inputs[i].expanded_text[last_index++]); + else { + last_index = 0; + return NULL; + } + } + } + + return NULL; +} + +int +main(int argc, char **argv) +{ + EditLine *el = el_init(argv[0], stdin, stdout, stderr); + size_t i; + size_t input_len; + el_line_t line; + wchar_t *buffer = malloc(64 * sizeof(*buffer)); + if (buffer == NULL) + err(EXIT_FAILURE, "malloc failed"); + + for (i = 0; i < sizeof(inputs)/sizeof(inputs[0]); i++) { + memset(buffer, 0, 64 * sizeof(*buffer)); + input_len = wcslen(inputs[i].user_typed_text); + wmemcpy(buffer, inputs[i].user_typed_text, input_len); + buffer[input_len] = 0; + line.buffer = buffer; + line.cursor = line.buffer + input_len ; + line.lastchar = line.cursor - 1; + line.limit = line.buffer + 64 * sizeof(*buffer); + el->el_line = line; + fn_complete(el, mycomplet_func, NULL, break_chars, NULL, NULL, 10, NULL, NULL, NULL, NULL); + + /* + * fn_complete would have expanded and escaped the input in el->el_line.buffer. + * We need to assert that it matches with the expected value in our test data + */ + printf("User input: %ls\t Expected output: %ls\t Generated output: %ls\n", + inputs[i].user_typed_text, inputs[i].escaped_output, el->el_line.buffer); + assert(wcscmp(el->el_line.buffer, inputs[i].escaped_output) == 0); + } + el_end(el); + return 0; + +} Copied: vendor/NetBSD/libedit/2019-09-10/chared.c (from r352134, vendor/NetBSD/libedit/dist/chared.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2019-09-10/chared.c Tue Sep 10 13:56:36 2019 (r352135, copy of r352134, vendor/NetBSD/libedit/dist/chared.c) @@ -0,0 +1,747 @@ +/* $NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $ */ + +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Christos Zoulas of Cornell University. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" +#if !defined(lint) && !defined(SCCSID) +#if 0 +static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; +#else +__RCSID("$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $"); +#endif +#endif /* not lint && not SCCSID */ + +/* + * chared.c: Character editor utilities + */ +#include +#include +#include + +#include "el.h" +#include "common.h" +#include "fcns.h" + +/* value to leave unused in line buffer */ +#define EL_LEAVE 2 + +/* cv_undo(): + * Handle state for the vi undo command + */ +libedit_private void +cv_undo(EditLine *el) +{ + c_undo_t *vu = &el->el_chared.c_undo; + c_redo_t *r = &el->el_chared.c_redo; + size_t size; + + /* Save entire line for undo */ + size = (size_t)(el->el_line.lastchar - el->el_line.buffer); + vu->len = (ssize_t)size; + vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); + (void)memcpy(vu->buf, el->el_line.buffer, size * sizeof(*vu->buf)); + + /* save command info for redo */ + r->count = el->el_state.doingarg ? el->el_state.argument : 0; + r->action = el->el_chared.c_vcmd.action; + r->pos = r->buf; + r->cmd = el->el_state.thiscmd; + r->ch = el->el_state.thisch; +} + +/* cv_yank(): + * Save yank/delete data for paste + */ +libedit_private void +cv_yank(EditLine *el, const wchar_t *ptr, int size) +{ + c_kill_t *k = &el->el_chared.c_kill; + + (void)memcpy(k->buf, ptr, (size_t)size * sizeof(*k->buf)); + k->last = k->buf + size; +} + + +/* c_insert(): + * Insert num characters + */ +libedit_private void +c_insert(EditLine *el, int num) +{ + wchar_t *cp; + + if (el->el_line.lastchar + num >= el->el_line.limit) { + if (!ch_enlargebufs(el, (size_t)num)) + return; /* can't go past end of buffer */ + } + + if (el->el_line.cursor < el->el_line.lastchar) { + /* if I must move chars */ + for (cp = el->el_line.lastchar; cp >= el->el_line.cursor; cp--) + cp[num] = *cp; + } + el->el_line.lastchar += num; +} + + +/* c_delafter(): + * Delete num characters after the cursor + */ +libedit_private void +c_delafter(EditLine *el, int num) +{ + + if (el->el_line.cursor + num > el->el_line.lastchar) + num = (int)(el->el_line.lastchar - el->el_line.cursor); + + if (el->el_map.current != el->el_map.emacs) { + cv_undo(el); + cv_yank(el, el->el_line.cursor, num); + } + + if (num > 0) { + wchar_t *cp; + + for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++) + *cp = cp[num]; + + el->el_line.lastchar -= num; + } +} + + +/* c_delafter1(): + * Delete the character after the cursor, do not yank + */ +libedit_private void +c_delafter1(EditLine *el) +{ + wchar_t *cp; + + for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++) + *cp = cp[1]; + + el->el_line.lastchar--; +} + + +/* c_delbefore(): + * Delete num characters before the cursor + */ +libedit_private void +c_delbefore(EditLine *el, int num) +{ + + if (el->el_line.cursor - num < el->el_line.buffer) + num = (int)(el->el_line.cursor - el->el_line.buffer); + + if (el->el_map.current != el->el_map.emacs) { + cv_undo(el); + cv_yank(el, el->el_line.cursor - num, num); + } + + if (num > 0) { + wchar_t *cp; + + for (cp = el->el_line.cursor - num; + &cp[num] <= el->el_line.lastchar; + cp++) + *cp = cp[num]; + + el->el_line.lastchar -= num; + } +} + + +/* c_delbefore1(): + * Delete the character before the cursor, do not yank + */ +libedit_private void +c_delbefore1(EditLine *el) +{ + wchar_t *cp; + + for (cp = el->el_line.cursor - 1; cp <= el->el_line.lastchar; cp++) + *cp = cp[1]; + + el->el_line.lastchar--; +} + + +/* ce__isword(): + * Return if p is part of a word according to emacs + */ +libedit_private int +ce__isword(wint_t p) +{ + return iswalnum(p) || wcschr(L"*?_-.[]~=", p) != NULL; +} + + +/* cv__isword(): + * Return if p is part of a word according to vi + */ +libedit_private int +cv__isword(wint_t p) +{ + if (iswalnum(p) || p == L'_') + return 1; + if (iswgraph(p)) + return 2; + return 0; +} + + +/* cv__isWord(): + * Return if p is part of a big word according to vi + */ +libedit_private int +cv__isWord(wint_t p) +{ + return !iswspace(p); +} + + +/* c__prev_word(): + * Find the previous word + */ +libedit_private wchar_t * +c__prev_word(wchar_t *p, wchar_t *low, int n, int (*wtest)(wint_t)) +{ + p--; + + while (n--) { + while ((p >= low) && !(*wtest)(*p)) + p--; + while ((p >= low) && (*wtest)(*p)) + p--; + } + + /* cp now points to one character before the word */ + p++; + if (p < low) + p = low; + /* cp now points where we want it */ + return p; +} + + +/* c__next_word(): + * Find the next word + */ +libedit_private wchar_t * +c__next_word(wchar_t *p, wchar_t *high, int n, int (*wtest)(wint_t)) +{ + while (n--) { + while ((p < high) && !(*wtest)(*p)) + p++; + while ((p < high) && (*wtest)(*p)) + p++; + } + if (p > high) + p = high; + /* p now points where we want it */ + return p; +} + +/* cv_next_word(): + * Find the next word vi style + */ +libedit_private wchar_t * +cv_next_word(EditLine *el, wchar_t *p, wchar_t *high, int n, + int (*wtest)(wint_t)) +{ + int test; + + while (n--) { + test = (*wtest)(*p); + while ((p < high) && (*wtest)(*p) == test) + p++; + /* + * vi historically deletes with cw only the word preserving the + * trailing whitespace! This is not what 'w' does.. + */ + if (n || el->el_chared.c_vcmd.action != (DELETE|INSERT)) + while ((p < high) && iswspace(*p)) + p++; + } + + /* p now points where we want it */ + if (p > high) + return high; + else + return p; +} + + +/* cv_prev_word(): + * Find the previous word vi style + */ +libedit_private wchar_t * +cv_prev_word(wchar_t *p, wchar_t *low, int n, int (*wtest)(wint_t)) +{ + int test; + + p--; + while (n--) { + while ((p > low) && iswspace(*p)) + p--; + test = (*wtest)(*p); + while ((p >= low) && (*wtest)(*p) == test) + p--; + } + p++; + + /* p now points where we want it */ + if (p < low) + return low; + else + return p; +} + + +/* cv_delfini(): + * Finish vi delete action + */ +libedit_private void +cv_delfini(EditLine *el) +{ + int size; + int action = el->el_chared.c_vcmd.action; + + if (action & INSERT) + el->el_map.current = el->el_map.key; + + if (el->el_chared.c_vcmd.pos == 0) + /* sanity */ + return; + + size = (int)(el->el_line.cursor - el->el_chared.c_vcmd.pos); + if (size == 0) + size = 1; + el->el_line.cursor = el->el_chared.c_vcmd.pos; + if (action & YANK) { + if (size > 0) + cv_yank(el, el->el_line.cursor, size); + else + cv_yank(el, el->el_line.cursor + size, -size); + } else { + if (size > 0) { + c_delafter(el, size); + re_refresh_cursor(el); + } else { + c_delbefore(el, -size); + el->el_line.cursor += size; + } + } + el->el_chared.c_vcmd.action = NOP; +} + + +/* cv__endword(): + * Go to the end of this word according to vi + */ +libedit_private wchar_t * +cv__endword(wchar_t *p, wchar_t *high, int n, int (*wtest)(wint_t)) +{ + int test; + + p++; + + while (n--) { + while ((p < high) && iswspace(*p)) + p++; + + test = (*wtest)(*p); + while ((p < high) && (*wtest)(*p) == test) + p++; + } + p--; + return p; +} + +/* ch_init(): + * Initialize the character editor + */ +libedit_private int +ch_init(EditLine *el) +{ + el->el_line.buffer = el_calloc(EL_BUFSIZ, + sizeof(*el->el_line.buffer)); + if (el->el_line.buffer == NULL) + return -1; + + el->el_line.cursor = el->el_line.buffer; + el->el_line.lastchar = el->el_line.buffer; + el->el_line.limit = &el->el_line.buffer[EL_BUFSIZ - EL_LEAVE]; + + el->el_chared.c_undo.buf = el_calloc(EL_BUFSIZ, + sizeof(*el->el_chared.c_undo.buf)); + if (el->el_chared.c_undo.buf == NULL) + return -1; + el->el_chared.c_undo.len = -1; + el->el_chared.c_undo.cursor = 0; + el->el_chared.c_redo.buf = el_calloc(EL_BUFSIZ, + sizeof(*el->el_chared.c_redo.buf)); + if (el->el_chared.c_redo.buf == NULL) + return -1; + el->el_chared.c_redo.pos = el->el_chared.c_redo.buf; + el->el_chared.c_redo.lim = el->el_chared.c_redo.buf + EL_BUFSIZ; + el->el_chared.c_redo.cmd = ED_UNASSIGNED; + + el->el_chared.c_vcmd.action = NOP; + el->el_chared.c_vcmd.pos = el->el_line.buffer; + + el->el_chared.c_kill.buf = el_calloc(EL_BUFSIZ, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 14:03:36 2019 Return-Path: Delivered-To: svn-src-all@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 1A4B8D7544 for ; Tue, 10 Sep 2019 14:03:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46SRZv5Q3Mz4TSv for ; Tue, 10 Sep 2019 14:03:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568124214; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Y6QYn/XVBRWGMh315ITuQQBO46sei/QBVtUgIhQQ7HWhbiDo63fQpr9PzXxt6HTtmwAdtZalW+nBt BJT0euN4LGhVkaDQNhzMR7XSWmnE0IqaXfPZDxiNxKq/abDmJk8DCMtS6ycSbhW7uJhjQ+/kx/j2au Fw7PUl7F4H4Nu3UttM/v5lr3viYTgbgSUtmx3akNbCf0ukWBW0x5Y6dHwWhpQgUo3TQr8ISbPYqZ6C EWUogl5k5tAfCzaOXSd2ZnK9FrdPOWzpdIBtSKPJCWfeK5d59jN6HCg7oSxAQleWv+YN9RT8B6obZT rcp/Q4j7PgmZQ99LB3uqoGgKZv49fUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=barJODCK+NNID+q5G8FigBGpZvZ1I7zNyMchL9WKpyg=; b=rwixgx3sAhvDMlsPT4cUQaRgev/0ZE+vLKt/V1qp11irDc/4e/uQP9LpNjFEOxiJJo1tbYDeyCWuN /oYX8Da125uUrNvcPiXDiz0BjSRM9raYg35b4GdDtv8l13F8VQGaTuf3QVSWDhG6nNajsaQ79Up71f /xIr3EKaPFCCs0eQXzOz5FYgBBc956CVJSNU5btVIavjpyQkU3PjwdSiPOcbQBtxiDX0lqAIahYnQf C54QwiRB/nWIMhhDnnuhquU3CxgsnbU/q3OonL9iRr+m7Le8h9zxX95XS2fix5h+KAK3Q1Vh7usY0i xIaoctUfxD/4w8+/S1U58imhgdMVORA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=barJODCK+NNID+q5G8FigBGpZvZ1I7zNyMchL9WKpyg=; b=H/FbNQ7JTcSKz5Lhkb6o+jxpXFjqb2CXrCIh1pJnl6pRmpuvd1ENyQ2GHHvKRTGHAbnwdA4Hylt2h 6S2NggE3EFJ6ecYBA3LuBvh6ZuliIL23xAx2CwA2klbtIqAtPMTl0jgewEQ6nskkuLC7bubUbVg5Jc TNzECDBmpVJRh3YDG8ANEwlT+mVlYfNEnyr8whF6UNjJFS2SmgHhG7/+7AGLy/GFXENMZzO/5AYXcx tOekQ6Yih8lFO8690PefPptAv4adiJQG/uuxk8swWpAp9cnBP2mltvljMC81y+uzDYtKtL1SO0Xiyg bZ0U71InbfUl5FDodKqaiYygrqLuF1g== X-MHO-RoutePath: aGlwcGll X-MHO-User: c4202099-d3d3-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id c4202099-d3d3-11e9-b67d-cdd75d6ce7a8; Tue, 10 Sep 2019 14:03:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8AE3Tr0066775; Tue, 10 Sep 2019 08:03:29 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <06266e49ff64bba81b435c58985db7d88c74be03.camel@freebsd.org> Subject: Re: svn commit: r352113 - head/sys/net From: Ian Lepore To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 10 Sep 2019 08:03:29 -0600 In-Reply-To: <201909100156.x8A1ulJx087903@repo.freebsd.org> References: <201909100156.x8A1ulJx087903@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46SRZv5Q3Mz4TSv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 14:03:36 -0000 On Tue, 2019-09-10 at 01:56 +0000, Conrad Meyer wrote: > Author: cem > Date: Tue Sep 10 01:56:47 2019 > New Revision: 352113 > URL: https://svnweb.freebsd.org/changeset/base/352113 > > Log: > Appease Clang false-positive Werrors in r352112 > > Reported by: bcran > > Modified: > head/sys/net/rtsock.c > > Modified: head/sys/net/rtsock.c > ===================================================================== > ========= > --- head/sys/net/rtsock.c Mon Sep 9 22:54:27 2019 (r352112) > +++ head/sys/net/rtsock.c Tue Sep 10 01:56:47 2019 (r352113) > @@ -2105,7 +2105,7 @@ rt_dumpentry_ddb(struct radix_node *rn, void > *arg __un > > if (flags != rt->rt_flags) > db_printf(","); > - db_printf(rt_flag_name(idx)); > + db_printf("%s", rt_flag_name(idx)); > > flags &= ~(1ul << idx); > } > @@ -2374,8 +2374,12 @@ _DB_FUNC(_show, route, db_show_route_cmd, > db_show_tabl > u.dest_sin6.sin6_addr.s6_addr16[i] = > htons(hextets[i]); > dstp = (void *)&u.dest_sin6; > dst_addrp = &u.dest_sin6.sin6_addr; > - } else > + } else { > MPASS(false); > + /* UNREACHABLE */ > + /* Appease Clang false positive: */ > + dstp = NULL; > + } > > bp = inet_ntop(af, dst_addrp, buf, sizeof(buf)); > if (bp != NULL) > I don't think this was a false positive. MPASS resolves to KASSERT which resolves to nothing when built without INVARIANTS defined. So that comment is misleading, the code isn't unreachable, and after falling through, dstp is going to be dereferenced a few lines later. Instead of just squelching the coverity error, I think it should lead to the question: Does it make any sense to assert in a ddb command handler? Would it make more sense to make that else block do something like db_printf("Unexpected address family %d\n", af); goto exit; ? -- Ian From owner-svn-src-all@freebsd.org Tue Sep 10 14:30:11 2019 Return-Path: Delivered-To: svn-src-all@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 3AF58D7FE9; Tue, 10 Sep 2019 14:30:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SS9b0q2Hz4VjK; Tue, 10 Sep 2019 14:30:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 004E7276AC; Tue, 10 Sep 2019 14:30:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AEUAPT035324; Tue, 10 Sep 2019 14:30:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AEUAdT035323; Tue, 10 Sep 2019 14:30:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909101430.x8AEUAdT035323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Sep 2019 14:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352136 - head/contrib/libedit X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/libedit X-SVN-Commit-Revision: 352136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 14:30:11 -0000 Author: bapt Date: Tue Sep 10 14:30:10 2019 New Revision: 352136 URL: https://svnweb.freebsd.org/changeset/base/352136 Log: Import libedit 2019-09-10 Compared to current version in base: - great improvements on the Unicode support - full support for filename completion including quoting which means we do not need anymore our custom addition) - Improved readline compatiblity Upgrading libedit has been a pain in the past, because somehow we never managed to properly cleanup the tree in lib/libedit and each merge has always been very painful. After years of fighting give up and refresh a merge from scrarch properly in contrib. Note that the switch to this version will be done in another commit. Added: head/contrib/libedit/ - copied from r352135, vendor/NetBSD/libedit/dist/ From owner-svn-src-all@freebsd.org Tue Sep 10 14:33:07 2019 Return-Path: Delivered-To: svn-src-all@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 D4B79D8298; Tue, 10 Sep 2019 14:33:07 +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 46SSDz5M4qz4WCD; Tue, 10 Sep 2019 14:33:07 +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 9B8C52785F; Tue, 10 Sep 2019 14:33:07 +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 x8AEX7to040848; Tue, 10 Sep 2019 14:33:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AEX7aq040847; Tue, 10 Sep 2019 14:33:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909101433.x8AEX7aq040847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Sep 2019 14:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352137 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 352137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 14:33:07 -0000 Author: hselasky Date: Tue Sep 10 14:33:07 2019 New Revision: 352137 URL: https://svnweb.freebsd.org/changeset/base/352137 Log: Callout drain does not have to be followed by a callout stop call. Fix bogus code. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/net/if_spppsubr.c Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Tue Sep 10 14:30:10 2019 (r352136) +++ head/sys/net/if_spppsubr.c Tue Sep 10 14:33:07 2019 (r352137) @@ -1060,15 +1060,13 @@ sppp_detach(struct ifnet *ifp) KASSERT(mtx_initialized(&sp->mtx), ("sppp mutex is not initialized")); /* Stop keepalive handler. */ - if (!callout_drain(&sp->keepalive_callout)) - callout_stop(&sp->keepalive_callout); + callout_drain(&sp->keepalive_callout); for (i = 0; i < IDX_COUNT; i++) { - if (!callout_drain(&sp->ch[i])) - callout_stop(&sp->ch[i]); + callout_drain(&sp->ch[i]); } - if (!callout_drain(&sp->pap_my_to_ch)) - callout_stop(&sp->pap_my_to_ch); + callout_drain(&sp->pap_my_to_ch); + mtx_destroy(&sp->pp_cpq.ifq_mtx); mtx_destroy(&sp->pp_fastq.ifq_mtx); mtx_destroy(&sp->mtx); From owner-svn-src-all@freebsd.org Tue Sep 10 15:09:48 2019 Return-Path: Delivered-To: svn-src-all@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 7D8CED94AE; Tue, 10 Sep 2019 15:09:48 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ST3J3T4kz4XyJ; Tue, 10 Sep 2019 15:09:48 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55D3E27E29; Tue, 10 Sep 2019 15:09:48 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AF9mBg058942; Tue, 10 Sep 2019 15:09:48 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AF9kXj058932; Tue, 10 Sep 2019 15:09:46 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909101509.x8AF9kXj058932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 10 Sep 2019 15:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352138 - in head: etc/mtree usr.bin/locale usr.bin/locale/tests X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: etc/mtree usr.bin/locale usr.bin/locale/tests X-SVN-Commit-Revision: 352138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 15:09:48 -0000 Author: yuripv Date: Tue Sep 10 15:09:46 2019 New Revision: 352138 URL: https://svnweb.freebsd.org/changeset/base/352138 Log: locale: handle day, abday, mon, abmon, am_pm keywords All of these are defined as mandatory by POSIX. While here, mark all non-standard ones as FreeBSD-only as other systems (at least, GNU/Linux and illumos) do not handle them, so we should not encourage their use. PR: 237752 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D21490 Added: head/usr.bin/locale/tests/ head/usr.bin/locale/tests/Makefile (contents, props changed) head/usr.bin/locale/tests/k_flag_posix_messages.out (contents, props changed) head/usr.bin/locale/tests/k_flag_posix_monetary.out (contents, props changed) head/usr.bin/locale/tests/k_flag_posix_numeric.out (contents, props changed) head/usr.bin/locale/tests/k_flag_posix_time.out (contents, props changed) head/usr.bin/locale/tests/locale_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/locale/Makefile head/usr.bin/locale/locale.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Sep 10 14:33:07 2019 (r352137) +++ head/etc/mtree/BSD.tests.dist Tue Sep 10 15:09:46 2019 (r352138) @@ -1010,6 +1010,8 @@ .. limits .. + locale + .. m4 .. mkimg Modified: head/usr.bin/locale/Makefile ============================================================================== --- head/usr.bin/locale/Makefile Tue Sep 10 14:33:07 2019 (r352137) +++ head/usr.bin/locale/Makefile Tue Sep 10 15:09:46 2019 (r352138) @@ -1,6 +1,12 @@ # $FreeBSD$ +.include + PROG= locale CFLAGS+= -I${SRCTOP}/lib/libc/locale +LIBADD+= sbuf + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Tue Sep 10 14:33:07 2019 (r352137) +++ head/usr.bin/locale/locale.c Tue Sep 10 15:09:46 2019 (r352138) @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -59,7 +60,7 @@ void list_charmaps(void); void list_locales(void); const char *lookup_localecat(int); char *kwval_lconv(int); -int kwval_lookup(const char *, char **, int *, int *); +int kwval_lookup(const char *, char **, int *, int *, int *); void showdetails(const char *); void showkeywordslist(char *substring); void showlocale(void); @@ -87,141 +88,258 @@ static const struct _lcinfo { #define NLCINFO nitems(lcinfo) /* ids for values not referenced by nl_langinfo() */ -#define KW_ZERO 10000 -#define KW_GROUPING (KW_ZERO+1) -#define KW_INT_CURR_SYMBOL (KW_ZERO+2) -#define KW_CURRENCY_SYMBOL (KW_ZERO+3) -#define KW_MON_DECIMAL_POINT (KW_ZERO+4) -#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) -#define KW_MON_GROUPING (KW_ZERO+6) -#define KW_POSITIVE_SIGN (KW_ZERO+7) -#define KW_NEGATIVE_SIGN (KW_ZERO+8) -#define KW_INT_FRAC_DIGITS (KW_ZERO+9) -#define KW_FRAC_DIGITS (KW_ZERO+10) -#define KW_P_CS_PRECEDES (KW_ZERO+11) -#define KW_P_SEP_BY_SPACE (KW_ZERO+12) -#define KW_N_CS_PRECEDES (KW_ZERO+13) -#define KW_N_SEP_BY_SPACE (KW_ZERO+14) -#define KW_P_SIGN_POSN (KW_ZERO+15) -#define KW_N_SIGN_POSN (KW_ZERO+16) -#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) -#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) -#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) -#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) -#define KW_INT_P_SIGN_POSN (KW_ZERO+21) -#define KW_INT_N_SIGN_POSN (KW_ZERO+22) +enum { + KW_GROUPING, + KW_INT_CURR_SYMBOL, + KW_CURRENCY_SYMBOL, + KW_MON_DECIMAL_POINT, + KW_MON_THOUSANDS_SEP, + KW_MON_GROUPING, + KW_POSITIVE_SIGN, + KW_NEGATIVE_SIGN, + KW_INT_FRAC_DIGITS, + KW_FRAC_DIGITS, + KW_P_CS_PRECEDES, + KW_P_SEP_BY_SPACE, + KW_N_CS_PRECEDES, + KW_N_SEP_BY_SPACE, + KW_P_SIGN_POSN, + KW_N_SIGN_POSN, + KW_INT_P_CS_PRECEDES, + KW_INT_P_SEP_BY_SPACE, + KW_INT_N_CS_PRECEDES, + KW_INT_N_SEP_BY_SPACE, + KW_INT_P_SIGN_POSN, + KW_INT_N_SIGN_POSN, + KW_TIME_DAY, + KW_TIME_ABDAY, + KW_TIME_MON, + KW_TIME_ABMON, + KW_TIME_AM_PM +}; +enum { + SRC_LINFO, + SRC_LCONV, + SRC_LTIME +}; + static const struct _kwinfo { const char *name; int isstr; /* true - string, false - number */ int catid; /* LC_* */ + int source; int value_ref; const char *comment; } kwinfo [] = { - { "charmap", 1, LC_CTYPE, CODESET, "" }, /* hack */ + { "charmap", 1, LC_CTYPE, SRC_LINFO, + CODESET, "" }, /* hack */ - { "decimal_point", 1, LC_NUMERIC, RADIXCHAR, "" }, - { "thousands_sep", 1, LC_NUMERIC, THOUSEP, "" }, - { "grouping", 1, LC_NUMERIC, KW_GROUPING, "" }, - { "radixchar", 1, LC_NUMERIC, RADIXCHAR, - "Same as decimal_point (FreeBSD only)" }, /* compat */ - { "thousep", 1, LC_NUMERIC, THOUSEP, - "Same as thousands_sep (FreeBSD only)" }, /* compat */ + /* LC_MONETARY - POSIX */ + { "int_curr_symbol", 1, LC_MONETARY, SRC_LCONV, + KW_INT_CURR_SYMBOL, "" }, + { "currency_symbol", 1, LC_MONETARY, SRC_LCONV, + KW_CURRENCY_SYMBOL, "" }, + { "mon_decimal_point", 1, LC_MONETARY, SRC_LCONV, + KW_MON_DECIMAL_POINT, "" }, + { "mon_thousands_sep", 1, LC_MONETARY, SRC_LCONV, + KW_MON_THOUSANDS_SEP, "" }, + { "mon_grouping", 1, LC_MONETARY, SRC_LCONV, + KW_MON_GROUPING, "" }, + { "positive_sign", 1, LC_MONETARY, SRC_LCONV, + KW_POSITIVE_SIGN, "" }, + { "negative_sign", 1, LC_MONETARY, SRC_LCONV, + KW_NEGATIVE_SIGN, "" }, + { "int_frac_digits", 0, LC_MONETARY, SRC_LCONV, + KW_INT_FRAC_DIGITS, "" }, + { "frac_digits", 0, LC_MONETARY, SRC_LCONV, + KW_FRAC_DIGITS, "" }, + { "p_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + KW_P_CS_PRECEDES, "" }, + { "p_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + KW_P_SEP_BY_SPACE, "" }, + { "n_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + KW_N_CS_PRECEDES, "" }, + { "n_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + KW_N_SEP_BY_SPACE, "" }, + { "p_sign_posn", 0, LC_MONETARY, SRC_LCONV, + KW_P_SIGN_POSN, "" }, + { "n_sign_posn", 0, LC_MONETARY, SRC_LCONV, + KW_N_SIGN_POSN, "" }, + { "int_p_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + KW_INT_P_CS_PRECEDES, "" }, + { "int_p_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + KW_INT_P_SEP_BY_SPACE, "" }, + { "int_n_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + KW_INT_N_CS_PRECEDES, "" }, + { "int_n_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + KW_INT_N_SEP_BY_SPACE, "" }, + { "int_p_sign_posn", 0, LC_MONETARY, SRC_LCONV, + KW_INT_P_SIGN_POSN, "" }, + { "int_n_sign_posn", 0, LC_MONETARY, SRC_LCONV, + KW_INT_N_SIGN_POSN, "" }, - { "int_curr_symbol", 1, LC_MONETARY, KW_INT_CURR_SYMBOL, "" }, - { "currency_symbol", 1, LC_MONETARY, KW_CURRENCY_SYMBOL, "" }, - { "mon_decimal_point", 1, LC_MONETARY, KW_MON_DECIMAL_POINT, "" }, - { "mon_thousands_sep", 1, LC_MONETARY, KW_MON_THOUSANDS_SEP, "" }, - { "mon_grouping", 1, LC_MONETARY, KW_MON_GROUPING, "" }, - { "positive_sign", 1, LC_MONETARY, KW_POSITIVE_SIGN, "" }, - { "negative_sign", 1, LC_MONETARY, KW_NEGATIVE_SIGN, "" }, + /* LC_NUMERIC - POSIX */ + { "decimal_point", 1, LC_NUMERIC, SRC_LINFO, + RADIXCHAR, "" }, + { "thousands_sep", 1, LC_NUMERIC, SRC_LINFO, + THOUSEP, "" }, + { "grouping", 1, LC_NUMERIC, SRC_LCONV, + KW_GROUPING, "" }, + /* LC_NUMERIC - local additions */ + { "radixchar", 1, LC_NUMERIC, SRC_LINFO, + RADIXCHAR, "Same as decimal_point (FreeBSD only)" }, /* compat */ + { "thousep", 1, LC_NUMERIC, SRC_LINFO, + THOUSEP, "Same as thousands_sep (FreeBSD only)" }, /* compat */ - { "int_frac_digits", 0, LC_MONETARY, KW_INT_FRAC_DIGITS, "" }, - { "frac_digits", 0, LC_MONETARY, KW_FRAC_DIGITS, "" }, - { "p_cs_precedes", 0, LC_MONETARY, KW_P_CS_PRECEDES, "" }, - { "p_sep_by_space", 0, LC_MONETARY, KW_P_SEP_BY_SPACE, "" }, - { "n_cs_precedes", 0, LC_MONETARY, KW_N_CS_PRECEDES, "" }, - { "n_sep_by_space", 0, LC_MONETARY, KW_N_SEP_BY_SPACE, "" }, - { "p_sign_posn", 0, LC_MONETARY, KW_P_SIGN_POSN, "" }, - { "n_sign_posn", 0, LC_MONETARY, KW_N_SIGN_POSN, "" }, - { "int_p_cs_precedes", 0, LC_MONETARY, KW_INT_P_CS_PRECEDES, "" }, - { "int_p_sep_by_space", 0, LC_MONETARY, KW_INT_P_SEP_BY_SPACE, "" }, - { "int_n_cs_precedes", 0, LC_MONETARY, KW_INT_N_CS_PRECEDES, "" }, - { "int_n_sep_by_space", 0, LC_MONETARY, KW_INT_N_SEP_BY_SPACE, "" }, - { "int_p_sign_posn", 0, LC_MONETARY, KW_INT_P_SIGN_POSN, "" }, - { "int_n_sign_posn", 0, LC_MONETARY, KW_INT_N_SIGN_POSN, "" }, + /* LC_TIME - POSIX */ + { "abday", 1, LC_TIME, SRC_LTIME, + KW_TIME_ABDAY, "" }, + { "day", 1, LC_TIME, SRC_LTIME, + KW_TIME_DAY, "" }, + { "abmon", 1, LC_TIME, SRC_LTIME, + KW_TIME_ABMON, "" }, + { "mon", 1, LC_TIME, SRC_LTIME, + KW_TIME_MON, "" }, + { "d_t_fmt", 1, LC_TIME, SRC_LINFO, + D_T_FMT, "" }, + { "d_fmt", 1, LC_TIME, SRC_LINFO, + D_FMT, "" }, + { "t_fmt", 1, LC_TIME, SRC_LINFO, + T_FMT, "" }, + { "am_pm", 1, LC_TIME, SRC_LTIME, + KW_TIME_AM_PM, "" }, + { "t_fmt_ampm", 1, LC_TIME, SRC_LINFO, + T_FMT_AMPM, "" }, + { "era", 1, LC_TIME, SRC_LINFO, + ERA, "(unavailable)" }, + { "era_d_fmt", 1, LC_TIME, SRC_LINFO, + ERA_D_FMT, "(unavailable)" }, + { "era_d_t_fmt", 1, LC_TIME, SRC_LINFO, + ERA_D_T_FMT, "(unavailable)" }, + { "era_t_fmt", 1, LC_TIME, SRC_LINFO, + ERA_T_FMT, "(unavailable)" }, + { "alt_digits", 1, LC_TIME, SRC_LINFO, + ALT_DIGITS, "" }, + /* LC_TIME - local additions */ + { "abday_1", 1, LC_TIME, SRC_LINFO, + ABDAY_1, "(FreeBSD only)" }, + { "abday_2", 1, LC_TIME, SRC_LINFO, + ABDAY_2, "(FreeBSD only)" }, + { "abday_3", 1, LC_TIME, SRC_LINFO, + ABDAY_3, "(FreeBSD only)" }, + { "abday_4", 1, LC_TIME, SRC_LINFO, + ABDAY_4, "(FreeBSD only)" }, + { "abday_5", 1, LC_TIME, SRC_LINFO, + ABDAY_5, "(FreeBSD only)" }, + { "abday_6", 1, LC_TIME, SRC_LINFO, + ABDAY_6, "(FreeBSD only)" }, + { "abday_7", 1, LC_TIME, SRC_LINFO, + ABDAY_7, "(FreeBSD only)" }, + { "day_1", 1, LC_TIME, SRC_LINFO, + DAY_1, "(FreeBSD only)" }, + { "day_2", 1, LC_TIME, SRC_LINFO, + DAY_2, "(FreeBSD only)" }, + { "day_3", 1, LC_TIME, SRC_LINFO, + DAY_3, "(FreeBSD only)" }, + { "day_4", 1, LC_TIME, SRC_LINFO, + DAY_4, "(FreeBSD only)" }, + { "day_5", 1, LC_TIME, SRC_LINFO, + DAY_5, "(FreeBSD only)" }, + { "day_6", 1, LC_TIME, SRC_LINFO, + DAY_6, "(FreeBSD only)" }, + { "day_7", 1, LC_TIME, SRC_LINFO, + DAY_7, "(FreeBSD only)" }, + { "abmon_1", 1, LC_TIME, SRC_LINFO, + ABMON_1, "(FreeBSD only)" }, + { "abmon_2", 1, LC_TIME, SRC_LINFO, + ABMON_2, "(FreeBSD only)" }, + { "abmon_3", 1, LC_TIME, SRC_LINFO, + ABMON_3, "(FreeBSD only)" }, + { "abmon_4", 1, LC_TIME, SRC_LINFO, + ABMON_4, "(FreeBSD only)" }, + { "abmon_5", 1, LC_TIME, SRC_LINFO, + ABMON_5, "(FreeBSD only)" }, + { "abmon_6", 1, LC_TIME, SRC_LINFO, + ABMON_6, "(FreeBSD only)" }, + { "abmon_7", 1, LC_TIME, SRC_LINFO, + ABMON_7, "(FreeBSD only)" }, + { "abmon_8", 1, LC_TIME, SRC_LINFO, + ABMON_8, "(FreeBSD only)" }, + { "abmon_9", 1, LC_TIME, SRC_LINFO, + ABMON_9, "(FreeBSD only)" }, + { "abmon_10", 1, LC_TIME, SRC_LINFO, + ABMON_10, "(FreeBSD only)" }, + { "abmon_11", 1, LC_TIME, SRC_LINFO, + ABMON_11, "(FreeBSD only)" }, + { "abmon_12", 1, LC_TIME, SRC_LINFO, + ABMON_12, "(FreeBSD only)" }, + { "mon_1", 1, LC_TIME, SRC_LINFO, + MON_1, "(FreeBSD only)" }, + { "mon_2", 1, LC_TIME, SRC_LINFO, + MON_2, "(FreeBSD only)" }, + { "mon_3", 1, LC_TIME, SRC_LINFO, + MON_3, "(FreeBSD only)" }, + { "mon_4", 1, LC_TIME, SRC_LINFO, + MON_4, "(FreeBSD only)" }, + { "mon_5", 1, LC_TIME, SRC_LINFO, + MON_5, "(FreeBSD only)" }, + { "mon_6", 1, LC_TIME, SRC_LINFO, + MON_6, "(FreeBSD only)" }, + { "mon_7", 1, LC_TIME, SRC_LINFO, + MON_7, "(FreeBSD only)" }, + { "mon_8", 1, LC_TIME, SRC_LINFO, + MON_8, "(FreeBSD only)" }, + { "mon_9", 1, LC_TIME, SRC_LINFO, + MON_9, "(FreeBSD only)" }, + { "mon_10", 1, LC_TIME, SRC_LINFO, + MON_10, "(FreeBSD only)" }, + { "mon_11", 1, LC_TIME, SRC_LINFO, + MON_11, "(FreeBSD only)" }, + { "mon_12", 1, LC_TIME, SRC_LINFO, + MON_12, "(FreeBSD only)" }, + { "altmon_1", 1, LC_TIME, SRC_LINFO, + ALTMON_1, "(FreeBSD only)" }, + { "altmon_2", 1, LC_TIME, SRC_LINFO, + ALTMON_2, "(FreeBSD only)" }, + { "altmon_3", 1, LC_TIME, SRC_LINFO, + ALTMON_3, "(FreeBSD only)" }, + { "altmon_4", 1, LC_TIME, SRC_LINFO, + ALTMON_4, "(FreeBSD only)" }, + { "altmon_5", 1, LC_TIME, SRC_LINFO, + ALTMON_5, "(FreeBSD only)" }, + { "altmon_6", 1, LC_TIME, SRC_LINFO, + ALTMON_6, "(FreeBSD only)" }, + { "altmon_7", 1, LC_TIME, SRC_LINFO, + ALTMON_7, "(FreeBSD only)" }, + { "altmon_8", 1, LC_TIME, SRC_LINFO, + ALTMON_8, "(FreeBSD only)" }, + { "altmon_9", 1, LC_TIME, SRC_LINFO, + ALTMON_9, "(FreeBSD only)" }, + { "altmon_10", 1, LC_TIME, SRC_LINFO, + ALTMON_10, "(FreeBSD only)" }, + { "altmon_11", 1, LC_TIME, SRC_LINFO, + ALTMON_11, "(FreeBSD only)" }, + { "altmon_12", 1, LC_TIME, SRC_LINFO, + ALTMON_12, "(FreeBSD only)" }, + { "am_str", 1, LC_TIME, SRC_LINFO, + AM_STR, "(FreeBSD only)" }, + { "pm_str", 1, LC_TIME, SRC_LINFO, + PM_STR, "(FreeBSD only)" }, + { "d_md_order", 1, LC_TIME, SRC_LINFO, + D_MD_ORDER, "(FreeBSD only)" }, /* local */ - { "d_t_fmt", 1, LC_TIME, D_T_FMT, "" }, - { "d_fmt", 1, LC_TIME, D_FMT, "" }, - { "t_fmt", 1, LC_TIME, T_FMT, "" }, - { "am_str", 1, LC_TIME, AM_STR, "" }, - { "pm_str", 1, LC_TIME, PM_STR, "" }, - { "t_fmt_ampm", 1, LC_TIME, T_FMT_AMPM, "" }, - { "day_1", 1, LC_TIME, DAY_1, "" }, - { "day_2", 1, LC_TIME, DAY_2, "" }, - { "day_3", 1, LC_TIME, DAY_3, "" }, - { "day_4", 1, LC_TIME, DAY_4, "" }, - { "day_5", 1, LC_TIME, DAY_5, "" }, - { "day_6", 1, LC_TIME, DAY_6, "" }, - { "day_7", 1, LC_TIME, DAY_7, "" }, - { "abday_1", 1, LC_TIME, ABDAY_1, "" }, - { "abday_2", 1, LC_TIME, ABDAY_2, "" }, - { "abday_3", 1, LC_TIME, ABDAY_3, "" }, - { "abday_4", 1, LC_TIME, ABDAY_4, "" }, - { "abday_5", 1, LC_TIME, ABDAY_5, "" }, - { "abday_6", 1, LC_TIME, ABDAY_6, "" }, - { "abday_7", 1, LC_TIME, ABDAY_7, "" }, - { "mon_1", 1, LC_TIME, MON_1, "" }, - { "mon_2", 1, LC_TIME, MON_2, "" }, - { "mon_3", 1, LC_TIME, MON_3, "" }, - { "mon_4", 1, LC_TIME, MON_4, "" }, - { "mon_5", 1, LC_TIME, MON_5, "" }, - { "mon_6", 1, LC_TIME, MON_6, "" }, - { "mon_7", 1, LC_TIME, MON_7, "" }, - { "mon_8", 1, LC_TIME, MON_8, "" }, - { "mon_9", 1, LC_TIME, MON_9, "" }, - { "mon_10", 1, LC_TIME, MON_10, "" }, - { "mon_11", 1, LC_TIME, MON_11, "" }, - { "mon_12", 1, LC_TIME, MON_12, "" }, - { "abmon_1", 1, LC_TIME, ABMON_1, "" }, - { "abmon_2", 1, LC_TIME, ABMON_2, "" }, - { "abmon_3", 1, LC_TIME, ABMON_3, "" }, - { "abmon_4", 1, LC_TIME, ABMON_4, "" }, - { "abmon_5", 1, LC_TIME, ABMON_5, "" }, - { "abmon_6", 1, LC_TIME, ABMON_6, "" }, - { "abmon_7", 1, LC_TIME, ABMON_7, "" }, - { "abmon_8", 1, LC_TIME, ABMON_8, "" }, - { "abmon_9", 1, LC_TIME, ABMON_9, "" }, - { "abmon_10", 1, LC_TIME, ABMON_10, "" }, - { "abmon_11", 1, LC_TIME, ABMON_11, "" }, - { "abmon_12", 1, LC_TIME, ABMON_12, "" }, - { "altmon_1", 1, LC_TIME, ALTMON_1, "(FreeBSD only)" }, - { "altmon_2", 1, LC_TIME, ALTMON_2, "(FreeBSD only)" }, - { "altmon_3", 1, LC_TIME, ALTMON_3, "(FreeBSD only)" }, - { "altmon_4", 1, LC_TIME, ALTMON_4, "(FreeBSD only)" }, - { "altmon_5", 1, LC_TIME, ALTMON_5, "(FreeBSD only)" }, - { "altmon_6", 1, LC_TIME, ALTMON_6, "(FreeBSD only)" }, - { "altmon_7", 1, LC_TIME, ALTMON_7, "(FreeBSD only)" }, - { "altmon_8", 1, LC_TIME, ALTMON_8, "(FreeBSD only)" }, - { "altmon_9", 1, LC_TIME, ALTMON_9, "(FreeBSD only)" }, - { "altmon_10", 1, LC_TIME, ALTMON_10, "(FreeBSD only)" }, - { "altmon_11", 1, LC_TIME, ALTMON_11, "(FreeBSD only)" }, - { "altmon_12", 1, LC_TIME, ALTMON_12, "(FreeBSD only)" }, - { "era", 1, LC_TIME, ERA, "(unavailable)" }, - { "era_d_fmt", 1, LC_TIME, ERA_D_FMT, "(unavailable)" }, - { "era_d_t_fmt", 1, LC_TIME, ERA_D_T_FMT, "(unavailable)" }, - { "era_t_fmt", 1, LC_TIME, ERA_T_FMT, "(unavailable)" }, - { "alt_digits", 1, LC_TIME, ALT_DIGITS, "" }, - { "d_md_order", 1, LC_TIME, D_MD_ORDER, - "(FreeBSD only)" }, /* local */ + /* LC_MESSAGES - POSIX */ + { "yesexpr", 1, LC_MESSAGES, SRC_LINFO, + YESEXPR, "" }, + { "noexpr", 1, LC_MESSAGES, SRC_LINFO, + NOEXPR, "" }, + /* LC_MESSAGES - local additions */ + { "yesstr", 1, LC_MESSAGES, SRC_LINFO, + YESSTR, "(POSIX legacy)" }, /* compat */ + { "nostr", 1, LC_MESSAGES, SRC_LINFO, + NOSTR, "(POSIX legacy)" } /* compat */ - { "yesexpr", 1, LC_MESSAGES, YESEXPR, "" }, - { "noexpr", 1, LC_MESSAGES, NOEXPR, "" }, - { "yesstr", 1, LC_MESSAGES, YESSTR, - "(POSIX legacy)" }, /* compat */ - { "nostr", 1, LC_MESSAGES, NOSTR, - "(POSIX legacy)" } /* compat */ - }; #define NKWINFO (nitems(kwinfo)) @@ -522,7 +640,7 @@ format_grouping(const char *binary) } /* - * keyword value lookup helper (via localeconv()) + * keyword value lookup helper for values accessible via localeconv() */ char * kwval_lconv(int id) @@ -606,24 +724,86 @@ kwval_lconv(int id) } /* + * keyword value lookup helper for LC_TIME keywords not accessible + * via nl_langinfo() or localeconv() + */ +static char * +kwval_ltime(int id) +{ + char *rval; + struct sbuf *kwsbuf; + nl_item i, s_item, e_item; + + switch (id) { + case KW_TIME_DAY: + s_item = DAY_1; + e_item = DAY_7; + break; + case KW_TIME_ABDAY: + s_item = ABDAY_1; + e_item = ABDAY_7; + break; + case KW_TIME_MON: + s_item = MON_1; + e_item = MON_12; + break; + case KW_TIME_ABMON: + s_item = ABMON_1; + e_item = ABMON_12; + break; + case KW_TIME_AM_PM: + if (asprintf(&rval, "%s\";\"%s", + nl_langinfo(AM_STR), + nl_langinfo(PM_STR)) == -1) + err(1, "asprintf"); + return (rval); + } + + kwsbuf = sbuf_new_auto(); + if (kwsbuf == NULL) + err(1, "sbuf"); + for (i = s_item; i <= e_item; i++) { + if (i != s_item) + (void) sbuf_cat(kwsbuf, "\""); + (void) sbuf_cat(kwsbuf, nl_langinfo(i)); + if (i != e_item) + (void) sbuf_cat(kwsbuf, "\";"); + } + (void) sbuf_finish(kwsbuf); + rval = strdup(sbuf_data(kwsbuf)); + if (rval == NULL) + err(1, "strdup"); + sbuf_delete(kwsbuf); + return (rval); +} + +/* * keyword value and properties lookup */ int -kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr) +kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr, int *alloc) { int rval; size_t i; rval = 0; + *alloc = 0; for (i = 0; i < NKWINFO; i++) { if (strcasecmp(kwname, kwinfo[i].name) == 0) { rval = 1; *cat = kwinfo[i].catid; *isstr = kwinfo[i].isstr; - if (kwinfo[i].value_ref < KW_ZERO) { + switch (kwinfo[i].source) { + case SRC_LINFO: *kwval = nl_langinfo(kwinfo[i].value_ref); - } else { + break; + case SRC_LCONV: *kwval = kwval_lconv(kwinfo[i].value_ref); + break; + case SRC_LTIME: + *kwval = kwval_ltime(kwinfo[i].value_ref); + *alloc = 1; + break; } break; } @@ -639,10 +819,10 @@ kwval_lookup(const char *kwname, char **kwval, int *ca void showdetails(const char *kw) { - int isstr, cat, tmpval; + int isstr, cat, tmpval, alloc; char *kwval; - if (kwval_lookup(kw, &kwval, &cat, &isstr) == 0) { + if (kwval_lookup(kw, &kwval, &cat, &isstr, &alloc) == 0) { /* * invalid keyword specified. * XXX: any actions? @@ -675,6 +855,9 @@ showdetails(const char *kw) printf("%d\n", tmpval); } } + + if (alloc) + free(kwval); } /* Added: head/usr.bin/locale/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/Makefile Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= locale_test + +${PACKAGE}FILES+= k_flag_posix_monetary.out +${PACKAGE}FILES+= k_flag_posix_numeric.out +${PACKAGE}FILES+= k_flag_posix_time.out +${PACKAGE}FILES+= k_flag_posix_messages.out + +.include Added: head/usr.bin/locale/tests/k_flag_posix_messages.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/k_flag_posix_messages.out Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,2 @@ +yesexpr="^[yY]" +noexpr="^[nN]" Added: head/usr.bin/locale/tests/k_flag_posix_monetary.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/k_flag_posix_monetary.out Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,21 @@ +int_curr_symbol="" +currency_symbol="" +mon_decimal_point="" +mon_thousands_sep="" +mon_grouping="127" +positive_sign="" +negative_sign="" +int_frac_digits=127 +frac_digits=127 +p_cs_precedes=127 +p_sep_by_space=127 +n_cs_precedes=127 +n_sep_by_space=127 +p_sign_posn=127 +n_sign_posn=127 +int_p_cs_precedes=127 +int_n_cs_precedes=127 +int_p_sep_by_space=127 +int_n_sep_by_space=127 +int_p_sign_posn=127 +int_n_sign_posn=127 Added: head/usr.bin/locale/tests/k_flag_posix_numeric.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/k_flag_posix_numeric.out Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,3 @@ +decimal_point="." +thousands_sep="" +grouping="127" Added: head/usr.bin/locale/tests/k_flag_posix_time.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/k_flag_posix_time.out Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,14 @@ +abday="Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat" +day="Sunday";"Monday";"Tuesday";"Wednesday";"Thursday";"Friday";"Saturday" +abmon="Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec" +mon="January";"February";"March";"April";"May";"June";"July";"August";"September";"October";"November";"December" +d_t_fmt="%a %b %e %H:%M:%S %Y" +d_fmt="%m/%d/%y" +t_fmt="%H:%M:%S" +am_pm="AM";"PM" +t_fmt_ampm="%I:%M:%S %p" +era="" +era_d_fmt="" +era_t_fmt="" +era_d_t_fmt="" +alt_digits="" Added: head/usr.bin/locale/tests/locale_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/locale_test.sh Tue Sep 10 15:09:46 2019 (r352138) @@ -0,0 +1,98 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2019 Yuri Pankov +# +# 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$ + +atf_test_case k_flag_posix +k_flag_posix_head() +{ + atf_set "descr" "Verify -k handles all POSIX specified keywords" +} +k_flag_posix_body() +{ + export LC_ALL="C" + + # LC_MONETARY + atf_check -o file:"$(atf_get_srcdir)/k_flag_posix_monetary.out" \ + locale -k \ + int_curr_symbol \ + currency_symbol \ + mon_decimal_point \ + mon_thousands_sep \ + mon_grouping \ + positive_sign \ + negative_sign \ + int_frac_digits \ + frac_digits \ + p_cs_precedes \ + p_sep_by_space \ + n_cs_precedes \ + n_sep_by_space \ + p_sign_posn \ + n_sign_posn \ + int_p_cs_precedes \ + int_n_cs_precedes \ + int_p_sep_by_space \ + int_n_sep_by_space \ + int_p_sign_posn \ + int_n_sign_posn + + # LC_NUMERIC + atf_check -o file:"$(atf_get_srcdir)/k_flag_posix_numeric.out" \ + locale -k \ + decimal_point \ + thousands_sep \ + grouping + + # LC_TIME + atf_check -o file:"$(atf_get_srcdir)/k_flag_posix_time.out" \ + locale -k \ + abday \ + day \ + abmon \ + mon \ + d_t_fmt \ + d_fmt \ + t_fmt \ + am_pm \ + t_fmt_ampm \ + era \ + era_d_fmt \ + era_t_fmt \ + era_d_t_fmt \ + alt_digits + + # LC_MESSAGES + atf_check -o file:"$(atf_get_srcdir)/k_flag_posix_messages.out" \ + locale -k \ + yesexpr \ + noexpr +} + +atf_init_test_cases() +{ + atf_add_test_case k_flag_posix +} From owner-svn-src-all@freebsd.org Tue Sep 10 15:38:36 2019 Return-Path: Delivered-To: svn-src-all@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 41726D9E8B; Tue, 10 Sep 2019 15:38:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46SThW2WDxz4ZJw; Tue, 10 Sep 2019 15:38:34 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A8B142602ED; Tue, 10 Sep 2019 17:38:25 +0200 (CEST) Subject: Re: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand... To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906250450.x5P4o9oR015946@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Tue, 10 Sep 2019 17:37:39 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201906250450.x5P4o9oR015946@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46SThW2WDxz4ZJw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.57)[ip: (-9.09), ipnet: 2a01:4f8::/29(-1.97), asn: 24940(-1.78), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 15:38:36 -0000 On 2019-06-25 06:50, Warner Losh wrote: > Author: imp > Date: Tue Jun 25 04:50:09 2019 > New Revision: 349352 > URL: https://svnweb.freebsd.org/changeset/base/349352 > > Log: > Remove NAND and NANDFS support > > NANDFS has been broken for years. Remove it. The NAND drivers that > remain are for ancient parts that are no longer relevant. They are > polled, have terrible performance and just for ancient arm > hardware. NAND parts have evolved significantly from this early work > and little to none of it would be relevant should someone need to > update to support raw nand. This code has been off by default for > years and has violated the vnode protocol leading to panics since it > was committed. > > Numerous posts to arch@ and other locations have found no actual users > for this software. > > Relnotes: Yes > No Objection From: arch@ > Differential Revision: https://reviews.freebsd.org/D20745 > This change leaves behind a bunch of empty directories in SVN? Cleanup? --HPS From owner-svn-src-all@freebsd.org Tue Sep 10 16:16:06 2019 Return-Path: Delivered-To: svn-src-all@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 10C76DB034; Tue, 10 Sep 2019 16:16:06 +0000 (UTC) (envelope-from luporl@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 46SVWn6lX8z4cQr; Tue, 10 Sep 2019 16:16:05 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CB19228A9E; Tue, 10 Sep 2019 16:16:05 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGG5Iw000693; Tue, 10 Sep 2019 16:16:05 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGG542000692; Tue, 10 Sep 2019 16:16:05 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201909101616.x8AGG542000692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 10 Sep 2019 16:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352140 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:16:06 -0000 Author: luporl Date: Tue Sep 10 16:16:05 2019 New Revision: 352140 URL: https://svnweb.freebsd.org/changeset/base/352140 Log: Add R_PPC_IRELATIVE relocation Pre-requisite for most ifunc related changes. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21587 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Tue Sep 10 15:42:34 2019 (r352139) +++ head/sys/sys/elf_common.h Tue Sep 10 16:16:05 2019 (r352140) @@ -1199,6 +1199,7 @@ typedef struct { #define R_PPC_SECTOFF_LO 34 #define R_PPC_SECTOFF_HI 35 #define R_PPC_SECTOFF_HA 36 +#define R_PPC_IRELATIVE 248 /* * 64-bit relocations From owner-svn-src-all@freebsd.org Tue Sep 10 16:30:07 2019 Return-Path: Delivered-To: svn-src-all@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 631BBDB753; Tue, 10 Sep 2019 16:30:07 +0000 (UTC) (envelope-from imp@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 46SVqz2148z4dGT; Tue, 10 Sep 2019 16:30:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BADB28CA1; Tue, 10 Sep 2019 16:30:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGU6UW006863; Tue, 10 Sep 2019 16:30:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGU618006862; Tue, 10 Sep 2019 16:30:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101630.x8AGU618006862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352141 - in head/sys/modules: nand nandfs nandsim X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/modules: nand nandfs nandsim X-SVN-Commit-Revision: 352141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:30:07 -0000 Author: imp Date: Tue Sep 10 16:30:06 2019 New Revision: 352141 URL: https://svnweb.freebsd.org/changeset/base/352141 Log: Remove empty directories left over from nand removal Deleted: head/sys/modules/nand/ head/sys/modules/nandfs/ head/sys/modules/nandsim/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:35:33 2019 Return-Path: Delivered-To: svn-src-all@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 45B63DBBC7; Tue, 10 Sep 2019 16:35:33 +0000 (UTC) (envelope-from imp@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 46SVyD5Vfwz4dwY; Tue, 10 Sep 2019 16:35:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F5A628E72; Tue, 10 Sep 2019 16:35:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGZWwb012657; Tue, 10 Sep 2019 16:35:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGZWU1012656; Tue, 10 Sep 2019 16:35:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101635.x8AGZWU1012656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352143 - in head/sys/modules: drm drm2 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/modules: drm drm2 X-SVN-Commit-Revision: 352143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:35:33 -0000 Author: imp Date: Tue Sep 10 16:35:31 2019 New Revision: 352143 URL: https://svnweb.freebsd.org/changeset/base/352143 Log: Remove empty directories after drm removal Deleted: head/sys/modules/drm/ head/sys/modules/drm2/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:36:10 2019 Return-Path: Delivered-To: svn-src-all@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 84174DBC42; Tue, 10 Sep 2019 16:36:10 +0000 (UTC) (envelope-from imp@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 46SVyy2wvcz4f5P; Tue, 10 Sep 2019 16:36:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4759928E73; Tue, 10 Sep 2019 16:36:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGaAD9012732; Tue, 10 Sep 2019 16:36:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGaAGL012731; Tue, 10 Sep 2019 16:36:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101636.x8AGaAGL012731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352144 - in head: lib/libnandfs sbin/nandfs sbin/newfs_nandfs sys/dev/nand sys/fs/nandfs usr.sbin/nandsim usr.sbin/nandtool X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: lib/libnandfs sbin/nandfs sbin/newfs_nandfs sys/dev/nand sys/fs/nandfs usr.sbin/nandsim usr.sbin/nandtool X-SVN-Commit-Revision: 352144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:36:10 -0000 Author: imp Date: Tue Sep 10 16:36:09 2019 New Revision: 352144 URL: https://svnweb.freebsd.org/changeset/base/352144 Log: Remove more directories left over from nand removal Deleted: head/lib/libnandfs/ head/sbin/nandfs/ head/sbin/newfs_nandfs/ head/sys/dev/nand/ head/sys/fs/nandfs/ head/usr.sbin/nandsim/ head/usr.sbin/nandtool/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:37:32 2019 Return-Path: Delivered-To: svn-src-all@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 DCE7CDBD0B; Tue, 10 Sep 2019 16:37:32 +0000 (UTC) (envelope-from imp@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 46SW0X5Vhqz4fDx; Tue, 10 Sep 2019 16:37:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8780D28E77; Tue, 10 Sep 2019 16:37:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGbWp6012841; Tue, 10 Sep 2019 16:37:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGbWr9012840; Tue, 10 Sep 2019 16:37:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101637.x8AGbWr9012840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352145 - head/stand/sparc64/zfsloader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/sparc64/zfsloader X-SVN-Commit-Revision: 352145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:37:32 -0000 Author: imp Date: Tue Sep 10 16:37:32 2019 New Revision: 352145 URL: https://svnweb.freebsd.org/changeset/base/352145 Log: Remove empty directory aftre r336532 Deleted: head/stand/sparc64/zfsloader/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:38:53 2019 Return-Path: Delivered-To: svn-src-all@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 CAF1CDBDE9; Tue, 10 Sep 2019 16:38:53 +0000 (UTC) (envelope-from imp@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 46SW254290z4fQm; Tue, 10 Sep 2019 16:38:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5614E28E78; Tue, 10 Sep 2019 16:38:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGcrwu012953; Tue, 10 Sep 2019 16:38:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGcrIx012952; Tue, 10 Sep 2019 16:38:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101638.x8AGcrIx012952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352146 - head/sys/mips/gxemul X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/gxemul X-SVN-Commit-Revision: 352146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:38:53 -0000 Author: imp Date: Tue Sep 10 16:38:52 2019 New Revision: 352146 URL: https://svnweb.freebsd.org/changeset/base/352146 Log: Remove empty directory after r342256 Deleted: head/sys/mips/gxemul/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:40:01 2019 Return-Path: Delivered-To: svn-src-all@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 766C0DBF73; Tue, 10 Sep 2019 16:40:01 +0000 (UTC) (envelope-from imp@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 46SW3P2VhBz4fcG; Tue, 10 Sep 2019 16:40:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F15928E7D; Tue, 10 Sep 2019 16:40:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGe11U013093; Tue, 10 Sep 2019 16:40:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGe1kl013092; Tue, 10 Sep 2019 16:40:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101640.x8AGe1kl013092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352147 - head/usr.bin/send-pr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/send-pr X-SVN-Commit-Revision: 352147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:40:01 -0000 Author: imp Date: Tue Sep 10 16:40:00 2019 New Revision: 352147 URL: https://svnweb.freebsd.org/changeset/base/352147 Log: Remove leftover usr.bin/send-pr after r338042 Deleted: head/usr.bin/send-pr/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:41:01 2019 Return-Path: Delivered-To: svn-src-all@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 26538DC19B; Tue, 10 Sep 2019 16:41:01 +0000 (UTC) (envelope-from imp@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 46SW4X7478z4fmd; Tue, 10 Sep 2019 16:41:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD4ED28EA3; Tue, 10 Sep 2019 16:41:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGf0UX013192; Tue, 10 Sep 2019 16:41:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGf0K9013191; Tue, 10 Sep 2019 16:41:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101641.x8AGf0K9013191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352148 - in head/sys/modules: if_tap if_tun X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/modules: if_tap if_tun X-SVN-Commit-Revision: 352148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:41:01 -0000 Author: imp Date: Tue Sep 10 16:41:00 2019 New Revision: 352148 URL: https://svnweb.freebsd.org/changeset/base/352148 Log: Remove empty tap/tun modules directories after r347241 Deleted: head/sys/modules/if_tap/ head/sys/modules/if_tun/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:43:06 2019 Return-Path: Delivered-To: svn-src-all@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 AD156DC25D; Tue, 10 Sep 2019 16:43:06 +0000 (UTC) (envelope-from imp@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 46SW6y49DJz4g6S; Tue, 10 Sep 2019 16:43:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5956529031; Tue, 10 Sep 2019 16:43:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGh6Cq018564; Tue, 10 Sep 2019 16:43:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGh6We018563; Tue, 10 Sep 2019 16:43:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101643.x8AGh6We018563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352149 - in head/tools/tools/nanobsd: gateworks rescue/Pkg X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/tools/tools/nanobsd: gateworks rescue/Pkg X-SVN-Commit-Revision: 352149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:43:06 -0000 Author: imp Date: Tue Sep 10 16:43:05 2019 New Revision: 352149 URL: https://svnweb.freebsd.org/changeset/base/352149 Log: Remove gateworks directories left over from r336136 Deleted: head/tools/tools/nanobsd/gateworks/ head/tools/tools/nanobsd/rescue/Pkg/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:48:50 2019 Return-Path: Delivered-To: svn-src-all@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 A703DDC374; Tue, 10 Sep 2019 16:48:50 +0000 (UTC) (envelope-from imp@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 46SWFZ3fCdz4gHJ; Tue, 10 Sep 2019 16:48:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C5EB29033; Tue, 10 Sep 2019 16:48:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGmoUb018908; Tue, 10 Sep 2019 16:48:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGmoTP018907; Tue, 10 Sep 2019 16:48:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101648.x8AGmoTP018907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352150 - in head/contrib/netbsd-tests: crypto/libcrypto/bf crypto/libcrypto/bn crypto/libcrypto/cast crypto/libcrypto/des crypto/libcrypto/dh crypto/libcrypto/dsa crypto/libcrypto/ec c... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/contrib/netbsd-tests: crypto/libcrypto/bf crypto/libcrypto/bn crypto/libcrypto/cast crypto/libcrypto/des crypto/libcrypto/dh crypto/libcrypto/dsa crypto/libcrypto/ec crypto/libcrypto/ecdh cryp... X-SVN-Commit-Revision: 352150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:48:50 -0000 Author: imp Date: Tue Sep 10 16:48:49 2019 New Revision: 352150 URL: https://svnweb.freebsd.org/changeset/base/352150 Log: Remove now-empty directories after r272458 Deleted: head/contrib/netbsd-tests/crypto/libcrypto/bf/ head/contrib/netbsd-tests/crypto/libcrypto/bn/ head/contrib/netbsd-tests/crypto/libcrypto/cast/ head/contrib/netbsd-tests/crypto/libcrypto/des/ head/contrib/netbsd-tests/crypto/libcrypto/dh/ head/contrib/netbsd-tests/crypto/libcrypto/dsa/ head/contrib/netbsd-tests/crypto/libcrypto/ec/ head/contrib/netbsd-tests/crypto/libcrypto/ecdh/ head/contrib/netbsd-tests/crypto/libcrypto/ecdsa/ head/contrib/netbsd-tests/crypto/libcrypto/engine/ head/contrib/netbsd-tests/crypto/libcrypto/evp/ head/contrib/netbsd-tests/crypto/libcrypto/hmac/ head/contrib/netbsd-tests/crypto/libcrypto/idea/ head/contrib/netbsd-tests/crypto/libcrypto/lhash/ head/contrib/netbsd-tests/crypto/libcrypto/md2/ head/contrib/netbsd-tests/crypto/libcrypto/md4/ head/contrib/netbsd-tests/crypto/libcrypto/md5/ head/contrib/netbsd-tests/crypto/libcrypto/mdc2/ head/contrib/netbsd-tests/crypto/libcrypto/rand/ head/contrib/netbsd-tests/crypto/libcrypto/rc2/ head/contrib/netbsd-tests/crypto/libcrypto/rc4/ head/contrib/netbsd-tests/crypto/libcrypto/rc5/ head/contrib/netbsd-tests/crypto/libcrypto/ripemd/ head/contrib/netbsd-tests/crypto/libcrypto/rsa/ head/contrib/netbsd-tests/crypto/libcrypto/sha/ head/contrib/netbsd-tests/crypto/libcrypto/sha1/ head/contrib/netbsd-tests/crypto/libcrypto/srp/ head/contrib/netbsd-tests/crypto/libcrypto/threads/ head/contrib/netbsd-tests/crypto/libcrypto/x509v3/ head/contrib/netbsd-tests/dev/usb/libhid/ head/contrib/netbsd-tests/dev/usb/t_hid/ head/contrib/netbsd-tests/lib/libposix/bsd/ head/contrib/netbsd-tests/lib/libposix/posix1/ head/contrib/netbsd-tests/lib/libposix/posix2/ head/contrib/netbsd-tests/lib/libtre/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:50:39 2019 Return-Path: Delivered-To: svn-src-all@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 0A83ADC45B; Tue, 10 Sep 2019 16:50:39 +0000 (UTC) (envelope-from imp@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 46SWHf6XV6z3Bs2; Tue, 10 Sep 2019 16:50:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAE612903C; Tue, 10 Sep 2019 16:50:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGocJA019075; Tue, 10 Sep 2019 16:50:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGoc84019074; Tue, 10 Sep 2019 16:50:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101650.x8AGoc84019074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352151 - head/cddl/contrib/opensolaris/common/avl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/common/avl X-SVN-Commit-Revision: 352151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:50:39 -0000 Author: imp Date: Tue Sep 10 16:50:38 2019 New Revision: 352151 URL: https://svnweb.freebsd.org/changeset/base/352151 Log: Remove now-empty directory after r288337 Deleted: head/cddl/contrib/opensolaris/common/avl/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:51:53 2019 Return-Path: Delivered-To: svn-src-all@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 1B57DDC73A; Tue, 10 Sep 2019 16:51:53 +0000 (UTC) (envelope-from imp@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 46SWK471z5z3CKg; Tue, 10 Sep 2019 16:51:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD4C8291AC; Tue, 10 Sep 2019 16:51:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGpqO1024497; Tue, 10 Sep 2019 16:51:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGpqsG024496; Tue, 10 Sep 2019 16:51:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101651.x8AGpqsG024496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352152 - head/usr.sbin/bsdconfig/fdisk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/fdisk X-SVN-Commit-Revision: 352152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:51:53 -0000 Author: imp Date: Tue Sep 10 16:51:52 2019 New Revision: 352152 URL: https://svnweb.freebsd.org/changeset/base/352152 Log: Remove empty directory imported with r238438 Deleted: head/usr.sbin/bsdconfig/fdisk/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:53:17 2019 Return-Path: Delivered-To: svn-src-all@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 83663DC860; Tue, 10 Sep 2019 16:53:17 +0000 (UTC) (envelope-from imp@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 46SWLj2vvsz3CWD; Tue, 10 Sep 2019 16:53:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DAF2291EA; Tue, 10 Sep 2019 16:53:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGrHtF024616; Tue, 10 Sep 2019 16:53:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGrHF3024615; Tue, 10 Sep 2019 16:53:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101653.x8AGrHF3024615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352153 - head/sys/gnu/dts/include/dt-bindings/genpd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/gnu/dts/include/dt-bindings/genpd X-SVN-Commit-Revision: 352153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:53:17 -0000 Author: imp Date: Tue Sep 10 16:53:16 2019 New Revision: 352153 URL: https://svnweb.freebsd.org/changeset/base/352153 Log: Remove empty directory imported with r342935 Deleted: head/sys/gnu/dts/include/dt-bindings/genpd/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:56:44 2019 Return-Path: Delivered-To: svn-src-all@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 03863DC9D6; Tue, 10 Sep 2019 16:56:44 +0000 (UTC) (envelope-from imp@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 46SWQg6JXlz3Cg1; Tue, 10 Sep 2019 16:56:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D6CB291EB; Tue, 10 Sep 2019 16:56:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGuh77024863; Tue, 10 Sep 2019 16:56:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGuhYZ024862; Tue, 10 Sep 2019 16:56:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101656.x8AGuhYZ024862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352154 - head/crypto/heimdal/lib/sqlite X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/crypto/heimdal/lib/sqlite X-SVN-Commit-Revision: 352154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:56:44 -0000 Author: imp Date: Tue Sep 10 16:56:43 2019 New Revision: 352154 URL: https://svnweb.freebsd.org/changeset/base/352154 Log: Remove empty directory after r342871 Deleted: head/crypto/heimdal/lib/sqlite/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:57:36 2019 Return-Path: Delivered-To: svn-src-all@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 4A8C8DCA59; Tue, 10 Sep 2019 16:57:36 +0000 (UTC) (envelope-from imp@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 46SWRh1Gj1z3Cq4; Tue, 10 Sep 2019 16:57:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9485291EC; Tue, 10 Sep 2019 16:57:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGvZ7R024946; Tue, 10 Sep 2019 16:57:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGvZhC024945; Tue, 10 Sep 2019 16:57:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101657.x8AGvZhC024945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352155 - head/contrib/traceroute/lbl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/traceroute/lbl X-SVN-Commit-Revision: 352155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:57:36 -0000 Author: imp Date: Tue Sep 10 16:57:35 2019 New Revision: 352155 URL: https://svnweb.freebsd.org/changeset/base/352155 Log: Remove empty directory after r215937 Deleted: head/contrib/traceroute/lbl/ From owner-svn-src-all@freebsd.org Tue Sep 10 16:58:20 2019 Return-Path: Delivered-To: svn-src-all@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 14A78DCAE4; Tue, 10 Sep 2019 16:58:20 +0000 (UTC) (envelope-from imp@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 46SWSW5cHvz3D13; Tue, 10 Sep 2019 16:58:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89B58291ED; Tue, 10 Sep 2019 16:58:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AGwJXp025024; Tue, 10 Sep 2019 16:58:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AGwJ0i025023; Tue, 10 Sep 2019 16:58:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101658.x8AGwJ0i025023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 16:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352156 - head/contrib/apr/include/private X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/apr/include/private X-SVN-Commit-Revision: 352156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 16:58:20 -0000 Author: imp Date: Tue Sep 10 16:58:19 2019 New Revision: 352156 URL: https://svnweb.freebsd.org/changeset/base/352156 Log: Remove directory empty after r266735 Deleted: head/contrib/apr/include/private/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:19:43 2019 Return-Path: Delivered-To: svn-src-all@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 F03FBDD7A3; Tue, 10 Sep 2019 17:19:43 +0000 (UTC) (envelope-from imp@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 46SWxC669yz3FK6; Tue, 10 Sep 2019 17:19:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98FB929579; Tue, 10 Sep 2019 17:19:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHJhxD039080; Tue, 10 Sep 2019 17:19:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHJh7Z039079; Tue, 10 Sep 2019 17:19:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101719.x8AHJh7Z039079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352157 - in head/contrib/wpa: patches wpa_supplicant/tests X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/contrib/wpa: patches wpa_supplicant/tests X-SVN-Commit-Revision: 352157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:19:44 -0000 Author: imp Date: Tue Sep 10 17:19:43 2019 New Revision: 352157 URL: https://svnweb.freebsd.org/changeset/base/352157 Log: Remove dirs empty since r336203 Deleted: head/contrib/wpa/patches/ head/contrib/wpa/wpa_supplicant/tests/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:20:25 2019 Return-Path: Delivered-To: svn-src-all@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 17893DD843; Tue, 10 Sep 2019 17:20:25 +0000 (UTC) (envelope-from imp@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 46SWy06vGLz3FSH; Tue, 10 Sep 2019 17:20:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B72FE2957D; Tue, 10 Sep 2019 17:20:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHKO85039346; Tue, 10 Sep 2019 17:20:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHKOAs039345; Tue, 10 Sep 2019 17:20:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101720.x8AHKOAs039345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352158 - head/contrib/wpa/src/hlr_auc_gw X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/wpa/src/hlr_auc_gw X-SVN-Commit-Revision: 352158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:20:25 -0000 Author: imp Date: Tue Sep 10 17:20:24 2019 New Revision: 352158 URL: https://svnweb.freebsd.org/changeset/base/352158 Log: Remove dir empty since r214734 Deleted: head/contrib/wpa/src/hlr_auc_gw/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:26:21 2019 Return-Path: Delivered-To: svn-src-all@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 8737EDDAFA; Tue, 10 Sep 2019 17:26:21 +0000 (UTC) (envelope-from imp@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 46SX4s30z1z3FtP; Tue, 10 Sep 2019 17:26:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DEA329735; Tue, 10 Sep 2019 17:26:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHQLTU046235; Tue, 10 Sep 2019 17:26:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHQLmF046234; Tue, 10 Sep 2019 17:26:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101726.x8AHQLmF046234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352159 - head/contrib/ipfilter/ipsd/Celler X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/ipfilter/ipsd/Celler X-SVN-Commit-Revision: 352159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:26:21 -0000 Author: imp Date: Tue Sep 10 17:26:20 2019 New Revision: 352159 URL: https://svnweb.freebsd.org/changeset/base/352159 Log: Remove empty dir after r342815 Deleted: head/contrib/ipfilter/ipsd/Celler/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:26:47 2019 Return-Path: Delivered-To: svn-src-all@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 B9D10DDBBF; Tue, 10 Sep 2019 17:26:47 +0000 (UTC) (envelope-from imp@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 46SX5M4Tthz3G5j; Tue, 10 Sep 2019 17:26:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 640A629736; Tue, 10 Sep 2019 17:26:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHQlq2046410; Tue, 10 Sep 2019 17:26:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHQl6r046409; Tue, 10 Sep 2019 17:26:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101726.x8AHQl6r046409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352160 - head/contrib/ipfilter/net X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/ipfilter/net X-SVN-Commit-Revision: 352160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:26:47 -0000 Author: imp Date: Tue Sep 10 17:26:46 2019 New Revision: 352160 URL: https://svnweb.freebsd.org/changeset/base/352160 Log: Remove empty dir after r288683 Deleted: head/contrib/ipfilter/net/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:30:06 2019 Return-Path: Delivered-To: svn-src-all@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 92B89DDE39; Tue, 10 Sep 2019 17:30:06 +0000 (UTC) (envelope-from imp@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 46SX9B3NV8z3GNK; Tue, 10 Sep 2019 17:30:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EE8929741; Tue, 10 Sep 2019 17:30:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHU6f8047380; Tue, 10 Sep 2019 17:30:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHU6m1047379; Tue, 10 Sep 2019 17:30:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101730.x8AHU6m1047379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352161 - head/contrib/ipfilter/ipsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/ipfilter/ipsd X-SVN-Commit-Revision: 352161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:30:06 -0000 Author: imp Date: Tue Sep 10 17:30:05 2019 New Revision: 352161 URL: https://svnweb.freebsd.org/changeset/base/352161 Log: Remove empty dir after r342815 (pt 2, oops) Deleted: head/contrib/ipfilter/ipsd/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:31:07 2019 Return-Path: Delivered-To: svn-src-all@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 A7E97DE079; Tue, 10 Sep 2019 17:31:07 +0000 (UTC) (envelope-from imp@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 46SXBM420Gz3GXY; Tue, 10 Sep 2019 17:31:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55F162976D; Tue, 10 Sep 2019 17:31:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHV7uq051669; Tue, 10 Sep 2019 17:31:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHV7bO051668; Tue, 10 Sep 2019 17:31:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101731.x8AHV7bO051668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352162 - head/contrib/libxo/m4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/libxo/m4 X-SVN-Commit-Revision: 352162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:31:07 -0000 Author: imp Date: Tue Sep 10 17:31:06 2019 New Revision: 352162 URL: https://svnweb.freebsd.org/changeset/base/352162 Log: Remove empty directory after r297894 Deleted: head/contrib/libxo/m4/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:41:00 2019 Return-Path: Delivered-To: svn-src-all@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 56CD3DE580; Tue, 10 Sep 2019 17:41:00 +0000 (UTC) (envelope-from jkim@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 46SXPm2Q9bz3HFt; Tue, 10 Sep 2019 17:41:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1CB5A29926; Tue, 10 Sep 2019 17:41:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHf0Rt054953; Tue, 10 Sep 2019 17:41:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHeslv054915; Tue, 10 Sep 2019 17:40:54 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909101740.x8AHeslv054915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 17:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352163 - in vendor-crypto/openssl/dist: . apps crypto crypto/aes/asm crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/cms crypto/conf crypto/dh crypto/dsa crypto/dso crypto/ec cry... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-crypto/openssl/dist: . apps crypto crypto/aes/asm crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/cms crypto/conf crypto/dh crypto/dsa crypto/dso crypto/ec crypto/ec/asm crypto/engine ... X-SVN-Commit-Revision: 352163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:41:00 -0000 Author: jkim Date: Tue Sep 10 17:40:53 2019 New Revision: 352163 URL: https://svnweb.freebsd.org/changeset/base/352163 Log: Import OpenSSL 1.1.1d. Added: vendor-crypto/openssl/dist/doc/man3/CRYPTO_memcmp.pod vendor-crypto/openssl/dist/doc/man3/X509_cmp.pod Deleted: vendor-crypto/openssl/dist/crypto/aes/asm/aes-586.pl vendor-crypto/openssl/dist/crypto/aes/asm/aes-x86_64.pl vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-x86_64.pl Modified: vendor-crypto/openssl/dist/CHANGES vendor-crypto/openssl/dist/Configure vendor-crypto/openssl/dist/FREEBSD-upgrade vendor-crypto/openssl/dist/INSTALL vendor-crypto/openssl/dist/NEWS vendor-crypto/openssl/dist/README vendor-crypto/openssl/dist/apps/apps.c vendor-crypto/openssl/dist/apps/apps.h vendor-crypto/openssl/dist/apps/ca.c vendor-crypto/openssl/dist/apps/dgst.c vendor-crypto/openssl/dist/apps/enc.c vendor-crypto/openssl/dist/apps/ocsp.c vendor-crypto/openssl/dist/apps/openssl.c vendor-crypto/openssl/dist/apps/pkcs12.c vendor-crypto/openssl/dist/apps/req.c vendor-crypto/openssl/dist/apps/s_apps.h vendor-crypto/openssl/dist/apps/s_cb.c vendor-crypto/openssl/dist/apps/s_client.c vendor-crypto/openssl/dist/apps/speed.c vendor-crypto/openssl/dist/apps/storeutl.c vendor-crypto/openssl/dist/config vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl vendor-crypto/openssl/dist/crypto/asn1/a_time.c vendor-crypto/openssl/dist/crypto/asn1/a_type.c vendor-crypto/openssl/dist/crypto/asn1/x_bignum.c vendor-crypto/openssl/dist/crypto/bio/b_addr.c vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c vendor-crypto/openssl/dist/crypto/bio/bss_file.c vendor-crypto/openssl/dist/crypto/bio/bss_mem.c vendor-crypto/openssl/dist/crypto/bn/asm/mips.pl vendor-crypto/openssl/dist/crypto/bn/bn_div.c vendor-crypto/openssl/dist/crypto/bn/bn_lcl.h vendor-crypto/openssl/dist/crypto/bn/bn_lib.c vendor-crypto/openssl/dist/crypto/bn/bn_prime.c vendor-crypto/openssl/dist/crypto/bn/bn_rand.c vendor-crypto/openssl/dist/crypto/bn/bn_sqrt.c vendor-crypto/openssl/dist/crypto/cms/cms_att.c vendor-crypto/openssl/dist/crypto/cms/cms_env.c vendor-crypto/openssl/dist/crypto/cms/cms_err.c vendor-crypto/openssl/dist/crypto/cms/cms_lcl.h vendor-crypto/openssl/dist/crypto/cms/cms_sd.c vendor-crypto/openssl/dist/crypto/cms/cms_smime.c vendor-crypto/openssl/dist/crypto/conf/conf_sap.c vendor-crypto/openssl/dist/crypto/ctype.c vendor-crypto/openssl/dist/crypto/dh/dh_check.c vendor-crypto/openssl/dist/crypto/dh/dh_gen.c vendor-crypto/openssl/dist/crypto/dh/dh_key.c vendor-crypto/openssl/dist/crypto/dh/dh_lib.c vendor-crypto/openssl/dist/crypto/dsa/dsa_ameth.c vendor-crypto/openssl/dist/crypto/dsa/dsa_err.c vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c vendor-crypto/openssl/dist/crypto/dso/dso_dlfcn.c vendor-crypto/openssl/dist/crypto/ec/asm/ecp_nistz256-sparcv9.pl vendor-crypto/openssl/dist/crypto/ec/asm/ecp_nistz256-x86_64.pl vendor-crypto/openssl/dist/crypto/ec/asm/x25519-ppc64.pl vendor-crypto/openssl/dist/crypto/ec/ec_asn1.c vendor-crypto/openssl/dist/crypto/ec/ec_curve.c vendor-crypto/openssl/dist/crypto/ec/ec_lcl.h vendor-crypto/openssl/dist/crypto/ec/ec_lib.c vendor-crypto/openssl/dist/crypto/ec/ecdh_ossl.c vendor-crypto/openssl/dist/crypto/ec/ecdsa_ossl.c vendor-crypto/openssl/dist/crypto/ec/ecp_nistp224.c vendor-crypto/openssl/dist/crypto/ec/ecp_nistp256.c vendor-crypto/openssl/dist/crypto/ec/ecp_nistp521.c vendor-crypto/openssl/dist/crypto/ec/ecp_nistputil.c vendor-crypto/openssl/dist/crypto/ec/ecx_meth.c vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c vendor-crypto/openssl/dist/crypto/engine/eng_openssl.c vendor-crypto/openssl/dist/crypto/err/err.c vendor-crypto/openssl/dist/crypto/err/openssl.txt vendor-crypto/openssl/dist/crypto/evp/bio_ok.c vendor-crypto/openssl/dist/crypto/evp/e_aes.c vendor-crypto/openssl/dist/crypto/evp/e_aria.c vendor-crypto/openssl/dist/crypto/evp/e_chacha20_poly1305.c vendor-crypto/openssl/dist/crypto/evp/e_rc5.c vendor-crypto/openssl/dist/crypto/evp/evp_err.c vendor-crypto/openssl/dist/crypto/evp/evp_lib.c vendor-crypto/openssl/dist/crypto/evp/m_sha3.c vendor-crypto/openssl/dist/crypto/include/internal/ctype.h vendor-crypto/openssl/dist/crypto/include/internal/rand_int.h vendor-crypto/openssl/dist/crypto/include/internal/sm2err.h vendor-crypto/openssl/dist/crypto/init.c vendor-crypto/openssl/dist/crypto/lhash/lhash.c vendor-crypto/openssl/dist/crypto/o_str.c vendor-crypto/openssl/dist/crypto/pem/pvkfmt.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_doit.c vendor-crypto/openssl/dist/crypto/rand/drbg_lib.c vendor-crypto/openssl/dist/crypto/rand/rand_err.c vendor-crypto/openssl/dist/crypto/rand/rand_lcl.h vendor-crypto/openssl/dist/crypto/rand/rand_lib.c vendor-crypto/openssl/dist/crypto/rand/rand_unix.c vendor-crypto/openssl/dist/crypto/rsa/rsa_ameth.c vendor-crypto/openssl/dist/crypto/rsa/rsa_err.c vendor-crypto/openssl/dist/crypto/rsa/rsa_gen.c vendor-crypto/openssl/dist/crypto/rsa/rsa_lib.c vendor-crypto/openssl/dist/crypto/rsa/rsa_ossl.c vendor-crypto/openssl/dist/crypto/s390xcap.c vendor-crypto/openssl/dist/crypto/sha/asm/keccak1600-armv4.pl vendor-crypto/openssl/dist/crypto/sha/asm/keccak1600-armv8.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha512-sparcv9.pl vendor-crypto/openssl/dist/crypto/sm2/sm2_sign.c vendor-crypto/openssl/dist/crypto/store/loader_file.c vendor-crypto/openssl/dist/crypto/store/store_lib.c vendor-crypto/openssl/dist/crypto/threads_none.c vendor-crypto/openssl/dist/crypto/threads_pthread.c vendor-crypto/openssl/dist/crypto/ui/ui_lib.c vendor-crypto/openssl/dist/crypto/ui/ui_openssl.c vendor-crypto/openssl/dist/crypto/uid.c vendor-crypto/openssl/dist/crypto/whrlpool/wp_block.c vendor-crypto/openssl/dist/crypto/x509/by_dir.c vendor-crypto/openssl/dist/crypto/x509/t_req.c vendor-crypto/openssl/dist/crypto/x509/x509_att.c vendor-crypto/openssl/dist/crypto/x509/x509_cmp.c vendor-crypto/openssl/dist/crypto/x509/x509_err.c vendor-crypto/openssl/dist/crypto/x509/x509_lu.c vendor-crypto/openssl/dist/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist/crypto/x509v3/v3_alt.c vendor-crypto/openssl/dist/crypto/x509v3/v3_purp.c vendor-crypto/openssl/dist/doc/HOWTO/proxy_certificates.txt vendor-crypto/openssl/dist/doc/man1/engine.pod vendor-crypto/openssl/dist/doc/man1/errstr.pod vendor-crypto/openssl/dist/doc/man1/pkcs12.pod vendor-crypto/openssl/dist/doc/man1/pkeyparam.pod vendor-crypto/openssl/dist/doc/man1/s_client.pod vendor-crypto/openssl/dist/doc/man1/s_server.pod vendor-crypto/openssl/dist/doc/man3/ADMISSIONS.pod vendor-crypto/openssl/dist/doc/man3/ASYNC_start_job.pod vendor-crypto/openssl/dist/doc/man3/BIO_connect.pod vendor-crypto/openssl/dist/doc/man3/BIO_f_ssl.pod vendor-crypto/openssl/dist/doc/man3/BIO_find_type.pod vendor-crypto/openssl/dist/doc/man3/BIO_new.pod vendor-crypto/openssl/dist/doc/man3/BIO_s_accept.pod vendor-crypto/openssl/dist/doc/man3/BIO_s_bio.pod vendor-crypto/openssl/dist/doc/man3/BIO_s_connect.pod vendor-crypto/openssl/dist/doc/man3/BIO_s_fd.pod vendor-crypto/openssl/dist/doc/man3/BIO_s_mem.pod vendor-crypto/openssl/dist/doc/man3/BIO_set_callback.pod vendor-crypto/openssl/dist/doc/man3/BN_generate_prime.pod vendor-crypto/openssl/dist/doc/man3/BN_mod_mul_montgomery.pod vendor-crypto/openssl/dist/doc/man3/BN_new.pod vendor-crypto/openssl/dist/doc/man3/CMS_final.pod vendor-crypto/openssl/dist/doc/man3/CRYPTO_THREAD_run_once.pod vendor-crypto/openssl/dist/doc/man3/DES_random_key.pod vendor-crypto/openssl/dist/doc/man3/DSA_generate_key.pod vendor-crypto/openssl/dist/doc/man3/DSA_sign.pod vendor-crypto/openssl/dist/doc/man3/ECDSA_SIG_new.pod vendor-crypto/openssl/dist/doc/man3/EVP_DigestInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_DigestSignInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_DigestVerifyInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_decrypt.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_derive.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_encrypt.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_sign.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_verify.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_verify_recover.pod vendor-crypto/openssl/dist/doc/man3/EVP_SealInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_SignInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_VerifyInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_aria.pod vendor-crypto/openssl/dist/doc/man3/EVP_md5.pod vendor-crypto/openssl/dist/doc/man3/EVP_rc5_32_12_16_cbc.pod vendor-crypto/openssl/dist/doc/man3/OCSP_REQUEST_new.pod vendor-crypto/openssl/dist/doc/man3/OPENSSL_fork_prepare.pod vendor-crypto/openssl/dist/doc/man3/OSSL_STORE_LOADER.pod vendor-crypto/openssl/dist/doc/man3/OSSL_STORE_expect.pod vendor-crypto/openssl/dist/doc/man3/PKCS12_newpass.pod vendor-crypto/openssl/dist/doc/man3/RAND_DRBG_set_callbacks.pod vendor-crypto/openssl/dist/doc/man3/RAND_set_rand_method.pod vendor-crypto/openssl/dist/doc/man3/RSA_blinding_on.pod vendor-crypto/openssl/dist/doc/man3/RSA_generate_key.pod vendor-crypto/openssl/dist/doc/man3/RSA_padding_add_PKCS1_type_1.pod vendor-crypto/openssl/dist/doc/man3/RSA_public_encrypt.pod vendor-crypto/openssl/dist/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_config.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_dane_enable.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_get0_param.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_new.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_cipher_list.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_generate_session_id.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_session_id_context.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_verify.pod vendor-crypto/openssl/dist/doc/man3/SSL_SESSION_get0_hostname.pod vendor-crypto/openssl/dist/doc/man3/SSL_get_error.pod vendor-crypto/openssl/dist/doc/man3/SSL_library_init.pod vendor-crypto/openssl/dist/doc/man3/SSL_set1_host.pod vendor-crypto/openssl/dist/doc/man3/SSL_write.pod vendor-crypto/openssl/dist/doc/man3/X509_STORE_CTX_get_error.pod vendor-crypto/openssl/dist/doc/man3/X509_STORE_CTX_set_verify_cb.pod vendor-crypto/openssl/dist/doc/man3/X509_STORE_add_cert.pod vendor-crypto/openssl/dist/doc/man3/X509_STORE_new.pod vendor-crypto/openssl/dist/doc/man3/X509_VERIFY_PARAM_set_flags.pod vendor-crypto/openssl/dist/doc/man3/X509_get_extension_flags.pod vendor-crypto/openssl/dist/doc/man3/d2i_X509.pod vendor-crypto/openssl/dist/doc/man5/x509v3_config.pod vendor-crypto/openssl/dist/doc/man7/Ed25519.pod vendor-crypto/openssl/dist/doc/man7/RAND.pod vendor-crypto/openssl/dist/doc/man7/SM2.pod vendor-crypto/openssl/dist/doc/man7/X25519.pod vendor-crypto/openssl/dist/doc/man7/bio.pod vendor-crypto/openssl/dist/doc/man7/scrypt.pod vendor-crypto/openssl/dist/e_os.h vendor-crypto/openssl/dist/engines/build.info vendor-crypto/openssl/dist/engines/e_afalg.c vendor-crypto/openssl/dist/include/internal/constant_time_locl.h vendor-crypto/openssl/dist/include/internal/cryptlib.h vendor-crypto/openssl/dist/include/internal/dsoerr.h vendor-crypto/openssl/dist/include/internal/refcount.h vendor-crypto/openssl/dist/include/internal/thread_once.h vendor-crypto/openssl/dist/include/internal/tsan_assist.h vendor-crypto/openssl/dist/include/openssl/asn1err.h vendor-crypto/openssl/dist/include/openssl/asyncerr.h vendor-crypto/openssl/dist/include/openssl/bio.h vendor-crypto/openssl/dist/include/openssl/bioerr.h vendor-crypto/openssl/dist/include/openssl/bnerr.h vendor-crypto/openssl/dist/include/openssl/buffererr.h vendor-crypto/openssl/dist/include/openssl/cms.h vendor-crypto/openssl/dist/include/openssl/cmserr.h vendor-crypto/openssl/dist/include/openssl/comperr.h vendor-crypto/openssl/dist/include/openssl/conferr.h vendor-crypto/openssl/dist/include/openssl/cryptoerr.h vendor-crypto/openssl/dist/include/openssl/cterr.h vendor-crypto/openssl/dist/include/openssl/dherr.h vendor-crypto/openssl/dist/include/openssl/dsaerr.h vendor-crypto/openssl/dist/include/openssl/ec.h vendor-crypto/openssl/dist/include/openssl/ecerr.h vendor-crypto/openssl/dist/include/openssl/engineerr.h vendor-crypto/openssl/dist/include/openssl/evp.h vendor-crypto/openssl/dist/include/openssl/evperr.h vendor-crypto/openssl/dist/include/openssl/kdferr.h vendor-crypto/openssl/dist/include/openssl/objectserr.h vendor-crypto/openssl/dist/include/openssl/ocsperr.h vendor-crypto/openssl/dist/include/openssl/opensslv.h vendor-crypto/openssl/dist/include/openssl/pemerr.h vendor-crypto/openssl/dist/include/openssl/pkcs12err.h vendor-crypto/openssl/dist/include/openssl/pkcs7err.h vendor-crypto/openssl/dist/include/openssl/randerr.h vendor-crypto/openssl/dist/include/openssl/rsaerr.h vendor-crypto/openssl/dist/include/openssl/ssl.h vendor-crypto/openssl/dist/include/openssl/sslerr.h vendor-crypto/openssl/dist/include/openssl/store.h vendor-crypto/openssl/dist/include/openssl/storeerr.h vendor-crypto/openssl/dist/include/openssl/tls1.h vendor-crypto/openssl/dist/include/openssl/tserr.h vendor-crypto/openssl/dist/include/openssl/uierr.h vendor-crypto/openssl/dist/include/openssl/x509err.h vendor-crypto/openssl/dist/include/openssl/x509v3.h vendor-crypto/openssl/dist/include/openssl/x509v3err.h vendor-crypto/openssl/dist/ssl/d1_msg.c vendor-crypto/openssl/dist/ssl/record/rec_layer_s3.c vendor-crypto/openssl/dist/ssl/s3_lib.c vendor-crypto/openssl/dist/ssl/ssl_cert.c vendor-crypto/openssl/dist/ssl/ssl_ciph.c vendor-crypto/openssl/dist/ssl/ssl_lib.c vendor-crypto/openssl/dist/ssl/ssl_locl.h vendor-crypto/openssl/dist/ssl/ssl_sess.c vendor-crypto/openssl/dist/ssl/statem/extensions.c vendor-crypto/openssl/dist/ssl/statem/extensions_clnt.c vendor-crypto/openssl/dist/ssl/statem/extensions_srvr.c vendor-crypto/openssl/dist/ssl/statem/statem_clnt.c vendor-crypto/openssl/dist/ssl/statem/statem_lib.c vendor-crypto/openssl/dist/ssl/statem/statem_srvr.c vendor-crypto/openssl/dist/ssl/t1_lib.c vendor-crypto/openssl/dist/ssl/tls13_enc.c Modified: vendor-crypto/openssl/dist/CHANGES ============================================================================== --- vendor-crypto/openssl/dist/CHANGES Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/CHANGES Tue Sep 10 17:40:53 2019 (r352163) @@ -7,6 +7,101 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1c and 1.1.1d [10 Sep 2019] + + *) Fixed a fork protection issue. OpenSSL 1.1.1 introduced a rewritten random + number generator (RNG). This was intended to include protection in the + event of a fork() system call in order to ensure that the parent and child + processes did not share the same RNG state. However this protection was not + being used in the default case. + + A partial mitigation for this issue is that the output from a high + precision timer is mixed into the RNG state so the likelihood of a parent + and child process sharing state is significantly reduced. + + If an application already calls OPENSSL_init_crypto() explicitly using + OPENSSL_INIT_ATFORK then this problem does not occur at all. + (CVE-2019-1549) + [Matthias St. Pierre] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems. The RAND subsystem will wait for + /dev/random to be producing output before seeding from /dev/urandom. + The seeded state is stored for future library initialisations using + a system global shared memory segment. The shared memory identifier + can be configured by defining OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID to + the desired value. The default identifier is 114. + [Paul Dale] + + *) Correct the extended master secret constant on EBCDIC systems. Without this + fix TLS connections between an EBCDIC system and a non-EBCDIC system that + negotiate EMS will fail. Unfortunately this also means that TLS connections + between EBCDIC systems with this fix, and EBCDIC systems without this + fix will fail if they negotiate EMS. + [Matt Caswell] + + *) Use Windows installation paths in the mingw builds + + Mingw isn't a POSIX environment per se, which means that Windows + paths should be used for installation. + (CVE-2019-1552) + [Richard Levitte] + + *) Changed DH_check to accept parameters with order q and 2q subgroups. + With order 2q subgroups the bit 0 of the private key is not secret + but DH_generate_key works around that by clearing bit 0 of the + private key for those. This avoids leaking bit 0 of the private key. + [Bernd Edlinger] + + *) Significantly reduce secure memory usage by the randomness pools. + [Paul Dale] + + *) Revert the DEVRANDOM_WAIT feature for Linux systems + + The DEVRANDOM_WAIT feature added a select() call to wait for the + /dev/random device to become readable before reading from the + /dev/urandom device. + + It turned out that this change had negative side effects on + performance which were not acceptable. After some discussion it + was decided to revert this feature and leave it up to the OS + resp. the platform maintainer to ensure a proper initialization + during early boot time. + [Matthias St. Pierre] + Changes between 1.1.1b and 1.1.1c [28 May 2019] *) Add build tests for C++. These are generated files that only do one @@ -75,6 +170,16 @@ (CVE-2019-1543) [Matt Caswell] + *) Add DEVRANDOM_WAIT feature for Linux systems + + On older Linux systems where the getrandom() system call is not available, + OpenSSL normally uses the /dev/urandom device for seeding its CSPRNG. + Contrary to getrandom(), the /dev/urandom device will not block during + early boot when the kernel CSPRNG has not been seeded yet. + + To mitigate this known weakness, use select() to wait for /dev/random to + become readable before reading from /dev/urandom. + *) Ensure that SM2 only uses SM3 as digest algorithm [Paul Yang] @@ -322,7 +427,7 @@ SSL_set_ciphersuites() [Matt Caswell] - *) Memory allocation failures consistenly add an error to the error + *) Memory allocation failures consistently add an error to the error stack. [Rich Salz] @@ -6860,7 +6965,7 @@ reason texts, thereby removing some of the footprint that may not be interesting if those errors aren't displayed anyway. - NOTE: it's still possible for any application or module to have it's + NOTE: it's still possible for any application or module to have its own set of error texts inserted. The routines are there, just not used by default when no-err is given. [Richard Levitte] @@ -8826,7 +8931,7 @@ des-cbc 3624.96k 5258.21k 5530.91k Changes between 0.9.6g and 0.9.6h [5 Dec 2002] *) New function OPENSSL_cleanse(), which is used to cleanse a section of - memory from it's contents. This is done with a counter that will + memory from its contents. This is done with a counter that will place alternating values in each byte. This can be used to solve two issues: 1) the removal of calls to memset() by highly optimizing compilers, and 2) cleansing with other values than 0, since those can Modified: vendor-crypto/openssl/dist/Configure ============================================================================== --- vendor-crypto/openssl/dist/Configure Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/Configure Tue Sep 10 17:40:53 2019 (r352163) @@ -87,9 +87,6 @@ my $usage="Usage: Configure [no- ...] [enable- # linked openssl executable has rather debugging value than # production quality. # -# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items -# provided to stack calls. Generates unique stack functions for -# each possible stack type. # BN_LLONG use the type 'long long' in crypto/bn/bn.h # RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h # Following are set automatically by this script @@ -145,13 +142,13 @@ my @gcc_devteam_warn = qw( # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc # -Wextended-offsetof -- no, needed in CMS ASN1 code my @clang_devteam_warn = qw( + -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers - -Wno-unknown-warning-option -Wmissing-variable-declarations ); Modified: vendor-crypto/openssl/dist/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist/FREEBSD-upgrade Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/FREEBSD-upgrade Tue Sep 10 17:40:53 2019 (r352163) @@ -11,7 +11,7 @@ First, read http://wiki.freebsd.org/SubversionPrimer/V # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://repo.freebsd.org/base" -setenv OSSLVER 1.1.1c +setenv OSSLVER 1.1.1d ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` Modified: vendor-crypto/openssl/dist/INSTALL ============================================================================== --- vendor-crypto/openssl/dist/INSTALL Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/INSTALL Tue Sep 10 17:40:53 2019 (r352163) @@ -98,6 +98,9 @@ $ nmake test $ nmake install + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + If any of these steps fails, see section Installation in Detail below. This will build and install OpenSSL in the default location, which is: @@ -107,6 +110,12 @@ OpenSSL version number with underscores instead of periods. Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or install + engines. If you already have a pre-installed version of OpenSSL as part of + your Operating System it is recommended that you do not overwrite the system + version and instead install to somewhere else. + If you want to install it anywhere else, run config like this: On Unix: @@ -135,7 +144,10 @@ Don't build with support for deprecated APIs below the specified version number. For example "--api=1.1.0" will remove support for all APIS that were deprecated in OpenSSL - version 1.1.0 or below. + version 1.1.0 or below. This is a rather specialized option + for developers. If you just intend to remove all deprecated + APIs entirely (up to the current version), it is easier + to add the 'no-deprecated' option instead (see below). --cross-compile-prefix=PREFIX The PREFIX to include in front of commands for your @@ -229,7 +241,7 @@ source exists. getrandom: Use the L or equivalent system call. - devrandom: Use the the first device from the DEVRANDOM list + devrandom: Use the first device from the DEVRANDOM list which can be opened to read random bytes. The DEVRANDOM preprocessor constant expands to "/dev/urandom","/dev/random","/dev/srandom" on @@ -908,8 +920,11 @@ $ mms install ! OpenVMS $ nmake install # Windows - This will install all the software components in this directory - tree under PREFIX (the directory given with --prefix or its + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + + The above commands will install all the software components in this + directory tree under PREFIX (the directory given with --prefix or its default): Unix: @@ -964,6 +979,12 @@ private Initially empty, this is the default location for private key files. misc Various scripts. + + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or + install engines. If you already have a pre-installed version of OpenSSL as + part of your Operating System it is recommended that you do not overwrite + the system version and instead install to somewhere else. Package builders who want to configure the library for standard locations, but have the package installed somewhere else so that Modified: vendor-crypto/openssl/dist/NEWS ============================================================================== --- vendor-crypto/openssl/dist/NEWS Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/NEWS Tue Sep 10 17:40:53 2019 (r352163) @@ -5,6 +5,23 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019] + + o Fixed a fork protection issue (CVE-2019-1549) + o Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey + (CVE-2019-1563) + o For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters + o Compute ECC cofactors if not provided during EC_GROUP construction + (CVE-2019-1547) + o Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems + o Correct the extended master secret constant on EBCDIC systems + o Use Windows installation paths in the mingw builds (CVE-2019-1552) + o Changed DH_check to accept parameters with order q and 2q subgroups + o Significantly reduce secure memory usage by the randomness pools + o Revert the DEVRANDOM_WAIT feature for Linux systems + Major changes between OpenSSL 1.1.1b and OpenSSL 1.1.1c [28 May 2019] o Prevent over long nonces in ChaCha20-Poly1305 (CVE-2019-1543) @@ -601,7 +618,7 @@ Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]: - o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build. + o Give EVP_MAX_MD_SIZE its old value, except for a FIPS build. Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]: Modified: vendor-crypto/openssl/dist/README ============================================================================== --- vendor-crypto/openssl/dist/README Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/README Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1c 28 May 2019 + OpenSSL 1.1.1d 10 Sep 2019 Copyright (c) 1998-2019 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist/apps/apps.c ============================================================================== --- vendor-crypto/openssl/dist/apps/apps.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/apps.c Tue Sep 10 17:40:53 2019 (r352163) @@ -40,12 +40,19 @@ #endif #include #include -#include "s_apps.h" #include "apps.h" #ifdef _WIN32 static int WIN32_rename(const char *from, const char *to); # define rename(from,to) WIN32_rename((from),(to)) +#endif + +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) +# include +#endif + +#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) +# define _kbhit kbhit #endif typedef struct { Modified: vendor-crypto/openssl/dist/apps/apps.h ============================================================================== --- vendor-crypto/openssl/dist/apps/apps.h Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/apps.h Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -444,11 +444,9 @@ void destroy_ui_method(void); const UI_METHOD *get_ui_method(void); int chopup_args(ARGS *arg, char *buf); -# ifdef HEADER_X509_H int dump_cert_text(BIO *out, X509 *x); void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags); -# endif void print_bignum_var(BIO *, const BIGNUM *, const char*, int, unsigned char *); void print_array(BIO *, const char *, int, const unsigned char *); Modified: vendor-crypto/openssl/dist/apps/ca.c ============================================================================== --- vendor-crypto/openssl/dist/apps/ca.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/ca.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -722,7 +722,7 @@ end_of_options: /*****************************************************************/ if (req || gencrl) { - if (spkac_file != NULL) { + if (spkac_file != NULL && outfile != NULL) { output_der = 1; batch = 1; } Modified: vendor-crypto/openssl/dist/apps/dgst.c ============================================================================== --- vendor-crypto/openssl/dist/apps/dgst.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/dgst.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -421,7 +421,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int s size_t len; int i; - for (;;) { + while (BIO_pending(bp) || !BIO_eof(bp)) { i = BIO_read(bp, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in %s\n", file); Modified: vendor-crypto/openssl/dist/apps/enc.c ============================================================================== --- vendor-crypto/openssl/dist/apps/enc.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/enc.c Tue Sep 10 17:40:53 2019 (r352163) @@ -586,7 +586,7 @@ int enc_main(int argc, char **argv) if (benc != NULL) wbio = BIO_push(benc, wbio); - for (;;) { + while (BIO_pending(rbio) || !BIO_eof(rbio)) { inl = BIO_read(rbio, (char *)buff, bsize); if (inl <= 0) break; Modified: vendor-crypto/openssl/dist/apps/ocsp.c ============================================================================== --- vendor-crypto/openssl/dist/apps/ocsp.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/ocsp.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1416,9 +1416,11 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcb *q = '\0'; /* - * Skip "GET / HTTP..." requests often used by load-balancers + * Skip "GET / HTTP..." requests often used by load-balancers. Note: + * 'p' was incremented above to point to the first byte *after* the + * leading slash, so with 'GET / ' it is now an empty string. */ - if (p[1] == '\0') + if (p[0] == '\0') goto out; len = urldecode(p); Modified: vendor-crypto/openssl/dist/apps/openssl.c ============================================================================== --- vendor-crypto/openssl/dist/apps/openssl.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/openssl.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,7 +22,6 @@ # include #endif #include -#include "s_apps.h" /* Needed to get the other O_xxx flags. */ #ifdef OPENSSL_SYS_VMS # include Modified: vendor-crypto/openssl/dist/apps/pkcs12.c ============================================================================== --- vendor-crypto/openssl/dist/apps/pkcs12.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/pkcs12.c Tue Sep 10 17:40:53 2019 (r352163) @@ -838,7 +838,7 @@ static int alg_print(const X509_ALGOR *alg) goto done; } BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, " - "Block size(r): %ld, Paralelizm(p): %ld", + "Block size(r): %ld, Parallelism(p): %ld", ASN1_STRING_length(kdf->salt), ASN1_INTEGER_get(kdf->costParameter), ASN1_INTEGER_get(kdf->blockSize), Modified: vendor-crypto/openssl/dist/apps/req.c ============================================================================== --- vendor-crypto/openssl/dist/apps/req.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/req.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -881,9 +881,19 @@ int req_main(int argc, char **argv) if (text) { if (x509) - X509_print_ex(out, x509ss, get_nameopt(), reqflag); + ret = X509_print_ex(out, x509ss, get_nameopt(), reqflag); else - X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + ret = X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + + if (ret == 0) { + if (x509) + BIO_printf(bio_err, "Error printing certificate\n"); + else + BIO_printf(bio_err, "Error printing certificate request\n"); + + ERR_print_errors(bio_err); + goto end; + } } if (subject) { Modified: vendor-crypto/openssl/dist/apps/s_apps.h ============================================================================== --- vendor-crypto/openssl/dist/apps/s_apps.h Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/s_apps.h Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -9,14 +9,8 @@ #include -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -# include -#endif +#include -#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) -# define _kbhit kbhit -#endif - #define PORT "4433" #define PROTOCOL "tcp" @@ -24,17 +18,15 @@ typedef int (*do_server_cb)(int s, int stype, int prot int do_server(int *accept_sock, const char *host, const char *port, int family, int type, int protocol, do_server_cb cb, unsigned char *context, int naccept, BIO *bio_s_out); -#ifdef HEADER_X509_H + int verify_callback(int ok, X509_STORE_CTX *ctx); -#endif -#ifdef HEADER_SSL_H + int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file); int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key, STACK_OF(X509) *chain, int build_chain); int ssl_print_sigalgs(BIO *out, SSL *s); int ssl_print_point_formats(BIO *out, SSL *s); int ssl_print_groups(BIO *out, SSL *s, int noshared); -#endif int ssl_print_tmp_key(BIO *out, SSL *s); int init_client(int *sock, const char *host, const char *port, const char *bindhost, const char *bindport, @@ -44,13 +36,11 @@ int should_retry(int i); long bio_dump_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); -#ifdef HEADER_SSL_H void apps_ssl_info_callback(const SSL *s, int where, int ret); void msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); void tlsext_cb(SSL *s, int client_server, int type, const unsigned char *data, int len, void *arg); -#endif int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len); @@ -75,7 +65,6 @@ int args_excert(int option, SSL_EXCERT **pexc); int load_excert(SSL_EXCERT **pexc); void print_verify_detail(SSL *s, BIO *bio); void print_ssl_summary(SSL *s); -#ifdef HEADER_SSL_H int config_ctx(SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, SSL_CTX *ctx); int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, int crl_download); @@ -86,4 +75,3 @@ int ssl_load_stores(SSL_CTX *ctx, const char *vfyCApat void ssl_ctx_security_debug(SSL_CTX *ctx, int verbose); int set_keylog_file(SSL_CTX *ctx, const char *keylog_file); void print_ca_names(BIO *bio, SSL *s); -#endif Modified: vendor-crypto/openssl/dist/apps/s_cb.c ============================================================================== --- vendor-crypto/openssl/dist/apps/s_cb.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/s_cb.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1525,7 +1525,8 @@ void print_ca_names(BIO *bio, SSL *s) int i; if (sk == NULL || sk_X509_NAME_num(sk) == 0) { - BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); + if (!SSL_is_server(s)) + BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); return; } Modified: vendor-crypto/openssl/dist/apps/s_client.c ============================================================================== --- vendor-crypto/openssl/dist/apps/s_client.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/s_client.c Tue Sep 10 17:40:53 2019 (r352163) @@ -2345,7 +2345,7 @@ int s_client_main(int argc, char **argv) (void)BIO_flush(fbio); /* * The first line is the HTTP response. According to RFC 7230, - * it's formated exactly like this: + * it's formatted exactly like this: * * HTTP/d.d ddd Reason text\r\n */ Modified: vendor-crypto/openssl/dist/apps/speed.c ============================================================================== --- vendor-crypto/openssl/dist/apps/speed.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/speed.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1790,7 +1790,7 @@ int speed_main(int argc, char **argv) } buflen = lengths[size_num - 1]; - if (buflen < 36) /* size of random vector in RSA bencmark */ + if (buflen < 36) /* size of random vector in RSA benchmark */ buflen = 36; buflen += MAX_MISALIGNMENT + 1; loopargs[i].buf_malloc = app_malloc(buflen, "input buffer"); Modified: vendor-crypto/openssl/dist/apps/storeutl.c ============================================================================== --- vendor-crypto/openssl/dist/apps/storeutl.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/apps/storeutl.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -125,7 +125,7 @@ int storeutl_main(int argc, char *argv[]) } /* * If expected wasn't set at this point, it means the map - * isn't syncronised with the possible options leading here. + * isn't synchronised with the possible options leading here. */ OPENSSL_assert(expected != 0); } Modified: vendor-crypto/openssl/dist/config ============================================================================== --- vendor-crypto/openssl/dist/config Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/config Tue Sep 10 17:40:53 2019 (r352163) @@ -498,12 +498,12 @@ case "$GUESSOS" in OUT="darwin64-x86_64-cc" fi ;; armv6+7-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20armv6 -arch%20armv7" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20armv6 -arch%20armv7" + __CNF_CFLAGS="$__CNF_CFLAGS -arch armv6 -arch armv7" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch armv6 -arch armv7" OUT="iphoneos-cross" ;; *-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20${MACHINE}" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20${MACHINE}" + __CNF_CFLAGS="$__CNF_CFLAGS -arch ${MACHINE}" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch ${MACHINE}" OUT="iphoneos-cross" ;; arm64-*-iphoneos|*-*-ios64) OUT="ios64-cross" ;; Modified: vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -38,14 +38,14 @@ # Implement AES_set_[en|de]crypt_key. Key schedule setup is avoided # for 128-bit keys, if hardware support is detected. -# Januray 2009. +# January 2009. # # Add support for hardware AES192/256 and reschedule instructions to # minimize/avoid Address Generation Interlock hazard and to favour # dual-issue z10 pipeline. This gave ~25% improvement on z10 and # almost 50% on z9. The gain is smaller on z10, because being dual- # issue z10 makes it impossible to eliminate the interlock condition: -# critial path is not long enough. Yet it spends ~24 cycles per byte +# critical path is not long enough. Yet it spends ~24 cycles per byte # processed with 128-bit key. # # Unlike previous version hardware support detection takes place only Modified: vendor-crypto/openssl/dist/crypto/asn1/a_time.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/a_time.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/asn1/a_time.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,7 @@ static void determine_days(struct tm *tm) } c = y / 100; y %= 100; - /* Zeller's congruance */ + /* Zeller's congruence */ tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7; } @@ -79,7 +79,11 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) char *a; int n, i, i2, l, o, min_l = 11, strict = 0, end = 6, btz = 5, md; struct tm tmp; - +#if defined(CHARSET_EBCDIC) + const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B; +#else + const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+'; +#endif /* * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280 * time string format, in which: @@ -120,20 +124,20 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (l < min_l) goto err; for (i = 0; i < end; i++) { - if (!strict && (i == btz) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) { i++; break; } - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; /* incomplete 2-digital number */ if (++o == l) goto err; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; /* no more bytes to read, but we haven't seen time-zone yet */ if (++o == l) goto err; @@ -185,14 +189,14 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * Optional fractional seconds: decimal point followed by one or more * digits. */ - if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == '.') { + if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) { if (strict) /* RFC 5280 forbids fractional seconds */ goto err; if (++o == l) goto err; i = o; - while ((o < l) && ossl_isdigit(a[o])) + while ((o < l) && ascii_isdigit(a[o])) o++; /* Must have at least one digit after decimal point */ if (i == o) @@ -207,10 +211,10 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * 'o' can point to '\0' is either the subsequent if or the first * else if is true. */ - if (a[o] == 'Z') { + if (a[o] == upper_z) { o++; - } else if (!strict && ((a[o] == '+') || (a[o] == '-'))) { - int offsign = a[o] == '-' ? 1 : -1; + } else if (!strict && ((a[o] == plus) || (a[o] == minus))) { + int offsign = a[o] == minus ? 1 : -1; int offset = 0; o++; @@ -223,13 +227,13 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (o + 4 != l) goto err; for (i = end; i < end + 2; i++) { - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; o++; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i; if ((n < min[i2]) || (n > max[i2])) goto err; @@ -300,7 +304,7 @@ ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm * ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec); -#ifdef CHARSET_EBCDIC_not +#ifdef CHARSET_EBCDIC ebcdic2ascii(tmps->data, tmps->data, tmps->length); #endif return tmps; @@ -467,6 +471,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) char *v; int gmt = 0, l; struct tm stm; + const char upper_z = 0x5A, period = 0x2E; if (!asn1_time_to_tm(&stm, tm)) { /* asn1_time_to_tm will check the time type */ @@ -475,7 +480,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) l = tm->length; v = (char *)tm->data; - if (v[l - 1] == 'Z') + if (v[l - 1] == upper_z) gmt = 1; if (tm->type == V_ASN1_GENERALIZEDTIME) { @@ -486,10 +491,10 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) * Try to parse fractional seconds. '14' is the place of * 'fraction point' in a GeneralizedTime string. */ - if (tm->length > 15 && v[14] == '.') { + if (tm->length > 15 && v[14] == period) { f = &v[14]; f_len = 1; - while (14 + f_len < l && ossl_isdigit(f[f_len])) + while (14 + f_len < l && ascii_isdigit(f[f_len])) ++f_len; } Modified: vendor-crypto/openssl/dist/crypto/asn1/a_type.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/a_type.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/asn1/a_type.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,7 +15,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) { - if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) + if (a->type == V_ASN1_BOOLEAN + || a->type == V_ASN1_NULL + || a->value.ptr != NULL) return a->type; else return 0; @@ -23,7 +25,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) { - if (a->value.ptr != NULL) { + if (a->type != V_ASN1_BOOLEAN + && a->type != V_ASN1_NULL + && a->value.ptr != NULL) { ASN1_TYPE **tmp_a = &a; asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0); } Modified: vendor-crypto/openssl/dist/crypto/asn1/x_bignum.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/x_bignum.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/asn1/x_bignum.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -130,9 +130,20 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned ch static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) { - if (!*pval) - bn_secure_new(pval, it); - return bn_c2i(pval, cont, len, utype, free_cont, it); + int ret; + BIGNUM *bn; + + if (!*pval && !bn_secure_new(pval, it)) + return 0; + + ret = bn_c2i(pval, cont, len, utype, free_cont, it); + if (!ret) + return 0; + + /* Set constant-time flag for all secure BIGNUMS */ + bn = (BIGNUM *)*pval; + BN_set_flags(bn, BN_FLG_CONSTTIME); + return ret; } static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, Modified: vendor-crypto/openssl/dist/crypto/bio/b_addr.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/b_addr.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/bio/b_addr.c Tue Sep 10 17:40:53 2019 (r352163) @@ -675,7 +675,7 @@ int BIO_lookup_ex(const char *host, const char *servic if (1) { #ifdef AI_PASSIVE - int gai_ret = 0; + int gai_ret = 0, old_ret = 0; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); @@ -683,12 +683,12 @@ int BIO_lookup_ex(const char *host, const char *servic hints.ai_family = family; hints.ai_socktype = socktype; hints.ai_protocol = protocol; -#ifdef AI_ADDRCONFIG -#ifdef AF_UNSPEC +# ifdef AI_ADDRCONFIG +# ifdef AF_UNSPEC if (family == AF_UNSPEC) -#endif +# endif hints.ai_flags |= AI_ADDRCONFIG; -#endif +# endif if (lookup_type == BIO_LOOKUP_SERVER) hints.ai_flags |= AI_PASSIVE; @@ -696,6 +696,7 @@ int BIO_lookup_ex(const char *host, const char *servic /* Note that |res| SHOULD be a 'struct addrinfo **' thanks to * macro magic in bio_lcl.h */ + retry: switch ((gai_ret = getaddrinfo(host, service, &hints, res))) { # ifdef EAI_SYSTEM case EAI_SYSTEM: @@ -703,12 +704,25 @@ int BIO_lookup_ex(const char *host, const char *servic BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); break; # endif +# ifdef EAI_MEMORY + case EAI_MEMORY: + BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_MALLOC_FAILURE); + break; +# endif case 0: ret = 1; /* Success */ break; default: +# if defined(AI_ADDRCONFIG) && defined(AI_NUMERICHOST) + if (hints.ai_flags & AI_ADDRCONFIG) { + hints.ai_flags &= ~AI_ADDRCONFIG; + hints.ai_flags |= AI_NUMERICHOST; + old_ret = gai_ret; + goto retry; + } +# endif BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); - ERR_add_error_data(1, gai_strerror(gai_ret)); + ERR_add_error_data(1, gai_strerror(old_ret ? old_ret : gai_ret)); break; } } else { Modified: vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c Tue Sep 10 17:40:53 2019 (r352163) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -784,7 +784,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void * reasons. When BIO_CTRL_DGRAM_SET_PEEK_MODE was first defined its value * was incorrectly clashing with BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. The * value has been updated to a non-clashing value. However to preserve - * binary compatiblity we now respond to both the old value and the new one + * binary compatibility we now respond to both the old value and the new one */ case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE: case BIO_CTRL_DGRAM_SET_PEEK_MODE: Modified: vendor-crypto/openssl/dist/crypto/bio/bss_file.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/bss_file.c Tue Sep 10 17:31:06 2019 (r352162) +++ vendor-crypto/openssl/dist/crypto/bio/bss_file.c Tue Sep 10 17:40:53 2019 (r352163) @@ -7,10 +7,7 @@ * https://www.openssl.org/source/license.html */ -#ifndef HEADER_BSS_FILE_C -# define HEADER_BSS_FILE_C - -# if defined(__linux) || defined(__sun) || defined(__hpux) +#if defined(__linux) || defined(__sun) || defined(__hpux) /* * Following definition aliases fopen to fopen64 on above mentioned * platforms. This makes it possible to open and sequentially access files @@ -23,17 +20,17 @@ * of 32-bit platforms which allow for sequential access of large files * without extra "magic" comprise *BSD, Darwin, IRIX... */ -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 # endif +#endif -# include -# include -# include "bio_lcl.h" -# include +#include +#include +#include "bio_lcl.h" +#include -# if !defined(OPENSSL_NO_STDIO) +#if !defined(OPENSSL_NO_STDIO) static int file_write(BIO *h, const char *buf, int num); static int file_read(BIO *h, char *buf, int size); @@ -72,9 +69,9 @@ BIO *BIO_new_file(const char *filename, const char *mo SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); if (errno == ENOENT -# ifdef ENXIO +#ifdef ENXIO || errno == ENXIO -# endif +#endif ) BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); else @@ -212,33 +209,33 @@ static long file_ctrl(BIO *b, int cmd, long num, void b->shutdown = (int)num & BIO_CLOSE; b->ptr = ptr; b->init = 1; -# if BIO_FLAGS_UPLINK!=0 -# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) -# define _IOB_ENTRIES 20 -# endif +# if BIO_FLAGS_UPLINK!=0 +# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) +# define _IOB_ENTRIES 20 +# endif /* Safety net to catch purely internal BIO_set_fp calls */ -# if defined(_MSC_VER) && _MSC_VER>=1900 +# if defined(_MSC_VER) && _MSC_VER>=1900 if (ptr == stdin || ptr == stdout || ptr == stderr) BIO_clear_flags(b, BIO_FLAGS_UPLINK); -# elif defined(_IOB_ENTRIES) +# elif defined(_IOB_ENTRIES) if ((size_t)ptr >= (size_t)stdin && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 17:41:39 2019 Return-Path: Delivered-To: svn-src-all@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 BF1E1DE634; Tue, 10 Sep 2019 17:41:39 +0000 (UTC) (envelope-from jkim@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 46SXQW4jKbz3HPt; Tue, 10 Sep 2019 17:41:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6B0DC29A7D; Tue, 10 Sep 2019 17:41:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHfd9g058084; Tue, 10 Sep 2019 17:41:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHfdBC058083; Tue, 10 Sep 2019 17:41:39 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909101741.x8AHfdBC058083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 17:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352164 - vendor-crypto/openssl/1.1.1d X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/1.1.1d X-SVN-Commit-Revision: 352164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:41:39 -0000 Author: jkim Date: Tue Sep 10 17:41:39 2019 New Revision: 352164 URL: https://svnweb.freebsd.org/changeset/base/352164 Log: Tag OpenSSL 1.1.1d. Added: vendor-crypto/openssl/1.1.1d/ - copied from r352163, vendor-crypto/openssl/dist/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:42:23 2019 Return-Path: Delivered-To: svn-src-all@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 9F45ADE70E; Tue, 10 Sep 2019 17:42:23 +0000 (UTC) (envelope-from jkim@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 46SXRM4WpZz3HmT; Tue, 10 Sep 2019 17:42:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5AA2229ABD; Tue, 10 Sep 2019 17:42:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHgN81060374; Tue, 10 Sep 2019 17:42:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHgIDG059909; Tue, 10 Sep 2019 17:42:18 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909101742.x8AHgIDG059909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 17:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352165 - in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/bn crypto/cms crypto/ec crypto/pem crypto/pkcs7 crypto/rsa crypto/x509 crypto/x509v3 util X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/bn crypto/cms crypto/ec crypto/pem crypto/pkcs7 crypto/rsa crypto/x509 crypto/x509v3 util X-SVN-Commit-Revision: 352165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:42:23 -0000 Author: jkim Date: Tue Sep 10 17:42:17 2019 New Revision: 352165 URL: https://svnweb.freebsd.org/changeset/base/352165 Log: Import OpenSSL 1.0.2t. Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES vendor-crypto/openssl/dist-1.0.2/Configure vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade vendor-crypto/openssl/dist-1.0.2/Makefile vendor-crypto/openssl/dist-1.0.2/NEWS vendor-crypto/openssl/dist-1.0.2/README vendor-crypto/openssl/dist-1.0.2/apps/CA.pl vendor-crypto/openssl/dist-1.0.2/crypto/arm_arch.h vendor-crypto/openssl/dist-1.0.2/crypto/armcap.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_env.c vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_lcl.h vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_smime.c vendor-crypto/openssl/dist-1.0.2/crypto/constant_time_locl.h vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h vendor-crypto/openssl/dist-1.0.2/crypto/ec/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec.h vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_asn1.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_curve.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_err.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp224.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp256.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistp521.c vendor-crypto/openssl/dist-1.0.2/crypto/opensslv.h vendor-crypto/openssl/dist-1.0.2/crypto/pem/pvkfmt.c vendor-crypto/openssl/dist-1.0.2/crypto/pkcs7/pk7_doit.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_chk.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_cmp.c vendor-crypto/openssl/dist-1.0.2/crypto/x509v3/v3_alt.c vendor-crypto/openssl/dist-1.0.2/util/libeay.num Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Sep 10 17:42:17 2019 (r352165) @@ -7,6 +7,48 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2s and 1.0.2t [10 Sep 2019] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Document issue with installation paths in diverse Windows builds + + '/usr/local/ssl' is an unsafe prefix for location to install OpenSSL + binaries and run-time config file. + (CVE-2019-1552) + [Richard Levitte] + Changes between 1.0.2r and 1.0.2s [28 May 2019] *) Change the default RSA, DSA and DH size to 2048 bit instead of 1024. Modified: vendor-crypto/openssl/dist-1.0.2/Configure ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/Configure Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/Configure Tue Sep 10 17:42:17 2019 (r352165) @@ -118,7 +118,7 @@ my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wn # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token # -Wextended-offsetof -my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; +my $clang_disabled_warnings = "-Wno-unknown-warning-option -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; # These are used in addition to $gcc_devteam_warn when the compiler is clang. # TODO(openssl-team): fix problems and investigate if (at least) the @@ -128,7 +128,7 @@ my $clang_disabled_warnings = "-Wno-unused-parameter - # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token # -Wextended-offsetof -my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; +my $clang_devteam_warn = "-Wno-unknown-warning-option -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; # Warn that "make depend" should be run? my $warn_make_depend = 0; Modified: vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Sep 10 17:42:17 2019 (r352165) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/SubversionPrimer/V # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://repo.freebsd.org/base" -setenv OSSLVER 1.0.2s -# OSSLTAG format: v1_0_2s +setenv OSSLVER 1.0.2t +# OSSLTAG format: v1_0_2t ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` Modified: vendor-crypto/openssl/dist-1.0.2/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/Makefile Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/Makefile Tue Sep 10 17:42:17 2019 (r352165) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2s +VERSION=1.0.2t MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -70,7 +70,7 @@ AR= ar $(ARFLAGS) r RANLIB= /usr/bin/ranlib RC= windres NM= nm -PERL= /usr/local/bin/perl +PERL= /usr/bin/perl TAR= tar TARFLAGS= --no-recursion MAKEDEPPROG= gcc Modified: vendor-crypto/openssl/dist-1.0.2/NEWS ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/NEWS Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/NEWS Tue Sep 10 17:42:17 2019 (r352165) @@ -5,6 +5,21 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2s and OpenSSL 1.0.2t [10 Sep 2019] + + o Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey + (CVE-2019-1563) + o For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters + o Compute ECC cofactors if not provided during EC_GROUP construction + (CVE-2019-1547) + o Document issue with installation paths in diverse Windows builds + (CVE-2019-1552) + + Major changes between OpenSSL 1.0.2r and OpenSSL 1.0.2s [28 May 2019] + + o None + Major changes between OpenSSL 1.0.2q and OpenSSL 1.0.2r [26 Feb 2019] o 0-byte record padding oracle (CVE-2019-1559) Modified: vendor-crypto/openssl/dist-1.0.2/README ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/README Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/README Tue Sep 10 17:42:17 2019 (r352165) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2s 28 May 2019 + OpenSSL 1.0.2t 10 Sep 2019 Copyright (c) 1998-2019 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist-1.0.2/apps/CA.pl ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/CA.pl Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/apps/CA.pl Tue Sep 10 17:42:17 2019 (r352165) @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # # CA - wrapper around ca to make it easier to use ... basically ca requires # some setup stuff to be done before you can use it and this makes Modified: vendor-crypto/openssl/dist-1.0.2/crypto/arm_arch.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/arm_arch.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/arm_arch.h Tue Sep 10 17:42:17 2019 (r352165) @@ -64,7 +64,7 @@ # endif # endif -# if !__ASSEMBLER__ +# ifndef __ASSEMBLER__ extern unsigned int OPENSSL_armcap_P; # endif Modified: vendor-crypto/openssl/dist-1.0.2/crypto/armcap.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/armcap.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/armcap.c Tue Sep 10 17:42:17 2019 (r352165) @@ -5,6 +5,7 @@ #include #include +#include "cryptlib.h" #include "arm_arch.h" unsigned int OPENSSL_armcap_P = 0; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile Tue Sep 10 17:42:17 2019 (r352165) @@ -297,8 +297,8 @@ bn_lib.o: ../../include/openssl/e_os2.h ../../include/ bn_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_lcl.h -bn_lib.o: bn_lib.c +bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../constant_time_locl.h +bn_lib.o: ../cryptlib.h bn_lcl.h bn_lib.c bn_mod.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_mod.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_mod.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c Tue Sep 10 17:42:17 2019 (r352165) @@ -66,6 +66,7 @@ #include #include "cryptlib.h" #include "bn_lcl.h" +#include "constant_time_locl.h" const char BN_version[] = "Big Number" OPENSSL_VERSION_PTEXT; @@ -187,13 +188,57 @@ int BN_num_bits_word(BN_ULONG l) return bits; } +/* + * This function still leaks `a->dmax`: it's caller's responsibility to + * expand the input `a` in advance to a public length. + */ +static inline +int bn_num_bits_consttime(const BIGNUM *a) +{ + int j, ret; + unsigned int mask, past_i; + int i = a->top - 1; + bn_check_top(a); + + for (j = 0, past_i = 0, ret = 0; j < a->dmax; j++) { + mask = constant_time_eq_int(i, j); /* 0xff..ff if i==j, 0x0 otherwise */ + + ret += BN_BITS2 & (~mask & ~past_i); + ret += BN_num_bits_word(a->d[j]) & mask; + + past_i |= mask; /* past_i will become 0xff..ff after i==j */ + } + + /* + * if BN_is_zero(a) => i is -1 and ret contains garbage, so we mask the + * final result. + */ + mask = ~(constant_time_eq_int(i, ((int)-1))); + + return ret & mask; +} + int BN_num_bits(const BIGNUM *a) { int i = a->top - 1; bn_check_top(a); + if (a->flags & BN_FLG_CONSTTIME) { + /* + * We assume that BIGNUMs flagged as CONSTTIME have also been expanded + * so that a->dmax is not leaking secret information. + * + * In other words, it's the caller's responsibility to ensure `a` has + * been preallocated in advance to a public length if we hit this + * branch. + * + */ + return bn_num_bits_consttime(a); + } + if (BN_is_zero(a)) return 0; + return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); } @@ -613,8 +658,11 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIG return (ret); } +typedef enum {big, little} endianess_t; + /* ignore negative */ -static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) +static +int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen, endianess_t endianess) { int n; size_t i, lasti, j, atop, mask; @@ -646,10 +694,17 @@ static int bn2binpad(const BIGNUM *a, unsigned char *t lasti = atop - 1; atop = a->top * BN_BYTES; - for (i = 0, j = 0, to += tolen; j < (size_t)tolen; j++) { + if (endianess == big) + to += tolen; /* start from the end of the buffer */ + for (i = 0, j = 0; j < (size_t)tolen; j++) { + unsigned char val; l = a->d[i / BN_BYTES]; mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1)); - *--to = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + val = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + if (endianess == big) + *--to = val; + else + *to++ = val; i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */ } @@ -660,21 +715,66 @@ int bn_bn2binpad(const BIGNUM *a, unsigned char *to, i { if (tolen < 0) return -1; - return bn2binpad(a, to, tolen); + return bn2binpad(a, to, tolen, big); } int BN_bn2bin(const BIGNUM *a, unsigned char *to) { - int n, i; + return bn2binpad(a, to, -1, big); +} + +BIGNUM *bn_lebin2bn(const unsigned char *s, int len, BIGNUM *ret) +{ + unsigned int i, m; + unsigned int n; BN_ULONG l; + BIGNUM *bn = NULL; - bn_check_top(a); - n = i = BN_num_bytes(a); - while (i--) { - l = a->d[i / BN_BYTES]; - *(to++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff; + if (ret == NULL) + ret = bn = BN_new(); + if (ret == NULL) + return NULL; + bn_check_top(ret); + s += len; + /* Skip trailing zeroes. */ + for ( ; len > 0 && s[-1] == 0; s--, len--) + continue; + n = len; + if (n == 0) { + ret->top = 0; + return ret; } - return (n); + i = ((n - 1) / BN_BYTES) + 1; + m = ((n - 1) % (BN_BYTES)); + if (bn_wexpand(ret, (int)i) == NULL) { + BN_free(bn); + return NULL; + } + ret->top = i; + ret->neg = 0; + l = 0; + while (n--) { + s--; + l = (l << 8L) | *s; + if (m-- == 0) { + ret->d[--i] = l; + l = 0; + m = BN_BYTES - 1; + } + } + /* + * need to call this due to clear byte at top if avoiding having the top + * bit set (-ve number) + */ + bn_correct_top(ret); + return ret; +} + +int bn_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen) +{ + if (tolen < 0) + return -1; + return bn2binpad(a, to, tolen, little); } int BN_ucmp(const BIGNUM *a, const BIGNUM *b) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h Tue Sep 10 17:42:17 2019 (r352165) @@ -19,3 +19,6 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); + +BIGNUM *bn_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); +int bn_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_env.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_env.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_env.c Tue Sep 10 17:42:17 2019 (r352165) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -422,6 +422,7 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI unsigned char *ek = NULL; size_t eklen; int ret = 0; + size_t fixlen = 0; CMS_EncryptedContentInfo *ec; ec = cms->d.envelopedData->encryptedContentInfo; @@ -430,6 +431,19 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI return 0; } + if (cms->d.envelopedData->encryptedContentInfo->havenocert + && !cms->d.envelopedData->encryptedContentInfo->debug) { + X509_ALGOR *calg = ec->contentEncryptionAlgorithm; + const EVP_CIPHER *ciph = EVP_get_cipherbyobj(calg->algorithm); + + if (ciph == NULL) { + CMSerr(CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT, CMS_R_UNKNOWN_CIPHER); + return 0; + } + + fixlen = EVP_CIPHER_key_length(ciph); + } + ktri->pctx = EVP_PKEY_CTX_new(pkey, NULL); if (!ktri->pctx) return 0; @@ -460,7 +474,9 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI if (EVP_PKEY_decrypt(ktri->pctx, ek, &eklen, ktri->encryptedKey->data, - ktri->encryptedKey->length) <= 0) { + ktri->encryptedKey->length) <= 0 + || eklen == 0 + || (fixlen != 0 && eklen != fixlen)) { CMSerr(CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT, CMS_R_CMS_LIB); goto err; } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_lcl.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_lcl.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_lcl.h Tue Sep 10 17:42:17 2019 (r352165) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -172,6 +172,8 @@ struct CMS_EncryptedContentInfo_st { size_t keylen; /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */ int debug; + /* Set to 1 if we have no cert and need extra safety measures for MMA */ + int havenocert; }; struct CMS_RecipientInfo_st { Modified: vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_smime.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_smime.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/cms/cms_smime.c Tue Sep 10 17:42:17 2019 (r352165) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -737,6 +737,10 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X5 cms->d.envelopedData->encryptedContentInfo->debug = 1; else cms->d.envelopedData->encryptedContentInfo->debug = 0; + if (!cert) + cms->d.envelopedData->encryptedContentInfo->havenocert = 1; + else + cms->d.envelopedData->encryptedContentInfo->havenocert = 0; if (!pk && !cert && !dcont && !out) return 1; if (pk && !CMS_decrypt_set1_pkey(cms, pk, cert)) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/constant_time_locl.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/constant_time_locl.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/constant_time_locl.h Tue Sep 10 17:42:17 2019 (r352165) @@ -6,7 +6,7 @@ * Based on previous work by Bodo Moeller, Emilia Kasper, Adam Langley * (Google). * ==================================================================== - * Copyright (c) 2014 The OpenSSL Project. All rights reserved. + * Copyright (c) 2014-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -185,11 +185,29 @@ static inline unsigned char constant_time_eq_int_8(int return constant_time_eq_8((unsigned)(a), (unsigned)(b)); } +/* + * Returns the value unmodified, but avoids optimizations. + * The barriers prevent the compiler from narrowing down the + * possible value range of the mask and ~mask in the select + * statements, which avoids the recognition of the select + * and turning it into a conditional load or branch. + */ +static inline unsigned int value_barrier(unsigned int a) +{ +#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) + unsigned int r; + __asm__("" : "=r"(r) : "0"(a)); +#else + volatile unsigned int r = a; +#endif + return r; +} + static inline unsigned int constant_time_select(unsigned int mask, unsigned int a, unsigned int b) { - return (mask & a) | (~mask & b); + return (value_barrier(mask) & a) | (value_barrier(~mask) & b); } static inline unsigned char constant_time_select_8(unsigned char mask, Modified: vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h Tue Sep 10 17:42:17 2019 (r352165) @@ -106,6 +106,8 @@ extern int OPENSSL_NONPIC_relocated; char *ossl_safe_getenv(const char *); +unsigned long OPENSSL_rdtsc(void); + #ifdef __cplusplus } #endif Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/Makefile Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/Makefile Tue Sep 10 17:42:17 2019 (r352165) @@ -156,7 +156,7 @@ ec_curve.o: ../../include/openssl/err.h ../../include/ ec_curve.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h +ec_curve.o: ../../include/openssl/symhacks.h ../bn_int.h ec_curve.c ec_lcl.h ec_cvt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_cvt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec.h Tue Sep 10 17:42:17 2019 (r352165) @@ -7,7 +7,7 @@ * \author Originally written by Bodo Moeller for the OpenSSL project */ /* ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1073,6 +1073,7 @@ int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int o * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_EC_strings(void); /* Error codes for the EC functions. */ @@ -1270,13 +1271,14 @@ void ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 152 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 # define EC_R_WRONG_CURVE_PARAMETERS 145 # define EC_R_WRONG_ORDER 130 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_asn1.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_asn1.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_asn1.c Tue Sep 10 17:42:17 2019 (r352165) @@ -3,7 +3,7 @@ * Written by Nils Larsch for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -695,10 +695,12 @@ ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GR static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params) { int ok = 0, tmp; - EC_GROUP *ret = NULL; + EC_GROUP *ret = NULL, *dup = NULL; BIGNUM *p = NULL, *a = NULL, *b = NULL; EC_POINT *point = NULL; long field_bits; + int curve_name = NID_undef; + BN_CTX *ctx = NULL; if (!params->fieldID || !params->fieldID->fieldType || !params->fieldID->p.ptr) { @@ -914,13 +916,75 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARA goto err; } + /* + * Check if the explicit parameters group just created matches one of the + * built-in curves. + * + * We create a copy of the group just built, so that we can remove optional + * fields for the lookup: we do this to avoid the possibility that one of + * the optional parameters is used to force the library into using a less + * performant and less secure EC_METHOD instead of the specialized one. + * In any case, `seed` is not really used in any computation, while a + * cofactor different from the one in the built-in table is just + * mathematically wrong anyway and should not be used. + */ + if ((ctx = BN_CTX_new()) == NULL) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB); + goto err; + } + if ((dup = EC_GROUP_dup(ret)) == NULL + || EC_GROUP_set_seed(dup, NULL, 0) != 1 + || !EC_GROUP_set_generator(dup, point, a, NULL)) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); + goto err; + } + if ((curve_name = ec_curve_nid_from_params(dup, ctx)) != NID_undef) { + /* + * The input explicit parameters successfully matched one of the + * built-in curves: often for built-in curves we have specialized + * methods with better performance and hardening. + * + * In this case we replace the `EC_GROUP` created through explicit + * parameters with one created from a named group. + */ + EC_GROUP *named_group = NULL; + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 + /* + * NID_wap_wsg_idm_ecid_wtls12 and NID_secp224r1 are both aliases for + * the same curve, we prefer the SECP nid when matching explicit + * parameters as that is associated with a specialized EC_METHOD. + */ + if (curve_name == NID_wap_wsg_idm_ecid_wtls12) + curve_name = NID_secp224r1; +#endif /* !def(OPENSSL_NO_EC_NISTP_64_GCC_128) */ + + if ((named_group = EC_GROUP_new_by_curve_name(curve_name)) == NULL) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); + goto err; + } + EC_GROUP_free(ret); + ret = named_group; + + /* + * Set the flag so that EC_GROUPs created from explicit parameters are + * serialized using explicit parameters by default. + * + * 0x0 = OPENSSL_EC_EXPLICIT_CURVE + */ + EC_GROUP_set_asn1_flag(ret, 0x0); + } + ok = 1; - err:if (!ok) { + err: + if (!ok) { if (ret) - EC_GROUP_clear_free(ret); + EC_GROUP_free(ret); ret = NULL; } + if (dup) + EC_GROUP_free(dup); if (p) BN_free(p); @@ -930,6 +994,8 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARA BN_free(b); if (point) EC_POINT_free(point); + if (ctx) + BN_CTX_free(ctx); return (ret); } @@ -990,7 +1056,7 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsig } if (a && *a) - EC_GROUP_clear_free(*a); + EC_GROUP_free(*a); if (a) *a = group; @@ -1040,7 +1106,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned ch if (priv_key->parameters) { if (ret->group) - EC_GROUP_clear_free(ret->group); + EC_GROUP_free(ret->group); ret->group = ec_asn1_pkparameters2group(priv_key->parameters); } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_curve.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_curve.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_curve.c Tue Sep 10 17:42:17 2019 (r352165) @@ -3,7 +3,7 @@ * Written by Nils Larsch for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,6 +75,8 @@ #include #include +#include "bn_int.h" + #ifdef OPENSSL_FIPS # include #endif @@ -3245,4 +3247,116 @@ int EC_curve_nist2nid(const char *name) return nist_curves[i].nid; } return NID_undef; +} + +#define NUM_BN_FIELDS 6 +/* + * Validates EC domain parameter data for known named curves. + * This can be used when a curve is loaded explicitly (without a curve + * name) or to validate that domain parameters have not been modified. + * + * Returns: The nid associated with the found named curve, or NID_undef + * if not found. If there was an error it returns -1. + */ +int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx) +{ + int ret = -1, nid, len, field_type, param_len; + size_t i, seed_len; + const unsigned char *seed, *params_seed, *params; + unsigned char *param_bytes = NULL; + const EC_CURVE_DATA *data; + const EC_POINT *generator = NULL; + const EC_METHOD *meth; + const BIGNUM *cofactor = NULL; + /* An array of BIGNUMs for (p, a, b, x, y, order) */ + BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL}; + + meth = EC_GROUP_method_of(group); + if (meth == NULL) + return -1; + /* Use the optional named curve nid as a search field */ + nid = EC_GROUP_get_curve_name(group); + field_type = EC_METHOD_get_field_type(meth); + seed_len = EC_GROUP_get_seed_len(group); + seed = EC_GROUP_get0_seed(group); + cofactor = &group->cofactor; + + BN_CTX_start(ctx); + + /* + * The built-in curves contains data fields (p, a, b, x, y, order) that are + * all zero-padded to be the same size. The size of the padding is + * determined by either the number of bytes in the field modulus (p) or the + * EC group order, whichever is larger. + */ + param_len = BN_num_bytes(&group->order); + len = BN_num_bytes(&group->field); + if (len > param_len) + param_len = len; + + /* Allocate space to store the padded data for (p, a, b, x, y, order) */ + param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS); + if (param_bytes == NULL) + goto end; + + /* Create the bignums */ + for (i = 0; i < NUM_BN_FIELDS; ++i) { + if ((bn[i] = BN_CTX_get(ctx)) == NULL) + goto end; + } + /* + * Fill in the bn array with the same values as the internal curves + * i.e. the values are p, a, b, x, y, order. + */ + /* Get p, a & b */ + if (!(ec_group_get_curve(group, bn[0], bn[1], bn[2], ctx) + && ((generator = EC_GROUP_get0_generator(group)) != NULL) + /* Get x & y */ + && ec_point_get_affine_coordinates(group, generator, bn[3], bn[4], ctx) + /* Get order */ + && EC_GROUP_get_order(group, bn[5], ctx))) + goto end; + + /* + * Convert the bignum array to bytes that are joined together to form + * a single buffer that contains data for all fields. + * (p, a, b, x, y, order) are all zero padded to be the same size. + */ + for (i = 0; i < NUM_BN_FIELDS; ++i) { + if (bn_bn2binpad(bn[i], ¶m_bytes[i*param_len], param_len) <= 0) + goto end; + } + + for (i = 0; i < curve_list_length; i++) { + const ec_list_element curve = curve_list[i]; + + data = curve.data; + /* Get the raw order byte data */ + params_seed = (const unsigned char *)(data + 1); /* skip header */ + params = params_seed + data->seed_len; + + /* Look for unique fields in the fixed curve data */ + if (data->field_type == field_type + && param_len == data->param_len + && (nid <= 0 || nid == curve.nid) + /* check the optional cofactor (ignore if its zero) */ + && (BN_is_zero(cofactor) + || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor)) + /* Check the optional seed (ignore if its not set) */ + && (data->seed_len == 0 || seed_len == 0 + || ((size_t)data->seed_len == seed_len + && memcmp(params_seed, seed, seed_len) == 0)) + /* Check that the groups params match the built-in curve params */ + && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS) + == 0) { + ret = curve.nid; + goto end; + } + } + /* Gets here if the group was not found */ + ret = NID_undef; +end: + OPENSSL_free(param_bytes); + BN_CTX_end(ctx); + return ret; } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_err.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_err.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_err.c Tue Sep 10 17:42:17 2019 (r352165) @@ -1,6 +1,6 @@ /* crypto/ec/ec_err.c */ /* ==================================================================== - * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -310,6 +310,7 @@ static ERR_STRING_DATA EC_str_reasons[] = { {ERR_REASON(EC_R_SLOT_FULL), "slot full"}, {ERR_REASON(EC_R_UNDEFINED_GENERATOR), "undefined generator"}, {ERR_REASON(EC_R_UNDEFINED_ORDER), "undefined order"}, + {ERR_REASON(EC_R_UNKNOWN_COFACTOR), "unknown cofactor"}, {ERR_REASON(EC_R_UNKNOWN_GROUP), "unknown group"}, {ERR_REASON(EC_R_UNKNOWN_ORDER), "unknown order"}, {ERR_REASON(EC_R_UNSUPPORTED_FIELD), "unsupported field"}, Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h Tue Sep 10 17:42:17 2019 (r352165) @@ -3,7 +3,7 @@ * Originally written by Bodo Moeller for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -565,3 +565,18 @@ EC_GROUP *FIPS_ec_group_new_curve_gf2m(const BIGNUM *p const BIGNUM *b, BN_CTX *ctx); EC_GROUP *FIPS_ec_group_new_by_curve_name(int nid); #endif + +int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx); + +/* + * The next 2 functions are just internal wrappers around the omonimous + * functions with either the `_GFp` or the `_GF2m` suffix. + * + * They are meant to facilitate backporting of code from newer branches, where + * the public API includes a "field agnostic" version of these 2 functions. + */ +int ec_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, + BIGNUM *b, BN_CTX *ctx); +int ec_point_get_affine_coordinates(const EC_GROUP *group, + const EC_POINT *point, BIGNUM *x, + BIGNUM *y, BN_CTX *ctx); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c Tue Sep 10 17:41:39 2019 (r352164) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c Tue Sep 10 17:42:17 2019 (r352165) @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth) return meth->field_type; } +/*- + * Try computing cofactor from the generator order (n) and field cardinality (q). + * This works for all curves of cryptographic interest. + * + * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q) + * h_min = (q + 1 - 2*sqrt(q))/n + * h_max = (q + 1 + 2*sqrt(q))/n + * h_max - h_min = 4*sqrt(q)/n + * So if n > 4*sqrt(q) holds, there is only one possible value for h: + * h = \lfloor (h_min + h_max)/2 \rceil = \lfloor (q + 1)/n \rceil + * + * Otherwise, zero cofactor and return success. + */ +static int ec_guess_cofactor(EC_GROUP *group) { + int ret = 0; + BN_CTX *ctx = NULL; + BIGNUM *q = NULL; + + /*- + * If the cofactor is too large, we cannot guess it. + * The RHS of below is a strict overestimate of lg(4 * sqrt(q)) + */ + if (BN_num_bits(&group->order) <= (BN_num_bits(&group->field) + 1) / 2 + 3) { + /* default to 0 */ + BN_zero(&group->cofactor); + /* return success */ + return 1; + } + + if ((ctx = BN_CTX_new()) == NULL) + return 0; + + BN_CTX_start(ctx); + if ((q = BN_CTX_get(ctx)) == NULL) + goto err; + + /* set q = 2**m for binary fields; q = p otherwise */ + if (group->meth->field_type == NID_X9_62_characteristic_two_field) { + BN_zero(q); + if (!BN_set_bit(q, BN_num_bits(&group->field) - 1)) + goto err; + } else { + if (!BN_copy(q, &group->field)) + goto err; + } + + /* compute h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2)/n \rfloor */ + if (!BN_rshift1(&group->cofactor, &group->order) /* n/2 */ + || !BN_add(&group->cofactor, &group->cofactor, q) /* q + n/2 */ + /* q + 1 + n/2 */ + || !BN_add(&group->cofactor, &group->cofactor, BN_value_one()) + /* (q + 1 + n/2)/n */ + || !BN_div(&group->cofactor, NULL, &group->cofactor, &group->order, ctx)) + goto err; + ret = 1; + err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ret; +} + int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor) { @@ -302,6 +363,33 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P return 0; } + /* require group->field >= 1 */ + if (BN_is_zero(&group->field) || BN_is_negative(&group->field)) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_INVALID_FIELD); + return 0; + } + + /*- + * - require order >= 1 + * - enforce upper bound due to Hasse thm: order can be no more than one bit + * longer than field cardinality + */ + if (order == NULL || BN_is_zero(order) || BN_is_negative(order) + || BN_num_bits(order) > BN_num_bits(&group->field) + 1) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + /*- + * Unfortunately the cofactor is an optional field in many standards. + * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor". + * So accept cofactor == NULL or cofactor >= 0. + */ + if (cofactor != NULL && BN_is_negative(cofactor)) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_UNKNOWN_COFACTOR); + return 0; + } + if (group->generator == NULL) { group->generator = EC_POINT_new(group); if (group->generator == NULL) @@ -310,17 +398,17 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P if (!EC_POINT_copy(group->generator, generator)) return 0; - if (order != NULL) { - if (!BN_copy(&group->order, order)) - return 0; - } else - BN_zero(&group->order); + if (!BN_copy(&group->order, order)) + return 0; - if (cofactor != NULL) { + /* Either take the provided positive cofactor, or try to compute it */ + if (cofactor != NULL && !BN_is_zero(cofactor)) { if (!BN_copy(&group->cofactor, cofactor)) return 0; - } else + } else if (!ec_guess_cofactor(group)) { BN_zero(&group->cofactor); + return 0; + } /*- * Access to the `mont_data` field of an EC_GROUP struct should always be *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 17:43:02 2019 Return-Path: Delivered-To: svn-src-all@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 19E7FDE7FE; Tue, 10 Sep 2019 17:43:02 +0000 (UTC) (envelope-from jkim@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 46SXS572Nhz3HwS; Tue, 10 Sep 2019 17:43:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BC28F29AD5; Tue, 10 Sep 2019 17:43:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHh1Is060718; Tue, 10 Sep 2019 17:43:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHh167060717; Tue, 10 Sep 2019 17:43:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909101743.x8AHh167060717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 17:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352166 - vendor-crypto/openssl/1.0.2t X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/1.0.2t X-SVN-Commit-Revision: 352166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:43:02 -0000 Author: jkim Date: Tue Sep 10 17:43:01 2019 New Revision: 352166 URL: https://svnweb.freebsd.org/changeset/base/352166 Log: Tag OpenSSL 1.0.2t. Added: vendor-crypto/openssl/1.0.2t/ - copied from r352165, vendor-crypto/openssl/dist-1.0.2/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:46:31 2019 Return-Path: Delivered-To: svn-src-all@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 4BB9DDE960; Tue, 10 Sep 2019 17:46:31 +0000 (UTC) (envelope-from imp@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 46SXX71Ky9z3J6h; Tue, 10 Sep 2019 17:46:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB01529ADF; Tue, 10 Sep 2019 17:46:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHkUgH061128; Tue, 10 Sep 2019 17:46:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHkUQO061127; Tue, 10 Sep 2019 17:46:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101746.x8AHkUQO061127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352167 - head/contrib/compiler-rt/lib/builtins/armv6m X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/builtins/armv6m X-SVN-Commit-Revision: 352167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:46:31 -0000 Author: imp Date: Tue Sep 10 17:46:30 2019 New Revision: 352167 URL: https://svnweb.freebsd.org/changeset/base/352167 Log: Remove dir empty since r276851 Deleted: head/contrib/compiler-rt/lib/builtins/armv6m/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:47:39 2019 Return-Path: Delivered-To: svn-src-all@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 73CDFDEA63; Tue, 10 Sep 2019 17:47:39 +0000 (UTC) (envelope-from imp@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 46SXYR2T1Cz3JKk; Tue, 10 Sep 2019 17:47:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3898C29AE0; Tue, 10 Sep 2019 17:47:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHldOV061226; Tue, 10 Sep 2019 17:47:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHldP2061225; Tue, 10 Sep 2019 17:47:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101747.x8AHldP2061225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352168 - in head/contrib/llvm: include/llvm/MC/MCAnalysis lib/ExecutionEngine/JIT lib/MC/MCAnalysis X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/contrib/llvm: include/llvm/MC/MCAnalysis lib/ExecutionEngine/JIT lib/MC/MCAnalysis X-SVN-Commit-Revision: 352168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:47:39 -0000 Author: imp Date: Tue Sep 10 17:47:38 2019 New Revision: 352168 URL: https://svnweb.freebsd.org/changeset/base/352168 Log: Remove dirs empty since r280031 Deleted: head/contrib/llvm/include/llvm/MC/MCAnalysis/ head/contrib/llvm/lib/ExecutionEngine/JIT/ head/contrib/llvm/lib/MC/MCAnalysis/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:49:19 2019 Return-Path: Delivered-To: svn-src-all@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 969DBDEBB7; Tue, 10 Sep 2019 17:49:19 +0000 (UTC) (envelope-from imp@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 46SXbM3XJXz3JYn; Tue, 10 Sep 2019 17:49:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EC5629AE1; Tue, 10 Sep 2019 17:49:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHnIc4061423; Tue, 10 Sep 2019 17:49:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHnIVF061422; Tue, 10 Sep 2019 17:49:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101749.x8AHnIVF061422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352169 - head/contrib/compiler-rt/lib/sancov X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/sancov X-SVN-Commit-Revision: 352169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:49:19 -0000 Author: imp Date: Tue Sep 10 17:49:18 2019 New Revision: 352169 URL: https://svnweb.freebsd.org/changeset/base/352169 Log: Remove dir empty since r314564 Deleted: head/contrib/compiler-rt/lib/sancov/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:50:01 2019 Return-Path: Delivered-To: svn-src-all@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 4427BDED75; Tue, 10 Sep 2019 17:50:01 +0000 (UTC) (envelope-from imp@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 46SXc90yhgz3JkM; Tue, 10 Sep 2019 17:50:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E107B29AE6; Tue, 10 Sep 2019 17:50:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHo0NY061536; Tue, 10 Sep 2019 17:50:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHo0Mq061535; Tue, 10 Sep 2019 17:50:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101750.x8AHo0Mq061535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352170 - head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs X-SVN-Commit-Revision: 352170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:50:01 -0000 Author: imp Date: Tue Sep 10 17:50:00 2019 New Revision: 352170 URL: https://svnweb.freebsd.org/changeset/base/352170 Log: Remove dir empty since r327952 Deleted: head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:51:23 2019 Return-Path: Delivered-To: svn-src-all@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 7152CDEE57; Tue, 10 Sep 2019 17:51:23 +0000 (UTC) (envelope-from imp@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 46SXdl1Lm4z3Jvm; Tue, 10 Sep 2019 17:51:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1236F29C32; Tue, 10 Sep 2019 17:51:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AHpMYO065425; Tue, 10 Sep 2019 17:51:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHpM2D065424; Tue, 10 Sep 2019 17:51:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909101751.x8AHpM2D065424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Sep 2019 17:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352171 - in head/contrib/llvm: include/llvm/TextAPI/MachO lib/Target/Nios2 lib/TextAPI/MachO tools/lldb/source/Plugins/ExpressionParser/Go tools/lldb/source/Plugins/Language/Go tools/l... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/contrib/llvm: include/llvm/TextAPI/MachO lib/Target/Nios2 lib/TextAPI/MachO tools/lldb/source/Plugins/ExpressionParser/Go tools/lldb/source/Plugins/Language/Go tools/lldb/source/Plugins/Langua... X-SVN-Commit-Revision: 352171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:51:23 -0000 Author: imp Date: Tue Sep 10 17:51:22 2019 New Revision: 352171 URL: https://svnweb.freebsd.org/changeset/base/352171 Log: Remove dirs (and their now-empty parents) empty since r344779 Deleted: head/contrib/llvm/include/llvm/TextAPI/MachO/ head/contrib/llvm/lib/Target/Nios2/ head/contrib/llvm/lib/TextAPI/MachO/ head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Go/ head/contrib/llvm/tools/lldb/source/Plugins/Language/Go/ head/contrib/llvm/tools/lldb/source/Plugins/Language/Java/ head/contrib/llvm/tools/lldb/source/Plugins/Language/OCaml/ head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Go/ head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Java/ head/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Go/ head/contrib/llvm/tools/llvm-mca/include/ head/contrib/llvm/tools/llvm-mca/lib/ From owner-svn-src-all@freebsd.org Tue Sep 10 17:53:55 2019 Return-Path: Delivered-To: svn-src-all@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 1A086DF308; Tue, 10 Sep 2019 17:53:55 +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 46SXhf72tyz3KNL; Tue, 10 Sep 2019 17:53:54 +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 BD17D29CA5; Tue, 10 Sep 2019 17:53:54 +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 x8AHrsUg066973; Tue, 10 Sep 2019 17:53:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHrscr066972; Tue, 10 Sep 2019 17:53:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909101753.x8AHrscr066972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Sep 2019 17:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352172 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 352172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:53:55 -0000 Author: kevans Date: Tue Sep 10 17:53:54 2019 New Revision: 352172 URL: https://svnweb.freebsd.org/changeset/base/352172 Log: Ignore LINT kernconf on arm64 Modified: Directory Properties: head/sys/arm64/arm64/ (props changed) From owner-svn-src-all@freebsd.org Tue Sep 10 17:55:08 2019 Return-Path: Delivered-To: svn-src-all@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 61530DF3CF; Tue, 10 Sep 2019 17:55:08 +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 46SXk41xgDz3KWr; Tue, 10 Sep 2019 17:55:08 +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 0E0EC29CB0; Tue, 10 Sep 2019 17:55:08 +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 x8AHt7fp067121; Tue, 10 Sep 2019 17:55:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AHt7LR067120; Tue, 10 Sep 2019 17:55:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909101755.x8AHt7LR067120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Sep 2019 17:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352173 - in head/sys/arm64: arm64 conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/arm64: arm64 conf X-SVN-Commit-Revision: 352173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 17:55:08 -0000 Author: kevans Date: Tue Sep 10 17:55:07 2019 New Revision: 352173 URL: https://svnweb.freebsd.org/changeset/base/352173 Log: ... it was so easy, and I goofed it up. Correct dir Modified: Directory Properties: head/sys/arm64/arm64/ (props changed) head/sys/arm64/conf/ (props changed) From owner-svn-src-all@freebsd.org Tue Sep 10 18:27:48 2019 Return-Path: Delivered-To: svn-src-all@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 36EF8E05BC; Tue, 10 Sep 2019 18:27:48 +0000 (UTC) (envelope-from jeff@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 46SYRm1Q2xz3MGT; Tue, 10 Sep 2019 18:27:48 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EAAC72A211; Tue, 10 Sep 2019 18:27:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AIRl6w085381; Tue, 10 Sep 2019 18:27:47 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AIRkmr085373; Tue, 10 Sep 2019 18:27:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201909101827.x8AIRkmr085373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 10 Sep 2019 18:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352174 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/ttm kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/ttm kern vm X-SVN-Commit-Revision: 352174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 18:27:48 -0000 Author: jeff Date: Tue Sep 10 18:27:45 2019 New Revision: 352174 URL: https://svnweb.freebsd.org/changeset/base/352174 Log: Use the sleepq lock rather than the page lock to protect against wakeup races with page busy state. The object lock is still used as an interlock to ensure that the identity stays valid. Most callers should use vm_page_sleep_if_busy() to handle the locking particulars. Reviewed by: alc, kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21255 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/kern/vfs_bio.c head/sys/vm/phys_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 10 18:27:45 2019 (r352174) @@ -422,10 +422,7 @@ page_busy(vnode_t *vp, int64_t start, int64_t off, int * likely to reclaim it. */ vm_page_reference(pp); - vm_page_lock(pp); - zfs_vmobject_wunlock(obj); - vm_page_busy_sleep(pp, "zfsmwb", true); - zfs_vmobject_wlock(obj); + vm_page_sleep_if_xbusy(pp, "zfsmwb"); continue; } vm_page_sbusy(pp); @@ -473,10 +470,7 @@ page_wire(vnode_t *vp, int64_t start) * likely to reclaim it. */ vm_page_reference(pp); - vm_page_lock(pp); - zfs_vmobject_wunlock(obj); - vm_page_busy_sleep(pp, "zfsmwb", true); - zfs_vmobject_wlock(obj); + vm_page_sleep_if_xbusy(pp, "zfsmwb"); continue; } Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Tue Sep 10 18:27:45 2019 (r352174) @@ -232,10 +232,7 @@ reserve: VM_OBJECT_WLOCK(vm_obj); if (vm_page_busied(m)) { - vm_page_lock(m); - VM_OBJECT_WUNLOCK(vm_obj); - vm_page_busy_sleep(m, "ttmpbs", false); - VM_OBJECT_WLOCK(vm_obj); + vm_page_sleep_if_busy(m, "ttmpbs"); ttm_mem_io_unlock(man); ttm_bo_unreserve(bo); goto retry; Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/kern/vfs_bio.c Tue Sep 10 18:27:45 2019 (r352174) @@ -2931,12 +2931,8 @@ vfs_vmio_invalidate(struct buf *bp) presid = resid > (PAGE_SIZE - poffset) ? (PAGE_SIZE - poffset) : resid; KASSERT(presid >= 0, ("brelse: extra page")); - while (vm_page_xbusied(m)) { - vm_page_lock(m); - VM_OBJECT_WUNLOCK(obj); - vm_page_busy_sleep(m, "mbncsh", true); - VM_OBJECT_WLOCK(obj); - } + while (vm_page_xbusied(m)) + vm_page_sleep_if_xbusy(m, "mbncsh"); if (pmap_page_wired_mappings(m) == 0) vm_page_set_invalid(m, poffset, presid); vm_page_release_locked(m, flags); @@ -4565,10 +4561,7 @@ vfs_drain_busy_pages(struct buf *bp) for (; last_busied < i; last_busied++) vm_page_sbusy(bp->b_pages[last_busied]); while (vm_page_xbusied(m)) { - vm_page_lock(m); - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); - vm_page_busy_sleep(m, "vbpage", true); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); + vm_page_sleep_if_xbusy(m, "vbpage"); } } } Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/vm/phys_pager.c Tue Sep 10 18:27:45 2019 (r352174) @@ -219,10 +219,7 @@ retry: pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; } else if (vm_page_xbusied(m)) { - vm_page_lock(m); - VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(m, "physb", true); - VM_OBJECT_WLOCK(object); + vm_page_sleep_if_xbusy(m, "physb"); goto retry; } else { vm_page_xbusy(m); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/vm/vm_fault.c Tue Sep 10 18:27:45 2019 (r352174) @@ -510,7 +510,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro *m_hold = &m[i]; vm_page_wire(&m[i]); } - vm_page_xunbusy_maybelocked(&m[i]); + vm_page_xunbusy(&m[i]); } if (m_mtx != NULL) mtx_unlock(m_mtx); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/vm/vm_object.c Tue Sep 10 18:27:45 2019 (r352174) @@ -1160,9 +1160,7 @@ next_page: ("vm_object_madvise: page %p is not managed", tm)); if (vm_page_busied(tm)) { if (object != tobject) - VM_OBJECT_WUNLOCK(tobject); - vm_page_lock(tm); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_WUNLOCK(object); if (advice == MADV_WILLNEED) { /* * Reference the page before unlocking and @@ -1345,10 +1343,7 @@ retry: */ if (vm_page_busied(m)) { VM_OBJECT_WUNLOCK(new_object); - vm_page_lock(m); - VM_OBJECT_WUNLOCK(orig_object); - vm_page_busy_sleep(m, "spltwt", false); - VM_OBJECT_WLOCK(orig_object); + vm_page_sleep_if_busy(m, "spltwt"); VM_OBJECT_WLOCK(new_object); goto retry; } @@ -1415,15 +1410,16 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_pa ("invalid ownership %p %p %p", p, object, backing_object)); if ((op & OBSC_COLLAPSE_NOWAIT) != 0) return (next); - if (p != NULL) - vm_page_lock(p); - VM_OBJECT_WUNLOCK(object); - VM_OBJECT_WUNLOCK(backing_object); /* The page is only NULL when rename fails. */ - if (p == NULL) + if (p == NULL) { vm_radix_wait(); - else + } else { + if (p->object == object) + VM_OBJECT_WUNLOCK(backing_object); + else + VM_OBJECT_WUNLOCK(object); vm_page_busy_sleep(p, "vmocol", false); + } VM_OBJECT_WLOCK(object); VM_OBJECT_WLOCK(backing_object); return (TAILQ_FIRST(&backing_object->memq)); @@ -1837,7 +1833,6 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t int options) { vm_page_t p, next; - struct mtx *mtx; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1848,7 +1843,6 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t vm_object_pip_add(object, 1); again: p = vm_page_find_least(object, start); - mtx = NULL; /* * Here, the variable "p" is either (1) the page with the least pindex @@ -1865,17 +1859,8 @@ again: * however, be invalidated if the option OBJPR_CLEANONLY is * not specified. */ - vm_page_change_lock(p, &mtx); - if (vm_page_xbusied(p)) { - VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(p, "vmopax", true); - VM_OBJECT_WLOCK(object); - goto again; - } if (vm_page_busied(p)) { - VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(p, "vmopar", false); - VM_OBJECT_WLOCK(object); + vm_page_sleep_if_busy(p, "vmopar"); goto again; } if (vm_page_wired(p)) { @@ -1904,8 +1889,6 @@ wired: goto wired; vm_page_free(p); } - if (mtx != NULL) - mtx_unlock(mtx); vm_object_pip_wakeup(object); } @@ -2190,8 +2173,7 @@ again: m = TAILQ_NEXT(m, listq); } if (vm_page_xbusied(tm)) { - vm_page_lock(tm); - for (tobject = object; locked_depth >= 1; + for (tobject = object; locked_depth > 1; locked_depth--) { t1object = tobject->backing_object; VM_OBJECT_RUNLOCK(tobject); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/vm/vm_page.c Tue Sep 10 18:27:45 2019 (r352174) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -873,27 +874,17 @@ void vm_page_busy_downgrade(vm_page_t m) { u_int x; - bool locked; vm_page_assert_xbusied(m); - locked = mtx_owned(vm_page_lockptr(m)); + x = m->busy_lock; for (;;) { - x = m->busy_lock; - x &= VPB_BIT_WAITERS; - if (x != 0 && !locked) - vm_page_lock(m); - if (atomic_cmpset_rel_int(&m->busy_lock, - VPB_SINGLE_EXCLUSIVER | x, VPB_SHARERS_WORD(1))) + if (atomic_fcmpset_rel_int(&m->busy_lock, + &x, VPB_SHARERS_WORD(1))) break; - if (x != 0 && !locked) - vm_page_unlock(m); } - if (x != 0) { + if ((x & VPB_BIT_WAITERS) != 0) wakeup(m); - if (!locked) - vm_page_unlock(m); - } } /* @@ -920,35 +911,23 @@ vm_page_sunbusy(vm_page_t m) { u_int x; - vm_page_lock_assert(m, MA_NOTOWNED); vm_page_assert_sbusied(m); + x = m->busy_lock; for (;;) { - x = m->busy_lock; if (VPB_SHARERS(x) > 1) { - if (atomic_cmpset_int(&m->busy_lock, x, + if (atomic_fcmpset_int(&m->busy_lock, &x, x - VPB_ONE_SHARER)) break; continue; } - if ((x & VPB_BIT_WAITERS) == 0) { - KASSERT(x == VPB_SHARERS_WORD(1), - ("vm_page_sunbusy: invalid lock state")); - if (atomic_cmpset_int(&m->busy_lock, - VPB_SHARERS_WORD(1), VPB_UNBUSIED)) - break; + KASSERT((x & ~VPB_BIT_WAITERS) == VPB_SHARERS_WORD(1), + ("vm_page_sunbusy: invalid lock state")); + if (!atomic_fcmpset_rel_int(&m->busy_lock, &x, VPB_UNBUSIED)) continue; - } - KASSERT(x == (VPB_SHARERS_WORD(1) | VPB_BIT_WAITERS), - ("vm_page_sunbusy: invalid lock state for waiters")); - - vm_page_lock(m); - if (!atomic_cmpset_int(&m->busy_lock, x, VPB_UNBUSIED)) { - vm_page_unlock(m); - continue; - } + if ((x & VPB_BIT_WAITERS) == 0) + break; wakeup(m); - vm_page_unlock(m); break; } } @@ -956,28 +935,35 @@ vm_page_sunbusy(vm_page_t m) /* * vm_page_busy_sleep: * - * Sleep and release the page lock, using the page pointer as wchan. + * Sleep if the page is busy, using the page pointer as wchan. * This is used to implement the hard-path of busying mechanism. * - * The given page must be locked. - * * If nonshared is true, sleep only if the page is xbusy. + * + * The object lock must be held on entry and will be released on exit. */ void vm_page_busy_sleep(vm_page_t m, const char *wmesg, bool nonshared) { + vm_object_t obj; u_int x; - vm_page_assert_locked(m); + obj = m->object; + vm_page_lock_assert(m, MA_NOTOWNED); + VM_OBJECT_ASSERT_LOCKED(obj); + sleepq_lock(m); x = m->busy_lock; if (x == VPB_UNBUSIED || (nonshared && (x & VPB_BIT_SHARED) != 0) || ((x & VPB_BIT_WAITERS) == 0 && !atomic_cmpset_int(&m->busy_lock, x, x | VPB_BIT_WAITERS))) { - vm_page_unlock(m); + VM_OBJECT_DROP(obj); + sleepq_release(m); return; } - msleep(m, vm_page_lockptr(m), PVM | PDROP, wmesg, 0); + VM_OBJECT_DROP(obj); + sleepq_add(m, NULL, wmesg, 0, 0); + sleepq_wait(m, PVM); } /* @@ -992,55 +978,20 @@ vm_page_trysbusy(vm_page_t m) { u_int x; + x = m->busy_lock; for (;;) { - x = m->busy_lock; if ((x & VPB_BIT_SHARED) == 0) return (0); - if (atomic_cmpset_acq_int(&m->busy_lock, x, x + VPB_ONE_SHARER)) + if (atomic_fcmpset_acq_int(&m->busy_lock, &x, + x + VPB_ONE_SHARER)) return (1); } } -static void -vm_page_xunbusy_locked(vm_page_t m) -{ - - vm_page_assert_xbusied(m); - vm_page_assert_locked(m); - - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); - /* There is a waiter, do wakeup() instead of vm_page_flash(). */ - wakeup(m); -} - -void -vm_page_xunbusy_maybelocked(vm_page_t m) -{ - bool lockacq; - - vm_page_assert_xbusied(m); - - /* - * Fast path for unbusy. If it succeeds, we know that there - * are no waiters, so we do not need a wakeup. - */ - if (atomic_cmpset_rel_int(&m->busy_lock, VPB_SINGLE_EXCLUSIVER, - VPB_UNBUSIED)) - return; - - lockacq = !mtx_owned(vm_page_lockptr(m)); - if (lockacq) - vm_page_lock(m); - vm_page_xunbusy_locked(m); - if (lockacq) - vm_page_unlock(m); -} - /* * vm_page_xunbusy_hard: * - * Called after the first try the exclusive unbusy of a page failed. - * It is assumed that the waiters bit is on. + * Called when unbusy has failed because there is a waiter. */ void vm_page_xunbusy_hard(vm_page_t m) @@ -1048,34 +999,10 @@ vm_page_xunbusy_hard(vm_page_t m) vm_page_assert_xbusied(m); - vm_page_lock(m); - vm_page_xunbusy_locked(m); - vm_page_unlock(m); -} - -/* - * vm_page_flash: - * - * Wakeup anyone waiting for the page. - * The ownership bits do not change. - * - * The given page must be locked. - */ -void -vm_page_flash(vm_page_t m) -{ - u_int x; - - vm_page_lock_assert(m, MA_OWNED); - - for (;;) { - x = m->busy_lock; - if ((x & VPB_BIT_WAITERS) == 0) - return; - if (atomic_cmpset_int(&m->busy_lock, x, - x & (~VPB_BIT_WAITERS))) - break; - } + /* + * Wake the waiter. + */ + atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); wakeup(m); } @@ -1264,7 +1191,7 @@ vm_page_readahead_finish(vm_page_t m) /* * vm_page_sleep_if_busy: * - * Sleep and release the page queues lock if the page is busied. + * Sleep and release the object lock if the page is busied. * Returns TRUE if the thread slept. * * The given page must be unlocked and object containing it must @@ -1287,8 +1214,6 @@ vm_page_sleep_if_busy(vm_page_t m, const char *msg) * held by the callers. */ obj = m->object; - vm_page_lock(m); - VM_OBJECT_WUNLOCK(obj); vm_page_busy_sleep(m, msg, false); VM_OBJECT_WLOCK(obj); return (TRUE); @@ -1297,6 +1222,39 @@ vm_page_sleep_if_busy(vm_page_t m, const char *msg) } /* + * vm_page_sleep_if_xbusy: + * + * Sleep and release the object lock if the page is xbusied. + * Returns TRUE if the thread slept. + * + * The given page must be unlocked and object containing it must + * be locked. + */ +int +vm_page_sleep_if_xbusy(vm_page_t m, const char *msg) +{ + vm_object_t obj; + + vm_page_lock_assert(m, MA_NOTOWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); + + if (vm_page_xbusied(m)) { + /* + * The page-specific object must be cached because page + * identity can change during the sleep, causing the + * re-lock of a different object. + * It is assumed that a reference to the object is already + * held by the callers. + */ + obj = m->object; + vm_page_busy_sleep(m, msg, true); + VM_OBJECT_WLOCK(obj); + return (TRUE); + } + return (FALSE); +} + +/* * vm_page_dirty_KBI: [ internal use only ] * * Set all bits in the page's dirty field. @@ -1452,7 +1410,7 @@ vm_page_object_remove(vm_page_t m) KASSERT((m->ref_count & VPRC_OBJREF) != 0, ("page %p is missing its object ref", m)); if (vm_page_xbusied(m)) - vm_page_xunbusy_maybelocked(m); + vm_page_xunbusy(m); mrem = vm_radix_remove(&object->rtree, m->pindex); KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m)); @@ -1598,7 +1556,7 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm mold->object = NULL; atomic_clear_int(&mold->ref_count, VPRC_OBJREF); - vm_page_xunbusy_maybelocked(mold); + vm_page_xunbusy(mold); /* * The object's resident_page_count does not change because we have @@ -4089,8 +4047,6 @@ retrylookup: * likely to reclaim it. */ vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_lock(m); - VM_OBJECT_WUNLOCK(object); vm_page_busy_sleep(m, "pgrbwt", (allocflags & VM_ALLOC_IGN_SBUSY) != 0); VM_OBJECT_WLOCK(object); @@ -4188,8 +4144,6 @@ retrylookup: * likely to reclaim it. */ vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_lock(m); - VM_OBJECT_WUNLOCK(object); vm_page_busy_sleep(m, "grbmaw", (allocflags & VM_ALLOC_IGN_SBUSY) != 0); VM_OBJECT_WLOCK(object); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Sep 10 17:55:07 2019 (r352173) +++ head/sys/vm/vm_page.h Tue Sep 10 18:27:45 2019 (r352174) @@ -541,7 +541,6 @@ malloc2vm_flags(int malloc_flags) void vm_page_busy_downgrade(vm_page_t m); void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); -void vm_page_flash(vm_page_t m); void vm_page_free(vm_page_t m); void vm_page_free_zero(vm_page_t m); @@ -604,6 +603,7 @@ vm_page_t vm_page_scan_contig(u_long npages, vm_page_t vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options); void vm_page_set_valid_range(vm_page_t m, int base, int size); int vm_page_sleep_if_busy(vm_page_t m, const char *msg); +int vm_page_sleep_if_xbusy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_sunbusy(vm_page_t m); void vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t newq); @@ -618,7 +618,6 @@ void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, void vm_page_wire(vm_page_t); bool vm_page_wire_mapped(vm_page_t m); void vm_page_xunbusy_hard(vm_page_t m); -void vm_page_xunbusy_maybelocked(vm_page_t m); void vm_page_set_validclean (vm_page_t, int, int); void vm_page_clear_dirty (vm_page_t, int, int); void vm_page_set_invalid (vm_page_t, int, int); From owner-svn-src-all@freebsd.org Tue Sep 10 18:46:33 2019 Return-Path: Delivered-To: svn-src-all@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 8EC56E0B41; Tue, 10 Sep 2019 18:46:33 +0000 (UTC) (envelope-from luporl@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 46SYsP31trz3N3H; Tue, 10 Sep 2019 18:46:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 469CF2A59A; Tue, 10 Sep 2019 18:46:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AIkXiq097157; Tue, 10 Sep 2019 18:46:33 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AIkXwR097156; Tue, 10 Sep 2019 18:46:33 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201909101846.x8AIkXwR097156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 10 Sep 2019 18:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352175 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 352175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 18:46:33 -0000 Author: luporl Date: Tue Sep 10 18:46:32 2019 New Revision: 352175 URL: https://svnweb.freebsd.org/changeset/base/352175 Log: Add powerpc support to libkvm probe function PowerPC kernels are of DYN type, instead of EXEC. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21583 Modified: head/lib/libkvm/kvm_private.c Modified: head/lib/libkvm/kvm_private.c ============================================================================== --- head/lib/libkvm/kvm_private.c Tue Sep 10 18:27:45 2019 (r352174) +++ head/lib/libkvm/kvm_private.c Tue Sep 10 18:46:32 2019 (r352175) @@ -131,7 +131,8 @@ _kvm_probe_elf_kernel(kvm_t *kd, int class, int machin { return (kd->nlehdr.e_ident[EI_CLASS] == class && - kd->nlehdr.e_type == ET_EXEC && + ((machine == EM_PPC || machine == EM_PPC64) ? + kd->nlehdr.e_type == ET_DYN : kd->nlehdr.e_type == ET_EXEC) && kd->nlehdr.e_machine == machine); } From owner-svn-src-all@freebsd.org Tue Sep 10 19:08:04 2019 Return-Path: Delivered-To: svn-src-all@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 30DABE126B; Tue, 10 Sep 2019 19:08:04 +0000 (UTC) (envelope-from jeff@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 46SZLD18YSz3NvJ; Tue, 10 Sep 2019 19:08:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0AA472A97C; Tue, 10 Sep 2019 19:08:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AJ84Hu009016; Tue, 10 Sep 2019 19:08:04 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AJ81KH009005; Tue, 10 Sep 2019 19:08:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201909101908.x8AJ81KH009005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 10 Sep 2019 19:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352176 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs compat/linuxkpi/common/src dev/drm2/ttm dev/xen/gntdev dev/xen/privcmd kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs compat/linuxkpi/common/src dev/drm2/ttm dev/xen/gntdev dev/xen/privcmd kern vm X-SVN-Commit-Revision: 352176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 19:08:04 -0000 Author: jeff Date: Tue Sep 10 19:08:01 2019 New Revision: 352176 URL: https://svnweb.freebsd.org/changeset/base/352176 Log: Replace redundant code with a few new vm_page_grab facilities: - VM_ALLOC_NOCREAT will grab without creating a page. - vm_page_grab_valid() will grab and page in if necessary. - vm_page_busy_acquire() automates some busy acquire loops. Discussed with: alc, kib, markj Tested by: pho (part of larger branch) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21546 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/dev/drm2/ttm/ttm_tt.c head/sys/dev/xen/gntdev/gntdev.c head/sys/dev/xen/privcmd/privcmd.c head/sys/kern/uipc_shm.c head/sys/vm/vm_glue.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 10 19:08:01 2019 (r352176) @@ -412,33 +412,14 @@ page_busy(vnode_t *vp, int64_t start, int64_t off, int obj = vp->v_object; zfs_vmobject_assert_wlocked(obj); - for (;;) { - if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && - pp->valid) { - if (vm_page_xbusied(pp)) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_reference(pp); - vm_page_sleep_if_xbusy(pp, "zfsmwb"); - continue; - } - vm_page_sbusy(pp); - } else if (pp != NULL) { - ASSERT(!pp->valid); - pp = NULL; - } - - if (pp != NULL) { - ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); - vm_object_pip_add(obj, 1); - pmap_remove_write(pp); - if (nbytes != 0) - vm_page_clear_dirty(pp, off, nbytes); - } - break; + vm_page_grab_valid(&pp, obj, OFF_TO_IDX(start), VM_ALLOC_NOCREAT | + VM_ALLOC_SBUSY | VM_ALLOC_NORMAL | VM_ALLOC_IGN_SBUSY); + if (pp != NULL) { + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_object_pip_add(obj, 1); + pmap_remove_write(pp); + if (nbytes != 0) + vm_page_clear_dirty(pp, off, nbytes); } return (pp); } @@ -455,32 +436,14 @@ static vm_page_t page_wire(vnode_t *vp, int64_t start) { vm_object_t obj; - vm_page_t pp; + vm_page_t m; obj = vp->v_object; zfs_vmobject_assert_wlocked(obj); - for (;;) { - if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && - pp->valid) { - if (vm_page_xbusied(pp)) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_reference(pp); - vm_page_sleep_if_xbusy(pp, "zfsmwb"); - continue; - } - - ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); - vm_page_wire(pp); - } else - pp = NULL; - break; - } - return (pp); + vm_page_grab_valid(&m, obj, OFF_TO_IDX(start), VM_ALLOC_NOCREAT | + VM_ALLOC_WIRED | VM_ALLOC_IGN_SBUSY | VM_ALLOC_NOBUSY); + return (m); } static void Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Tue Sep 10 19:08:01 2019 (r352176) @@ -286,27 +286,11 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int panic("GFP_NOWAIT is unimplemented"); VM_OBJECT_WLOCK(obj); - page = vm_page_grab(obj, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED); - if (page->valid != VM_PAGE_BITS_ALL) { - vm_page_xbusy(page); - if (vm_pager_has_page(obj, pindex, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL); - if (rv != VM_PAGER_OK) { - vm_page_unwire_noq(page); - vm_page_free(page); - VM_OBJECT_WUNLOCK(obj); - return (ERR_PTR(-EINVAL)); - } - MPASS(page->valid == VM_PAGE_BITS_ALL); - } else { - pmap_zero_page(page); - page->valid = VM_PAGE_BITS_ALL; - page->dirty = 0; - } - vm_page_xunbusy(page); - } + rv = vm_page_grab_valid(&page, obj, pindex, VM_ALLOC_NORMAL | + VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); VM_OBJECT_WUNLOCK(obj); + if (rv != VM_PAGER_OK) + return (ERR_PTR(-EINVAL)); return (page); } Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Tue Sep 10 19:08:01 2019 (r352176) @@ -231,8 +231,7 @@ reserve: } VM_OBJECT_WLOCK(vm_obj); - if (vm_page_busied(m)) { - vm_page_sleep_if_busy(m, "ttmpbs"); + if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) { ttm_mem_io_unlock(man); ttm_bo_unreserve(bo); goto retry; @@ -240,6 +239,7 @@ reserve: m1 = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); if (m1 == NULL) { if (vm_page_insert(m, vm_obj, OFF_TO_IDX(offset))) { + vm_page_xunbusy(m); VM_OBJECT_WUNLOCK(vm_obj); vm_wait(vm_obj); VM_OBJECT_WLOCK(vm_obj); @@ -253,7 +253,6 @@ reserve: bo, m, m1, (uintmax_t)offset)); } m->valid = VM_PAGE_BITS_ALL; - vm_page_xbusy(m); if (*mres != NULL) { KASSERT(*mres != m, ("losing %p %p", *mres, m)); vm_page_free(*mres); @@ -375,7 +374,7 @@ retry: m = vm_page_lookup(vm_obj, i); if (m == NULL) continue; - if (vm_page_sleep_if_busy(m, "ttm_unm")) + if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; cdev_pager_free_page(vm_obj, m); } Modified: head/sys/dev/drm2/ttm/ttm_tt.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_tt.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/dev/drm2/ttm/ttm_tt.c Tue Sep 10 19:08:01 2019 (r352176) @@ -288,20 +288,12 @@ int ttm_tt_swapin(struct ttm_tt *ttm) VM_OBJECT_WLOCK(obj); vm_object_pip_add(obj, 1); for (i = 0; i < ttm->num_pages; ++i) { - from_page = vm_page_grab(obj, i, VM_ALLOC_NORMAL); - if (from_page->valid != VM_PAGE_BITS_ALL) { - if (vm_pager_has_page(obj, i, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &from_page, 1, - NULL, NULL); - if (rv != VM_PAGER_OK) { - vm_page_free(from_page); - ret = -EIO; - goto err_ret; - } - } else - vm_page_zero_invalid(from_page, TRUE); + rv = vm_page_grab_valid(&from_page, obj, i, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); + if (rv != VM_PAGER_OK) { + ret = -EIO; + goto err_ret; } - vm_page_xunbusy(from_page); to_page = ttm->pages[i]; if (unlikely(to_page == NULL)) { ret = -ENOMEM; Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/dev/xen/gntdev/gntdev.c Tue Sep 10 19:08:01 2019 (r352176) @@ -606,7 +606,7 @@ retry: m = vm_page_lookup(gmap->map->mem, i); if (m == NULL) continue; - if (vm_page_sleep_if_busy(m, "pcmdum")) + if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; cdev_pager_free_page(gmap->map->mem, m); } Modified: head/sys/dev/xen/privcmd/privcmd.c ============================================================================== --- head/sys/dev/xen/privcmd/privcmd.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/dev/xen/privcmd/privcmd.c Tue Sep 10 19:08:01 2019 (r352176) @@ -128,7 +128,7 @@ retry: m = vm_page_lookup(map->mem, i); if (m == NULL) continue; - if (vm_page_sleep_if_busy(m, "pcmdum")) + if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; cdev_pager_free_page(map->mem, m); } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/kern/uipc_shm.c Tue Sep 10 19:08:01 2019 (r352176) @@ -188,24 +188,13 @@ uiomove_object_page(vm_object_t obj, size_t len, struc * lock to page out tobj's pages because tobj is a OBJT_SWAP * type object. */ - m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED); - if (m->valid != VM_PAGE_BITS_ALL) { - vm_page_xbusy(m); - if (vm_pager_has_page(obj, idx, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); - if (rv != VM_PAGER_OK) { - printf( - "uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n", - obj, idx, m->valid, rv); - vm_page_unwire_noq(m); - vm_page_free(m); - VM_OBJECT_WUNLOCK(obj); - return (EIO); - } - } else - vm_page_zero_invalid(m, TRUE); - vm_page_xunbusy(m); + rv = vm_page_grab_valid(&m, obj, idx, + VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOBUSY); + if (rv != VM_PAGER_OK) { + VM_OBJECT_WUNLOCK(obj); + printf("uiomove_object: vm_obj %p idx %jd pager error %d\n", + obj, idx, rv); + return (EIO); } VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/vm/vm_glue.c Tue Sep 10 19:08:01 2019 (r352176) @@ -219,24 +219,11 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t o { vm_page_t m; vm_pindex_t pindex; - int rv; - VM_OBJECT_WLOCK(object); pindex = OFF_TO_IDX(offset); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED); - if (m->valid != VM_PAGE_BITS_ALL) { - vm_page_xbusy(m); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - if (rv != VM_PAGER_OK) { - vm_page_unwire_noq(m); - vm_page_free(m); - m = NULL; - goto out; - } - vm_page_xunbusy(m); - } -out: + VM_OBJECT_WLOCK(object); + (void)vm_page_grab_valid(&m, object, pindex, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); VM_OBJECT_WUNLOCK(object); return (m); } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/vm/vm_object.c Tue Sep 10 19:08:01 2019 (r352176) @@ -1954,14 +1954,10 @@ vm_object_populate(vm_object_t object, vm_pindex_t sta VM_OBJECT_ASSERT_WLOCKED(object); for (pindex = start; pindex < end; pindex++) { - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); - if (m->valid != VM_PAGE_BITS_ALL) { - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - if (rv != VM_PAGER_OK) { - vm_page_free(m); - break; - } - } + rv = vm_page_grab_valid(&m, object, pindex, VM_ALLOC_NORMAL); + if (rv != VM_PAGER_OK) + break; + /* * Keep "m" busy because a subsequent iteration may unlock * the object. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/vm/vm_page.c Tue Sep 10 19:08:01 2019 (r352176) @@ -866,6 +866,66 @@ vm_page_reference(vm_page_t m) } /* + * vm_page_busy_acquire: + * + * Acquire the busy lock as described by VM_ALLOC_* flags. Will loop + * and drop the object lock if necessary. + */ +int +vm_page_busy_acquire(vm_page_t m, int allocflags) +{ + vm_object_t obj; + u_int x; + bool locked; + + /* + * The page-specific object must be cached because page + * identity can change during the sleep, causing the + * re-lock of a different object. + * It is assumed that a reference to the object is already + * held by the callers. + */ + obj = m->object; + for (;;) { + if ((allocflags & VM_ALLOC_SBUSY) == 0) { + if (vm_page_tryxbusy(m)) + return (TRUE); + } else { + if (vm_page_trysbusy(m)) + return (TRUE); + } + if ((allocflags & VM_ALLOC_NOWAIT) != 0) + return (FALSE); + if (obj != NULL) { + locked = VM_OBJECT_WOWNED(obj); + } else { + MPASS(vm_page_wired(m)); + locked = FALSE; + } + sleepq_lock(m); + x = m->busy_lock; + if (x == VPB_UNBUSIED || + ((allocflags & VM_ALLOC_SBUSY) != 0 && + (x & VPB_BIT_SHARED) != 0) || + ((x & VPB_BIT_WAITERS) == 0 && + !atomic_cmpset_int(&m->busy_lock, x, + x | VPB_BIT_WAITERS))) { + sleepq_release(m); + continue; + } + if (locked) + VM_OBJECT_WUNLOCK(obj); + sleepq_add(m, NULL, "vmpba", 0, 0); + sleepq_wait(m, PVM); + if (locked) + VM_OBJECT_WLOCK(obj); + MPASS(m->object == obj || m->object == NULL); + if ((allocflags & VM_ALLOC_WAITFAIL) != 0) + return (FALSE); + } +} + +/* * vm_page_busy_downgrade: * * Downgrade an exclusive busy page into a single shared busy page. @@ -4046,10 +4106,13 @@ retrylookup: * sleeping so that the page daemon is less * likely to reclaim it. */ - vm_page_aflag_set(m, PGA_REFERENCED); + if ((allocflags & VM_ALLOC_NOCREAT) == 0) + vm_page_aflag_set(m, PGA_REFERENCED); vm_page_busy_sleep(m, "pgrbwt", (allocflags & VM_ALLOC_IGN_SBUSY) != 0); VM_OBJECT_WLOCK(object); + if ((allocflags & VM_ALLOC_WAITFAIL) != 0) + return (NULL); goto retrylookup; } else { if ((allocflags & VM_ALLOC_WIRED) != 0) @@ -4057,11 +4120,13 @@ retrylookup: if ((allocflags & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) vm_page_xbusy(m); - if ((allocflags & VM_ALLOC_SBUSY) != 0) + else if ((allocflags & VM_ALLOC_SBUSY) != 0) vm_page_sbusy(m); return (m); } } + if ((allocflags & VM_ALLOC_NOCREAT) != 0) + return (NULL); m = vm_page_alloc(object, pindex, pflags); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) @@ -4074,6 +4139,109 @@ retrylookup: } /* + * Grab a page and make it valid, paging in if necessary. Pages missing from + * their pager are zero filled and validated. + */ +int +vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int allocflags) +{ + vm_page_t m; + bool sleep, xbusy; + int pflags; + int rv; + + KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || + (allocflags & VM_ALLOC_IGN_SBUSY) != 0, + ("vm_page_grab_valid: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch")); + KASSERT((allocflags & + (VM_ALLOC_NOWAIT | VM_ALLOC_WAITFAIL | VM_ALLOC_ZERO)) == 0, + ("vm_page_grab_valid: Invalid flags 0x%X", allocflags)); + VM_OBJECT_ASSERT_WLOCKED(object); + pflags = allocflags & ~(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY); + pflags |= VM_ALLOC_WAITFAIL; + +retrylookup: + xbusy = false; + if ((m = vm_page_lookup(object, pindex)) != NULL) { + /* + * If the page is fully valid it can only become invalid + * with the object lock held. If it is not valid it can + * become valid with the busy lock held. Therefore, we + * may unnecessarily lock the exclusive busy here if we + * race with I/O completion not using the object lock. + * However, we will not end up with an invalid page and a + * shared lock. + */ + if (m->valid != VM_PAGE_BITS_ALL || + (allocflags & (VM_ALLOC_IGN_SBUSY | VM_ALLOC_SBUSY)) == 0) { + sleep = !vm_page_tryxbusy(m); + xbusy = true; + } else + sleep = !vm_page_trysbusy(m); + if (sleep) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + if ((allocflags & VM_ALLOC_NOCREAT) == 0) + vm_page_aflag_set(m, PGA_REFERENCED); + vm_page_busy_sleep(m, "pgrbwt", (allocflags & + VM_ALLOC_IGN_SBUSY) != 0); + VM_OBJECT_WLOCK(object); + goto retrylookup; + } + if ((allocflags & VM_ALLOC_NOCREAT) != 0 && + m->valid != VM_PAGE_BITS_ALL) { + if (xbusy) + vm_page_xunbusy(m); + else + vm_page_sunbusy(m); + *mp = NULL; + return (VM_PAGER_FAIL); + } + if ((allocflags & VM_ALLOC_WIRED) != 0) + vm_page_wire(m); + if (m->valid == VM_PAGE_BITS_ALL) + goto out; + } else if ((allocflags & VM_ALLOC_NOCREAT) != 0) { + *mp = NULL; + return (VM_PAGER_FAIL); + } else if ((m = vm_page_alloc(object, pindex, pflags)) != NULL) { + xbusy = true; + } else { + goto retrylookup; + } + + vm_page_assert_xbusied(m); + MPASS(xbusy); + if (vm_pager_has_page(object, pindex, NULL, NULL)) { + rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + if (rv != VM_PAGER_OK) { + if (allocflags & VM_ALLOC_WIRED) + vm_page_unwire_noq(m); + vm_page_free(m); + *mp = NULL; + return (rv); + } + MPASS(m->valid == VM_PAGE_BITS_ALL); + } else { + vm_page_zero_invalid(m, TRUE); + } +out: + if ((allocflags & VM_ALLOC_NOBUSY) != 0) { + if (xbusy) + vm_page_xunbusy(m); + else + vm_page_sunbusy(m); + } + if ((allocflags & VM_ALLOC_SBUSY) != 0 && xbusy) + vm_page_busy_downgrade(m); + *mp = m; + return (VM_PAGER_OK); +} + +/* * Return the specified range of pages from the given object. For each * page offset within the range, if a page already exists within the object * at that offset and it is busy, then wait for it to change state. If, @@ -4143,7 +4311,8 @@ retrylookup: * sleeping so that the page daemon is less * likely to reclaim it. */ - vm_page_aflag_set(m, PGA_REFERENCED); + if ((allocflags & VM_ALLOC_NOCREAT) == 0) + vm_page_aflag_set(m, PGA_REFERENCED); vm_page_busy_sleep(m, "grbmaw", (allocflags & VM_ALLOC_IGN_SBUSY) != 0); VM_OBJECT_WLOCK(object); @@ -4157,6 +4326,8 @@ retrylookup: if ((allocflags & VM_ALLOC_SBUSY) != 0) vm_page_sbusy(m); } else { + if ((allocflags & VM_ALLOC_NOCREAT) != 0) + break; m = vm_page_alloc_after(object, pindex + i, pflags | VM_ALLOC_COUNT(count - i), mpred); if (m == NULL) { Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Sep 10 18:46:32 2019 (r352175) +++ head/sys/vm/vm_page.h Tue Sep 10 19:08:01 2019 (r352176) @@ -497,6 +497,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ +#define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ @@ -539,6 +540,7 @@ malloc2vm_flags(int malloc_flags) #define PS_ALL_VALID 0x2 #define PS_NONE_BUSY 0x4 +int vm_page_busy_acquire(vm_page_t m, int allocflags); void vm_page_busy_downgrade(vm_page_t m); void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); void vm_page_free(vm_page_t m); @@ -565,6 +567,8 @@ void vm_page_change_lock(vm_page_t m, struct mtx **mtx vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count); +int vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, + int allocflags); void vm_page_deactivate(vm_page_t); void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); From owner-svn-src-all@freebsd.org Tue Sep 10 20:08:25 2019 Return-Path: Delivered-To: svn-src-all@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 062C2E2D96; Tue, 10 Sep 2019 20:08:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sbgr67L3z3xGp; Tue, 10 Sep 2019 20:08:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C70D2B4A2; Tue, 10 Sep 2019 20:08:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AK8OEJ045712; Tue, 10 Sep 2019 20:08:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AK8Ot6045711; Tue, 10 Sep 2019 20:08:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909102008.x8AK8Ot6045711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Sep 2019 20:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352177 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:08:25 -0000 Author: mjg Date: Tue Sep 10 20:08:24 2019 New Revision: 352177 URL: https://svnweb.freebsd.org/changeset/base/352177 Log: cache: assorted cleanups Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Sep 10 19:08:01 2019 (r352176) +++ head/sys/kern/vfs_cache.c Tue Sep 10 20:08:24 2019 (r352177) @@ -380,6 +380,8 @@ STATNODE_COUNTER(numfullpathfail4, "Number of fullpath STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, "Number of times zap_and_exit failed to lock"); +static long zap_and_exit_bucket_fail2; STATNODE_ULONG(zap_and_exit_bucket_fail2, + "Number of times zap_and_exit failed to lock"); static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); @@ -394,7 +396,7 @@ static int cache_yield; SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, "Number of times cache called yield"); -static void +static void __noinline cache_maybe_yield(void) { @@ -453,12 +455,14 @@ cache_assert_bucket_locked(struct namecache *ncp, int #define cache_assert_bucket_locked(x, y) do { } while (0) #endif -#define cache_sort(x, y) _cache_sort((void **)(x), (void **)(y)) +#define cache_sort_vnodes(x, y) _cache_sort_vnodes((void **)(x), (void **)(y)) static void -_cache_sort(void **p1, void **p2) +_cache_sort_vnodes(void **p1, void **p2) { void *tmp; + MPASS(*p1 != NULL || *p2 != NULL); + if (*p1 > *p2) { tmp = *p2; *p2 = *p1; @@ -506,8 +510,7 @@ static int cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2) { - cache_sort(&vlp1, &vlp2); - MPASS(vlp2 != NULL); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 != NULL) { if (!mtx_trylock(vlp1)) @@ -924,7 +927,7 @@ cache_zap_locked_vnode_kl2(struct namecache *ncp, stru mtx_unlock(*vlpp); *vlpp = NULL; } - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 == pvlp) { mtx_lock(vlp2); to_unlock = vlp2; @@ -950,7 +953,7 @@ out_relock: return (false); } -static int +static int __noinline cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp) { struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; @@ -969,7 +972,7 @@ cache_zap_locked_vnode(struct namecache *ncp, struct v blp = NCP2BUCKETLOCK(ncp); vlp1 = VP2VNODELOCK(ncp->nc_dvp); vlp2 = VP2VNODELOCK(ncp->nc_vp); - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 == pvlp) { mtx_lock(vlp2); to_unlock = vlp2; @@ -1047,7 +1050,7 @@ cache_zap_wlocked_bucket_kl(struct namecache *ncp, str vlp = NULL; if (!(ncp->nc_flag & NCF_NEGATIVE)) vlp = VP2VNODELOCK(ncp->nc_vp); - cache_sort(&dvlp, &vlp); + cache_sort_vnodes(&dvlp, &vlp); if (*vlpp1 == dvlp && *vlpp2 == vlp) { cache_zap_locked(ncp, false); @@ -1194,14 +1197,13 @@ retry: goto out_no_entry; } - counter_u64_add(numposzaps, 1); - error = cache_zap_wlocked_bucket(ncp, blp); - if (error != 0) { + if (__predict_false(error != 0)) { zap_and_exit_bucket_fail++; cache_maybe_yield(); goto retry; } + counter_u64_add(numposzaps, 1); cache_free(ncp); return (0); out_no_entry: @@ -1397,8 +1399,8 @@ zap_and_exit: error = cache_zap_rlocked_bucket(ncp, blp); else error = cache_zap_locked_vnode(ncp, dvp); - if (error != 0) { - zap_and_exit_bucket_fail++; + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; cache_maybe_yield(); goto retry; } @@ -1434,7 +1436,7 @@ cache_lock_vnodes_cel(struct celockstate *cel, struct vlp1 = VP2VNODELOCK(vp); vlp2 = VP2VNODELOCK(dvp); - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 != NULL) { mtx_lock(vlp1); @@ -1504,7 +1506,7 @@ cache_lock_buckets_cel(struct celockstate *cel, struct MPASS(cel->blp[0] == NULL); MPASS(cel->blp[1] == NULL); - cache_sort(&blp1, &blp2); + cache_sort_vnodes(&blp1, &blp2); if (blp1 != NULL) { rw_wlock(blp1); From owner-svn-src-all@freebsd.org Tue Sep 10 20:11:01 2019 Return-Path: Delivered-To: svn-src-all@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 3AA90E2E78; Tue, 10 Sep 2019 20:11:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sbks0vHHz3xX1; Tue, 10 Sep 2019 20:11:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0314B2B4DF; Tue, 10 Sep 2019 20:11:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKB0VR048288; Tue, 10 Sep 2019 20:11:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKB0e2048287; Tue, 10 Sep 2019 20:11:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909102011.x8AKB0e2048287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Sep 2019 20:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352178 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:11:01 -0000 Author: mjg Date: Tue Sep 10 20:11:00 2019 New Revision: 352178 URL: https://svnweb.freebsd.org/changeset/base/352178 Log: cache: change the formula for calculating lock array sizes It used to be mp_ncpus * 64, but this gives unnecessarily big values for small machines and at the same time constraints bigger ones. In particular this helps on a 104-way box for which the count is now doubled. While here make cache_purgevfs less likely. Currently it is not efficient in face of contention due to lock ordering issues. These are fixable but not worth it at the moment. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Sep 10 20:08:24 2019 (r352177) +++ head/sys/kern/vfs_cache.c Tue Sep 10 20:11:00 2019 (r352178) @@ -1879,19 +1879,21 @@ nchinit(void *dummy __unused) UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); - ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1; + ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; + if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ + ncbuckethash = 7; if (ncbuckethash > nchash) ncbuckethash = nchash; bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numbucketlocks; i++) rw_init_flags(&bucketlocks[i], "ncbuc", RW_DUPOK | RW_RECURSE); - ncvnodehash = cache_roundup_2(mp_ncpus * 64) - 1; + ncvnodehash = ncbuckethash; vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numvnodelocks; i++) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); - ncpurgeminvnodes = numbucketlocks; + ncpurgeminvnodes = numbucketlocks * 2; ncneghash = 3; neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, From owner-svn-src-all@freebsd.org Tue Sep 10 20:14:52 2019 Return-Path: Delivered-To: svn-src-all@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 AE3CDE317E; Tue, 10 Sep 2019 20:14:52 +0000 (UTC) (envelope-from oshogbo@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 46SbqJ48fcz3y16; Tue, 10 Sep 2019 20:14:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70ABA2B68C; Tue, 10 Sep 2019 20:14:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKEqGR051577; Tue, 10 Sep 2019 20:14:52 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKEqDo051576; Tue, 10 Sep 2019 20:14:52 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102014.x8AKEqDo051576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:14: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: r352179 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:14:52 -0000 Author: oshogbo Date: Tue Sep 10 20:14:52 2019 New Revision: 352179 URL: https://svnweb.freebsd.org/changeset/base/352179 Log: MFCr350610: exit1: postpone clearing P_TRACED flag until the proctree lock is acquired In case of the process being debugged. The P_TRACED is cleared very early, which would make procdesc_close() not calling proc_clear_orphan(). That would result in the debugged process can not be able to collect status of the process with process descriptor. Reviewed by: markj, kib Tested by: pho Modified: stable/12/sys/kern/kern_exit.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Tue Sep 10 20:11:00 2019 (r352178) +++ stable/12/sys/kern/kern_exit.c Tue Sep 10 20:14:52 2019 (r352179) @@ -335,7 +335,6 @@ exit1(struct thread *td, int rval, int signo) */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); p->p_ptevents = 0; /* @@ -437,6 +436,11 @@ exit1(struct thread *td, int rval, int signo) LIST_INSERT_HEAD(&zombproc, p, p_list); LIST_REMOVE(p, p_hash); sx_xunlock(&allproc_lock); + + sx_xlock(&proctree_lock); + PROC_LOCK(p); + p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + PROC_UNLOCK(p); /* * Reparent all children processes: From owner-svn-src-all@freebsd.org Tue Sep 10 20:15:53 2019 Return-Path: Delivered-To: svn-src-all@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 21DDBE325A; Tue, 10 Sep 2019 20:15:53 +0000 (UTC) (envelope-from oshogbo@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 46SbrT06hrz3yCY; Tue, 10 Sep 2019 20:15:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C311E2B696; Tue, 10 Sep 2019 20:15:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKFqFJ051858; Tue, 10 Sep 2019 20:15:52 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKFqgJ051856; Tue, 10 Sep 2019 20:15:52 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102015.x8AKFqgJ051856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:15: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: r352180 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 352180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:15:53 -0000 Author: oshogbo Date: Tue Sep 10 20:15:52 2019 New Revision: 352180 URL: https://svnweb.freebsd.org/changeset/base/352180 Log: MFCr350611: proc: introduce the proc_add_orphan function This API allows adding the process to its parent orphan list. Reviewed by: kib, markj Modified: stable/12/sys/kern/kern_exit.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Tue Sep 10 20:14:52 2019 (r352179) +++ stable/12/sys/kern/kern_exit.c Tue Sep 10 20:15:52 2019 (r352180) @@ -1330,6 +1330,24 @@ loop_locked: goto loop; } +void +proc_add_orphan(struct proc *child, struct proc *parent) +{ + + sx_assert(&proctree_lock, SX_XLOCKED); + KASSERT((child->p_flag & P_TRACED) != 0, + ("proc_add_orphan: not traced")); + + if (LIST_EMPTY(&parent->p_orphans)) { + child->p_treeflag |= P_TREE_FIRST_ORPHAN; + LIST_INSERT_HEAD(&parent->p_orphans, child, p_orphan); + } else { + LIST_INSERT_AFTER(LIST_FIRST(&parent->p_orphans), + child, p_orphan); + } + child->p_treeflag |= P_TREE_ORPHANED; +} + /* * Make process 'parent' the new parent of process 'child'. * Must be called with an exclusive hold of proctree lock. @@ -1350,16 +1368,8 @@ proc_reparent(struct proc *child, struct proc *parent, LIST_INSERT_HEAD(&parent->p_children, child, p_sibling); clear_orphan(child); - if (child->p_flag & P_TRACED) { - if (LIST_EMPTY(&child->p_pptr->p_orphans)) { - child->p_treeflag |= P_TREE_FIRST_ORPHAN; - LIST_INSERT_HEAD(&child->p_pptr->p_orphans, child, - p_orphan); - } else { - LIST_INSERT_AFTER(LIST_FIRST(&child->p_pptr->p_orphans), - child, p_orphan); - } - child->p_treeflag |= P_TREE_ORPHANED; + if ((child->p_flag & P_TRACED) != 0) { + proc_add_orphan(child, child->p_pptr); } child->p_pptr = parent; Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Tue Sep 10 20:14:52 2019 (r352179) +++ stable/12/sys/sys/proc.h Tue Sep 10 20:15:52 2019 (r352180) @@ -1063,6 +1063,7 @@ void proc_linkup(struct proc *p, struct thread *td); struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent, bool set_oppid); +void proc_add_orphan(struct proc *child, struct proc *parent); void proc_set_traced(struct proc *p, bool stop); void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); From owner-svn-src-all@freebsd.org Tue Sep 10 20:18:07 2019 Return-Path: Delivered-To: svn-src-all@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 D80DBE3338; Tue, 10 Sep 2019 20:18:07 +0000 (UTC) (envelope-from oshogbo@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 46Sbv35PNjz3yL9; Tue, 10 Sep 2019 20:18:07 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C8222B698; Tue, 10 Sep 2019 20:18:07 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKI7s0052015; Tue, 10 Sep 2019 20:18:07 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKI7RR052013; Tue, 10 Sep 2019 20:18:07 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102018.x8AKI7RR052013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:18:07 +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: r352181 - in stable/12: sys/kern tests/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/12: sys/kern tests/sys/kern X-SVN-Commit-Revision: 352181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:18:07 -0000 Author: oshogbo Date: Tue Sep 10 20:18:06 2019 New Revision: 352181 URL: https://svnweb.freebsd.org/changeset/base/352181 Log: MFCr350612 procdesc: fix reparenting when the debugger is attached The process is reparented to the debugger while it is attached. B B / ----> | A A D Every time when the process is reparented, it is added to the orphan list of the previous parent: A->orphan = B D->orphan = NULL When the A process will close the process descriptor to the B process, the B process will be reparented to the init process. B B - init | ----> A D A D A->orphan = B D->orphan = B In this scenario, the B process is in the orphan list of A and D. When the last process descriptor is closed instead of reparenting it to the reaper let it stay with the debugger process and set our previews parent to the reaper. Add test case for this situation. Notice that without this patch the kernel will crash with this test case: panic: orphan 0xfffff8000e990530 of 0xfffff8000e990000 has unexpected oppid 1 Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D20361 Modified: stable/12/sys/kern/sys_procdesc.c stable/12/tests/sys/kern/ptrace_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_procdesc.c ============================================================================== --- stable/12/sys/kern/sys_procdesc.c Tue Sep 10 20:15:52 2019 (r352180) +++ stable/12/sys/kern/sys_procdesc.c Tue Sep 10 20:18:06 2019 (r352181) @@ -416,7 +416,13 @@ procdesc_close(struct file *fp, struct thread *td) * terminate with prejudice. */ p->p_sigparent = SIGCHLD; - proc_reparent(p, p->p_reaper, true); + if ((p->p_flag & P_TRACED) == 0) { + proc_reparent(p, p->p_reaper, true); + } else { + clear_orphan(p); + p->p_oppid = p->p_reaper->p_pid; + proc_add_orphan(p, p->p_reaper); + } if ((pd->pd_flags & PDF_DAEMON) == 0) kern_psignal(p, SIGKILL); PROC_UNLOCK(p); Modified: stable/12/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/12/tests/sys/kern/ptrace_test.c Tue Sep 10 20:15:52 2019 (r352180) +++ stable/12/tests/sys/kern/ptrace_test.c Tue Sep 10 20:18:06 2019 (r352181) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #define _WANT_MIPS_REGNUM +#include #include #include #include @@ -3906,6 +3907,60 @@ ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * Verify that when the process is traced that it isn't reparent + * to the init process when we close all process descriptors. + */ +ATF_TC(ptrace__proc_reparent); +ATF_TC_HEAD(ptrace__proc_reparent, tc) +{ + + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(ptrace__proc_reparent, tc) +{ + pid_t traced, debuger, wpid; + int pd, status; + + traced = pdfork(&pd, 0); + ATF_REQUIRE(traced >= 0); + if (traced == 0) { + raise(SIGSTOP); + exit(0); + } + ATF_REQUIRE(pd >= 0); + + debuger = fork(); + ATF_REQUIRE(debuger >= 0); + if (debuger == 0) { + /* The traced process is reparented to debuger. */ + ATF_REQUIRE(ptrace(PT_ATTACH, traced, 0, 0) == 0); + wpid = waitpid(traced, &status, 0); + ATF_REQUIRE(wpid == traced); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + ATF_REQUIRE(close(pd) == 0); + ATF_REQUIRE(ptrace(PT_DETACH, traced, (caddr_t)1, 0) == 0); + + /* We closed pd so we should not have any child. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); + + exit(0); + } + + ATF_REQUIRE(close(pd) == 0); + wpid = waitpid(debuger, &status, 0); + ATF_REQUIRE(wpid == debuger); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + /* Check if we still have any child. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3967,6 +4022,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); + ATF_TP_ADD_TC(tp, ptrace__proc_reparent); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Sep 10 20:19:02 2019 Return-Path: Delivered-To: svn-src-all@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 ED581E33F6; Tue, 10 Sep 2019 20:19:02 +0000 (UTC) (envelope-from oshogbo@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 46Sbw65zDWz3yTl; Tue, 10 Sep 2019 20:19:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B19C12B69B; Tue, 10 Sep 2019 20:19:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKJ2e9052125; Tue, 10 Sep 2019 20:19:02 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKJ2lL052124; Tue, 10 Sep 2019 20:19:02 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102019.x8AKJ2lL052124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:19:02 +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: r352182 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:19:03 -0000 Author: oshogbo Date: Tue Sep 10 20:19:02 2019 New Revision: 352182 URL: https://svnweb.freebsd.org/changeset/base/352182 Log: MFCr350614: exit1: fix style nits Modified: stable/12/sys/kern/kern_exit.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Tue Sep 10 20:18:06 2019 (r352181) +++ stable/12/sys/kern/kern_exit.c Tue Sep 10 20:19:02 2019 (r352182) @@ -456,7 +456,7 @@ exit1(struct thread *td, int rval, int signo) PROC_LOCK(q); q->p_sigparent = SIGCHLD; - if (!(q->p_flag & P_TRACED)) { + if ((q->p_flag & P_TRACED) == 0) { proc_reparent(q, q->p_reaper, true); if (q->p_state == PRS_ZOMBIE) { /* From owner-svn-src-all@freebsd.org Tue Sep 10 20:19:29 2019 Return-Path: Delivered-To: svn-src-all@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 DA6E9E3483; Tue, 10 Sep 2019 20:19:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sbwd5R6xz3ybt; Tue, 10 Sep 2019 20:19:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DC892B69C; Tue, 10 Sep 2019 20:19:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKJT89052194; Tue, 10 Sep 2019 20:19:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKJTuO052193; Tue, 10 Sep 2019 20:19:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909102019.x8AKJTuO052193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Sep 2019 20:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352183 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:19:29 -0000 Author: mjg Date: Tue Sep 10 20:19:29 2019 New Revision: 352183 URL: https://svnweb.freebsd.org/changeset/base/352183 Log: cache: avoid excessive relocking on entry removal during lookup Due to lock ordering issues (bucket lock held, vnode locks wanted) the code starts with trylocking which in face of contention often fails. Prior to the change it would loop back with a possible yield. Instead note we know what locks are needed and can take them in the right order, avoiding retries. Then we can safely re-lookup and see if the entry we are looking for is still there. On a 104-way box poudriere would result in constant retries during an 11h run as seen in the vfs.cache.zap_and_exit_bucket_fail counter. before: 408866592 after : 0 However, a new stat reports: vfs.cache.zap_and_exit_bucket_relock_success: 32638 Note this is only a bandaid over current design issues. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Sep 10 20:19:02 2019 (r352182) +++ head/sys/kern/vfs_cache.c Tue Sep 10 20:19:29 2019 (r352183) @@ -378,6 +378,8 @@ STATNODE_COUNTER(numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); +STATNODE_COUNTER(zap_and_exit_bucket_relock_success, + "Number of successful removals after relocking"); static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, "Number of times zap_and_exit failed to lock"); static long zap_and_exit_bucket_fail2; STATNODE_ULONG(zap_and_exit_bucket_fail2, @@ -526,6 +528,19 @@ cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp } static void +cache_lock_vnodes(struct mtx *vlp1, struct mtx *vlp2) +{ + + MPASS(vlp1 != NULL || vlp2 != NULL); + MPASS(vlp1 <= vlp2); + + if (vlp1 != NULL) + mtx_lock(vlp1); + if (vlp2 != NULL) + mtx_lock(vlp2); +} + +static void cache_unlock_vnodes(struct mtx *vlp1, struct mtx *vlp2) { @@ -992,10 +1007,47 @@ out: return (error); } +/* + * If trylocking failed we can get here. We know enough to take all needed locks + * in the right order and re-lookup the entry. + */ static int -cache_zap_wlocked_bucket(struct namecache *ncp, struct rwlock *blp) +cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp, + struct vnode *dvp, struct mtx *dvlp, struct mtx *vlp, uint32_t hash, + struct rwlock *blp) { + struct namecache *rncp; + + cache_assert_bucket_locked(ncp, RA_UNLOCKED); + + cache_sort_vnodes(&dvlp, &vlp); + cache_lock_vnodes(dvlp, vlp); + rw_wlock(blp); + LIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { + if (rncp == ncp && rncp->nc_dvp == dvp && + rncp->nc_nlen == cnp->cn_namelen && + !bcmp(rncp->nc_name, cnp->cn_nameptr, rncp->nc_nlen)) + break; + } + if (rncp != NULL) { + cache_zap_locked(rncp, false); + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + counter_u64_add(zap_and_exit_bucket_relock_success, 1); + return (0); + } + + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + return (EAGAIN); +} + +static int __noinline +cache_zap_wlocked_bucket(struct namecache *ncp, struct componentname *cnp, + uint32_t hash, struct rwlock *blp) +{ struct mtx *dvlp, *vlp; + struct vnode *dvp; cache_assert_bucket_locked(ncp, RA_WLOCKED); @@ -1010,14 +1062,17 @@ cache_zap_wlocked_bucket(struct namecache *ncp, struct return (0); } + dvp = ncp->nc_dvp; rw_wunlock(blp); - return (EAGAIN); + return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); } -static int -cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp) +static int __noinline +cache_zap_rlocked_bucket(struct namecache *ncp, struct componentname *cnp, + uint32_t hash, struct rwlock *blp) { struct mtx *dvlp, *vlp; + struct vnode *dvp; cache_assert_bucket_locked(ncp, RA_RLOCKED); @@ -1034,8 +1089,9 @@ cache_zap_rlocked_bucket(struct namecache *ncp, struct return (0); } + dvp = ncp->nc_dvp; rw_runlock(blp); - return (EAGAIN); + return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); } static int @@ -1197,7 +1253,7 @@ retry: goto out_no_entry; } - error = cache_zap_wlocked_bucket(ncp, blp); + error = cache_zap_wlocked_bucket(ncp, cnp, hash, blp); if (__predict_false(error != 0)) { zap_and_exit_bucket_fail++; cache_maybe_yield(); @@ -1396,7 +1452,7 @@ success: zap_and_exit: if (blp != NULL) - error = cache_zap_rlocked_bucket(ncp, blp); + error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); else error = cache_zap_locked_vnode(ncp, dvp); if (__predict_false(error != 0)) { @@ -1922,6 +1978,7 @@ nchinit(void *dummy __unused) numfullpathfail2 = counter_u64_alloc(M_WAITOK); numfullpathfail4 = counter_u64_alloc(M_WAITOK); numfullpathfound = counter_u64_alloc(M_WAITOK); + zap_and_exit_bucket_relock_success = counter_u64_alloc(M_WAITOK); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); From owner-svn-src-all@freebsd.org Tue Sep 10 20:20:46 2019 Return-Path: Delivered-To: svn-src-all@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 41105E357A; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@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 46Sby611nnz3ylh; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0683D2B6B3; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKKjf4052341; Tue, 10 Sep 2019 20:20:45 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKKjb0052340; Tue, 10 Sep 2019 20:20:45 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102020.x8AKKjb0052340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:20: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: r352184 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:20:46 -0000 Author: oshogbo Date: Tue Sep 10 20:20:45 2019 New Revision: 352184 URL: https://svnweb.freebsd.org/changeset/base/352184 Log: MFCr350616: process: style We don't need to check if the parent is already set. This is done already in the proc_reparent. No functional behaviour changes intended. MFC after: 1 month Modified: stable/12/sys/kern/sys_process.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Tue Sep 10 20:19:29 2019 (r352183) +++ stable/12/sys/kern/sys_process.c Tue Sep 10 20:20:45 2019 (r352184) @@ -929,9 +929,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi * on a "detach". */ proc_set_traced(p, true); - if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc, false); - } + proc_reparent(p, td->td_proc, false); CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1048,7 +1046,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi bcopy(td2->td_sa.args, addr, td2->td_sa.narg * sizeof(register_t)); break; - + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -1158,8 +1156,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi sendsig: MPASS(proctree_locked == 0); - - /* + + /* * Clear the pending event for the thread that just * reported its event (p_xthread). This may not be * the thread passed to PT_CONTINUE, PT_STEP, etc. if From owner-svn-src-all@freebsd.org Tue Sep 10 20:21:48 2019 Return-Path: Delivered-To: svn-src-all@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 85C51E3611; Tue, 10 Sep 2019 20:21:48 +0000 (UTC) (envelope-from oshogbo@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 46SbzJ2yjtz3ywL; Tue, 10 Sep 2019 20:21:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 492B52B816; Tue, 10 Sep 2019 20:21:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKLmr2056202; Tue, 10 Sep 2019 20:21:48 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKLmWZ056201; Tue, 10 Sep 2019 20:21:48 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102021.x8AKLmWZ056201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:21:48 +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: r352185 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:21:48 -0000 Author: oshogbo Date: Tue Sep 10 20:21:47 2019 New Revision: 352185 URL: https://svnweb.freebsd.org/changeset/base/352185 Log: MFCr350617: procdesc: fix the function name I changed name of the function r350429 and forgot to update the r350612 patch. Reported by: jenkins Modified: stable/12/sys/kern/sys_procdesc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_procdesc.c ============================================================================== --- stable/12/sys/kern/sys_procdesc.c Tue Sep 10 20:20:45 2019 (r352184) +++ stable/12/sys/kern/sys_procdesc.c Tue Sep 10 20:21:47 2019 (r352185) @@ -419,7 +419,7 @@ procdesc_close(struct file *fp, struct thread *td) if ((p->p_flag & P_TRACED) == 0) { proc_reparent(p, p->p_reaper, true); } else { - clear_orphan(p); + proc_clear_orphan(p); p->p_oppid = p->p_reaper->p_pid; proc_add_orphan(p, p->p_reaper); } From owner-svn-src-all@freebsd.org Tue Sep 10 20:27:45 2019 Return-Path: Delivered-To: svn-src-all@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 17665E386B; Tue, 10 Sep 2019 20:27:45 +0000 (UTC) (envelope-from oshogbo@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 46Sc686j23z40Ll; Tue, 10 Sep 2019 20:27:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C94722B874; Tue, 10 Sep 2019 20:27:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKRi9H057919; Tue, 10 Sep 2019 20:27:44 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKRiUS057918; Tue, 10 Sep 2019 20:27:44 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102027.x8AKRiUS057918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352186 - head/lib/geom/nop X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/geom/nop X-SVN-Commit-Revision: 352186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:27:45 -0000 Author: oshogbo Date: Tue Sep 10 20:27:44 2019 New Revision: 352186 URL: https://svnweb.freebsd.org/changeset/base/352186 Log: gnop: Fix initial value for the wdelayprob Reported by: Chuck Silvers Modified: head/lib/geom/nop/geom_nop.c Modified: head/lib/geom/nop/geom_nop.c ============================================================================== --- head/lib/geom/nop/geom_nop.c Tue Sep 10 20:21:47 2019 (r352185) +++ head/lib/geom/nop/geom_nop.c Tue Sep 10 20:27:44 2019 (r352186) @@ -53,7 +53,7 @@ struct g_command class_commands[] = { { 's', "size", "0", G_TYPE_NUMBER }, { 'S', "secsize", "0", G_TYPE_NUMBER }, { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, - { 'x', "wdelayprob", "1", G_TYPE_NUMBER }, + { 'x', "wdelayprob", "-1", G_TYPE_NUMBER }, { 'z', "physpath", G_NOP_PHYSPATH_PASSTHROUGH, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -68,7 +68,7 @@ struct g_command class_commands[] = { { 'q', "rdelayprob", "-1", G_TYPE_NUMBER }, { 'r', "rfailprob", "-1", G_TYPE_NUMBER }, { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, - { 'x', "wdelayprob", "1", G_TYPE_NUMBER }, + { 'x', "wdelayprob", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, "[-v] [-d delaymsec] [-e error] [-q rdelayprob] [-r rfailprob] " From owner-svn-src-all@freebsd.org Tue Sep 10 20:41:43 2019 Return-Path: Delivered-To: svn-src-all@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 2EA61E4021; Tue, 10 Sep 2019 20:41:43 +0000 (UTC) (envelope-from oshogbo@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 46ScQH0Td1z416P; Tue, 10 Sep 2019 20:41:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7BB02BBBC; Tue, 10 Sep 2019 20:41:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKfgRE068984; Tue, 10 Sep 2019 20:41:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKfgA8068981; Tue, 10 Sep 2019 20:41:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102041.x8AKfgA8068981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:41:42 +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: r352187 - in stable/12/lib/libcasper/services/cap_dns: . tests X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/12/lib/libcasper/services/cap_dns: . tests X-SVN-Commit-Revision: 352187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:41:43 -0000 Author: oshogbo Date: Tue Sep 10 20:41:42 2019 New Revision: 352187 URL: https://svnweb.freebsd.org/changeset/base/352187 Log: MFCr340141: libcasper: fix limitations in dns service The getaddrinfo(3) and gethostbyname(3) are used to return the address for a given hostname. The getnameinfo(3) and gethostbyaddr(3) are used to return hostname for a given address. Right now in casper, we have two limitations: - NAME which allows resolving DNS names. - ADDR which allows to do revert DNS lookups. Before this change the rights was mixed up: NAME - getnameinfo(3) and gethostbyname(3) ADDR - gethostbyaddr(3) and getaddrinfo(3) Which no matters on limitation allowed us to resolve DNS names and do DNS lookups basically by using a different set of functions. Now the NAME type allows getaddrinfo(3) and gethostbyname (3)functions, and the ADDR names allow to use gethostbyaddr(3) and getnameinfo(3) functions. Reviewed by: pjd, bcr Discussed with: hrs Differential Revision: https://reviews.freebsd.org/D16930 Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3 stable/12/lib/libcasper/services/cap_dns/cap_dns.c stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Tue Sep 10 20:27:44 2019 (r352186) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Tue Sep 10 20:41:42 2019 (r352187) @@ -118,19 +118,21 @@ or .Dv NAME . The .Dv ADDR -means that functions -.Fn cap_gethostbyname , -.Fn cap_gethostbyname2 +means that reverse DNS lookups are allowed with +.Fn cap_getnameinfo and .Fn cap_gethostbyaddr -are allowed. +functions. In case when .Va type is set to .Dv NAME -the -.Fn cap_getnameinfo -function is allowed. +the name resolution is allowed with +.Fn cap_getaddrinfo , +.Fn cap_gethostbyname , +and +.Fn cap_gethostbyname2 +functions. .It family ( NV_TYPE_NUMBER ) The .Va family Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:27:44 2019 (r352186) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:41:42 2019 (r352187) @@ -524,7 +524,7 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "NAME")) + if (!dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); error = 0; @@ -617,7 +617,7 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "ADDR")) + if (!dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); Modified: stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c Tue Sep 10 20:27:44 2019 (r352186) +++ stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c Tue Sep 10 20:41:42 2019 (r352187) @@ -393,7 +393,8 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == 0); CHECK(runtest(capdns) == - (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6)); + (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6 | + GETADDRINFO_AF_INET | GETADDRINFO_AF_INET6)); cap_close(capdns); @@ -419,9 +420,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == 0); CHECK(runtest(capdns) == - (GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6 | - GETADDRINFO_AF_INET | GETADDRINFO_AF_INET6)); - + (GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6)); cap_close(capdns); /* @@ -512,7 +511,8 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 1) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capdns) == (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET)); + CHECK(runtest(capdns) == + (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | GETADDRINFO_AF_INET)); cap_close(capdns); @@ -548,7 +548,8 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 1) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capdns) == GETHOSTBYNAME2_AF_INET6); + CHECK(runtest(capdns) == + (GETHOSTBYNAME2_AF_INET6 | GETADDRINFO_AF_INET6)); cap_close(capdns); @@ -584,7 +585,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 1) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capdns) == (GETHOSTBYADDR_AF_INET | GETADDRINFO_AF_INET)); + CHECK(runtest(capdns) == GETHOSTBYADDR_AF_INET); cap_close(capdns); @@ -620,8 +621,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 1) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capdns) == (GETHOSTBYADDR_AF_INET6 | - GETADDRINFO_AF_INET6)); + CHECK(runtest(capdns) == GETHOSTBYADDR_AF_INET6); cap_close(capdns); @@ -657,7 +657,8 @@ main(void) errno == ENOTCAPABLE); /* Do the limits still hold? */ - CHECK(runtest(capdns) == (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET)); + CHECK(runtest(capdns) == (GETHOSTBYNAME | GETHOSTBYNAME2_AF_INET | + GETADDRINFO_AF_INET)); cap_close(capdns); @@ -691,8 +692,7 @@ main(void) errno == ENOTCAPABLE); /* Do the limits still hold? */ - CHECK(runtest(capdns) == (GETHOSTBYADDR_AF_INET6 | - GETADDRINFO_AF_INET6)); + CHECK(runtest(capdns) == GETHOSTBYADDR_AF_INET6); cap_close(capdns); From owner-svn-src-all@freebsd.org Tue Sep 10 20:45:53 2019 Return-Path: Delivered-To: svn-src-all@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 9D85FE40F0; Tue, 10 Sep 2019 20:45:53 +0000 (UTC) (envelope-from oshogbo@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 46ScW53hXzz41Hs; Tue, 10 Sep 2019 20:45:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440982BC10; Tue, 10 Sep 2019 20:45:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKjr2l070095; Tue, 10 Sep 2019 20:45:53 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKjppA070087; Tue, 10 Sep 2019 20:45:51 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102045.x8AKjppA070087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:45:51 +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: r352188 - in stable/12: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/12: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping X-SVN-Commit-Revision: 352188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:45:53 -0000 Author: oshogbo Date: Tue Sep 10 20:45:51 2019 New Revision: 352188 URL: https://svnweb.freebsd.org/changeset/base/352188 Log: MFCr340363: libcasper: Change the name of limits in cap_dns so the intentions are obvious. Reported by: pjd Modified: stable/12/ObsoleteFiles.inc stable/12/contrib/tcpdump/tcpdump.c stable/12/contrib/traceroute/traceroute.c stable/12/lib/libcasper/services/cap_dns/Makefile stable/12/lib/libcasper/services/cap_dns/cap_dns.3 stable/12/lib/libcasper/services/cap_dns/cap_dns.c stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c stable/12/sbin/ping/ping.c Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/ObsoleteFiles.inc Tue Sep 10 20:45:51 2019 (r352188) @@ -483,6 +483,9 @@ OLD_DIRS+=usr/lib/clang/6.0.1/lib OLD_DIRS+=usr/lib/clang/6.0.1 # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb +# 20181112: Cleanup old libcap_dns. +OLD_LIBS+=lib/casper/libcap_dns.so.1 +OLD_LIBS+=usr/lib32/libcap_dns.so.1 # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports Modified: stable/12/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/12/contrib/tcpdump/tcpdump.c Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/contrib/tcpdump/tcpdump.c Tue Sep 10 20:45:51 2019 (r352188) @@ -741,7 +741,7 @@ capdns_setup(void) if (capdnsloc == NULL) error("unable to open system.dns service"); /* Limit system.dns to reverse DNS lookups. */ - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; if (cap_dns_type_limit(capdnsloc, types, 1) < 0) error("unable to limit access to system.dns service"); families[0] = AF_INET; Modified: stable/12/contrib/traceroute/traceroute.c ============================================================================== --- stable/12/contrib/traceroute/traceroute.c Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/contrib/traceroute/traceroute.c Tue Sep 10 20:45:51 2019 (r352188) @@ -523,7 +523,7 @@ main(int argc, char **argv) int sump = 0; int sockerrno; #ifdef WITH_CASPER - const char *types[] = { "NAME", "ADDR" }; + const char *types[] = { "NAME2ADDR", "ADDR2NAME" }; int families[1]; cap_channel_t *casper; #endif Modified: stable/12/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/Makefile Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/lib/libcasper/services/cap_dns/Makefile Tue Sep 10 20:45:51 2019 (r352188) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Tue Sep 10 20:45:51 2019 (r352188) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2018 +.Dd November 12, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -76,9 +76,9 @@ function limits the functions allowed in the service. The .Fa types variable can be set to -.Dv ADDR +.Dv ADDR2NAME or -.Dv NAME . +.Dv NAME2ADDR . See the .Sx LIMITS section for more details. @@ -113,9 +113,9 @@ for that function can contain the following values and The .Va type can have two values: -.Dv ADDR +.Dv ADDR2NAME or -.Dv NAME . +.Dv NAME2ADDR . The .Dv ADDR means that reverse DNS lookups are allowed with Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:45:51 2019 (r352188) @@ -474,7 +474,7 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist struct hostent *hp; int family; - if (!dns_allowed_type(limits, "NAME")) + if (!dns_allowed_type(limits, "NAME2ADDR")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -498,7 +498,7 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist size_t addrsize; int family; - if (!dns_allowed_type(limits, "ADDR")) + if (!dns_allowed_type(limits, "ADDR2NAME")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -524,7 +524,7 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "ADDR")) + if (!dns_allowed_type(limits, "ADDR2NAME")) return (NO_RECOVERY); error = 0; @@ -617,7 +617,7 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "NAME")) + if (!dns_allowed_type(limits, "NAME2ADDR")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); @@ -702,8 +702,8 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n if (strncmp(name, "type", sizeof("type") - 1) != 0) return (EINVAL); type = nvlist_get_string(newlimits, name); - if (strcmp(type, "ADDR") != 0 && - strcmp(type, "NAME") != 0) { + if (strcmp(type, "ADDR2NAME") != 0 && + strcmp(type, "NAME2ADDR") != 0) { return (EINVAL); } if (!dns_allowed_type(oldlimits, type)) Modified: stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/lib/libcasper/services/cap_dns/tests/dns_test.c Tue Sep 10 20:45:51 2019 (r352188) @@ -357,8 +357,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; @@ -380,12 +380,12 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -407,12 +407,12 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -432,8 +432,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); @@ -459,8 +459,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); @@ -488,18 +488,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -525,18 +525,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -562,18 +562,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -598,18 +598,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -630,13 +630,13 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); families[0] = AF_INET; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -644,7 +644,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -665,13 +665,13 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); families[0] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -679,7 +679,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; Modified: stable/12/sbin/ping/ping.c ============================================================================== --- stable/12/sbin/ping/ping.c Tue Sep 10 20:41:42 2019 (r352187) +++ stable/12/sbin/ping/ping.c Tue Sep 10 20:45:51 2019 (r352188) @@ -619,7 +619,7 @@ main(int argc, char *const *argv) if (capdns != NULL) { const char *types[1]; - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; if (cap_dns_type_limit(capdns, types, 1) < 0) err(1, "unable to limit access to system.dns service"); } @@ -1791,8 +1791,8 @@ capdns_setup(void) cap_close(capcas); if (capdnsloc == NULL) err(1, "unable to open system.dns service"); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; if (cap_dns_type_limit(capdnsloc, types, 2) < 0) err(1, "unable to limit access to system.dns service"); families[0] = AF_INET; From owner-svn-src-all@freebsd.org Tue Sep 10 20:49:48 2019 Return-Path: Delivered-To: svn-src-all@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 481FEE41C6; Tue, 10 Sep 2019 20:49:48 +0000 (UTC) (envelope-from oshogbo@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 46Scbc1HdJz41QQ; Tue, 10 Sep 2019 20:49:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0642BC11; Tue, 10 Sep 2019 20:49:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKnlH9070320; Tue, 10 Sep 2019 20:49:47 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKnlws070319; Tue, 10 Sep 2019 20:49:47 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102049.x8AKnlws070319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:49: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: r352189 - stable/12/lib/libcasper/services/cap_dns X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 352189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:49:48 -0000 Author: oshogbo Date: Tue Sep 10 20:49:47 2019 New Revision: 352189 URL: https://svnweb.freebsd.org/changeset/base/352189 Log: MFCr340638: libcasper: provide compatibility with the old version of service Some external tools like tcpdump(1) have upstream the changes with old limits name. Because of that provide compatibility with the old names. Reported by: emaste Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:45:51 2019 (r352188) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c Tue Sep 10 20:49:47 2019 (r352189) @@ -474,7 +474,8 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist struct hostent *hp; int family; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -498,7 +499,8 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist size_t addrsize; int family; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -524,7 +526,8 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); error = 0; @@ -617,7 +620,8 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); @@ -703,7 +707,9 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n return (EINVAL); type = nvlist_get_string(newlimits, name); if (strcmp(type, "ADDR2NAME") != 0 && - strcmp(type, "NAME2ADDR") != 0) { + strcmp(type, "NAME2ADDR") != 0 && + strcmp(type, "ADDR") != 0 && + strcmp(type, "NAME") != 0) { return (EINVAL); } if (!dns_allowed_type(oldlimits, type)) From owner-svn-src-all@freebsd.org Tue Sep 10 20:55:48 2019 Return-Path: Delivered-To: svn-src-all@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 61DDBE447D; Tue, 10 Sep 2019 20:55:48 +0000 (UTC) (envelope-from oshogbo@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 46SckX1yDmz41t4; Tue, 10 Sep 2019 20:55:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267452BDE1; Tue, 10 Sep 2019 20:55:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKtmIK075829; Tue, 10 Sep 2019 20:55:48 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKtlZ6075827; Tue, 10 Sep 2019 20:55:47 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102055.x8AKtlZ6075827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:55: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: r352190 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 352190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:55:48 -0000 Author: oshogbo Date: Tue Sep 10 20:55:47 2019 New Revision: 352190 URL: https://svnweb.freebsd.org/changeset/base/352190 Log: MFCr350429: proc: make clear_orphan an public API This will be useful for other patches with process descriptors. Change its name as well. Reviewed by: markj, kib Modified: stable/12/sys/kern/kern_exit.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Tue Sep 10 20:49:47 2019 (r352189) +++ stable/12/sys/kern/kern_exit.c Tue Sep 10 20:55:47 2019 (r352190) @@ -147,8 +147,8 @@ reaper_abandon_children(struct proc *p, bool exiting) p->p_treeflag &= ~P_TREE_REAPER; } -static void -clear_orphan(struct proc *p) +void +proc_clear_orphan(struct proc *p) { struct proc *p1; @@ -505,7 +505,7 @@ exit1(struct thread *td, int rval, int signo) * list due to present P_TRACED flag. Clear * orphan link for q now while q is locked. */ - clear_orphan(q); + proc_clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; @@ -539,7 +539,7 @@ exit1(struct thread *td, int rval, int signo) kern_psignal(q, q->p_pdeathsig); CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid, q->p_pid); - clear_orphan(q); + proc_clear_orphan(q); PROC_UNLOCK(q); } @@ -889,7 +889,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat reaper_abandon_children(p, true); LIST_REMOVE(p, p_reapsibling); PROC_LOCK(p); - clear_orphan(p); + proc_clear_orphan(p); PROC_UNLOCK(p); leavepgrp(p); if (p->p_procdesc != NULL) @@ -1367,7 +1367,7 @@ proc_reparent(struct proc *child, struct proc *parent, LIST_REMOVE(child, p_sibling); LIST_INSERT_HEAD(&parent->p_children, child, p_sibling); - clear_orphan(child); + proc_clear_orphan(child); if ((child->p_flag & P_TRACED) != 0) { proc_add_orphan(child, child->p_pptr); } Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Tue Sep 10 20:49:47 2019 (r352189) +++ stable/12/sys/sys/proc.h Tue Sep 10 20:55:47 2019 (r352190) @@ -1069,6 +1069,7 @@ void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); +void proc_clear_orphan(struct proc *p); void reaper_abandon_children(struct proc *p, bool exiting); int securelevel_ge(struct ucred *cr, int level); int securelevel_gt(struct ucred *cr, int level); From owner-svn-src-all@freebsd.org Tue Sep 10 21:08:24 2019 Return-Path: Delivered-To: svn-src-all@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 54835E4784; Tue, 10 Sep 2019 21:08:24 +0000 (UTC) (envelope-from jkim@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 46Sd1429F6z42NG; Tue, 10 Sep 2019 21:08:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 294812BFB0; Tue, 10 Sep 2019 21:08:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AL8OTS082105; Tue, 10 Sep 2019 21:08:24 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AL8I2l082065; Tue, 10 Sep 2019 21:08:18 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909102108.x8AL8I2l082065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 21:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352191 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn... X-SVN-Commit-Revision: 352191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 21:08:24 -0000 Author: jkim Date: Tue Sep 10 21:08:17 2019 New Revision: 352191 URL: https://svnweb.freebsd.org/changeset/base/352191 Log: Merge OpenSSL 1.1.1d. Added: head/crypto/openssl/doc/man3/CRYPTO_memcmp.pod - copied unchanged from r352163, vendor-crypto/openssl/dist/doc/man3/CRYPTO_memcmp.pod head/crypto/openssl/doc/man3/X509_cmp.pod - copied unchanged from r352163, vendor-crypto/openssl/dist/doc/man3/X509_cmp.pod head/secure/lib/libcrypto/man/CRYPTO_memcmp.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_cmp.3 (contents, props changed) Deleted: head/crypto/openssl/crypto/aes/asm/aes-586.pl head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl head/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl head/secure/lib/libcrypto/amd64/aes-x86_64.S head/secure/lib/libcrypto/amd64/bsaes-x86_64.S head/secure/lib/libcrypto/i386/aes-586.S Modified: head/ObsoleteFiles.inc head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/dgst.c head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.c head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/req.c head/crypto/openssl/apps/s_apps.h head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/storeutl.c head/crypto/openssl/config head/crypto/openssl/crypto/aes/asm/aes-s390x.pl head/crypto/openssl/crypto/asn1/a_time.c head/crypto/openssl/crypto/asn1/a_type.c head/crypto/openssl/crypto/asn1/x_bignum.c head/crypto/openssl/crypto/bio/b_addr.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bio/bss_file.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/bn/asm/mips.pl head/crypto/openssl/crypto/bn/bn_div.c head/crypto/openssl/crypto/bn/bn_lcl.h head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_prime.c head/crypto/openssl/crypto/bn/bn_rand.c head/crypto/openssl/crypto/bn/bn_sqrt.c head/crypto/openssl/crypto/cms/cms_att.c head/crypto/openssl/crypto/cms/cms_env.c head/crypto/openssl/crypto/cms/cms_err.c head/crypto/openssl/crypto/cms/cms_lcl.h head/crypto/openssl/crypto/cms/cms_sd.c head/crypto/openssl/crypto/cms/cms_smime.c head/crypto/openssl/crypto/conf/conf_sap.c head/crypto/openssl/crypto/ctype.c head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dh_gen.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dh/dh_lib.c head/crypto/openssl/crypto/dsa/dsa_ameth.c head/crypto/openssl/crypto/dsa/dsa_err.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl head/crypto/openssl/crypto/ec/asm/x25519-ppc64.pl head/crypto/openssl/crypto/ec/ec_asn1.c head/crypto/openssl/crypto/ec/ec_curve.c head/crypto/openssl/crypto/ec/ec_lcl.h head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ecdh_ossl.c head/crypto/openssl/crypto/ec/ecdsa_ossl.c head/crypto/openssl/crypto/ec/ecp_nistp224.c head/crypto/openssl/crypto/ec/ecp_nistp256.c head/crypto/openssl/crypto/ec/ecp_nistp521.c head/crypto/openssl/crypto/ec/ecp_nistputil.c head/crypto/openssl/crypto/ec/ecx_meth.c head/crypto/openssl/crypto/engine/eng_devcrypto.c head/crypto/openssl/crypto/engine/eng_openssl.c head/crypto/openssl/crypto/err/err.c head/crypto/openssl/crypto/err/openssl.txt head/crypto/openssl/crypto/evp/bio_ok.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_aria.c head/crypto/openssl/crypto/evp/e_chacha20_poly1305.c head/crypto/openssl/crypto/evp/e_rc5.c head/crypto/openssl/crypto/evp/evp_err.c head/crypto/openssl/crypto/evp/evp_lib.c head/crypto/openssl/crypto/evp/m_sha3.c head/crypto/openssl/crypto/include/internal/ctype.h head/crypto/openssl/crypto/include/internal/rand_int.h head/crypto/openssl/crypto/include/internal/sm2err.h head/crypto/openssl/crypto/init.c head/crypto/openssl/crypto/lhash/lhash.c head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/pem/pvkfmt.c head/crypto/openssl/crypto/pkcs7/pk7_doit.c head/crypto/openssl/crypto/rand/drbg_lib.c head/crypto/openssl/crypto/rand/rand_err.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/rsa/rsa_err.c head/crypto/openssl/crypto/rsa/rsa_gen.c head/crypto/openssl/crypto/rsa/rsa_lib.c head/crypto/openssl/crypto/rsa/rsa_ossl.c head/crypto/openssl/crypto/s390xcap.c head/crypto/openssl/crypto/sha/asm/keccak1600-armv4.pl head/crypto/openssl/crypto/sha/asm/keccak1600-armv8.pl head/crypto/openssl/crypto/sha/asm/sha512-sparcv9.pl head/crypto/openssl/crypto/sm2/sm2_sign.c head/crypto/openssl/crypto/store/loader_file.c head/crypto/openssl/crypto/store/store_lib.c head/crypto/openssl/crypto/threads_none.c head/crypto/openssl/crypto/threads_pthread.c head/crypto/openssl/crypto/ui/ui_lib.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/uid.c head/crypto/openssl/crypto/whrlpool/wp_block.c head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/t_req.c head/crypto/openssl/crypto/x509/x509_att.c head/crypto/openssl/crypto/x509/x509_cmp.c head/crypto/openssl/crypto/x509/x509_err.c head/crypto/openssl/crypto/x509/x509_lu.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509v3/v3_alt.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/doc/HOWTO/proxy_certificates.txt head/crypto/openssl/doc/man1/engine.pod head/crypto/openssl/doc/man1/errstr.pod head/crypto/openssl/doc/man1/pkcs12.pod head/crypto/openssl/doc/man1/pkeyparam.pod head/crypto/openssl/doc/man1/s_client.pod head/crypto/openssl/doc/man1/s_server.pod head/crypto/openssl/doc/man3/ADMISSIONS.pod head/crypto/openssl/doc/man3/ASYNC_start_job.pod head/crypto/openssl/doc/man3/BIO_connect.pod head/crypto/openssl/doc/man3/BIO_f_ssl.pod head/crypto/openssl/doc/man3/BIO_find_type.pod head/crypto/openssl/doc/man3/BIO_new.pod head/crypto/openssl/doc/man3/BIO_s_accept.pod head/crypto/openssl/doc/man3/BIO_s_bio.pod head/crypto/openssl/doc/man3/BIO_s_connect.pod head/crypto/openssl/doc/man3/BIO_s_fd.pod head/crypto/openssl/doc/man3/BIO_s_mem.pod head/crypto/openssl/doc/man3/BIO_set_callback.pod head/crypto/openssl/doc/man3/BN_generate_prime.pod head/crypto/openssl/doc/man3/BN_mod_mul_montgomery.pod head/crypto/openssl/doc/man3/BN_new.pod head/crypto/openssl/doc/man3/CMS_final.pod head/crypto/openssl/doc/man3/CRYPTO_THREAD_run_once.pod head/crypto/openssl/doc/man3/DES_random_key.pod head/crypto/openssl/doc/man3/DSA_generate_key.pod head/crypto/openssl/doc/man3/DSA_sign.pod head/crypto/openssl/doc/man3/ECDSA_SIG_new.pod head/crypto/openssl/doc/man3/EVP_DigestInit.pod head/crypto/openssl/doc/man3/EVP_DigestSignInit.pod head/crypto/openssl/doc/man3/EVP_DigestVerifyInit.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_decrypt.pod head/crypto/openssl/doc/man3/EVP_PKEY_derive.pod head/crypto/openssl/doc/man3/EVP_PKEY_encrypt.pod head/crypto/openssl/doc/man3/EVP_PKEY_sign.pod head/crypto/openssl/doc/man3/EVP_PKEY_verify.pod head/crypto/openssl/doc/man3/EVP_PKEY_verify_recover.pod head/crypto/openssl/doc/man3/EVP_SealInit.pod head/crypto/openssl/doc/man3/EVP_SignInit.pod head/crypto/openssl/doc/man3/EVP_VerifyInit.pod head/crypto/openssl/doc/man3/EVP_aria.pod head/crypto/openssl/doc/man3/EVP_md5.pod head/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod head/crypto/openssl/doc/man3/OCSP_REQUEST_new.pod head/crypto/openssl/doc/man3/OPENSSL_fork_prepare.pod head/crypto/openssl/doc/man3/OSSL_STORE_LOADER.pod head/crypto/openssl/doc/man3/OSSL_STORE_expect.pod head/crypto/openssl/doc/man3/PKCS12_newpass.pod head/crypto/openssl/doc/man3/RAND_DRBG_set_callbacks.pod head/crypto/openssl/doc/man3/RAND_set_rand_method.pod head/crypto/openssl/doc/man3/RSA_blinding_on.pod head/crypto/openssl/doc/man3/RSA_generate_key.pod head/crypto/openssl/doc/man3/RSA_padding_add_PKCS1_type_1.pod head/crypto/openssl/doc/man3/RSA_public_encrypt.pod head/crypto/openssl/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod head/crypto/openssl/doc/man3/SSL_CTX_config.pod head/crypto/openssl/doc/man3/SSL_CTX_dane_enable.pod head/crypto/openssl/doc/man3/SSL_CTX_get0_param.pod head/crypto/openssl/doc/man3/SSL_CTX_new.pod head/crypto/openssl/doc/man3/SSL_CTX_set_cipher_list.pod head/crypto/openssl/doc/man3/SSL_CTX_set_generate_session_id.pod head/crypto/openssl/doc/man3/SSL_CTX_set_session_id_context.pod head/crypto/openssl/doc/man3/SSL_CTX_set_verify.pod head/crypto/openssl/doc/man3/SSL_SESSION_get0_hostname.pod head/crypto/openssl/doc/man3/SSL_get_error.pod head/crypto/openssl/doc/man3/SSL_library_init.pod head/crypto/openssl/doc/man3/SSL_set1_host.pod head/crypto/openssl/doc/man3/SSL_write.pod head/crypto/openssl/doc/man3/X509_STORE_CTX_get_error.pod head/crypto/openssl/doc/man3/X509_STORE_CTX_set_verify_cb.pod head/crypto/openssl/doc/man3/X509_STORE_add_cert.pod head/crypto/openssl/doc/man3/X509_STORE_new.pod head/crypto/openssl/doc/man3/X509_VERIFY_PARAM_set_flags.pod head/crypto/openssl/doc/man3/X509_get_extension_flags.pod head/crypto/openssl/doc/man3/d2i_X509.pod head/crypto/openssl/doc/man5/x509v3_config.pod head/crypto/openssl/doc/man7/Ed25519.pod head/crypto/openssl/doc/man7/RAND.pod head/crypto/openssl/doc/man7/SM2.pod head/crypto/openssl/doc/man7/X25519.pod head/crypto/openssl/doc/man7/bio.pod head/crypto/openssl/doc/man7/scrypt.pod head/crypto/openssl/e_os.h head/crypto/openssl/engines/build.info head/crypto/openssl/engines/e_afalg.c head/crypto/openssl/include/internal/constant_time_locl.h head/crypto/openssl/include/internal/cryptlib.h head/crypto/openssl/include/internal/dsoerr.h head/crypto/openssl/include/internal/refcount.h head/crypto/openssl/include/internal/thread_once.h head/crypto/openssl/include/internal/tsan_assist.h head/crypto/openssl/include/openssl/asn1err.h head/crypto/openssl/include/openssl/asyncerr.h head/crypto/openssl/include/openssl/bio.h head/crypto/openssl/include/openssl/bioerr.h head/crypto/openssl/include/openssl/bnerr.h head/crypto/openssl/include/openssl/buffererr.h head/crypto/openssl/include/openssl/cms.h head/crypto/openssl/include/openssl/cmserr.h head/crypto/openssl/include/openssl/comperr.h head/crypto/openssl/include/openssl/conferr.h head/crypto/openssl/include/openssl/cryptoerr.h head/crypto/openssl/include/openssl/cterr.h head/crypto/openssl/include/openssl/dherr.h head/crypto/openssl/include/openssl/dsaerr.h head/crypto/openssl/include/openssl/ec.h head/crypto/openssl/include/openssl/ecerr.h head/crypto/openssl/include/openssl/engineerr.h head/crypto/openssl/include/openssl/evp.h head/crypto/openssl/include/openssl/evperr.h head/crypto/openssl/include/openssl/kdferr.h head/crypto/openssl/include/openssl/objectserr.h head/crypto/openssl/include/openssl/ocsperr.h head/crypto/openssl/include/openssl/opensslv.h head/crypto/openssl/include/openssl/pemerr.h head/crypto/openssl/include/openssl/pkcs12err.h head/crypto/openssl/include/openssl/pkcs7err.h head/crypto/openssl/include/openssl/randerr.h head/crypto/openssl/include/openssl/rsaerr.h head/crypto/openssl/include/openssl/ssl.h head/crypto/openssl/include/openssl/sslerr.h head/crypto/openssl/include/openssl/store.h head/crypto/openssl/include/openssl/storeerr.h head/crypto/openssl/include/openssl/tls1.h head/crypto/openssl/include/openssl/tserr.h head/crypto/openssl/include/openssl/uierr.h head/crypto/openssl/include/openssl/x509err.h head/crypto/openssl/include/openssl/x509v3.h head/crypto/openssl/include/openssl/x509v3err.h head/crypto/openssl/ssl/d1_msg.c head/crypto/openssl/ssl/record/rec_layer_s3.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_sess.c head/crypto/openssl/ssl/statem/extensions.c head/crypto/openssl/ssl/statem/extensions_clnt.c head/crypto/openssl/ssl/statem/extensions_srvr.c head/crypto/openssl/ssl/statem/statem_clnt.c head/crypto/openssl/ssl/statem/statem_lib.c head/crypto/openssl/ssl/statem/statem_srvr.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls13_enc.c head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/Version.map head/secure/lib/libcrypto/aarch64/keccak1600-armv8.S head/secure/lib/libcrypto/arm/keccak1600-armv4.S head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/engine.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/list.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/prime.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/srp.1 head/secure/usr.bin/openssl/man/storeutl.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Sep 10 20:55:47 2019 (r352190) +++ head/ObsoleteFiles.inc Tue Sep 10 21:08:17 2019 (r352191) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190910: OpenSSL 1.1.1d +OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz +OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz # 20190910: mklocale(1) and colldef(1) removed OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/CHANGES Tue Sep 10 21:08:17 2019 (r352191) @@ -7,6 +7,101 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1c and 1.1.1d [10 Sep 2019] + + *) Fixed a fork protection issue. OpenSSL 1.1.1 introduced a rewritten random + number generator (RNG). This was intended to include protection in the + event of a fork() system call in order to ensure that the parent and child + processes did not share the same RNG state. However this protection was not + being used in the default case. + + A partial mitigation for this issue is that the output from a high + precision timer is mixed into the RNG state so the likelihood of a parent + and child process sharing state is significantly reduced. + + If an application already calls OPENSSL_init_crypto() explicitly using + OPENSSL_INIT_ATFORK then this problem does not occur at all. + (CVE-2019-1549) + [Matthias St. Pierre] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems. The RAND subsystem will wait for + /dev/random to be producing output before seeding from /dev/urandom. + The seeded state is stored for future library initialisations using + a system global shared memory segment. The shared memory identifier + can be configured by defining OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID to + the desired value. The default identifier is 114. + [Paul Dale] + + *) Correct the extended master secret constant on EBCDIC systems. Without this + fix TLS connections between an EBCDIC system and a non-EBCDIC system that + negotiate EMS will fail. Unfortunately this also means that TLS connections + between EBCDIC systems with this fix, and EBCDIC systems without this + fix will fail if they negotiate EMS. + [Matt Caswell] + + *) Use Windows installation paths in the mingw builds + + Mingw isn't a POSIX environment per se, which means that Windows + paths should be used for installation. + (CVE-2019-1552) + [Richard Levitte] + + *) Changed DH_check to accept parameters with order q and 2q subgroups. + With order 2q subgroups the bit 0 of the private key is not secret + but DH_generate_key works around that by clearing bit 0 of the + private key for those. This avoids leaking bit 0 of the private key. + [Bernd Edlinger] + + *) Significantly reduce secure memory usage by the randomness pools. + [Paul Dale] + + *) Revert the DEVRANDOM_WAIT feature for Linux systems + + The DEVRANDOM_WAIT feature added a select() call to wait for the + /dev/random device to become readable before reading from the + /dev/urandom device. + + It turned out that this change had negative side effects on + performance which were not acceptable. After some discussion it + was decided to revert this feature and leave it up to the OS + resp. the platform maintainer to ensure a proper initialization + during early boot time. + [Matthias St. Pierre] + Changes between 1.1.1b and 1.1.1c [28 May 2019] *) Add build tests for C++. These are generated files that only do one @@ -75,6 +170,16 @@ (CVE-2019-1543) [Matt Caswell] + *) Add DEVRANDOM_WAIT feature for Linux systems + + On older Linux systems where the getrandom() system call is not available, + OpenSSL normally uses the /dev/urandom device for seeding its CSPRNG. + Contrary to getrandom(), the /dev/urandom device will not block during + early boot when the kernel CSPRNG has not been seeded yet. + + To mitigate this known weakness, use select() to wait for /dev/random to + become readable before reading from /dev/urandom. + *) Ensure that SM2 only uses SM3 as digest algorithm [Paul Yang] @@ -322,7 +427,7 @@ SSL_set_ciphersuites() [Matt Caswell] - *) Memory allocation failures consistenly add an error to the error + *) Memory allocation failures consistently add an error to the error stack. [Rich Salz] @@ -6860,7 +6965,7 @@ reason texts, thereby removing some of the footprint that may not be interesting if those errors aren't displayed anyway. - NOTE: it's still possible for any application or module to have it's + NOTE: it's still possible for any application or module to have its own set of error texts inserted. The routines are there, just not used by default when no-err is given. [Richard Levitte] @@ -8826,7 +8931,7 @@ des-cbc 3624.96k 5258.21k 5530.91k Changes between 0.9.6g and 0.9.6h [5 Dec 2002] *) New function OPENSSL_cleanse(), which is used to cleanse a section of - memory from it's contents. This is done with a counter that will + memory from its contents. This is done with a counter that will place alternating values in each byte. This can be used to solve two issues: 1) the removal of calls to memset() by highly optimizing compilers, and 2) cleansing with other values than 0, since those can Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/Configure Tue Sep 10 21:08:17 2019 (r352191) @@ -87,9 +87,6 @@ my $usage="Usage: Configure [no- ...] [enable- # linked openssl executable has rather debugging value than # production quality. # -# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items -# provided to stack calls. Generates unique stack functions for -# each possible stack type. # BN_LLONG use the type 'long long' in crypto/bn/bn.h # RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h # Following are set automatically by this script @@ -145,13 +142,13 @@ my @gcc_devteam_warn = qw( # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc # -Wextended-offsetof -- no, needed in CMS ASN1 code my @clang_devteam_warn = qw( + -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers - -Wno-unknown-warning-option -Wmissing-variable-declarations ); Modified: head/crypto/openssl/INSTALL ============================================================================== --- head/crypto/openssl/INSTALL Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/INSTALL Tue Sep 10 21:08:17 2019 (r352191) @@ -98,6 +98,9 @@ $ nmake test $ nmake install + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + If any of these steps fails, see section Installation in Detail below. This will build and install OpenSSL in the default location, which is: @@ -107,6 +110,12 @@ OpenSSL version number with underscores instead of periods. Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or install + engines. If you already have a pre-installed version of OpenSSL as part of + your Operating System it is recommended that you do not overwrite the system + version and instead install to somewhere else. + If you want to install it anywhere else, run config like this: On Unix: @@ -135,7 +144,10 @@ Don't build with support for deprecated APIs below the specified version number. For example "--api=1.1.0" will remove support for all APIS that were deprecated in OpenSSL - version 1.1.0 or below. + version 1.1.0 or below. This is a rather specialized option + for developers. If you just intend to remove all deprecated + APIs entirely (up to the current version), it is easier + to add the 'no-deprecated' option instead (see below). --cross-compile-prefix=PREFIX The PREFIX to include in front of commands for your @@ -229,7 +241,7 @@ source exists. getrandom: Use the L or equivalent system call. - devrandom: Use the the first device from the DEVRANDOM list + devrandom: Use the first device from the DEVRANDOM list which can be opened to read random bytes. The DEVRANDOM preprocessor constant expands to "/dev/urandom","/dev/random","/dev/srandom" on @@ -908,8 +920,11 @@ $ mms install ! OpenVMS $ nmake install # Windows - This will install all the software components in this directory - tree under PREFIX (the directory given with --prefix or its + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + + The above commands will install all the software components in this + directory tree under PREFIX (the directory given with --prefix or its default): Unix: @@ -964,6 +979,12 @@ private Initially empty, this is the default location for private key files. misc Various scripts. + + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or + install engines. If you already have a pre-installed version of OpenSSL as + part of your Operating System it is recommended that you do not overwrite + the system version and instead install to somewhere else. Package builders who want to configure the library for standard locations, but have the package installed somewhere else so that Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/NEWS Tue Sep 10 21:08:17 2019 (r352191) @@ -5,6 +5,23 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019] + + o Fixed a fork protection issue (CVE-2019-1549) + o Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey + (CVE-2019-1563) + o For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters + o Compute ECC cofactors if not provided during EC_GROUP construction + (CVE-2019-1547) + o Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems + o Correct the extended master secret constant on EBCDIC systems + o Use Windows installation paths in the mingw builds (CVE-2019-1552) + o Changed DH_check to accept parameters with order q and 2q subgroups + o Significantly reduce secure memory usage by the randomness pools + o Revert the DEVRANDOM_WAIT feature for Linux systems + Major changes between OpenSSL 1.1.1b and OpenSSL 1.1.1c [28 May 2019] o Prevent over long nonces in ChaCha20-Poly1305 (CVE-2019-1543) @@ -601,7 +618,7 @@ Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]: - o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build. + o Give EVP_MAX_MD_SIZE its old value, except for a FIPS build. Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]: Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/README Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1c 28 May 2019 + OpenSSL 1.1.1d 10 Sep 2019 Copyright (c) 1998-2019 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/apps.c Tue Sep 10 21:08:17 2019 (r352191) @@ -40,12 +40,19 @@ #endif #include #include -#include "s_apps.h" #include "apps.h" #ifdef _WIN32 static int WIN32_rename(const char *from, const char *to); # define rename(from,to) WIN32_rename((from),(to)) +#endif + +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) +# include +#endif + +#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) +# define _kbhit kbhit #endif typedef struct { Modified: head/crypto/openssl/apps/apps.h ============================================================================== --- head/crypto/openssl/apps/apps.h Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/apps.h Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -444,11 +444,9 @@ void destroy_ui_method(void); const UI_METHOD *get_ui_method(void); int chopup_args(ARGS *arg, char *buf); -# ifdef HEADER_X509_H int dump_cert_text(BIO *out, X509 *x); void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags); -# endif void print_bignum_var(BIO *, const BIGNUM *, const char*, int, unsigned char *); void print_array(BIO *, const char *, int, const unsigned char *); Modified: head/crypto/openssl/apps/ca.c ============================================================================== --- head/crypto/openssl/apps/ca.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/ca.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -722,7 +722,7 @@ end_of_options: /*****************************************************************/ if (req || gencrl) { - if (spkac_file != NULL) { + if (spkac_file != NULL && outfile != NULL) { output_der = 1; batch = 1; } Modified: head/crypto/openssl/apps/dgst.c ============================================================================== --- head/crypto/openssl/apps/dgst.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/dgst.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -421,7 +421,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int s size_t len; int i; - for (;;) { + while (BIO_pending(bp) || !BIO_eof(bp)) { i = BIO_read(bp, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in %s\n", file); Modified: head/crypto/openssl/apps/enc.c ============================================================================== --- head/crypto/openssl/apps/enc.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/enc.c Tue Sep 10 21:08:17 2019 (r352191) @@ -586,7 +586,7 @@ int enc_main(int argc, char **argv) if (benc != NULL) wbio = BIO_push(benc, wbio); - for (;;) { + while (BIO_pending(rbio) || !BIO_eof(rbio)) { inl = BIO_read(rbio, (char *)buff, bsize); if (inl <= 0) break; Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/ocsp.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1416,9 +1416,11 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcb *q = '\0'; /* - * Skip "GET / HTTP..." requests often used by load-balancers + * Skip "GET / HTTP..." requests often used by load-balancers. Note: + * 'p' was incremented above to point to the first byte *after* the + * leading slash, so with 'GET / ' it is now an empty string. */ - if (p[1] == '\0') + if (p[0] == '\0') goto out; len = urldecode(p); Modified: head/crypto/openssl/apps/openssl.c ============================================================================== --- head/crypto/openssl/apps/openssl.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/openssl.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,7 +22,6 @@ # include #endif #include -#include "s_apps.h" /* Needed to get the other O_xxx flags. */ #ifdef OPENSSL_SYS_VMS # include Modified: head/crypto/openssl/apps/pkcs12.c ============================================================================== --- head/crypto/openssl/apps/pkcs12.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/pkcs12.c Tue Sep 10 21:08:17 2019 (r352191) @@ -838,7 +838,7 @@ static int alg_print(const X509_ALGOR *alg) goto done; } BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, " - "Block size(r): %ld, Paralelizm(p): %ld", + "Block size(r): %ld, Parallelism(p): %ld", ASN1_STRING_length(kdf->salt), ASN1_INTEGER_get(kdf->costParameter), ASN1_INTEGER_get(kdf->blockSize), Modified: head/crypto/openssl/apps/req.c ============================================================================== --- head/crypto/openssl/apps/req.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/req.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -881,9 +881,19 @@ int req_main(int argc, char **argv) if (text) { if (x509) - X509_print_ex(out, x509ss, get_nameopt(), reqflag); + ret = X509_print_ex(out, x509ss, get_nameopt(), reqflag); else - X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + ret = X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + + if (ret == 0) { + if (x509) + BIO_printf(bio_err, "Error printing certificate\n"); + else + BIO_printf(bio_err, "Error printing certificate request\n"); + + ERR_print_errors(bio_err); + goto end; + } } if (subject) { Modified: head/crypto/openssl/apps/s_apps.h ============================================================================== --- head/crypto/openssl/apps/s_apps.h Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/s_apps.h Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -9,14 +9,8 @@ #include -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -# include -#endif +#include -#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) -# define _kbhit kbhit -#endif - #define PORT "4433" #define PROTOCOL "tcp" @@ -24,17 +18,15 @@ typedef int (*do_server_cb)(int s, int stype, int prot int do_server(int *accept_sock, const char *host, const char *port, int family, int type, int protocol, do_server_cb cb, unsigned char *context, int naccept, BIO *bio_s_out); -#ifdef HEADER_X509_H + int verify_callback(int ok, X509_STORE_CTX *ctx); -#endif -#ifdef HEADER_SSL_H + int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file); int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key, STACK_OF(X509) *chain, int build_chain); int ssl_print_sigalgs(BIO *out, SSL *s); int ssl_print_point_formats(BIO *out, SSL *s); int ssl_print_groups(BIO *out, SSL *s, int noshared); -#endif int ssl_print_tmp_key(BIO *out, SSL *s); int init_client(int *sock, const char *host, const char *port, const char *bindhost, const char *bindport, @@ -44,13 +36,11 @@ int should_retry(int i); long bio_dump_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); -#ifdef HEADER_SSL_H void apps_ssl_info_callback(const SSL *s, int where, int ret); void msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); void tlsext_cb(SSL *s, int client_server, int type, const unsigned char *data, int len, void *arg); -#endif int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len); @@ -75,7 +65,6 @@ int args_excert(int option, SSL_EXCERT **pexc); int load_excert(SSL_EXCERT **pexc); void print_verify_detail(SSL *s, BIO *bio); void print_ssl_summary(SSL *s); -#ifdef HEADER_SSL_H int config_ctx(SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, SSL_CTX *ctx); int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, int crl_download); @@ -86,4 +75,3 @@ int ssl_load_stores(SSL_CTX *ctx, const char *vfyCApat void ssl_ctx_security_debug(SSL_CTX *ctx, int verbose); int set_keylog_file(SSL_CTX *ctx, const char *keylog_file); void print_ca_names(BIO *bio, SSL *s); -#endif Modified: head/crypto/openssl/apps/s_cb.c ============================================================================== --- head/crypto/openssl/apps/s_cb.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/s_cb.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1525,7 +1525,8 @@ void print_ca_names(BIO *bio, SSL *s) int i; if (sk == NULL || sk_X509_NAME_num(sk) == 0) { - BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); + if (!SSL_is_server(s)) + BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); return; } Modified: head/crypto/openssl/apps/s_client.c ============================================================================== --- head/crypto/openssl/apps/s_client.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/s_client.c Tue Sep 10 21:08:17 2019 (r352191) @@ -2345,7 +2345,7 @@ int s_client_main(int argc, char **argv) (void)BIO_flush(fbio); /* * The first line is the HTTP response. According to RFC 7230, - * it's formated exactly like this: + * it's formatted exactly like this: * * HTTP/d.d ddd Reason text\r\n */ Modified: head/crypto/openssl/apps/speed.c ============================================================================== --- head/crypto/openssl/apps/speed.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/speed.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1790,7 +1790,7 @@ int speed_main(int argc, char **argv) } buflen = lengths[size_num - 1]; - if (buflen < 36) /* size of random vector in RSA bencmark */ + if (buflen < 36) /* size of random vector in RSA benchmark */ buflen = 36; buflen += MAX_MISALIGNMENT + 1; loopargs[i].buf_malloc = app_malloc(buflen, "input buffer"); Modified: head/crypto/openssl/apps/storeutl.c ============================================================================== --- head/crypto/openssl/apps/storeutl.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/apps/storeutl.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -125,7 +125,7 @@ int storeutl_main(int argc, char *argv[]) } /* * If expected wasn't set at this point, it means the map - * isn't syncronised with the possible options leading here. + * isn't synchronised with the possible options leading here. */ OPENSSL_assert(expected != 0); } Modified: head/crypto/openssl/config ============================================================================== --- head/crypto/openssl/config Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/config Tue Sep 10 21:08:17 2019 (r352191) @@ -498,12 +498,12 @@ case "$GUESSOS" in OUT="darwin64-x86_64-cc" fi ;; armv6+7-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20armv6 -arch%20armv7" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20armv6 -arch%20armv7" + __CNF_CFLAGS="$__CNF_CFLAGS -arch armv6 -arch armv7" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch armv6 -arch armv7" OUT="iphoneos-cross" ;; *-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20${MACHINE}" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20${MACHINE}" + __CNF_CFLAGS="$__CNF_CFLAGS -arch ${MACHINE}" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch ${MACHINE}" OUT="iphoneos-cross" ;; arm64-*-iphoneos|*-*-ios64) OUT="ios64-cross" ;; Modified: head/crypto/openssl/crypto/aes/asm/aes-s390x.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -38,14 +38,14 @@ # Implement AES_set_[en|de]crypt_key. Key schedule setup is avoided # for 128-bit keys, if hardware support is detected. -# Januray 2009. +# January 2009. # # Add support for hardware AES192/256 and reschedule instructions to # minimize/avoid Address Generation Interlock hazard and to favour # dual-issue z10 pipeline. This gave ~25% improvement on z10 and # almost 50% on z9. The gain is smaller on z10, because being dual- # issue z10 makes it impossible to eliminate the interlock condition: -# critial path is not long enough. Yet it spends ~24 cycles per byte +# critical path is not long enough. Yet it spends ~24 cycles per byte # processed with 128-bit key. # # Unlike previous version hardware support detection takes place only Modified: head/crypto/openssl/crypto/asn1/a_time.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_time.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/asn1/a_time.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,7 @@ static void determine_days(struct tm *tm) } c = y / 100; y %= 100; - /* Zeller's congruance */ + /* Zeller's congruence */ tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7; } @@ -79,7 +79,11 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) char *a; int n, i, i2, l, o, min_l = 11, strict = 0, end = 6, btz = 5, md; struct tm tmp; - +#if defined(CHARSET_EBCDIC) + const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B; +#else + const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+'; +#endif /* * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280 * time string format, in which: @@ -120,20 +124,20 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (l < min_l) goto err; for (i = 0; i < end; i++) { - if (!strict && (i == btz) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) { i++; break; } - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; /* incomplete 2-digital number */ if (++o == l) goto err; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; /* no more bytes to read, but we haven't seen time-zone yet */ if (++o == l) goto err; @@ -185,14 +189,14 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * Optional fractional seconds: decimal point followed by one or more * digits. */ - if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == '.') { + if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) { if (strict) /* RFC 5280 forbids fractional seconds */ goto err; if (++o == l) goto err; i = o; - while ((o < l) && ossl_isdigit(a[o])) + while ((o < l) && ascii_isdigit(a[o])) o++; /* Must have at least one digit after decimal point */ if (i == o) @@ -207,10 +211,10 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * 'o' can point to '\0' is either the subsequent if or the first * else if is true. */ - if (a[o] == 'Z') { + if (a[o] == upper_z) { o++; - } else if (!strict && ((a[o] == '+') || (a[o] == '-'))) { - int offsign = a[o] == '-' ? 1 : -1; + } else if (!strict && ((a[o] == plus) || (a[o] == minus))) { + int offsign = a[o] == minus ? 1 : -1; int offset = 0; o++; @@ -223,13 +227,13 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (o + 4 != l) goto err; for (i = end; i < end + 2; i++) { - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; o++; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i; if ((n < min[i2]) || (n > max[i2])) goto err; @@ -300,7 +304,7 @@ ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm * ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec); -#ifdef CHARSET_EBCDIC_not +#ifdef CHARSET_EBCDIC ebcdic2ascii(tmps->data, tmps->data, tmps->length); #endif return tmps; @@ -467,6 +471,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) char *v; int gmt = 0, l; struct tm stm; + const char upper_z = 0x5A, period = 0x2E; if (!asn1_time_to_tm(&stm, tm)) { /* asn1_time_to_tm will check the time type */ @@ -475,7 +480,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) l = tm->length; v = (char *)tm->data; - if (v[l - 1] == 'Z') + if (v[l - 1] == upper_z) gmt = 1; if (tm->type == V_ASN1_GENERALIZEDTIME) { @@ -486,10 +491,10 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) * Try to parse fractional seconds. '14' is the place of * 'fraction point' in a GeneralizedTime string. */ - if (tm->length > 15 && v[14] == '.') { + if (tm->length > 15 && v[14] == period) { f = &v[14]; f_len = 1; - while (14 + f_len < l && ossl_isdigit(f[f_len])) + while (14 + f_len < l && ascii_isdigit(f[f_len])) ++f_len; } Modified: head/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_type.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/asn1/a_type.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,7 +15,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) { - if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) + if (a->type == V_ASN1_BOOLEAN + || a->type == V_ASN1_NULL + || a->value.ptr != NULL) return a->type; else return 0; @@ -23,7 +25,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) { - if (a->value.ptr != NULL) { + if (a->type != V_ASN1_BOOLEAN + && a->type != V_ASN1_NULL + && a->value.ptr != NULL) { ASN1_TYPE **tmp_a = &a; asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0); } Modified: head/crypto/openssl/crypto/asn1/x_bignum.c ============================================================================== --- head/crypto/openssl/crypto/asn1/x_bignum.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/asn1/x_bignum.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -130,9 +130,20 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned ch static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) { - if (!*pval) - bn_secure_new(pval, it); - return bn_c2i(pval, cont, len, utype, free_cont, it); + int ret; + BIGNUM *bn; + + if (!*pval && !bn_secure_new(pval, it)) + return 0; + + ret = bn_c2i(pval, cont, len, utype, free_cont, it); + if (!ret) + return 0; + + /* Set constant-time flag for all secure BIGNUMS */ + bn = (BIGNUM *)*pval; + BN_set_flags(bn, BN_FLG_CONSTTIME); + return ret; } static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, Modified: head/crypto/openssl/crypto/bio/b_addr.c ============================================================================== --- head/crypto/openssl/crypto/bio/b_addr.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/bio/b_addr.c Tue Sep 10 21:08:17 2019 (r352191) @@ -675,7 +675,7 @@ int BIO_lookup_ex(const char *host, const char *servic if (1) { #ifdef AI_PASSIVE - int gai_ret = 0; + int gai_ret = 0, old_ret = 0; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); @@ -683,12 +683,12 @@ int BIO_lookup_ex(const char *host, const char *servic hints.ai_family = family; hints.ai_socktype = socktype; hints.ai_protocol = protocol; -#ifdef AI_ADDRCONFIG -#ifdef AF_UNSPEC +# ifdef AI_ADDRCONFIG +# ifdef AF_UNSPEC if (family == AF_UNSPEC) -#endif +# endif hints.ai_flags |= AI_ADDRCONFIG; -#endif +# endif if (lookup_type == BIO_LOOKUP_SERVER) hints.ai_flags |= AI_PASSIVE; @@ -696,6 +696,7 @@ int BIO_lookup_ex(const char *host, const char *servic /* Note that |res| SHOULD be a 'struct addrinfo **' thanks to * macro magic in bio_lcl.h */ + retry: switch ((gai_ret = getaddrinfo(host, service, &hints, res))) { # ifdef EAI_SYSTEM case EAI_SYSTEM: @@ -703,12 +704,25 @@ int BIO_lookup_ex(const char *host, const char *servic BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); break; # endif +# ifdef EAI_MEMORY + case EAI_MEMORY: + BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_MALLOC_FAILURE); + break; +# endif case 0: ret = 1; /* Success */ break; default: +# if defined(AI_ADDRCONFIG) && defined(AI_NUMERICHOST) + if (hints.ai_flags & AI_ADDRCONFIG) { + hints.ai_flags &= ~AI_ADDRCONFIG; + hints.ai_flags |= AI_NUMERICHOST; + old_ret = gai_ret; + goto retry; + } +# endif BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); - ERR_add_error_data(1, gai_strerror(gai_ret)); + ERR_add_error_data(1, gai_strerror(old_ret ? old_ret : gai_ret)); break; } } else { Modified: head/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_dgram.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/bio/bss_dgram.c Tue Sep 10 21:08:17 2019 (r352191) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -784,7 +784,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void * reasons. When BIO_CTRL_DGRAM_SET_PEEK_MODE was first defined its value * was incorrectly clashing with BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. The * value has been updated to a non-clashing value. However to preserve - * binary compatiblity we now respond to both the old value and the new one + * binary compatibility we now respond to both the old value and the new one */ case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE: case BIO_CTRL_DGRAM_SET_PEEK_MODE: Modified: head/crypto/openssl/crypto/bio/bss_file.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_file.c Tue Sep 10 20:55:47 2019 (r352190) +++ head/crypto/openssl/crypto/bio/bss_file.c Tue Sep 10 21:08:17 2019 (r352191) @@ -7,10 +7,7 @@ * https://www.openssl.org/source/license.html */ -#ifndef HEADER_BSS_FILE_C -# define HEADER_BSS_FILE_C - -# if defined(__linux) || defined(__sun) || defined(__hpux) +#if defined(__linux) || defined(__sun) || defined(__hpux) /* * Following definition aliases fopen to fopen64 on above mentioned * platforms. This makes it possible to open and sequentially access files @@ -23,17 +20,17 @@ * of 32-bit platforms which allow for sequential access of large files * without extra "magic" comprise *BSD, Darwin, IRIX... */ -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 # endif +#endif -# include -# include -# include "bio_lcl.h" -# include +#include +#include +#include "bio_lcl.h" +#include -# if !defined(OPENSSL_NO_STDIO) +#if !defined(OPENSSL_NO_STDIO) static int file_write(BIO *h, const char *buf, int num); static int file_read(BIO *h, char *buf, int size); @@ -72,9 +69,9 @@ BIO *BIO_new_file(const char *filename, const char *mo SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); if (errno == ENOENT -# ifdef ENXIO +#ifdef ENXIO || errno == ENXIO -# endif +#endif ) BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); else @@ -212,33 +209,33 @@ static long file_ctrl(BIO *b, int cmd, long num, void b->shutdown = (int)num & BIO_CLOSE; b->ptr = ptr; b->init = 1; -# if BIO_FLAGS_UPLINK!=0 -# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) -# define _IOB_ENTRIES 20 -# endif +# if BIO_FLAGS_UPLINK!=0 +# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) +# define _IOB_ENTRIES 20 +# endif /* Safety net to catch purely internal BIO_set_fp calls */ -# if defined(_MSC_VER) && _MSC_VER>=1900 +# if defined(_MSC_VER) && _MSC_VER>=1900 if (ptr == stdin || ptr == stdout || ptr == stderr) BIO_clear_flags(b, BIO_FLAGS_UPLINK); -# elif defined(_IOB_ENTRIES) +# elif defined(_IOB_ENTRIES) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 21:13:44 2019 Return-Path: Delivered-To: svn-src-all@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 57A33E4ADC; Tue, 10 Sep 2019 21:13:44 +0000 (UTC) (envelope-from jkim@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 46Sd7D2MBzz42t4; Tue, 10 Sep 2019 21:13:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 194AE2C17F; Tue, 10 Sep 2019 21:13:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ALDijN088314; Tue, 10 Sep 2019 21:13:44 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ALDceq088282; Tue, 10 Sep 2019 21:13:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909102113.x8ALDceq088282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 21:13: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: r352192 - in stable/12: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/cryp... X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/12: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/cryp... X-SVN-Commit-Revision: 352192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 21:13:44 -0000 Author: jkim Date: Tue Sep 10 21:13:37 2019 New Revision: 352192 URL: https://svnweb.freebsd.org/changeset/base/352192 Log: MFC: r352191 Merge OpenSSL 1.1.1d. Added: stable/12/crypto/openssl/doc/man3/CRYPTO_memcmp.pod - copied unchanged from r352191, head/crypto/openssl/doc/man3/CRYPTO_memcmp.pod stable/12/crypto/openssl/doc/man3/X509_cmp.pod - copied unchanged from r352191, head/crypto/openssl/doc/man3/X509_cmp.pod stable/12/secure/lib/libcrypto/man/CRYPTO_memcmp.3 - copied unchanged from r352191, head/secure/lib/libcrypto/man/CRYPTO_memcmp.3 stable/12/secure/lib/libcrypto/man/X509_cmp.3 - copied unchanged from r352191, head/secure/lib/libcrypto/man/X509_cmp.3 Deleted: stable/12/crypto/openssl/crypto/aes/asm/aes-586.pl stable/12/crypto/openssl/crypto/aes/asm/aes-x86_64.pl stable/12/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl stable/12/secure/lib/libcrypto/amd64/aes-x86_64.S stable/12/secure/lib/libcrypto/amd64/bsaes-x86_64.S stable/12/secure/lib/libcrypto/i386/aes-586.S Modified: stable/12/ObsoleteFiles.inc stable/12/crypto/openssl/CHANGES stable/12/crypto/openssl/Configure stable/12/crypto/openssl/INSTALL stable/12/crypto/openssl/NEWS stable/12/crypto/openssl/README stable/12/crypto/openssl/apps/apps.c stable/12/crypto/openssl/apps/apps.h stable/12/crypto/openssl/apps/ca.c stable/12/crypto/openssl/apps/dgst.c stable/12/crypto/openssl/apps/enc.c stable/12/crypto/openssl/apps/ocsp.c stable/12/crypto/openssl/apps/openssl.c stable/12/crypto/openssl/apps/pkcs12.c stable/12/crypto/openssl/apps/req.c stable/12/crypto/openssl/apps/s_apps.h stable/12/crypto/openssl/apps/s_cb.c stable/12/crypto/openssl/apps/s_client.c stable/12/crypto/openssl/apps/speed.c stable/12/crypto/openssl/apps/storeutl.c stable/12/crypto/openssl/config stable/12/crypto/openssl/crypto/aes/asm/aes-s390x.pl stable/12/crypto/openssl/crypto/asn1/a_time.c stable/12/crypto/openssl/crypto/asn1/a_type.c stable/12/crypto/openssl/crypto/asn1/x_bignum.c stable/12/crypto/openssl/crypto/bio/b_addr.c stable/12/crypto/openssl/crypto/bio/bss_dgram.c stable/12/crypto/openssl/crypto/bio/bss_file.c stable/12/crypto/openssl/crypto/bio/bss_mem.c stable/12/crypto/openssl/crypto/bn/asm/mips.pl stable/12/crypto/openssl/crypto/bn/bn_div.c stable/12/crypto/openssl/crypto/bn/bn_lcl.h stable/12/crypto/openssl/crypto/bn/bn_lib.c stable/12/crypto/openssl/crypto/bn/bn_prime.c stable/12/crypto/openssl/crypto/bn/bn_rand.c stable/12/crypto/openssl/crypto/bn/bn_sqrt.c stable/12/crypto/openssl/crypto/cms/cms_att.c stable/12/crypto/openssl/crypto/cms/cms_env.c stable/12/crypto/openssl/crypto/cms/cms_err.c stable/12/crypto/openssl/crypto/cms/cms_lcl.h stable/12/crypto/openssl/crypto/cms/cms_sd.c stable/12/crypto/openssl/crypto/cms/cms_smime.c stable/12/crypto/openssl/crypto/conf/conf_sap.c stable/12/crypto/openssl/crypto/ctype.c stable/12/crypto/openssl/crypto/dh/dh_check.c stable/12/crypto/openssl/crypto/dh/dh_gen.c stable/12/crypto/openssl/crypto/dh/dh_key.c stable/12/crypto/openssl/crypto/dh/dh_lib.c stable/12/crypto/openssl/crypto/dsa/dsa_ameth.c stable/12/crypto/openssl/crypto/dsa/dsa_err.c stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c stable/12/crypto/openssl/crypto/dso/dso_dlfcn.c stable/12/crypto/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl stable/12/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl stable/12/crypto/openssl/crypto/ec/asm/x25519-ppc64.pl stable/12/crypto/openssl/crypto/ec/ec_asn1.c stable/12/crypto/openssl/crypto/ec/ec_curve.c stable/12/crypto/openssl/crypto/ec/ec_lcl.h stable/12/crypto/openssl/crypto/ec/ec_lib.c stable/12/crypto/openssl/crypto/ec/ecdh_ossl.c stable/12/crypto/openssl/crypto/ec/ecdsa_ossl.c stable/12/crypto/openssl/crypto/ec/ecp_nistp224.c stable/12/crypto/openssl/crypto/ec/ecp_nistp256.c stable/12/crypto/openssl/crypto/ec/ecp_nistp521.c stable/12/crypto/openssl/crypto/ec/ecp_nistputil.c stable/12/crypto/openssl/crypto/ec/ecx_meth.c stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c stable/12/crypto/openssl/crypto/engine/eng_openssl.c stable/12/crypto/openssl/crypto/err/err.c stable/12/crypto/openssl/crypto/err/openssl.txt stable/12/crypto/openssl/crypto/evp/bio_ok.c stable/12/crypto/openssl/crypto/evp/e_aes.c stable/12/crypto/openssl/crypto/evp/e_aria.c stable/12/crypto/openssl/crypto/evp/e_chacha20_poly1305.c stable/12/crypto/openssl/crypto/evp/e_rc5.c stable/12/crypto/openssl/crypto/evp/evp_err.c stable/12/crypto/openssl/crypto/evp/evp_lib.c stable/12/crypto/openssl/crypto/evp/m_sha3.c stable/12/crypto/openssl/crypto/include/internal/ctype.h stable/12/crypto/openssl/crypto/include/internal/rand_int.h stable/12/crypto/openssl/crypto/include/internal/sm2err.h stable/12/crypto/openssl/crypto/init.c stable/12/crypto/openssl/crypto/lhash/lhash.c stable/12/crypto/openssl/crypto/o_str.c stable/12/crypto/openssl/crypto/pem/pvkfmt.c stable/12/crypto/openssl/crypto/pkcs7/pk7_doit.c stable/12/crypto/openssl/crypto/rand/drbg_lib.c stable/12/crypto/openssl/crypto/rand/rand_err.c stable/12/crypto/openssl/crypto/rand/rand_lcl.h stable/12/crypto/openssl/crypto/rand/rand_lib.c stable/12/crypto/openssl/crypto/rand/rand_unix.c stable/12/crypto/openssl/crypto/rsa/rsa_ameth.c stable/12/crypto/openssl/crypto/rsa/rsa_err.c stable/12/crypto/openssl/crypto/rsa/rsa_gen.c stable/12/crypto/openssl/crypto/rsa/rsa_lib.c stable/12/crypto/openssl/crypto/rsa/rsa_ossl.c stable/12/crypto/openssl/crypto/s390xcap.c stable/12/crypto/openssl/crypto/sha/asm/keccak1600-armv4.pl stable/12/crypto/openssl/crypto/sha/asm/keccak1600-armv8.pl stable/12/crypto/openssl/crypto/sha/asm/sha512-sparcv9.pl stable/12/crypto/openssl/crypto/sm2/sm2_sign.c stable/12/crypto/openssl/crypto/store/loader_file.c stable/12/crypto/openssl/crypto/store/store_lib.c stable/12/crypto/openssl/crypto/threads_none.c stable/12/crypto/openssl/crypto/threads_pthread.c stable/12/crypto/openssl/crypto/ui/ui_lib.c stable/12/crypto/openssl/crypto/ui/ui_openssl.c stable/12/crypto/openssl/crypto/uid.c stable/12/crypto/openssl/crypto/whrlpool/wp_block.c stable/12/crypto/openssl/crypto/x509/by_dir.c stable/12/crypto/openssl/crypto/x509/t_req.c stable/12/crypto/openssl/crypto/x509/x509_att.c stable/12/crypto/openssl/crypto/x509/x509_cmp.c stable/12/crypto/openssl/crypto/x509/x509_err.c stable/12/crypto/openssl/crypto/x509/x509_lu.c stable/12/crypto/openssl/crypto/x509/x509_vfy.c stable/12/crypto/openssl/crypto/x509v3/v3_alt.c stable/12/crypto/openssl/crypto/x509v3/v3_purp.c stable/12/crypto/openssl/doc/HOWTO/proxy_certificates.txt stable/12/crypto/openssl/doc/man1/engine.pod stable/12/crypto/openssl/doc/man1/errstr.pod stable/12/crypto/openssl/doc/man1/pkcs12.pod stable/12/crypto/openssl/doc/man1/pkeyparam.pod stable/12/crypto/openssl/doc/man1/s_client.pod stable/12/crypto/openssl/doc/man1/s_server.pod stable/12/crypto/openssl/doc/man3/ADMISSIONS.pod stable/12/crypto/openssl/doc/man3/ASYNC_start_job.pod stable/12/crypto/openssl/doc/man3/BIO_connect.pod stable/12/crypto/openssl/doc/man3/BIO_f_ssl.pod stable/12/crypto/openssl/doc/man3/BIO_find_type.pod stable/12/crypto/openssl/doc/man3/BIO_new.pod stable/12/crypto/openssl/doc/man3/BIO_s_accept.pod stable/12/crypto/openssl/doc/man3/BIO_s_bio.pod stable/12/crypto/openssl/doc/man3/BIO_s_connect.pod stable/12/crypto/openssl/doc/man3/BIO_s_fd.pod stable/12/crypto/openssl/doc/man3/BIO_s_mem.pod stable/12/crypto/openssl/doc/man3/BIO_set_callback.pod stable/12/crypto/openssl/doc/man3/BN_generate_prime.pod stable/12/crypto/openssl/doc/man3/BN_mod_mul_montgomery.pod stable/12/crypto/openssl/doc/man3/BN_new.pod stable/12/crypto/openssl/doc/man3/CMS_final.pod stable/12/crypto/openssl/doc/man3/CRYPTO_THREAD_run_once.pod stable/12/crypto/openssl/doc/man3/DES_random_key.pod stable/12/crypto/openssl/doc/man3/DSA_generate_key.pod stable/12/crypto/openssl/doc/man3/DSA_sign.pod stable/12/crypto/openssl/doc/man3/ECDSA_SIG_new.pod stable/12/crypto/openssl/doc/man3/EVP_DigestInit.pod stable/12/crypto/openssl/doc/man3/EVP_DigestSignInit.pod stable/12/crypto/openssl/doc/man3/EVP_DigestVerifyInit.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_decrypt.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_derive.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_encrypt.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_sign.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_verify.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_verify_recover.pod stable/12/crypto/openssl/doc/man3/EVP_SealInit.pod stable/12/crypto/openssl/doc/man3/EVP_SignInit.pod stable/12/crypto/openssl/doc/man3/EVP_VerifyInit.pod stable/12/crypto/openssl/doc/man3/EVP_aria.pod stable/12/crypto/openssl/doc/man3/EVP_md5.pod stable/12/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod stable/12/crypto/openssl/doc/man3/OCSP_REQUEST_new.pod stable/12/crypto/openssl/doc/man3/OPENSSL_fork_prepare.pod stable/12/crypto/openssl/doc/man3/OSSL_STORE_LOADER.pod stable/12/crypto/openssl/doc/man3/OSSL_STORE_expect.pod stable/12/crypto/openssl/doc/man3/PKCS12_newpass.pod stable/12/crypto/openssl/doc/man3/RAND_DRBG_set_callbacks.pod stable/12/crypto/openssl/doc/man3/RAND_set_rand_method.pod stable/12/crypto/openssl/doc/man3/RSA_blinding_on.pod stable/12/crypto/openssl/doc/man3/RSA_generate_key.pod stable/12/crypto/openssl/doc/man3/RSA_padding_add_PKCS1_type_1.pod stable/12/crypto/openssl/doc/man3/RSA_public_encrypt.pod stable/12/crypto/openssl/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_config.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_dane_enable.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_get0_param.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_new.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_cipher_list.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_generate_session_id.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_session_id_context.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_verify.pod stable/12/crypto/openssl/doc/man3/SSL_SESSION_get0_hostname.pod stable/12/crypto/openssl/doc/man3/SSL_get_error.pod stable/12/crypto/openssl/doc/man3/SSL_library_init.pod stable/12/crypto/openssl/doc/man3/SSL_set1_host.pod stable/12/crypto/openssl/doc/man3/SSL_write.pod stable/12/crypto/openssl/doc/man3/X509_STORE_CTX_get_error.pod stable/12/crypto/openssl/doc/man3/X509_STORE_CTX_set_verify_cb.pod stable/12/crypto/openssl/doc/man3/X509_STORE_add_cert.pod stable/12/crypto/openssl/doc/man3/X509_STORE_new.pod stable/12/crypto/openssl/doc/man3/X509_VERIFY_PARAM_set_flags.pod stable/12/crypto/openssl/doc/man3/X509_get_extension_flags.pod stable/12/crypto/openssl/doc/man3/d2i_X509.pod stable/12/crypto/openssl/doc/man5/x509v3_config.pod stable/12/crypto/openssl/doc/man7/Ed25519.pod stable/12/crypto/openssl/doc/man7/RAND.pod stable/12/crypto/openssl/doc/man7/SM2.pod stable/12/crypto/openssl/doc/man7/X25519.pod stable/12/crypto/openssl/doc/man7/bio.pod stable/12/crypto/openssl/doc/man7/scrypt.pod stable/12/crypto/openssl/e_os.h stable/12/crypto/openssl/engines/build.info stable/12/crypto/openssl/engines/e_afalg.c stable/12/crypto/openssl/include/internal/constant_time_locl.h stable/12/crypto/openssl/include/internal/cryptlib.h stable/12/crypto/openssl/include/internal/dsoerr.h stable/12/crypto/openssl/include/internal/refcount.h stable/12/crypto/openssl/include/internal/thread_once.h stable/12/crypto/openssl/include/internal/tsan_assist.h stable/12/crypto/openssl/include/openssl/asn1err.h stable/12/crypto/openssl/include/openssl/asyncerr.h stable/12/crypto/openssl/include/openssl/bio.h stable/12/crypto/openssl/include/openssl/bioerr.h stable/12/crypto/openssl/include/openssl/bnerr.h stable/12/crypto/openssl/include/openssl/buffererr.h stable/12/crypto/openssl/include/openssl/cms.h stable/12/crypto/openssl/include/openssl/cmserr.h stable/12/crypto/openssl/include/openssl/comperr.h stable/12/crypto/openssl/include/openssl/conferr.h stable/12/crypto/openssl/include/openssl/cryptoerr.h stable/12/crypto/openssl/include/openssl/cterr.h stable/12/crypto/openssl/include/openssl/dherr.h stable/12/crypto/openssl/include/openssl/dsaerr.h stable/12/crypto/openssl/include/openssl/ec.h stable/12/crypto/openssl/include/openssl/ecerr.h stable/12/crypto/openssl/include/openssl/engineerr.h stable/12/crypto/openssl/include/openssl/evp.h stable/12/crypto/openssl/include/openssl/evperr.h stable/12/crypto/openssl/include/openssl/kdferr.h stable/12/crypto/openssl/include/openssl/objectserr.h stable/12/crypto/openssl/include/openssl/ocsperr.h stable/12/crypto/openssl/include/openssl/opensslv.h stable/12/crypto/openssl/include/openssl/pemerr.h stable/12/crypto/openssl/include/openssl/pkcs12err.h stable/12/crypto/openssl/include/openssl/pkcs7err.h stable/12/crypto/openssl/include/openssl/randerr.h stable/12/crypto/openssl/include/openssl/rsaerr.h stable/12/crypto/openssl/include/openssl/ssl.h stable/12/crypto/openssl/include/openssl/sslerr.h stable/12/crypto/openssl/include/openssl/store.h stable/12/crypto/openssl/include/openssl/storeerr.h stable/12/crypto/openssl/include/openssl/tls1.h stable/12/crypto/openssl/include/openssl/tserr.h stable/12/crypto/openssl/include/openssl/uierr.h stable/12/crypto/openssl/include/openssl/x509err.h stable/12/crypto/openssl/include/openssl/x509v3.h stable/12/crypto/openssl/include/openssl/x509v3err.h stable/12/crypto/openssl/ssl/d1_msg.c stable/12/crypto/openssl/ssl/record/rec_layer_s3.c stable/12/crypto/openssl/ssl/s3_lib.c stable/12/crypto/openssl/ssl/ssl_cert.c stable/12/crypto/openssl/ssl/ssl_ciph.c stable/12/crypto/openssl/ssl/ssl_lib.c stable/12/crypto/openssl/ssl/ssl_locl.h stable/12/crypto/openssl/ssl/ssl_sess.c stable/12/crypto/openssl/ssl/statem/extensions.c stable/12/crypto/openssl/ssl/statem/extensions_clnt.c stable/12/crypto/openssl/ssl/statem/extensions_srvr.c stable/12/crypto/openssl/ssl/statem/statem_clnt.c stable/12/crypto/openssl/ssl/statem/statem_lib.c stable/12/crypto/openssl/ssl/statem/statem_srvr.c stable/12/crypto/openssl/ssl/t1_lib.c stable/12/crypto/openssl/ssl/tls13_enc.c stable/12/secure/lib/libcrypto/Makefile stable/12/secure/lib/libcrypto/Makefile.asm stable/12/secure/lib/libcrypto/Makefile.inc stable/12/secure/lib/libcrypto/Makefile.man stable/12/secure/lib/libcrypto/Version.map stable/12/secure/lib/libcrypto/aarch64/keccak1600-armv8.S stable/12/secure/lib/libcrypto/arm/keccak1600-armv4.S stable/12/secure/lib/libcrypto/man/ADMISSIONS.3 stable/12/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 stable/12/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 stable/12/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/12/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/12/secure/lib/libcrypto/man/ASN1_TYPE_get.3 stable/12/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/12/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 stable/12/secure/lib/libcrypto/man/ASYNC_start_job.3 stable/12/secure/lib/libcrypto/man/BF_encrypt.3 stable/12/secure/lib/libcrypto/man/BIO_ADDR.3 stable/12/secure/lib/libcrypto/man/BIO_ADDRINFO.3 stable/12/secure/lib/libcrypto/man/BIO_connect.3 stable/12/secure/lib/libcrypto/man/BIO_ctrl.3 stable/12/secure/lib/libcrypto/man/BIO_f_base64.3 stable/12/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/12/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/12/secure/lib/libcrypto/man/BIO_f_md.3 stable/12/secure/lib/libcrypto/man/BIO_f_null.3 stable/12/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/12/secure/lib/libcrypto/man/BIO_find_type.3 stable/12/secure/lib/libcrypto/man/BIO_get_data.3 stable/12/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/BIO_meth_new.3 stable/12/secure/lib/libcrypto/man/BIO_new.3 stable/12/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/12/secure/lib/libcrypto/man/BIO_parse_hostserv.3 stable/12/secure/lib/libcrypto/man/BIO_printf.3 stable/12/secure/lib/libcrypto/man/BIO_push.3 stable/12/secure/lib/libcrypto/man/BIO_read.3 stable/12/secure/lib/libcrypto/man/BIO_s_accept.3 stable/12/secure/lib/libcrypto/man/BIO_s_bio.3 stable/12/secure/lib/libcrypto/man/BIO_s_connect.3 stable/12/secure/lib/libcrypto/man/BIO_s_fd.3 stable/12/secure/lib/libcrypto/man/BIO_s_file.3 stable/12/secure/lib/libcrypto/man/BIO_s_mem.3 stable/12/secure/lib/libcrypto/man/BIO_s_null.3 stable/12/secure/lib/libcrypto/man/BIO_s_socket.3 stable/12/secure/lib/libcrypto/man/BIO_set_callback.3 stable/12/secure/lib/libcrypto/man/BIO_should_retry.3 stable/12/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_start.3 stable/12/secure/lib/libcrypto/man/BN_add.3 stable/12/secure/lib/libcrypto/man/BN_add_word.3 stable/12/secure/lib/libcrypto/man/BN_bn2bin.3 stable/12/secure/lib/libcrypto/man/BN_cmp.3 stable/12/secure/lib/libcrypto/man/BN_copy.3 stable/12/secure/lib/libcrypto/man/BN_generate_prime.3 stable/12/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/12/secure/lib/libcrypto/man/BN_new.3 stable/12/secure/lib/libcrypto/man/BN_num_bytes.3 stable/12/secure/lib/libcrypto/man/BN_rand.3 stable/12/secure/lib/libcrypto/man/BN_security_bits.3 stable/12/secure/lib/libcrypto/man/BN_set_bit.3 stable/12/secure/lib/libcrypto/man/BN_swap.3 stable/12/secure/lib/libcrypto/man/BN_zero.3 stable/12/secure/lib/libcrypto/man/BUF_MEM_new.3 stable/12/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/12/secure/lib/libcrypto/man/CMS_compress.3 stable/12/secure/lib/libcrypto/man/CMS_decrypt.3 stable/12/secure/lib/libcrypto/man/CMS_encrypt.3 stable/12/secure/lib/libcrypto/man/CMS_final.3 stable/12/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_type.3 stable/12/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/12/secure/lib/libcrypto/man/CMS_sign.3 stable/12/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/12/secure/lib/libcrypto/man/CMS_uncompress.3 stable/12/secure/lib/libcrypto/man/CMS_verify.3 stable/12/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/12/secure/lib/libcrypto/man/CONF_modules_free.3 stable/12/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/12/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 stable/12/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_new.3 stable/12/secure/lib/libcrypto/man/CTLOG_new.3 stable/12/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 stable/12/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 stable/12/secure/lib/libcrypto/man/DES_random_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DH_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DH_get_1024_160.3 stable/12/secure/lib/libcrypto/man/DH_meth_new.3 stable/12/secure/lib/libcrypto/man/DH_new.3 stable/12/secure/lib/libcrypto/man/DH_new_by_nid.3 stable/12/secure/lib/libcrypto/man/DH_set_method.3 stable/12/secure/lib/libcrypto/man/DH_size.3 stable/12/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/DSA_do_sign.3 stable/12/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/12/secure/lib/libcrypto/man/DSA_generate_key.3 stable/12/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DSA_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DSA_meth_new.3 stable/12/secure/lib/libcrypto/man/DSA_new.3 stable/12/secure/lib/libcrypto/man/DSA_set_method.3 stable/12/secure/lib/libcrypto/man/DSA_sign.3 stable/12/secure/lib/libcrypto/man/DSA_size.3 stable/12/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 stable/12/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 stable/12/secure/lib/libcrypto/man/DTLSv1_listen.3 stable/12/secure/lib/libcrypto/man/ECDSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/ECPKParameters_print.3 stable/12/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/12/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 stable/12/secure/lib/libcrypto/man/EC_KEY_new.3 stable/12/secure/lib/libcrypto/man/EC_POINT_add.3 stable/12/secure/lib/libcrypto/man/EC_POINT_new.3 stable/12/secure/lib/libcrypto/man/ENGINE_add.3 stable/12/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/12/secure/lib/libcrypto/man/ERR_clear_error.3 stable/12/secure/lib/libcrypto/man/ERR_error_string.3 stable/12/secure/lib/libcrypto/man/ERR_get_error.3 stable/12/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/12/secure/lib/libcrypto/man/ERR_load_strings.3 stable/12/secure/lib/libcrypto/man/ERR_print_errors.3 stable/12/secure/lib/libcrypto/man/ERR_put_error.3 stable/12/secure/lib/libcrypto/man/ERR_remove_state.3 stable/12/secure/lib/libcrypto/man/ERR_set_mark.3 stable/12/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/12/secure/lib/libcrypto/man/EVP_MD_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/12/secure/lib/libcrypto/man/EVP_SealInit.3 stable/12/secure/lib/libcrypto/man/EVP_SignInit.3 stable/12/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_aes.3 stable/12/secure/lib/libcrypto/man/EVP_aria.3 stable/12/secure/lib/libcrypto/man/EVP_bf_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_blake2b512.3 stable/12/secure/lib/libcrypto/man/EVP_camellia.3 stable/12/secure/lib/libcrypto/man/EVP_cast5_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_chacha20.3 stable/12/secure/lib/libcrypto/man/EVP_des.3 stable/12/secure/lib/libcrypto/man/EVP_desx_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_idea_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_md2.3 stable/12/secure/lib/libcrypto/man/EVP_md4.3 stable/12/secure/lib/libcrypto/man/EVP_md5.3 stable/12/secure/lib/libcrypto/man/EVP_mdc2.3 stable/12/secure/lib/libcrypto/man/EVP_rc2_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_rc4.3 stable/12/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_ripemd160.3 stable/12/secure/lib/libcrypto/man/EVP_seed_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_sha1.3 stable/12/secure/lib/libcrypto/man/EVP_sha224.3 stable/12/secure/lib/libcrypto/man/EVP_sha3_224.3 stable/12/secure/lib/libcrypto/man/EVP_sm3.3 stable/12/secure/lib/libcrypto/man/EVP_sm4_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_whirlpool.3 stable/12/secure/lib/libcrypto/man/HMAC.3 stable/12/secure/lib/libcrypto/man/MD5.3 stable/12/secure/lib/libcrypto/man/MDC2_Init.3 stable/12/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/12/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 stable/12/secure/lib/libcrypto/man/OCSP_cert_to_id.3 stable/12/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 stable/12/secure/lib/libcrypto/man/OCSP_resp_find_status.3 stable/12/secure/lib/libcrypto/man/OCSP_response_status.3 stable/12/secure/lib/libcrypto/man/OCSP_sendreq_new.3 stable/12/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 stable/12/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/12/secure/lib/libcrypto/man/OPENSSL_config.3 stable/12/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 stable/12/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 stable/12/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/12/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/12/secure/lib/libcrypto/man/OPENSSL_malloc.3 stable/12/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_expect.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_open.3 stable/12/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/12/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 stable/12/secure/lib/libcrypto/man/PEM_read.3 stable/12/secure/lib/libcrypto/man/PEM_read_CMS.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_ex.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/12/secure/lib/libcrypto/man/PKCS12_create.3 stable/12/secure/lib/libcrypto/man/PKCS12_newpass.3 stable/12/secure/lib/libcrypto/man/PKCS12_parse.3 stable/12/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 stable/12/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/12/secure/lib/libcrypto/man/PKCS7_verify.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_generate.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_new.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 stable/12/secure/lib/libcrypto/man/RAND_add.3 stable/12/secure/lib/libcrypto/man/RAND_bytes.3 stable/12/secure/lib/libcrypto/man/RAND_cleanup.3 stable/12/secure/lib/libcrypto/man/RAND_egd.3 stable/12/secure/lib/libcrypto/man/RAND_load_file.3 stable/12/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/12/secure/lib/libcrypto/man/RC4_set_key.3 stable/12/secure/lib/libcrypto/man/RIPEMD160_Init.3 stable/12/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/12/secure/lib/libcrypto/man/RSA_check_key.3 stable/12/secure/lib/libcrypto/man/RSA_generate_key.3 stable/12/secure/lib/libcrypto/man/RSA_get0_key.3 stable/12/secure/lib/libcrypto/man/RSA_meth_new.3 stable/12/secure/lib/libcrypto/man/RSA_new.3 stable/12/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/12/secure/lib/libcrypto/man/RSA_print.3 stable/12/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_set_method.3 stable/12/secure/lib/libcrypto/man/RSA_sign.3 stable/12/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/12/secure/lib/libcrypto/man/RSA_size.3 stable/12/secure/lib/libcrypto/man/SCT_new.3 stable/12/secure/lib/libcrypto/man/SCT_print.3 stable/12/secure/lib/libcrypto/man/SCT_validate.3 stable/12/secure/lib/libcrypto/man/SHA256_Init.3 stable/12/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/12/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/12/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 stable/12/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_session.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_config.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_free.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_options.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_free.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_print.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 stable/12/secure/lib/libcrypto/man/SSL_accept.3 stable/12/secure/lib/libcrypto/man/SSL_alert_type_string.3 stable/12/secure/lib/libcrypto/man/SSL_alloc_buffers.3 stable/12/secure/lib/libcrypto/man/SSL_check_chain.3 stable/12/secure/lib/libcrypto/man/SSL_clear.3 stable/12/secure/lib/libcrypto/man/SSL_connect.3 stable/12/secure/lib/libcrypto/man/SSL_do_handshake.3 stable/12/secure/lib/libcrypto/man/SSL_export_keying_material.3 stable/12/secure/lib/libcrypto/man/SSL_extension_supported.3 stable/12/secure/lib/libcrypto/man/SSL_free.3 stable/12/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 stable/12/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 stable/12/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 stable/12/secure/lib/libcrypto/man/SSL_get_ciphers.3 stable/12/secure/lib/libcrypto/man/SSL_get_client_random.3 stable/12/secure/lib/libcrypto/man/SSL_get_current_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_get_default_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_get_error.3 stable/12/secure/lib/libcrypto/man/SSL_get_extms_support.3 stable/12/secure/lib/libcrypto/man/SSL_get_fd.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 stable/12/secure/lib/libcrypto/man/SSL_get_psk_identity.3 stable/12/secure/lib/libcrypto/man/SSL_get_rbio.3 stable/12/secure/lib/libcrypto/man/SSL_get_session.3 stable/12/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_get_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_get_version.3 stable/12/secure/lib/libcrypto/man/SSL_in_init.3 stable/12/secure/lib/libcrypto/man/SSL_key_update.3 stable/12/secure/lib/libcrypto/man/SSL_library_init.3 stable/12/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 stable/12/secure/lib/libcrypto/man/SSL_new.3 stable/12/secure/lib/libcrypto/man/SSL_pending.3 stable/12/secure/lib/libcrypto/man/SSL_read.3 stable/12/secure/lib/libcrypto/man/SSL_read_early_data.3 stable/12/secure/lib/libcrypto/man/SSL_rstate_string.3 stable/12/secure/lib/libcrypto/man/SSL_session_reused.3 stable/12/secure/lib/libcrypto/man/SSL_set1_host.3 stable/12/secure/lib/libcrypto/man/SSL_set_bio.3 stable/12/secure/lib/libcrypto/man/SSL_set_connect_state.3 stable/12/secure/lib/libcrypto/man/SSL_set_fd.3 stable/12/secure/lib/libcrypto/man/SSL_set_session.3 stable/12/secure/lib/libcrypto/man/SSL_set_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_set_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_state_string.3 stable/12/secure/lib/libcrypto/man/SSL_want.3 stable/12/secure/lib/libcrypto/man/SSL_write.3 stable/12/secure/lib/libcrypto/man/UI_STRING.3 stable/12/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 stable/12/secure/lib/libcrypto/man/UI_create_method.3 stable/12/secure/lib/libcrypto/man/UI_new.3 stable/12/secure/lib/libcrypto/man/X509V3_get_d2i.3 stable/12/secure/lib/libcrypto/man/X509_ALGOR_dup.3 stable/12/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 stable/12/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 stable/12/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/12/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get0_der.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/12/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/12/secure/lib/libcrypto/man/X509_PUBKEY_new.3 stable/12/secure/lib/libcrypto/man/X509_SIG_get0.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/12/secure/lib/libcrypto/man/X509_STORE_add_cert.3 stable/12/secure/lib/libcrypto/man/X509_STORE_get0_param.3 stable/12/secure/lib/libcrypto/man/X509_STORE_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/12/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/12/secure/lib/libcrypto/man/X509_check_ca.3 stable/12/secure/lib/libcrypto/man/X509_check_host.3 stable/12/secure/lib/libcrypto/man/X509_check_issued.3 stable/12/secure/lib/libcrypto/man/X509_check_private_key.3 stable/12/secure/lib/libcrypto/man/X509_cmp_time.3 stable/12/secure/lib/libcrypto/man/X509_digest.3 stable/12/secure/lib/libcrypto/man/X509_dup.3 stable/12/secure/lib/libcrypto/man/X509_get0_notBefore.3 stable/12/secure/lib/libcrypto/man/X509_get0_signature.3 stable/12/secure/lib/libcrypto/man/X509_get0_uids.3 stable/12/secure/lib/libcrypto/man/X509_get_extension_flags.3 stable/12/secure/lib/libcrypto/man/X509_get_pubkey.3 stable/12/secure/lib/libcrypto/man/X509_get_serialNumber.3 stable/12/secure/lib/libcrypto/man/X509_get_subject_name.3 stable/12/secure/lib/libcrypto/man/X509_get_version.3 stable/12/secure/lib/libcrypto/man/X509_new.3 stable/12/secure/lib/libcrypto/man/X509_sign.3 stable/12/secure/lib/libcrypto/man/X509_verify_cert.3 stable/12/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 stable/12/secure/lib/libcrypto/man/d2i_DHparams.3 stable/12/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 stable/12/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/12/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 stable/12/secure/lib/libcrypto/man/d2i_X509.3 stable/12/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 stable/12/secure/lib/libcrypto/man/o2i_SCT_LIST.3 stable/12/secure/usr.bin/openssl/man/CA.pl.1 stable/12/secure/usr.bin/openssl/man/asn1parse.1 stable/12/secure/usr.bin/openssl/man/ca.1 stable/12/secure/usr.bin/openssl/man/ciphers.1 stable/12/secure/usr.bin/openssl/man/cms.1 stable/12/secure/usr.bin/openssl/man/crl.1 stable/12/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/12/secure/usr.bin/openssl/man/dgst.1 stable/12/secure/usr.bin/openssl/man/dhparam.1 stable/12/secure/usr.bin/openssl/man/dsa.1 stable/12/secure/usr.bin/openssl/man/dsaparam.1 stable/12/secure/usr.bin/openssl/man/ec.1 stable/12/secure/usr.bin/openssl/man/ecparam.1 stable/12/secure/usr.bin/openssl/man/enc.1 stable/12/secure/usr.bin/openssl/man/engine.1 stable/12/secure/usr.bin/openssl/man/errstr.1 stable/12/secure/usr.bin/openssl/man/gendsa.1 stable/12/secure/usr.bin/openssl/man/genpkey.1 stable/12/secure/usr.bin/openssl/man/genrsa.1 stable/12/secure/usr.bin/openssl/man/list.1 stable/12/secure/usr.bin/openssl/man/nseq.1 stable/12/secure/usr.bin/openssl/man/ocsp.1 stable/12/secure/usr.bin/openssl/man/openssl.1 stable/12/secure/usr.bin/openssl/man/passwd.1 stable/12/secure/usr.bin/openssl/man/pkcs12.1 stable/12/secure/usr.bin/openssl/man/pkcs7.1 stable/12/secure/usr.bin/openssl/man/pkcs8.1 stable/12/secure/usr.bin/openssl/man/pkey.1 stable/12/secure/usr.bin/openssl/man/pkeyparam.1 stable/12/secure/usr.bin/openssl/man/pkeyutl.1 stable/12/secure/usr.bin/openssl/man/prime.1 stable/12/secure/usr.bin/openssl/man/rand.1 stable/12/secure/usr.bin/openssl/man/req.1 stable/12/secure/usr.bin/openssl/man/rsa.1 stable/12/secure/usr.bin/openssl/man/rsautl.1 stable/12/secure/usr.bin/openssl/man/s_client.1 stable/12/secure/usr.bin/openssl/man/s_server.1 stable/12/secure/usr.bin/openssl/man/s_time.1 stable/12/secure/usr.bin/openssl/man/sess_id.1 stable/12/secure/usr.bin/openssl/man/smime.1 stable/12/secure/usr.bin/openssl/man/speed.1 stable/12/secure/usr.bin/openssl/man/spkac.1 stable/12/secure/usr.bin/openssl/man/srp.1 stable/12/secure/usr.bin/openssl/man/storeutl.1 stable/12/secure/usr.bin/openssl/man/ts.1 stable/12/secure/usr.bin/openssl/man/tsget.1 stable/12/secure/usr.bin/openssl/man/verify.1 stable/12/secure/usr.bin/openssl/man/version.1 stable/12/secure/usr.bin/openssl/man/x509.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/ObsoleteFiles.inc Tue Sep 10 21:13:37 2019 (r352192) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190910: OpenSSL 1.1.1d +OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz +OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. Modified: stable/12/crypto/openssl/CHANGES ============================================================================== --- stable/12/crypto/openssl/CHANGES Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/CHANGES Tue Sep 10 21:13:37 2019 (r352192) @@ -7,6 +7,101 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1c and 1.1.1d [10 Sep 2019] + + *) Fixed a fork protection issue. OpenSSL 1.1.1 introduced a rewritten random + number generator (RNG). This was intended to include protection in the + event of a fork() system call in order to ensure that the parent and child + processes did not share the same RNG state. However this protection was not + being used in the default case. + + A partial mitigation for this issue is that the output from a high + precision timer is mixed into the RNG state so the likelihood of a parent + and child process sharing state is significantly reduced. + + If an application already calls OPENSSL_init_crypto() explicitly using + OPENSSL_INIT_ATFORK then this problem does not occur at all. + (CVE-2019-1549) + [Matthias St. Pierre] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems. The RAND subsystem will wait for + /dev/random to be producing output before seeding from /dev/urandom. + The seeded state is stored for future library initialisations using + a system global shared memory segment. The shared memory identifier + can be configured by defining OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID to + the desired value. The default identifier is 114. + [Paul Dale] + + *) Correct the extended master secret constant on EBCDIC systems. Without this + fix TLS connections between an EBCDIC system and a non-EBCDIC system that + negotiate EMS will fail. Unfortunately this also means that TLS connections + between EBCDIC systems with this fix, and EBCDIC systems without this + fix will fail if they negotiate EMS. + [Matt Caswell] + + *) Use Windows installation paths in the mingw builds + + Mingw isn't a POSIX environment per se, which means that Windows + paths should be used for installation. + (CVE-2019-1552) + [Richard Levitte] + + *) Changed DH_check to accept parameters with order q and 2q subgroups. + With order 2q subgroups the bit 0 of the private key is not secret + but DH_generate_key works around that by clearing bit 0 of the + private key for those. This avoids leaking bit 0 of the private key. + [Bernd Edlinger] + + *) Significantly reduce secure memory usage by the randomness pools. + [Paul Dale] + + *) Revert the DEVRANDOM_WAIT feature for Linux systems + + The DEVRANDOM_WAIT feature added a select() call to wait for the + /dev/random device to become readable before reading from the + /dev/urandom device. + + It turned out that this change had negative side effects on + performance which were not acceptable. After some discussion it + was decided to revert this feature and leave it up to the OS + resp. the platform maintainer to ensure a proper initialization + during early boot time. + [Matthias St. Pierre] + Changes between 1.1.1b and 1.1.1c [28 May 2019] *) Add build tests for C++. These are generated files that only do one @@ -75,6 +170,16 @@ (CVE-2019-1543) [Matt Caswell] + *) Add DEVRANDOM_WAIT feature for Linux systems + + On older Linux systems where the getrandom() system call is not available, + OpenSSL normally uses the /dev/urandom device for seeding its CSPRNG. + Contrary to getrandom(), the /dev/urandom device will not block during + early boot when the kernel CSPRNG has not been seeded yet. + + To mitigate this known weakness, use select() to wait for /dev/random to + become readable before reading from /dev/urandom. + *) Ensure that SM2 only uses SM3 as digest algorithm [Paul Yang] @@ -322,7 +427,7 @@ SSL_set_ciphersuites() [Matt Caswell] - *) Memory allocation failures consistenly add an error to the error + *) Memory allocation failures consistently add an error to the error stack. [Rich Salz] @@ -6860,7 +6965,7 @@ reason texts, thereby removing some of the footprint that may not be interesting if those errors aren't displayed anyway. - NOTE: it's still possible for any application or module to have it's + NOTE: it's still possible for any application or module to have its own set of error texts inserted. The routines are there, just not used by default when no-err is given. [Richard Levitte] @@ -8826,7 +8931,7 @@ des-cbc 3624.96k 5258.21k 5530.91k Changes between 0.9.6g and 0.9.6h [5 Dec 2002] *) New function OPENSSL_cleanse(), which is used to cleanse a section of - memory from it's contents. This is done with a counter that will + memory from its contents. This is done with a counter that will place alternating values in each byte. This can be used to solve two issues: 1) the removal of calls to memset() by highly optimizing compilers, and 2) cleansing with other values than 0, since those can Modified: stable/12/crypto/openssl/Configure ============================================================================== --- stable/12/crypto/openssl/Configure Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/Configure Tue Sep 10 21:13:37 2019 (r352192) @@ -87,9 +87,6 @@ my $usage="Usage: Configure [no- ...] [enable- # linked openssl executable has rather debugging value than # production quality. # -# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items -# provided to stack calls. Generates unique stack functions for -# each possible stack type. # BN_LLONG use the type 'long long' in crypto/bn/bn.h # RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h # Following are set automatically by this script @@ -145,13 +142,13 @@ my @gcc_devteam_warn = qw( # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc # -Wextended-offsetof -- no, needed in CMS ASN1 code my @clang_devteam_warn = qw( + -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers - -Wno-unknown-warning-option -Wmissing-variable-declarations ); Modified: stable/12/crypto/openssl/INSTALL ============================================================================== --- stable/12/crypto/openssl/INSTALL Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/INSTALL Tue Sep 10 21:13:37 2019 (r352192) @@ -98,6 +98,9 @@ $ nmake test $ nmake install + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + If any of these steps fails, see section Installation in Detail below. This will build and install OpenSSL in the default location, which is: @@ -107,6 +110,12 @@ OpenSSL version number with underscores instead of periods. Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or install + engines. If you already have a pre-installed version of OpenSSL as part of + your Operating System it is recommended that you do not overwrite the system + version and instead install to somewhere else. + If you want to install it anywhere else, run config like this: On Unix: @@ -135,7 +144,10 @@ Don't build with support for deprecated APIs below the specified version number. For example "--api=1.1.0" will remove support for all APIS that were deprecated in OpenSSL - version 1.1.0 or below. + version 1.1.0 or below. This is a rather specialized option + for developers. If you just intend to remove all deprecated + APIs entirely (up to the current version), it is easier + to add the 'no-deprecated' option instead (see below). --cross-compile-prefix=PREFIX The PREFIX to include in front of commands for your @@ -229,7 +241,7 @@ source exists. getrandom: Use the L or equivalent system call. - devrandom: Use the the first device from the DEVRANDOM list + devrandom: Use the first device from the DEVRANDOM list which can be opened to read random bytes. The DEVRANDOM preprocessor constant expands to "/dev/urandom","/dev/random","/dev/srandom" on @@ -908,8 +920,11 @@ $ mms install ! OpenVMS $ nmake install # Windows - This will install all the software components in this directory - tree under PREFIX (the directory given with --prefix or its + Note that in order to perform the install step above you need to have + appropriate permissions to write to the installation directory. + + The above commands will install all the software components in this + directory tree under PREFIX (the directory given with --prefix or its default): Unix: @@ -964,6 +979,12 @@ private Initially empty, this is the default location for private key files. misc Various scripts. + + The installation directory should be appropriately protected to ensure + unprivileged users cannot make changes to OpenSSL binaries or files, or + install engines. If you already have a pre-installed version of OpenSSL as + part of your Operating System it is recommended that you do not overwrite + the system version and instead install to somewhere else. Package builders who want to configure the library for standard locations, but have the package installed somewhere else so that Modified: stable/12/crypto/openssl/NEWS ============================================================================== --- stable/12/crypto/openssl/NEWS Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/NEWS Tue Sep 10 21:13:37 2019 (r352192) @@ -5,6 +5,23 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019] + + o Fixed a fork protection issue (CVE-2019-1549) + o Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey + (CVE-2019-1563) + o For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters + o Compute ECC cofactors if not provided during EC_GROUP construction + (CVE-2019-1547) + o Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems + o Correct the extended master secret constant on EBCDIC systems + o Use Windows installation paths in the mingw builds (CVE-2019-1552) + o Changed DH_check to accept parameters with order q and 2q subgroups + o Significantly reduce secure memory usage by the randomness pools + o Revert the DEVRANDOM_WAIT feature for Linux systems + Major changes between OpenSSL 1.1.1b and OpenSSL 1.1.1c [28 May 2019] o Prevent over long nonces in ChaCha20-Poly1305 (CVE-2019-1543) @@ -601,7 +618,7 @@ Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]: - o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build. + o Give EVP_MAX_MD_SIZE its old value, except for a FIPS build. Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]: Modified: stable/12/crypto/openssl/README ============================================================================== --- stable/12/crypto/openssl/README Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/README Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1c 28 May 2019 + OpenSSL 1.1.1d 10 Sep 2019 Copyright (c) 1998-2019 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/12/crypto/openssl/apps/apps.c ============================================================================== --- stable/12/crypto/openssl/apps/apps.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/apps.c Tue Sep 10 21:13:37 2019 (r352192) @@ -40,12 +40,19 @@ #endif #include #include -#include "s_apps.h" #include "apps.h" #ifdef _WIN32 static int WIN32_rename(const char *from, const char *to); # define rename(from,to) WIN32_rename((from),(to)) +#endif + +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) +# include +#endif + +#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) +# define _kbhit kbhit #endif typedef struct { Modified: stable/12/crypto/openssl/apps/apps.h ============================================================================== --- stable/12/crypto/openssl/apps/apps.h Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/apps.h Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -444,11 +444,9 @@ void destroy_ui_method(void); const UI_METHOD *get_ui_method(void); int chopup_args(ARGS *arg, char *buf); -# ifdef HEADER_X509_H int dump_cert_text(BIO *out, X509 *x); void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags); -# endif void print_bignum_var(BIO *, const BIGNUM *, const char*, int, unsigned char *); void print_array(BIO *, const char *, int, const unsigned char *); Modified: stable/12/crypto/openssl/apps/ca.c ============================================================================== --- stable/12/crypto/openssl/apps/ca.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/ca.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -722,7 +722,7 @@ end_of_options: /*****************************************************************/ if (req || gencrl) { - if (spkac_file != NULL) { + if (spkac_file != NULL && outfile != NULL) { output_der = 1; batch = 1; } Modified: stable/12/crypto/openssl/apps/dgst.c ============================================================================== --- stable/12/crypto/openssl/apps/dgst.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/dgst.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -421,7 +421,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int s size_t len; int i; - for (;;) { + while (BIO_pending(bp) || !BIO_eof(bp)) { i = BIO_read(bp, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in %s\n", file); Modified: stable/12/crypto/openssl/apps/enc.c ============================================================================== --- stable/12/crypto/openssl/apps/enc.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/enc.c Tue Sep 10 21:13:37 2019 (r352192) @@ -586,7 +586,7 @@ int enc_main(int argc, char **argv) if (benc != NULL) wbio = BIO_push(benc, wbio); - for (;;) { + while (BIO_pending(rbio) || !BIO_eof(rbio)) { inl = BIO_read(rbio, (char *)buff, bsize); if (inl <= 0) break; Modified: stable/12/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/12/crypto/openssl/apps/ocsp.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/ocsp.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1416,9 +1416,11 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcb *q = '\0'; /* - * Skip "GET / HTTP..." requests often used by load-balancers + * Skip "GET / HTTP..." requests often used by load-balancers. Note: + * 'p' was incremented above to point to the first byte *after* the + * leading slash, so with 'GET / ' it is now an empty string. */ - if (p[1] == '\0') + if (p[0] == '\0') goto out; len = urldecode(p); Modified: stable/12/crypto/openssl/apps/openssl.c ============================================================================== --- stable/12/crypto/openssl/apps/openssl.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/openssl.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,7 +22,6 @@ # include #endif #include -#include "s_apps.h" /* Needed to get the other O_xxx flags. */ #ifdef OPENSSL_SYS_VMS # include Modified: stable/12/crypto/openssl/apps/pkcs12.c ============================================================================== --- stable/12/crypto/openssl/apps/pkcs12.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/pkcs12.c Tue Sep 10 21:13:37 2019 (r352192) @@ -838,7 +838,7 @@ static int alg_print(const X509_ALGOR *alg) goto done; } BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, " - "Block size(r): %ld, Paralelizm(p): %ld", + "Block size(r): %ld, Parallelism(p): %ld", ASN1_STRING_length(kdf->salt), ASN1_INTEGER_get(kdf->costParameter), ASN1_INTEGER_get(kdf->blockSize), Modified: stable/12/crypto/openssl/apps/req.c ============================================================================== --- stable/12/crypto/openssl/apps/req.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/req.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -881,9 +881,19 @@ int req_main(int argc, char **argv) if (text) { if (x509) - X509_print_ex(out, x509ss, get_nameopt(), reqflag); + ret = X509_print_ex(out, x509ss, get_nameopt(), reqflag); else - X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + ret = X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + + if (ret == 0) { + if (x509) + BIO_printf(bio_err, "Error printing certificate\n"); + else + BIO_printf(bio_err, "Error printing certificate request\n"); + + ERR_print_errors(bio_err); + goto end; + } } if (subject) { Modified: stable/12/crypto/openssl/apps/s_apps.h ============================================================================== --- stable/12/crypto/openssl/apps/s_apps.h Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/s_apps.h Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -9,14 +9,8 @@ #include -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -# include -#endif +#include -#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) -# define _kbhit kbhit -#endif - #define PORT "4433" #define PROTOCOL "tcp" @@ -24,17 +18,15 @@ typedef int (*do_server_cb)(int s, int stype, int prot int do_server(int *accept_sock, const char *host, const char *port, int family, int type, int protocol, do_server_cb cb, unsigned char *context, int naccept, BIO *bio_s_out); -#ifdef HEADER_X509_H + int verify_callback(int ok, X509_STORE_CTX *ctx); -#endif -#ifdef HEADER_SSL_H + int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file); int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key, STACK_OF(X509) *chain, int build_chain); int ssl_print_sigalgs(BIO *out, SSL *s); int ssl_print_point_formats(BIO *out, SSL *s); int ssl_print_groups(BIO *out, SSL *s, int noshared); -#endif int ssl_print_tmp_key(BIO *out, SSL *s); int init_client(int *sock, const char *host, const char *port, const char *bindhost, const char *bindport, @@ -44,13 +36,11 @@ int should_retry(int i); long bio_dump_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); -#ifdef HEADER_SSL_H void apps_ssl_info_callback(const SSL *s, int where, int ret); void msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); void tlsext_cb(SSL *s, int client_server, int type, const unsigned char *data, int len, void *arg); -#endif int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len); @@ -75,7 +65,6 @@ int args_excert(int option, SSL_EXCERT **pexc); int load_excert(SSL_EXCERT **pexc); void print_verify_detail(SSL *s, BIO *bio); void print_ssl_summary(SSL *s); -#ifdef HEADER_SSL_H int config_ctx(SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, SSL_CTX *ctx); int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, int crl_download); @@ -86,4 +75,3 @@ int ssl_load_stores(SSL_CTX *ctx, const char *vfyCApat void ssl_ctx_security_debug(SSL_CTX *ctx, int verbose); int set_keylog_file(SSL_CTX *ctx, const char *keylog_file); void print_ca_names(BIO *bio, SSL *s); -#endif Modified: stable/12/crypto/openssl/apps/s_cb.c ============================================================================== --- stable/12/crypto/openssl/apps/s_cb.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/s_cb.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1525,7 +1525,8 @@ void print_ca_names(BIO *bio, SSL *s) int i; if (sk == NULL || sk_X509_NAME_num(sk) == 0) { - BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); + if (!SSL_is_server(s)) + BIO_printf(bio, "---\nNo %s certificate CA names sent\n", cs); return; } Modified: stable/12/crypto/openssl/apps/s_client.c ============================================================================== --- stable/12/crypto/openssl/apps/s_client.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/s_client.c Tue Sep 10 21:13:37 2019 (r352192) @@ -2345,7 +2345,7 @@ int s_client_main(int argc, char **argv) (void)BIO_flush(fbio); /* * The first line is the HTTP response. According to RFC 7230, - * it's formated exactly like this: + * it's formatted exactly like this: * * HTTP/d.d ddd Reason text\r\n */ Modified: stable/12/crypto/openssl/apps/speed.c ============================================================================== --- stable/12/crypto/openssl/apps/speed.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/speed.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1790,7 +1790,7 @@ int speed_main(int argc, char **argv) } buflen = lengths[size_num - 1]; - if (buflen < 36) /* size of random vector in RSA bencmark */ + if (buflen < 36) /* size of random vector in RSA benchmark */ buflen = 36; buflen += MAX_MISALIGNMENT + 1; loopargs[i].buf_malloc = app_malloc(buflen, "input buffer"); Modified: stable/12/crypto/openssl/apps/storeutl.c ============================================================================== --- stable/12/crypto/openssl/apps/storeutl.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/apps/storeutl.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -125,7 +125,7 @@ int storeutl_main(int argc, char *argv[]) } /* * If expected wasn't set at this point, it means the map - * isn't syncronised with the possible options leading here. + * isn't synchronised with the possible options leading here. */ OPENSSL_assert(expected != 0); } Modified: stable/12/crypto/openssl/config ============================================================================== --- stable/12/crypto/openssl/config Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/config Tue Sep 10 21:13:37 2019 (r352192) @@ -498,12 +498,12 @@ case "$GUESSOS" in OUT="darwin64-x86_64-cc" fi ;; armv6+7-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20armv6 -arch%20armv7" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20armv6 -arch%20armv7" + __CNF_CFLAGS="$__CNF_CFLAGS -arch armv6 -arch armv7" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch armv6 -arch armv7" OUT="iphoneos-cross" ;; *-*-iphoneos) - __CNF_CFLAGS="$__CNF_CFLAGS -arch%20${MACHINE}" - __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20${MACHINE}" + __CNF_CFLAGS="$__CNF_CFLAGS -arch ${MACHINE}" + __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch ${MACHINE}" OUT="iphoneos-cross" ;; arm64-*-iphoneos|*-*-ios64) OUT="ios64-cross" ;; Modified: stable/12/crypto/openssl/crypto/aes/asm/aes-s390x.pl ============================================================================== --- stable/12/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -38,14 +38,14 @@ # Implement AES_set_[en|de]crypt_key. Key schedule setup is avoided # for 128-bit keys, if hardware support is detected. -# Januray 2009. +# January 2009. # # Add support for hardware AES192/256 and reschedule instructions to # minimize/avoid Address Generation Interlock hazard and to favour # dual-issue z10 pipeline. This gave ~25% improvement on z10 and # almost 50% on z9. The gain is smaller on z10, because being dual- # issue z10 makes it impossible to eliminate the interlock condition: -# critial path is not long enough. Yet it spends ~24 cycles per byte +# critical path is not long enough. Yet it spends ~24 cycles per byte # processed with 128-bit key. # # Unlike previous version hardware support detection takes place only Modified: stable/12/crypto/openssl/crypto/asn1/a_time.c ============================================================================== --- stable/12/crypto/openssl/crypto/asn1/a_time.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/asn1/a_time.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,7 @@ static void determine_days(struct tm *tm) } c = y / 100; y %= 100; - /* Zeller's congruance */ + /* Zeller's congruence */ tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7; } @@ -79,7 +79,11 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) char *a; int n, i, i2, l, o, min_l = 11, strict = 0, end = 6, btz = 5, md; struct tm tmp; - +#if defined(CHARSET_EBCDIC) + const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B; +#else + const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+'; +#endif /* * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280 * time string format, in which: @@ -120,20 +124,20 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (l < min_l) goto err; for (i = 0; i < end; i++) { - if (!strict && (i == btz) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) { i++; break; } - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; /* incomplete 2-digital number */ if (++o == l) goto err; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; /* no more bytes to read, but we haven't seen time-zone yet */ if (++o == l) goto err; @@ -185,14 +189,14 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * Optional fractional seconds: decimal point followed by one or more * digits. */ - if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == '.') { + if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) { if (strict) /* RFC 5280 forbids fractional seconds */ goto err; if (++o == l) goto err; i = o; - while ((o < l) && ossl_isdigit(a[o])) + while ((o < l) && ascii_isdigit(a[o])) o++; /* Must have at least one digit after decimal point */ if (i == o) @@ -207,10 +211,10 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) * 'o' can point to '\0' is either the subsequent if or the first * else if is true. */ - if (a[o] == 'Z') { + if (a[o] == upper_z) { o++; - } else if (!strict && ((a[o] == '+') || (a[o] == '-'))) { - int offsign = a[o] == '-' ? 1 : -1; + } else if (!strict && ((a[o] == plus) || (a[o] == minus))) { + int offsign = a[o] == minus ? 1 : -1; int offset = 0; o++; @@ -223,13 +227,13 @@ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) if (o + 4 != l) goto err; for (i = end; i < end + 2; i++) { - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = a[o] - '0'; + n = a[o] - num_zero; o++; - if (!ossl_isdigit(a[o])) + if (!ascii_isdigit(a[o])) goto err; - n = (n * 10) + a[o] - '0'; + n = (n * 10) + a[o] - num_zero; i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i; if ((n < min[i2]) || (n > max[i2])) goto err; @@ -300,7 +304,7 @@ ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm * ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec); -#ifdef CHARSET_EBCDIC_not +#ifdef CHARSET_EBCDIC ebcdic2ascii(tmps->data, tmps->data, tmps->length); #endif return tmps; @@ -467,6 +471,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) char *v; int gmt = 0, l; struct tm stm; + const char upper_z = 0x5A, period = 0x2E; if (!asn1_time_to_tm(&stm, tm)) { /* asn1_time_to_tm will check the time type */ @@ -475,7 +480,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) l = tm->length; v = (char *)tm->data; - if (v[l - 1] == 'Z') + if (v[l - 1] == upper_z) gmt = 1; if (tm->type == V_ASN1_GENERALIZEDTIME) { @@ -486,10 +491,10 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) * Try to parse fractional seconds. '14' is the place of * 'fraction point' in a GeneralizedTime string. */ - if (tm->length > 15 && v[14] == '.') { + if (tm->length > 15 && v[14] == period) { f = &v[14]; f_len = 1; - while (14 + f_len < l && ossl_isdigit(f[f_len])) + while (14 + f_len < l && ascii_isdigit(f[f_len])) ++f_len; } Modified: stable/12/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- stable/12/crypto/openssl/crypto/asn1/a_type.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/asn1/a_type.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,7 +15,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) { - if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) + if (a->type == V_ASN1_BOOLEAN + || a->type == V_ASN1_NULL + || a->value.ptr != NULL) return a->type; else return 0; @@ -23,7 +25,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a) void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) { - if (a->value.ptr != NULL) { + if (a->type != V_ASN1_BOOLEAN + && a->type != V_ASN1_NULL + && a->value.ptr != NULL) { ASN1_TYPE **tmp_a = &a; asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0); } Modified: stable/12/crypto/openssl/crypto/asn1/x_bignum.c ============================================================================== --- stable/12/crypto/openssl/crypto/asn1/x_bignum.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/asn1/x_bignum.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -130,9 +130,20 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned ch static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) { - if (!*pval) - bn_secure_new(pval, it); - return bn_c2i(pval, cont, len, utype, free_cont, it); + int ret; + BIGNUM *bn; + + if (!*pval && !bn_secure_new(pval, it)) + return 0; + + ret = bn_c2i(pval, cont, len, utype, free_cont, it); + if (!ret) + return 0; + + /* Set constant-time flag for all secure BIGNUMS */ + bn = (BIGNUM *)*pval; + BN_set_flags(bn, BN_FLG_CONSTTIME); + return ret; } static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, Modified: stable/12/crypto/openssl/crypto/bio/b_addr.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/b_addr.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/bio/b_addr.c Tue Sep 10 21:13:37 2019 (r352192) @@ -675,7 +675,7 @@ int BIO_lookup_ex(const char *host, const char *servic if (1) { #ifdef AI_PASSIVE - int gai_ret = 0; + int gai_ret = 0, old_ret = 0; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); @@ -683,12 +683,12 @@ int BIO_lookup_ex(const char *host, const char *servic hints.ai_family = family; hints.ai_socktype = socktype; hints.ai_protocol = protocol; -#ifdef AI_ADDRCONFIG -#ifdef AF_UNSPEC +# ifdef AI_ADDRCONFIG +# ifdef AF_UNSPEC if (family == AF_UNSPEC) -#endif +# endif hints.ai_flags |= AI_ADDRCONFIG; -#endif +# endif if (lookup_type == BIO_LOOKUP_SERVER) hints.ai_flags |= AI_PASSIVE; @@ -696,6 +696,7 @@ int BIO_lookup_ex(const char *host, const char *servic /* Note that |res| SHOULD be a 'struct addrinfo **' thanks to * macro magic in bio_lcl.h */ + retry: switch ((gai_ret = getaddrinfo(host, service, &hints, res))) { # ifdef EAI_SYSTEM case EAI_SYSTEM: @@ -703,12 +704,25 @@ int BIO_lookup_ex(const char *host, const char *servic BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); break; # endif +# ifdef EAI_MEMORY + case EAI_MEMORY: + BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_MALLOC_FAILURE); + break; +# endif case 0: ret = 1; /* Success */ break; default: +# if defined(AI_ADDRCONFIG) && defined(AI_NUMERICHOST) + if (hints.ai_flags & AI_ADDRCONFIG) { + hints.ai_flags &= ~AI_ADDRCONFIG; + hints.ai_flags |= AI_NUMERICHOST; + old_ret = gai_ret; + goto retry; + } +# endif BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB); - ERR_add_error_data(1, gai_strerror(gai_ret)); + ERR_add_error_data(1, gai_strerror(old_ret ? old_ret : gai_ret)); break; } } else { Modified: stable/12/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bss_dgram.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/bio/bss_dgram.c Tue Sep 10 21:13:37 2019 (r352192) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -784,7 +784,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void * reasons. When BIO_CTRL_DGRAM_SET_PEEK_MODE was first defined its value * was incorrectly clashing with BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. The * value has been updated to a non-clashing value. However to preserve - * binary compatiblity we now respond to both the old value and the new one + * binary compatibility we now respond to both the old value and the new one */ case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE: case BIO_CTRL_DGRAM_SET_PEEK_MODE: Modified: stable/12/crypto/openssl/crypto/bio/bss_file.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bss_file.c Tue Sep 10 21:08:17 2019 (r352191) +++ stable/12/crypto/openssl/crypto/bio/bss_file.c Tue Sep 10 21:13:37 2019 (r352192) @@ -7,10 +7,7 @@ * https://www.openssl.org/source/license.html */ -#ifndef HEADER_BSS_FILE_C -# define HEADER_BSS_FILE_C - -# if defined(__linux) || defined(__sun) || defined(__hpux) +#if defined(__linux) || defined(__sun) || defined(__hpux) /* * Following definition aliases fopen to fopen64 on above mentioned * platforms. This makes it possible to open and sequentially access files @@ -23,17 +20,17 @@ * of 32-bit platforms which allow for sequential access of large files * without extra "magic" comprise *BSD, Darwin, IRIX... */ -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 # endif +#endif -# include -# include -# include "bio_lcl.h" -# include +#include +#include +#include "bio_lcl.h" +#include -# if !defined(OPENSSL_NO_STDIO) +#if !defined(OPENSSL_NO_STDIO) static int file_write(BIO *h, const char *buf, int num); static int file_read(BIO *h, char *buf, int size); @@ -72,9 +69,9 @@ BIO *BIO_new_file(const char *filename, const char *mo SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); if (errno == ENOENT -# ifdef ENXIO +#ifdef ENXIO || errno == ENXIO -# endif +#endif ) BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); else @@ -212,33 +209,33 @@ static long file_ctrl(BIO *b, int cmd, long num, void b->shutdown = (int)num & BIO_CLOSE; b->ptr = ptr; b->init = 1; -# if BIO_FLAGS_UPLINK!=0 -# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) -# define _IOB_ENTRIES 20 -# endif +# if BIO_FLAGS_UPLINK!=0 +# if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES) +# define _IOB_ENTRIES 20 +# endif /* Safety net to catch purely internal BIO_set_fp calls */ -# if defined(_MSC_VER) && _MSC_VER>=1900 +# if defined(_MSC_VER) && _MSC_VER>=1900 if (ptr == stdin || ptr == stdout || ptr == stderr) BIO_clear_flags(b, BIO_FLAGS_UPLINK); -# elif defined(_IOB_ENTRIES) +# elif defined(_IOB_ENTRIES) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 21:15:01 2019 Return-Path: Delivered-To: svn-src-all@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 7E0A1E4BD3; Tue, 10 Sep 2019 21:15:01 +0000 (UTC) (envelope-from jkim@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 46Sd8j3YPNz432g; Tue, 10 Sep 2019 21:15:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5D7EA2C183; Tue, 10 Sep 2019 21:15:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ALF10s088461; Tue, 10 Sep 2019 21:15:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ALEuML088421; Tue, 10 Sep 2019 21:14:56 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909102114.x8ALEuML088421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 21:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352193 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bn crypto/openssl/crypto/cms crypto/openssl/crypto/ec crypto/openssl/crypto/pem cr... X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bn crypto/openssl/crypto/cms crypto/openssl/crypto/ec crypto/openssl/crypto/pem crypto/openssl/crypto/pkcs7... X-SVN-Commit-Revision: 352193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 21:15:01 -0000 Author: jkim Date: Tue Sep 10 21:14:56 2019 New Revision: 352193 URL: https://svnweb.freebsd.org/changeset/base/352193 Log: Merge OpenSSL 1.0.2t. Modified: stable/11/crypto/openssl/CHANGES stable/11/crypto/openssl/Configure stable/11/crypto/openssl/Makefile stable/11/crypto/openssl/NEWS stable/11/crypto/openssl/README stable/11/crypto/openssl/apps/CA.pl stable/11/crypto/openssl/crypto/arm_arch.h stable/11/crypto/openssl/crypto/armcap.c stable/11/crypto/openssl/crypto/bn/Makefile stable/11/crypto/openssl/crypto/bn/bn_lib.c stable/11/crypto/openssl/crypto/bn_int.h stable/11/crypto/openssl/crypto/cms/cms_env.c stable/11/crypto/openssl/crypto/cms/cms_lcl.h stable/11/crypto/openssl/crypto/cms/cms_smime.c stable/11/crypto/openssl/crypto/constant_time_locl.h stable/11/crypto/openssl/crypto/cryptlib.h stable/11/crypto/openssl/crypto/ec/Makefile stable/11/crypto/openssl/crypto/ec/ec.h stable/11/crypto/openssl/crypto/ec/ec_asn1.c stable/11/crypto/openssl/crypto/ec/ec_curve.c stable/11/crypto/openssl/crypto/ec/ec_err.c stable/11/crypto/openssl/crypto/ec/ec_lcl.h stable/11/crypto/openssl/crypto/ec/ec_lib.c stable/11/crypto/openssl/crypto/ec/ecp_nistp224.c stable/11/crypto/openssl/crypto/ec/ecp_nistp256.c stable/11/crypto/openssl/crypto/ec/ecp_nistp521.c stable/11/crypto/openssl/crypto/opensslv.h stable/11/crypto/openssl/crypto/pem/pvkfmt.c stable/11/crypto/openssl/crypto/pkcs7/pk7_doit.c stable/11/crypto/openssl/crypto/rsa/rsa_chk.c stable/11/crypto/openssl/crypto/x509/x509_cmp.c stable/11/crypto/openssl/crypto/x509v3/v3_alt.c stable/11/crypto/openssl/util/libeay.num stable/11/secure/lib/libcrypto/Makefile.inc stable/11/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/11/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/11/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/11/secure/lib/libcrypto/man/BIO_ctrl.3 stable/11/secure/lib/libcrypto/man/BIO_f_base64.3 stable/11/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/11/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/11/secure/lib/libcrypto/man/BIO_f_md.3 stable/11/secure/lib/libcrypto/man/BIO_f_null.3 stable/11/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/11/secure/lib/libcrypto/man/BIO_find_type.3 stable/11/secure/lib/libcrypto/man/BIO_new.3 stable/11/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/11/secure/lib/libcrypto/man/BIO_push.3 stable/11/secure/lib/libcrypto/man/BIO_read.3 stable/11/secure/lib/libcrypto/man/BIO_s_accept.3 stable/11/secure/lib/libcrypto/man/BIO_s_bio.3 stable/11/secure/lib/libcrypto/man/BIO_s_connect.3 stable/11/secure/lib/libcrypto/man/BIO_s_fd.3 stable/11/secure/lib/libcrypto/man/BIO_s_file.3 stable/11/secure/lib/libcrypto/man/BIO_s_mem.3 stable/11/secure/lib/libcrypto/man/BIO_s_null.3 stable/11/secure/lib/libcrypto/man/BIO_s_socket.3 stable/11/secure/lib/libcrypto/man/BIO_set_callback.3 stable/11/secure/lib/libcrypto/man/BIO_should_retry.3 stable/11/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_start.3 stable/11/secure/lib/libcrypto/man/BN_add.3 stable/11/secure/lib/libcrypto/man/BN_add_word.3 stable/11/secure/lib/libcrypto/man/BN_bn2bin.3 stable/11/secure/lib/libcrypto/man/BN_cmp.3 stable/11/secure/lib/libcrypto/man/BN_copy.3 stable/11/secure/lib/libcrypto/man/BN_generate_prime.3 stable/11/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/11/secure/lib/libcrypto/man/BN_new.3 stable/11/secure/lib/libcrypto/man/BN_num_bytes.3 stable/11/secure/lib/libcrypto/man/BN_rand.3 stable/11/secure/lib/libcrypto/man/BN_set_bit.3 stable/11/secure/lib/libcrypto/man/BN_swap.3 stable/11/secure/lib/libcrypto/man/BN_zero.3 stable/11/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/11/secure/lib/libcrypto/man/CMS_compress.3 stable/11/secure/lib/libcrypto/man/CMS_decrypt.3 stable/11/secure/lib/libcrypto/man/CMS_encrypt.3 stable/11/secure/lib/libcrypto/man/CMS_final.3 stable/11/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_type.3 stable/11/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/11/secure/lib/libcrypto/man/CMS_sign.3 stable/11/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/11/secure/lib/libcrypto/man/CMS_uncompress.3 stable/11/secure/lib/libcrypto/man/CMS_verify.3 stable/11/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/11/secure/lib/libcrypto/man/CONF_modules_free.3 stable/11/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/11/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/11/secure/lib/libcrypto/man/DH_generate_key.3 stable/11/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DH_new.3 stable/11/secure/lib/libcrypto/man/DH_set_method.3 stable/11/secure/lib/libcrypto/man/DH_size.3 stable/11/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/11/secure/lib/libcrypto/man/DSA_do_sign.3 stable/11/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/11/secure/lib/libcrypto/man/DSA_generate_key.3 stable/11/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DSA_new.3 stable/11/secure/lib/libcrypto/man/DSA_set_method.3 stable/11/secure/lib/libcrypto/man/DSA_sign.3 stable/11/secure/lib/libcrypto/man/DSA_size.3 stable/11/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/11/secure/lib/libcrypto/man/EC_KEY_new.3 stable/11/secure/lib/libcrypto/man/EC_POINT_add.3 stable/11/secure/lib/libcrypto/man/EC_POINT_new.3 stable/11/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/11/secure/lib/libcrypto/man/ERR_clear_error.3 stable/11/secure/lib/libcrypto/man/ERR_error_string.3 stable/11/secure/lib/libcrypto/man/ERR_get_error.3 stable/11/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/11/secure/lib/libcrypto/man/ERR_load_strings.3 stable/11/secure/lib/libcrypto/man/ERR_print_errors.3 stable/11/secure/lib/libcrypto/man/ERR_put_error.3 stable/11/secure/lib/libcrypto/man/ERR_remove_state.3 stable/11/secure/lib/libcrypto/man/ERR_set_mark.3 stable/11/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/11/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/11/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/11/secure/lib/libcrypto/man/EVP_SealInit.3 stable/11/secure/lib/libcrypto/man/EVP_SignInit.3 stable/11/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/11/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/11/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/11/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/11/secure/lib/libcrypto/man/OPENSSL_config.3 stable/11/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/11/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/11/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/11/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/11/secure/lib/libcrypto/man/PKCS12_create.3 stable/11/secure/lib/libcrypto/man/PKCS12_parse.3 stable/11/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/11/secure/lib/libcrypto/man/PKCS7_verify.3 stable/11/secure/lib/libcrypto/man/RAND_add.3 stable/11/secure/lib/libcrypto/man/RAND_bytes.3 stable/11/secure/lib/libcrypto/man/RAND_cleanup.3 stable/11/secure/lib/libcrypto/man/RAND_egd.3 stable/11/secure/lib/libcrypto/man/RAND_load_file.3 stable/11/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/11/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/11/secure/lib/libcrypto/man/RSA_check_key.3 stable/11/secure/lib/libcrypto/man/RSA_generate_key.3 stable/11/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/RSA_new.3 stable/11/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/11/secure/lib/libcrypto/man/RSA_print.3 stable/11/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_set_method.3 stable/11/secure/lib/libcrypto/man/RSA_sign.3 stable/11/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/11/secure/lib/libcrypto/man/RSA_size.3 stable/11/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/11/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/11/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/11/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/11/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/11/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/11/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/11/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/11/secure/lib/libcrypto/man/X509_check_host.3 stable/11/secure/lib/libcrypto/man/X509_check_private_key.3 stable/11/secure/lib/libcrypto/man/X509_cmp_time.3 stable/11/secure/lib/libcrypto/man/X509_new.3 stable/11/secure/lib/libcrypto/man/X509_verify_cert.3 stable/11/secure/lib/libcrypto/man/bio.3 stable/11/secure/lib/libcrypto/man/blowfish.3 stable/11/secure/lib/libcrypto/man/bn.3 stable/11/secure/lib/libcrypto/man/bn_internal.3 stable/11/secure/lib/libcrypto/man/buffer.3 stable/11/secure/lib/libcrypto/man/crypto.3 stable/11/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/11/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/11/secure/lib/libcrypto/man/d2i_DHparams.3 stable/11/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_ECPKParameters.3 stable/11/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_X509.3 stable/11/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/11/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/11/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/11/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/11/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/11/secure/lib/libcrypto/man/des.3 stable/11/secure/lib/libcrypto/man/dh.3 stable/11/secure/lib/libcrypto/man/dsa.3 stable/11/secure/lib/libcrypto/man/ec.3 stable/11/secure/lib/libcrypto/man/ecdsa.3 stable/11/secure/lib/libcrypto/man/engine.3 stable/11/secure/lib/libcrypto/man/err.3 stable/11/secure/lib/libcrypto/man/evp.3 stable/11/secure/lib/libcrypto/man/hmac.3 stable/11/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/11/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/11/secure/lib/libcrypto/man/lh_stats.3 stable/11/secure/lib/libcrypto/man/lhash.3 stable/11/secure/lib/libcrypto/man/md5.3 stable/11/secure/lib/libcrypto/man/mdc2.3 stable/11/secure/lib/libcrypto/man/pem.3 stable/11/secure/lib/libcrypto/man/rand.3 stable/11/secure/lib/libcrypto/man/rc4.3 stable/11/secure/lib/libcrypto/man/ripemd.3 stable/11/secure/lib/libcrypto/man/rsa.3 stable/11/secure/lib/libcrypto/man/sha.3 stable/11/secure/lib/libcrypto/man/threads.3 stable/11/secure/lib/libcrypto/man/ui.3 stable/11/secure/lib/libcrypto/man/ui_compat.3 stable/11/secure/lib/libcrypto/man/x509.3 stable/11/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/11/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 stable/11/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/11/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/11/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_free.3 stable/11/secure/lib/libssl/man/SSL_CTX_get0_param.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/11/secure/lib/libssl/man/SSL_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_curves.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 stable/11/secure/lib/libssl/man/SSL_SESSION_free.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/11/secure/lib/libssl/man/SSL_accept.3 stable/11/secure/lib/libssl/man/SSL_alert_type_string.3 stable/11/secure/lib/libssl/man/SSL_check_chain.3 stable/11/secure/lib/libssl/man/SSL_clear.3 stable/11/secure/lib/libssl/man/SSL_connect.3 stable/11/secure/lib/libssl/man/SSL_do_handshake.3 stable/11/secure/lib/libssl/man/SSL_export_keying_material.3 stable/11/secure/lib/libssl/man/SSL_free.3 stable/11/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/11/secure/lib/libssl/man/SSL_get_ciphers.3 stable/11/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/11/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/11/secure/lib/libssl/man/SSL_get_error.3 stable/11/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/11/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_get_fd.3 stable/11/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/11/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/11/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/11/secure/lib/libssl/man/SSL_get_rbio.3 stable/11/secure/lib/libssl/man/SSL_get_session.3 stable/11/secure/lib/libssl/man/SSL_get_verify_result.3 stable/11/secure/lib/libssl/man/SSL_get_version.3 stable/11/secure/lib/libssl/man/SSL_library_init.3 stable/11/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/11/secure/lib/libssl/man/SSL_new.3 stable/11/secure/lib/libssl/man/SSL_pending.3 stable/11/secure/lib/libssl/man/SSL_read.3 stable/11/secure/lib/libssl/man/SSL_rstate_string.3 stable/11/secure/lib/libssl/man/SSL_session_reused.3 stable/11/secure/lib/libssl/man/SSL_set_bio.3 stable/11/secure/lib/libssl/man/SSL_set_connect_state.3 stable/11/secure/lib/libssl/man/SSL_set_fd.3 stable/11/secure/lib/libssl/man/SSL_set_session.3 stable/11/secure/lib/libssl/man/SSL_set_shutdown.3 stable/11/secure/lib/libssl/man/SSL_set_verify_result.3 stable/11/secure/lib/libssl/man/SSL_shutdown.3 stable/11/secure/lib/libssl/man/SSL_state_string.3 stable/11/secure/lib/libssl/man/SSL_want.3 stable/11/secure/lib/libssl/man/SSL_write.3 stable/11/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/11/secure/lib/libssl/man/ssl.3 stable/11/secure/usr.bin/openssl/man/CA.pl.1 stable/11/secure/usr.bin/openssl/man/asn1parse.1 stable/11/secure/usr.bin/openssl/man/ca.1 stable/11/secure/usr.bin/openssl/man/ciphers.1 stable/11/secure/usr.bin/openssl/man/cms.1 stable/11/secure/usr.bin/openssl/man/crl.1 stable/11/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/11/secure/usr.bin/openssl/man/dgst.1 stable/11/secure/usr.bin/openssl/man/dhparam.1 stable/11/secure/usr.bin/openssl/man/dsa.1 stable/11/secure/usr.bin/openssl/man/dsaparam.1 stable/11/secure/usr.bin/openssl/man/ec.1 stable/11/secure/usr.bin/openssl/man/ecparam.1 stable/11/secure/usr.bin/openssl/man/enc.1 stable/11/secure/usr.bin/openssl/man/errstr.1 stable/11/secure/usr.bin/openssl/man/gendsa.1 stable/11/secure/usr.bin/openssl/man/genpkey.1 stable/11/secure/usr.bin/openssl/man/genrsa.1 stable/11/secure/usr.bin/openssl/man/nseq.1 stable/11/secure/usr.bin/openssl/man/ocsp.1 stable/11/secure/usr.bin/openssl/man/openssl.1 stable/11/secure/usr.bin/openssl/man/passwd.1 stable/11/secure/usr.bin/openssl/man/pkcs12.1 stable/11/secure/usr.bin/openssl/man/pkcs7.1 stable/11/secure/usr.bin/openssl/man/pkcs8.1 stable/11/secure/usr.bin/openssl/man/pkey.1 stable/11/secure/usr.bin/openssl/man/pkeyparam.1 stable/11/secure/usr.bin/openssl/man/pkeyutl.1 stable/11/secure/usr.bin/openssl/man/rand.1 stable/11/secure/usr.bin/openssl/man/req.1 stable/11/secure/usr.bin/openssl/man/rsa.1 stable/11/secure/usr.bin/openssl/man/rsautl.1 stable/11/secure/usr.bin/openssl/man/s_client.1 stable/11/secure/usr.bin/openssl/man/s_server.1 stable/11/secure/usr.bin/openssl/man/s_time.1 stable/11/secure/usr.bin/openssl/man/sess_id.1 stable/11/secure/usr.bin/openssl/man/smime.1 stable/11/secure/usr.bin/openssl/man/speed.1 stable/11/secure/usr.bin/openssl/man/spkac.1 stable/11/secure/usr.bin/openssl/man/ts.1 stable/11/secure/usr.bin/openssl/man/tsget.1 stable/11/secure/usr.bin/openssl/man/verify.1 stable/11/secure/usr.bin/openssl/man/version.1 stable/11/secure/usr.bin/openssl/man/x509.1 stable/11/secure/usr.bin/openssl/man/x509v3_config.1 Modified: stable/11/crypto/openssl/CHANGES ============================================================================== --- stable/11/crypto/openssl/CHANGES Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/CHANGES Tue Sep 10 21:14:56 2019 (r352193) @@ -7,6 +7,48 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2s and 1.0.2t [10 Sep 2019] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Document issue with installation paths in diverse Windows builds + + '/usr/local/ssl' is an unsafe prefix for location to install OpenSSL + binaries and run-time config file. + (CVE-2019-1552) + [Richard Levitte] + Changes between 1.0.2r and 1.0.2s [28 May 2019] *) Change the default RSA, DSA and DH size to 2048 bit instead of 1024. Modified: stable/11/crypto/openssl/Configure ============================================================================== --- stable/11/crypto/openssl/Configure Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/Configure Tue Sep 10 21:14:56 2019 (r352193) @@ -118,7 +118,7 @@ my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wn # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token # -Wextended-offsetof -my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; +my $clang_disabled_warnings = "-Wno-unknown-warning-option -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; # These are used in addition to $gcc_devteam_warn when the compiler is clang. # TODO(openssl-team): fix problems and investigate if (at least) the @@ -128,7 +128,7 @@ my $clang_disabled_warnings = "-Wno-unused-parameter - # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token # -Wextended-offsetof -my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; +my $clang_devteam_warn = "-Wno-unknown-warning-option -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; # Warn that "make depend" should be run? my $warn_make_depend = 0; Modified: stable/11/crypto/openssl/Makefile ============================================================================== --- stable/11/crypto/openssl/Makefile Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/Makefile Tue Sep 10 21:14:56 2019 (r352193) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2s +VERSION=1.0.2t MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -70,7 +70,7 @@ AR= ar $(ARFLAGS) r RANLIB= /usr/bin/ranlib RC= windres NM= nm -PERL= /usr/local/bin/perl +PERL= /usr/bin/perl TAR= tar TARFLAGS= --no-recursion MAKEDEPPROG= gcc Modified: stable/11/crypto/openssl/NEWS ============================================================================== --- stable/11/crypto/openssl/NEWS Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/NEWS Tue Sep 10 21:14:56 2019 (r352193) @@ -5,6 +5,21 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2s and OpenSSL 1.0.2t [10 Sep 2019] + + o Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey + (CVE-2019-1563) + o For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters + o Compute ECC cofactors if not provided during EC_GROUP construction + (CVE-2019-1547) + o Document issue with installation paths in diverse Windows builds + (CVE-2019-1552) + + Major changes between OpenSSL 1.0.2r and OpenSSL 1.0.2s [28 May 2019] + + o None + Major changes between OpenSSL 1.0.2q and OpenSSL 1.0.2r [26 Feb 2019] o 0-byte record padding oracle (CVE-2019-1559) Modified: stable/11/crypto/openssl/README ============================================================================== --- stable/11/crypto/openssl/README Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/README Tue Sep 10 21:14:56 2019 (r352193) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2s 28 May 2019 + OpenSSL 1.0.2t 10 Sep 2019 Copyright (c) 1998-2019 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/11/crypto/openssl/apps/CA.pl ============================================================================== --- stable/11/crypto/openssl/apps/CA.pl Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/apps/CA.pl Tue Sep 10 21:14:56 2019 (r352193) @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # # CA - wrapper around ca to make it easier to use ... basically ca requires # some setup stuff to be done before you can use it and this makes Modified: stable/11/crypto/openssl/crypto/arm_arch.h ============================================================================== --- stable/11/crypto/openssl/crypto/arm_arch.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/arm_arch.h Tue Sep 10 21:14:56 2019 (r352193) @@ -64,7 +64,7 @@ # endif # endif -# if !__ASSEMBLER__ +# ifndef __ASSEMBLER__ extern unsigned int OPENSSL_armcap_P; # endif Modified: stable/11/crypto/openssl/crypto/armcap.c ============================================================================== --- stable/11/crypto/openssl/crypto/armcap.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/armcap.c Tue Sep 10 21:14:56 2019 (r352193) @@ -5,6 +5,7 @@ #include #include +#include "cryptlib.h" #include "arm_arch.h" __attribute__ ((visibility("hidden"))) Modified: stable/11/crypto/openssl/crypto/bn/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/bn/Makefile Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/bn/Makefile Tue Sep 10 21:14:56 2019 (r352193) @@ -297,8 +297,8 @@ bn_lib.o: ../../include/openssl/e_os2.h ../../include/ bn_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_lcl.h -bn_lib.o: bn_lib.c +bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../constant_time_locl.h +bn_lib.o: ../cryptlib.h bn_lcl.h bn_lib.c bn_mod.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_mod.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_mod.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h Modified: stable/11/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_lib.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/bn/bn_lib.c Tue Sep 10 21:14:56 2019 (r352193) @@ -66,6 +66,7 @@ #include #include "cryptlib.h" #include "bn_lcl.h" +#include "constant_time_locl.h" const char BN_version[] = "Big Number" OPENSSL_VERSION_PTEXT; @@ -187,13 +188,57 @@ int BN_num_bits_word(BN_ULONG l) return bits; } +/* + * This function still leaks `a->dmax`: it's caller's responsibility to + * expand the input `a` in advance to a public length. + */ +static inline +int bn_num_bits_consttime(const BIGNUM *a) +{ + int j, ret; + unsigned int mask, past_i; + int i = a->top - 1; + bn_check_top(a); + + for (j = 0, past_i = 0, ret = 0; j < a->dmax; j++) { + mask = constant_time_eq_int(i, j); /* 0xff..ff if i==j, 0x0 otherwise */ + + ret += BN_BITS2 & (~mask & ~past_i); + ret += BN_num_bits_word(a->d[j]) & mask; + + past_i |= mask; /* past_i will become 0xff..ff after i==j */ + } + + /* + * if BN_is_zero(a) => i is -1 and ret contains garbage, so we mask the + * final result. + */ + mask = ~(constant_time_eq_int(i, ((int)-1))); + + return ret & mask; +} + int BN_num_bits(const BIGNUM *a) { int i = a->top - 1; bn_check_top(a); + if (a->flags & BN_FLG_CONSTTIME) { + /* + * We assume that BIGNUMs flagged as CONSTTIME have also been expanded + * so that a->dmax is not leaking secret information. + * + * In other words, it's the caller's responsibility to ensure `a` has + * been preallocated in advance to a public length if we hit this + * branch. + * + */ + return bn_num_bits_consttime(a); + } + if (BN_is_zero(a)) return 0; + return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); } @@ -613,8 +658,11 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIG return (ret); } +typedef enum {big, little} endianess_t; + /* ignore negative */ -static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) +static +int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen, endianess_t endianess) { int n; size_t i, lasti, j, atop, mask; @@ -646,10 +694,17 @@ static int bn2binpad(const BIGNUM *a, unsigned char *t lasti = atop - 1; atop = a->top * BN_BYTES; - for (i = 0, j = 0, to += tolen; j < (size_t)tolen; j++) { + if (endianess == big) + to += tolen; /* start from the end of the buffer */ + for (i = 0, j = 0; j < (size_t)tolen; j++) { + unsigned char val; l = a->d[i / BN_BYTES]; mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1)); - *--to = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + val = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + if (endianess == big) + *--to = val; + else + *to++ = val; i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */ } @@ -660,21 +715,66 @@ int bn_bn2binpad(const BIGNUM *a, unsigned char *to, i { if (tolen < 0) return -1; - return bn2binpad(a, to, tolen); + return bn2binpad(a, to, tolen, big); } int BN_bn2bin(const BIGNUM *a, unsigned char *to) { - int n, i; + return bn2binpad(a, to, -1, big); +} + +BIGNUM *bn_lebin2bn(const unsigned char *s, int len, BIGNUM *ret) +{ + unsigned int i, m; + unsigned int n; BN_ULONG l; + BIGNUM *bn = NULL; - bn_check_top(a); - n = i = BN_num_bytes(a); - while (i--) { - l = a->d[i / BN_BYTES]; - *(to++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff; + if (ret == NULL) + ret = bn = BN_new(); + if (ret == NULL) + return NULL; + bn_check_top(ret); + s += len; + /* Skip trailing zeroes. */ + for ( ; len > 0 && s[-1] == 0; s--, len--) + continue; + n = len; + if (n == 0) { + ret->top = 0; + return ret; } - return (n); + i = ((n - 1) / BN_BYTES) + 1; + m = ((n - 1) % (BN_BYTES)); + if (bn_wexpand(ret, (int)i) == NULL) { + BN_free(bn); + return NULL; + } + ret->top = i; + ret->neg = 0; + l = 0; + while (n--) { + s--; + l = (l << 8L) | *s; + if (m-- == 0) { + ret->d[--i] = l; + l = 0; + m = BN_BYTES - 1; + } + } + /* + * need to call this due to clear byte at top if avoiding having the top + * bit set (-ve number) + */ + bn_correct_top(ret); + return ret; +} + +int bn_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen) +{ + if (tolen < 0) + return -1; + return bn2binpad(a, to, tolen, little); } int BN_ucmp(const BIGNUM *a, const BIGNUM *b) Modified: stable/11/crypto/openssl/crypto/bn_int.h ============================================================================== --- stable/11/crypto/openssl/crypto/bn_int.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/bn_int.h Tue Sep 10 21:14:56 2019 (r352193) @@ -19,3 +19,6 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); + +BIGNUM *bn_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); +int bn_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen); Modified: stable/11/crypto/openssl/crypto/cms/cms_env.c ============================================================================== --- stable/11/crypto/openssl/crypto/cms/cms_env.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/cms/cms_env.c Tue Sep 10 21:14:56 2019 (r352193) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -422,6 +422,7 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI unsigned char *ek = NULL; size_t eklen; int ret = 0; + size_t fixlen = 0; CMS_EncryptedContentInfo *ec; ec = cms->d.envelopedData->encryptedContentInfo; @@ -430,6 +431,19 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI return 0; } + if (cms->d.envelopedData->encryptedContentInfo->havenocert + && !cms->d.envelopedData->encryptedContentInfo->debug) { + X509_ALGOR *calg = ec->contentEncryptionAlgorithm; + const EVP_CIPHER *ciph = EVP_get_cipherbyobj(calg->algorithm); + + if (ciph == NULL) { + CMSerr(CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT, CMS_R_UNKNOWN_CIPHER); + return 0; + } + + fixlen = EVP_CIPHER_key_length(ciph); + } + ktri->pctx = EVP_PKEY_CTX_new(pkey, NULL); if (!ktri->pctx) return 0; @@ -460,7 +474,9 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentI if (EVP_PKEY_decrypt(ktri->pctx, ek, &eklen, ktri->encryptedKey->data, - ktri->encryptedKey->length) <= 0) { + ktri->encryptedKey->length) <= 0 + || eklen == 0 + || (fixlen != 0 && eklen != fixlen)) { CMSerr(CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT, CMS_R_CMS_LIB); goto err; } Modified: stable/11/crypto/openssl/crypto/cms/cms_lcl.h ============================================================================== --- stable/11/crypto/openssl/crypto/cms/cms_lcl.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/cms/cms_lcl.h Tue Sep 10 21:14:56 2019 (r352193) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -172,6 +172,8 @@ struct CMS_EncryptedContentInfo_st { size_t keylen; /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */ int debug; + /* Set to 1 if we have no cert and need extra safety measures for MMA */ + int havenocert; }; struct CMS_RecipientInfo_st { Modified: stable/11/crypto/openssl/crypto/cms/cms_smime.c ============================================================================== --- stable/11/crypto/openssl/crypto/cms/cms_smime.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/cms/cms_smime.c Tue Sep 10 21:14:56 2019 (r352193) @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 2008-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -737,6 +737,10 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X5 cms->d.envelopedData->encryptedContentInfo->debug = 1; else cms->d.envelopedData->encryptedContentInfo->debug = 0; + if (!cert) + cms->d.envelopedData->encryptedContentInfo->havenocert = 1; + else + cms->d.envelopedData->encryptedContentInfo->havenocert = 0; if (!pk && !cert && !dcont && !out) return 1; if (pk && !CMS_decrypt_set1_pkey(cms, pk, cert)) Modified: stable/11/crypto/openssl/crypto/constant_time_locl.h ============================================================================== --- stable/11/crypto/openssl/crypto/constant_time_locl.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/constant_time_locl.h Tue Sep 10 21:14:56 2019 (r352193) @@ -6,7 +6,7 @@ * Based on previous work by Bodo Moeller, Emilia Kasper, Adam Langley * (Google). * ==================================================================== - * Copyright (c) 2014 The OpenSSL Project. All rights reserved. + * Copyright (c) 2014-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -185,11 +185,29 @@ static inline unsigned char constant_time_eq_int_8(int return constant_time_eq_8((unsigned)(a), (unsigned)(b)); } +/* + * Returns the value unmodified, but avoids optimizations. + * The barriers prevent the compiler from narrowing down the + * possible value range of the mask and ~mask in the select + * statements, which avoids the recognition of the select + * and turning it into a conditional load or branch. + */ +static inline unsigned int value_barrier(unsigned int a) +{ +#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) + unsigned int r; + __asm__("" : "=r"(r) : "0"(a)); +#else + volatile unsigned int r = a; +#endif + return r; +} + static inline unsigned int constant_time_select(unsigned int mask, unsigned int a, unsigned int b) { - return (mask & a) | (~mask & b); + return (value_barrier(mask) & a) | (value_barrier(~mask) & b); } static inline unsigned char constant_time_select_8(unsigned char mask, Modified: stable/11/crypto/openssl/crypto/cryptlib.h ============================================================================== --- stable/11/crypto/openssl/crypto/cryptlib.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/cryptlib.h Tue Sep 10 21:14:56 2019 (r352193) @@ -106,6 +106,8 @@ extern int OPENSSL_NONPIC_relocated; char *ossl_safe_getenv(const char *); +unsigned long OPENSSL_rdtsc(void); + #ifdef __cplusplus } #endif Modified: stable/11/crypto/openssl/crypto/ec/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/ec/Makefile Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/Makefile Tue Sep 10 21:14:56 2019 (r352193) @@ -156,7 +156,7 @@ ec_curve.o: ../../include/openssl/err.h ../../include/ ec_curve.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h +ec_curve.o: ../../include/openssl/symhacks.h ../bn_int.h ec_curve.c ec_lcl.h ec_cvt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ec_cvt.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h ec_cvt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h Modified: stable/11/crypto/openssl/crypto/ec/ec.h ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec.h Tue Sep 10 21:14:56 2019 (r352193) @@ -7,7 +7,7 @@ * \author Originally written by Bodo Moeller for the OpenSSL project */ /* ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1073,6 +1073,7 @@ int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int o * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_EC_strings(void); /* Error codes for the EC functions. */ @@ -1270,13 +1271,14 @@ void ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 152 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 # define EC_R_WRONG_CURVE_PARAMETERS 145 # define EC_R_WRONG_ORDER 130 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif Modified: stable/11/crypto/openssl/crypto/ec/ec_asn1.c ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_asn1.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec_asn1.c Tue Sep 10 21:14:56 2019 (r352193) @@ -3,7 +3,7 @@ * Written by Nils Larsch for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -695,10 +695,12 @@ ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GR static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params) { int ok = 0, tmp; - EC_GROUP *ret = NULL; + EC_GROUP *ret = NULL, *dup = NULL; BIGNUM *p = NULL, *a = NULL, *b = NULL; EC_POINT *point = NULL; long field_bits; + int curve_name = NID_undef; + BN_CTX *ctx = NULL; if (!params->fieldID || !params->fieldID->fieldType || !params->fieldID->p.ptr) { @@ -914,13 +916,75 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARA goto err; } + /* + * Check if the explicit parameters group just created matches one of the + * built-in curves. + * + * We create a copy of the group just built, so that we can remove optional + * fields for the lookup: we do this to avoid the possibility that one of + * the optional parameters is used to force the library into using a less + * performant and less secure EC_METHOD instead of the specialized one. + * In any case, `seed` is not really used in any computation, while a + * cofactor different from the one in the built-in table is just + * mathematically wrong anyway and should not be used. + */ + if ((ctx = BN_CTX_new()) == NULL) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB); + goto err; + } + if ((dup = EC_GROUP_dup(ret)) == NULL + || EC_GROUP_set_seed(dup, NULL, 0) != 1 + || !EC_GROUP_set_generator(dup, point, a, NULL)) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); + goto err; + } + if ((curve_name = ec_curve_nid_from_params(dup, ctx)) != NID_undef) { + /* + * The input explicit parameters successfully matched one of the + * built-in curves: often for built-in curves we have specialized + * methods with better performance and hardening. + * + * In this case we replace the `EC_GROUP` created through explicit + * parameters with one created from a named group. + */ + EC_GROUP *named_group = NULL; + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 + /* + * NID_wap_wsg_idm_ecid_wtls12 and NID_secp224r1 are both aliases for + * the same curve, we prefer the SECP nid when matching explicit + * parameters as that is associated with a specialized EC_METHOD. + */ + if (curve_name == NID_wap_wsg_idm_ecid_wtls12) + curve_name = NID_secp224r1; +#endif /* !def(OPENSSL_NO_EC_NISTP_64_GCC_128) */ + + if ((named_group = EC_GROUP_new_by_curve_name(curve_name)) == NULL) { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); + goto err; + } + EC_GROUP_free(ret); + ret = named_group; + + /* + * Set the flag so that EC_GROUPs created from explicit parameters are + * serialized using explicit parameters by default. + * + * 0x0 = OPENSSL_EC_EXPLICIT_CURVE + */ + EC_GROUP_set_asn1_flag(ret, 0x0); + } + ok = 1; - err:if (!ok) { + err: + if (!ok) { if (ret) - EC_GROUP_clear_free(ret); + EC_GROUP_free(ret); ret = NULL; } + if (dup) + EC_GROUP_free(dup); if (p) BN_free(p); @@ -930,6 +994,8 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARA BN_free(b); if (point) EC_POINT_free(point); + if (ctx) + BN_CTX_free(ctx); return (ret); } @@ -990,7 +1056,7 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsig } if (a && *a) - EC_GROUP_clear_free(*a); + EC_GROUP_free(*a); if (a) *a = group; @@ -1040,7 +1106,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned ch if (priv_key->parameters) { if (ret->group) - EC_GROUP_clear_free(ret->group); + EC_GROUP_free(ret->group); ret->group = ec_asn1_pkparameters2group(priv_key->parameters); } Modified: stable/11/crypto/openssl/crypto/ec/ec_curve.c ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_curve.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec_curve.c Tue Sep 10 21:14:56 2019 (r352193) @@ -3,7 +3,7 @@ * Written by Nils Larsch for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,6 +75,8 @@ #include #include +#include "bn_int.h" + #ifdef OPENSSL_FIPS # include #endif @@ -3245,4 +3247,116 @@ int EC_curve_nist2nid(const char *name) return nist_curves[i].nid; } return NID_undef; +} + +#define NUM_BN_FIELDS 6 +/* + * Validates EC domain parameter data for known named curves. + * This can be used when a curve is loaded explicitly (without a curve + * name) or to validate that domain parameters have not been modified. + * + * Returns: The nid associated with the found named curve, or NID_undef + * if not found. If there was an error it returns -1. + */ +int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx) +{ + int ret = -1, nid, len, field_type, param_len; + size_t i, seed_len; + const unsigned char *seed, *params_seed, *params; + unsigned char *param_bytes = NULL; + const EC_CURVE_DATA *data; + const EC_POINT *generator = NULL; + const EC_METHOD *meth; + const BIGNUM *cofactor = NULL; + /* An array of BIGNUMs for (p, a, b, x, y, order) */ + BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL}; + + meth = EC_GROUP_method_of(group); + if (meth == NULL) + return -1; + /* Use the optional named curve nid as a search field */ + nid = EC_GROUP_get_curve_name(group); + field_type = EC_METHOD_get_field_type(meth); + seed_len = EC_GROUP_get_seed_len(group); + seed = EC_GROUP_get0_seed(group); + cofactor = &group->cofactor; + + BN_CTX_start(ctx); + + /* + * The built-in curves contains data fields (p, a, b, x, y, order) that are + * all zero-padded to be the same size. The size of the padding is + * determined by either the number of bytes in the field modulus (p) or the + * EC group order, whichever is larger. + */ + param_len = BN_num_bytes(&group->order); + len = BN_num_bytes(&group->field); + if (len > param_len) + param_len = len; + + /* Allocate space to store the padded data for (p, a, b, x, y, order) */ + param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS); + if (param_bytes == NULL) + goto end; + + /* Create the bignums */ + for (i = 0; i < NUM_BN_FIELDS; ++i) { + if ((bn[i] = BN_CTX_get(ctx)) == NULL) + goto end; + } + /* + * Fill in the bn array with the same values as the internal curves + * i.e. the values are p, a, b, x, y, order. + */ + /* Get p, a & b */ + if (!(ec_group_get_curve(group, bn[0], bn[1], bn[2], ctx) + && ((generator = EC_GROUP_get0_generator(group)) != NULL) + /* Get x & y */ + && ec_point_get_affine_coordinates(group, generator, bn[3], bn[4], ctx) + /* Get order */ + && EC_GROUP_get_order(group, bn[5], ctx))) + goto end; + + /* + * Convert the bignum array to bytes that are joined together to form + * a single buffer that contains data for all fields. + * (p, a, b, x, y, order) are all zero padded to be the same size. + */ + for (i = 0; i < NUM_BN_FIELDS; ++i) { + if (bn_bn2binpad(bn[i], ¶m_bytes[i*param_len], param_len) <= 0) + goto end; + } + + for (i = 0; i < curve_list_length; i++) { + const ec_list_element curve = curve_list[i]; + + data = curve.data; + /* Get the raw order byte data */ + params_seed = (const unsigned char *)(data + 1); /* skip header */ + params = params_seed + data->seed_len; + + /* Look for unique fields in the fixed curve data */ + if (data->field_type == field_type + && param_len == data->param_len + && (nid <= 0 || nid == curve.nid) + /* check the optional cofactor (ignore if its zero) */ + && (BN_is_zero(cofactor) + || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor)) + /* Check the optional seed (ignore if its not set) */ + && (data->seed_len == 0 || seed_len == 0 + || ((size_t)data->seed_len == seed_len + && memcmp(params_seed, seed, seed_len) == 0)) + /* Check that the groups params match the built-in curve params */ + && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS) + == 0) { + ret = curve.nid; + goto end; + } + } + /* Gets here if the group was not found */ + ret = NID_undef; +end: + OPENSSL_free(param_bytes); + BN_CTX_end(ctx); + return ret; } Modified: stable/11/crypto/openssl/crypto/ec/ec_err.c ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_err.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec_err.c Tue Sep 10 21:14:56 2019 (r352193) @@ -1,6 +1,6 @@ /* crypto/ec/ec_err.c */ /* ==================================================================== - * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -310,6 +310,7 @@ static ERR_STRING_DATA EC_str_reasons[] = { {ERR_REASON(EC_R_SLOT_FULL), "slot full"}, {ERR_REASON(EC_R_UNDEFINED_GENERATOR), "undefined generator"}, {ERR_REASON(EC_R_UNDEFINED_ORDER), "undefined order"}, + {ERR_REASON(EC_R_UNKNOWN_COFACTOR), "unknown cofactor"}, {ERR_REASON(EC_R_UNKNOWN_GROUP), "unknown group"}, {ERR_REASON(EC_R_UNKNOWN_ORDER), "unknown order"}, {ERR_REASON(EC_R_UNSUPPORTED_FIELD), "unsupported field"}, Modified: stable/11/crypto/openssl/crypto/ec/ec_lcl.h ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_lcl.h Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec_lcl.h Tue Sep 10 21:14:56 2019 (r352193) @@ -3,7 +3,7 @@ * Originally written by Bodo Moeller for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -565,3 +565,18 @@ EC_GROUP *FIPS_ec_group_new_curve_gf2m(const BIGNUM *p const BIGNUM *b, BN_CTX *ctx); EC_GROUP *FIPS_ec_group_new_by_curve_name(int nid); #endif + +int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx); + +/* + * The next 2 functions are just internal wrappers around the omonimous + * functions with either the `_GFp` or the `_GF2m` suffix. + * + * They are meant to facilitate backporting of code from newer branches, where + * the public API includes a "field agnostic" version of these 2 functions. + */ +int ec_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, + BIGNUM *b, BN_CTX *ctx); +int ec_point_get_affine_coordinates(const EC_GROUP *group, + const EC_POINT *point, BIGNUM *x, + BIGNUM *y, BN_CTX *ctx); Modified: stable/11/crypto/openssl/crypto/ec/ec_lib.c ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_lib.c Tue Sep 10 21:13:37 2019 (r352192) +++ stable/11/crypto/openssl/crypto/ec/ec_lib.c Tue Sep 10 21:14:56 2019 (r352193) @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth) return meth->field_type; } +/*- + * Try computing cofactor from the generator order (n) and field cardinality (q). + * This works for all curves of cryptographic interest. + * + * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q) + * h_min = (q + 1 - 2*sqrt(q))/n + * h_max = (q + 1 + 2*sqrt(q))/n + * h_max - h_min = 4*sqrt(q)/n + * So if n > 4*sqrt(q) holds, there is only one possible value for h: + * h = \lfloor (h_min + h_max)/2 \rceil = \lfloor (q + 1)/n \rceil + * + * Otherwise, zero cofactor and return success. + */ +static int ec_guess_cofactor(EC_GROUP *group) { + int ret = 0; + BN_CTX *ctx = NULL; + BIGNUM *q = NULL; + + /*- + * If the cofactor is too large, we cannot guess it. + * The RHS of below is a strict overestimate of lg(4 * sqrt(q)) + */ + if (BN_num_bits(&group->order) <= (BN_num_bits(&group->field) + 1) / 2 + 3) { + /* default to 0 */ + BN_zero(&group->cofactor); + /* return success */ + return 1; + } + + if ((ctx = BN_CTX_new()) == NULL) + return 0; + + BN_CTX_start(ctx); + if ((q = BN_CTX_get(ctx)) == NULL) + goto err; + + /* set q = 2**m for binary fields; q = p otherwise */ + if (group->meth->field_type == NID_X9_62_characteristic_two_field) { + BN_zero(q); + if (!BN_set_bit(q, BN_num_bits(&group->field) - 1)) + goto err; + } else { + if (!BN_copy(q, &group->field)) + goto err; + } + + /* compute h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2)/n \rfloor */ + if (!BN_rshift1(&group->cofactor, &group->order) /* n/2 */ + || !BN_add(&group->cofactor, &group->cofactor, q) /* q + n/2 */ + /* q + 1 + n/2 */ + || !BN_add(&group->cofactor, &group->cofactor, BN_value_one()) + /* (q + 1 + n/2)/n */ + || !BN_div(&group->cofactor, NULL, &group->cofactor, &group->order, ctx)) + goto err; + ret = 1; + err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ret; +} + int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor) { @@ -302,6 +363,33 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P return 0; } + /* require group->field >= 1 */ + if (BN_is_zero(&group->field) || BN_is_negative(&group->field)) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_INVALID_FIELD); + return 0; + } + + /*- + * - require order >= 1 + * - enforce upper bound due to Hasse thm: order can be no more than one bit + * longer than field cardinality + */ + if (order == NULL || BN_is_zero(order) || BN_is_negative(order) + || BN_num_bits(order) > BN_num_bits(&group->field) + 1) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + /*- + * Unfortunately the cofactor is an optional field in many standards. + * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor". + * So accept cofactor == NULL or cofactor >= 0. + */ + if (cofactor != NULL && BN_is_negative(cofactor)) { + ECerr(EC_F_EC_GROUP_SET_GENERATOR, EC_R_UNKNOWN_COFACTOR); + return 0; + } + if (group->generator == NULL) { group->generator = EC_POINT_new(group); if (group->generator == NULL) @@ -310,17 +398,17 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P if (!EC_POINT_copy(group->generator, generator)) return 0; - if (order != NULL) { - if (!BN_copy(&group->order, order)) - return 0; - } else - BN_zero(&group->order); + if (!BN_copy(&group->order, order)) + return 0; - if (cofactor != NULL) { + /* Either take the provided positive cofactor, or try to compute it */ + if (cofactor != NULL && !BN_is_zero(cofactor)) { if (!BN_copy(&group->cofactor, cofactor)) return 0; - } else + } else if (!ec_guess_cofactor(group)) { BN_zero(&group->cofactor); + return 0; + } /*- * Access to the `mont_data` field of an EC_GROUP struct should always be @@ -1168,4 +1256,61 @@ int ec_precompute_mont_data(EC_GROUP *group) if (ctx) BN_CTX_free(ctx); return ret; +} + +/* + * This is just a wrapper around the public functions + * - EC_GROUP_get_curve_GF2m + * - EC_GROUP_get_curve_GFp + * + * It is meant to facilitate backporting of code from newer branches, where + * the public API includes a "field agnostic" version of it. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 10 21:30:38 2019 Return-Path: Delivered-To: svn-src-all@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 E00B6E5297; Tue, 10 Sep 2019 21:30:38 +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 46SdVk5gDDz43fH; Tue, 10 Sep 2019 21:30:38 +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 A6D342C364; Tue, 10 Sep 2019 21:30:38 +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 x8ALUcdM094706; Tue, 10 Sep 2019 21:30:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ALUc93094699; Tue, 10 Sep 2019 21:30:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909102130.x8ALUc93094699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Sep 2019 21:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352194 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 352194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 21:30:38 -0000 Author: kevans Date: Tue Sep 10 21:30:38 2019 New Revision: 352194 URL: https://svnweb.freebsd.org/changeset/base/352194 Log: lualoader: Revert to ASCII menu frame for serial console The box drawing characters we use aren't necessarily safe with a serial console; for instance, in the report by npn@, these were causing his xterm to send back a sequence that lua picked up as input and halted the boot. This is less than ideal. Fallback to ASCII frames for console with 'comconsole' in it. This is a partial revert r338108 by imp@ -- instead of removing the menu entirely and disabling color/cursor sequences, just reverting the default frame to ASCII is enough to not break in this setup. Reported by: npn Triaged and recommended by: tsoome Modified: head/stand/lua/core.lua head/stand/lua/drawer.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Tue Sep 10 21:14:56 2019 (r352193) +++ head/stand/lua/core.lua Tue Sep 10 21:30:38 2019 (r352194) @@ -325,6 +325,16 @@ function core.isZFSBoot() return false end +function core.isSerialConsole() + local c = loader.getenv("console") + if c ~= nil then + if c:find("comconsole") ~= nil then + return true + end + end + return false +end + function core.isSerialBoot() local s = loader.getenv("boot_serial") if s ~= nil then Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Tue Sep 10 21:14:56 2019 (r352193) +++ head/stand/lua/drawer.lua Tue Sep 10 21:30:38 2019 (r352194) @@ -144,13 +144,20 @@ local function drawmenu(menudef) return alias_table end +local function defaultframe() + if core.isSerialConsole() then + return "ascii" + end + return "double" +end + local function drawbox() local x = menu_position.x - 3 local y = menu_position.y - 1 local w = frame_size.w local h = frame_size.h - local framestyle = loader.getenv("loader_menu_frame") or "double" + local framestyle = loader.getenv("loader_menu_frame") or defaultframe() local framespec = drawer.frame_styles[framestyle] -- If we don't have a framespec for the current frame style, just don't -- draw a box. From owner-svn-src-all@freebsd.org Tue Sep 10 21:53:43 2019 Return-Path: Delivered-To: svn-src-all@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 AA0BCE5D18; Tue, 10 Sep 2019 21:53:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sf1M43DJz455R; Tue, 10 Sep 2019 21:53:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E2B02C8B9; Tue, 10 Sep 2019 21:53:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ALrhCs012275; Tue, 10 Sep 2019 21:53:43 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ALrhPU012273; Tue, 10 Sep 2019 21:53:43 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909102153.x8ALrhPU012273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 10 Sep 2019 21:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352195 - in head/stand/i386: libi386 loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/i386: libi386 loader X-SVN-Commit-Revision: 352195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 21:53:43 -0000 Author: tsoome Date: Tue Sep 10 21:53:42 2019 New Revision: 352195 URL: https://svnweb.freebsd.org/changeset/base/352195 Log: loader: vidconsole should set LINES and COLUMNS Set LINES and COLUMNS based on terminal dimensions. Modified: head/stand/i386/libi386/vidconsole.c head/stand/i386/loader/main.c Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Tue Sep 10 21:30:38 2019 (r352194) +++ head/stand/i386/libi386/vidconsole.c Tue Sep 10 21:53:42 2019 (r352195) @@ -574,6 +574,7 @@ vidc_init(int arg) { const teken_attr_t *a; int val; + char env[8]; if (vidc_started && arg == 0) return (0); @@ -605,6 +606,11 @@ vidc_init(int arg) teken_init(&teken, &tf, NULL); teken_set_winsize(&teken, &tp); a = teken_get_defattr(&teken); + + snprintf(env, sizeof (env), "%u", tp.tp_row); + setenv("LINES", env, 1); + snprintf(env, sizeof (env), "%u", tp.tp_col); + setenv("COLUMNS", env, 1); for (int row = 0; row < tp.tp_row; row++) for (int col = 0; col < tp.tp_col; col++) { Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Tue Sep 10 21:30:38 2019 (r352194) +++ head/stand/i386/loader/main.c Tue Sep 10 21:53:42 2019 (r352195) @@ -238,7 +238,6 @@ main(void) printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ - setenv("LINES", "24", 1); /* optional */ bios_getsmap(); From owner-svn-src-all@freebsd.org Tue Sep 10 22:08:35 2019 Return-Path: Delivered-To: svn-src-all@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 584FEE6018; Tue, 10 Sep 2019 22:08:35 +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 46SfLW1f8Sz45bn; Tue, 10 Sep 2019 22:08:35 +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 1BF3D2CA77; Tue, 10 Sep 2019 22:08:35 +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 x8AM8YfP018428; Tue, 10 Sep 2019 22:08:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AM8YUP018427; Tue, 10 Sep 2019 22:08:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909102208.x8AM8YUP018427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Sep 2019 22:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352196 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 352196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 22:08:35 -0000 Author: ian Date: Tue Sep 10 22:08:34 2019 New Revision: 352196 URL: https://svnweb.freebsd.org/changeset/base/352196 Log: In am335x_dmtpps, use a spin mutex to interlock between PPS capture and PPS ioctl(2) handling. This allows doing the pps_event() work in the polling routine, instead of using a taskqueue task to do that work. Also, add PNPINFO, and switch to using make_dev_s() to create the cdev. Using a spin mutex and calling pps_event() from the polling function works around the situation which requires more than 2 sets of timecounter timehands in a single-core system to get reliable PPS capture. That problem would happen when a single-core system is idle in cpu_idle() then gets woken up with an event timer event which was scheduled to handle a hardclock tick. That processing path would end up calling tc_windup 3 or 4 times between when the tc polling function was called and when the taskqueue task would eventually run, and with only two sets of timehands, the th_generation count would always be too old to allow the captured PPS data to be used. Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtpps.c Tue Sep 10 21:53:42 2019 (r352195) +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Tue Sep 10 22:08:34 2019 (r352196) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -79,7 +78,6 @@ struct dmtpps_softc { uint32_t tclr; /* Cached TCLR register. */ struct timecounter tc; int pps_curmode; /* Edge mode now set in hw. */ - struct task pps_task; /* For pps_event handling. */ struct cdev * pps_cdev; struct pps_state pps_state; struct mtx pps_mtx; @@ -93,6 +91,7 @@ static struct ofw_compat_data compat_data[] = { {"ti,am335x-timer-1ms", 1}, {NULL, 0}, }; +SIMPLEBUS_PNP_INFO(compat_data); /* * A table relating pad names to the hardware timer number they can be mux'd to. @@ -285,48 +284,29 @@ dmtpps_poll(struct timecounter *tc) * populates it from the current DMT_TCRR register) with the latched * value from the TCAR1 register. * - * There is no locking here, by design. pps_capture() writes into an - * area of struct pps_state which is read only by pps_event(). The - * synchronization of access to that area is temporal rather than - * interlock based... we write in this routine and trigger the task that - * will read the data, so no simultaneous access can occur. - * * Note that we don't have the TCAR interrupt enabled, but the hardware * still provides the status bits in the "RAW" status register even when * they're masked from generating an irq. However, when clearing the * TCAR status to re-arm the capture for the next second, we have to * write to the IRQ status register, not the RAW register. Quirky. + * + * We do not need to hold a lock while capturing the pps data, because + * it is captured into an area of the pps_state struct which is read + * only by pps_event(). We do need to hold a lock while calling + * pps_event(), because it manipulates data which is also accessed from + * the ioctl(2) context by userland processes. */ if (DMTIMER_READ4(sc, DMT_IRQSTATUS_RAW) & DMT_IRQ_TCAR) { pps_capture(&sc->pps_state); sc->pps_state.capcount = DMTIMER_READ4(sc, DMT_TCAR1); DMTIMER_WRITE4(sc, DMT_IRQSTATUS, DMT_IRQ_TCAR); - taskqueue_enqueue(taskqueue_fast, &sc->pps_task); + + mtx_lock_spin(&sc->pps_mtx); + pps_event(&sc->pps_state, PPS_CAPTUREASSERT); + mtx_unlock_spin(&sc->pps_mtx); } } -static void -dmtpps_event(void *arg, int pending) -{ - struct dmtpps_softc *sc; - - sc = arg; - - /* This is the task function that gets enqueued by poll_pps. Once the - * time has been captured by the timecounter polling code which runs in - * primary interrupt context, the remaining (more expensive) work to - * process the event is done later in a threaded context. - * - * Here there is an interlock that protects the event data in struct - * pps_state. That data can be accessed at any time from userland via - * ioctl() calls so we must ensure that there is no read access to - * partially updated data while pps_event() does its work. - */ - mtx_lock(&sc->pps_mtx); - pps_event(&sc->pps_state, PPS_CAPTUREASSERT); - mtx_unlock(&sc->pps_mtx); -} - static int dmtpps_open(struct cdev *dev, int flags, int fmt, struct thread *td) @@ -374,9 +354,9 @@ dmtpps_ioctl(struct cdev *dev, u_long cmd, caddr_t dat sc = dev->si_drv1; /* Let the kernel do the heavy lifting for ioctl. */ - mtx_lock(&sc->pps_mtx); + mtx_lock_spin(&sc->pps_mtx); err = pps_ioctl(cmd, data, &sc->pps_state); - mtx_unlock(&sc->pps_mtx); + mtx_unlock_spin(&sc->pps_mtx); if (err != 0) return (err); @@ -436,6 +416,7 @@ static int dmtpps_attach(device_t dev) { struct dmtpps_softc *sc; + struct make_dev_args mda; clk_ident_t timer_id; int err, sysclk_freq; @@ -502,22 +483,27 @@ dmtpps_attach(device_t dev) * now, just say we can only capture assert events (the positive-going * edge of the pulse). */ - mtx_init(&sc->pps_mtx, "dmtpps", NULL, MTX_DEF); + mtx_init(&sc->pps_mtx, "dmtpps", NULL, MTX_SPIN); + sc->pps_state.flags = PPSFLAG_MTX_SPIN; sc->pps_state.ppscap = PPS_CAPTUREASSERT; sc->pps_state.driver_abi = PPS_ABI_VERSION; sc->pps_state.driver_mtx = &sc->pps_mtx; pps_init_abi(&sc->pps_state); - /* - * Init the task that does deferred pps_event() processing after - * the polling routine has captured a pps pulse time. - */ - TASK_INIT(&sc->pps_task, 0, dmtpps_event, sc); - /* Create the PPS cdev. */ - sc->pps_cdev = make_dev(&dmtpps_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - PPS_CDEV_NAME); - sc->pps_cdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK; + mda.mda_devsw = &dmtpps_cdevsw; + mda.mda_cr = NULL; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_unit = device_get_unit(dev); + mda.mda_si_drv1 = sc; + if ((err = make_dev_s(&mda, &sc->pps_cdev, PPS_CDEV_NAME)) != 0) { + device_printf(dev, "Failed to create cdev %s\n", PPS_CDEV_NAME); + return (err); + } if (bootverbose) device_printf(sc->dev, "Using %s for PPS device /dev/%s\n", From owner-svn-src-all@freebsd.org Tue Sep 10 22:24:42 2019 Return-Path: Delivered-To: svn-src-all@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 E0A2CE6835; Tue, 10 Sep 2019 22:24:42 +0000 (UTC) (envelope-from jkim@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 46Sfj65ctwz46jB; Tue, 10 Sep 2019 22:24:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A42DD2CDFD; Tue, 10 Sep 2019 22:24:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AMOgZR030155; Tue, 10 Sep 2019 22:24:42 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AMOgd9030154; Tue, 10 Sep 2019 22:24:42 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909102224.x8AMOgd9030154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 22:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352197 - head X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 22:24:42 -0000 Author: jkim Date: Tue Sep 10 22:24:42 2019 New Revision: 352197 URL: https://svnweb.freebsd.org/changeset/base/352197 Log: Remove unnecessary entries from the previous commit. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Sep 10 22:08:34 2019 (r352196) +++ head/ObsoleteFiles.inc Tue Sep 10 22:24:42 2019 (r352197) @@ -38,9 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20190910: OpenSSL 1.1.1d -OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz -OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz # 20190910: mklocale(1) and colldef(1) removed OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz From owner-svn-src-all@freebsd.org Tue Sep 10 22:26:31 2019 Return-Path: Delivered-To: svn-src-all@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 CD966E68DA; Tue, 10 Sep 2019 22:26:31 +0000 (UTC) (envelope-from jkim@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 46SflC555bz46qv; Tue, 10 Sep 2019 22:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8D69F2CDFE; Tue, 10 Sep 2019 22:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AMQVXo030308; Tue, 10 Sep 2019 22:26:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AMQVfU030307; Tue, 10 Sep 2019 22:26:31 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909102226.x8AMQVfU030307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Sep 2019 22:26:31 +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: r352198 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 352198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 22:26:31 -0000 Author: jkim Date: Tue Sep 10 22:26:31 2019 New Revision: 352198 URL: https://svnweb.freebsd.org/changeset/base/352198 Log: MFC: r352197 Remove unnecessary entries from the previous commit. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Sep 10 22:24:42 2019 (r352197) +++ stable/12/ObsoleteFiles.inc Tue Sep 10 22:26:31 2019 (r352198) @@ -38,9 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20190910: OpenSSL 1.1.1d -OLD_FILES+=usr/share/openssl/man/man3/d2i_ECDSA_SIG.3.gz -OLD_FILES+=usr/share/openssl/man/man3/i2d_ECDSA_SIG.3.gz # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. From owner-svn-src-all@freebsd.org Tue Sep 10 22:44:10 2019 Return-Path: Delivered-To: svn-src-all@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 A5579E6E41; Tue, 10 Sep 2019 22:44:10 +0000 (UTC) (envelope-from jgh@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 46Sg7Z3sw2z47Yn; Tue, 10 Sep 2019 22:44:10 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 682352D172; Tue, 10 Sep 2019 22:44:10 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AMiAh8041720; Tue, 10 Sep 2019 22:44:10 GMT (envelope-from jgh@FreeBSD.org) Received: (from jgh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AMiAol041719; Tue, 10 Sep 2019 22:44:10 GMT (envelope-from jgh@FreeBSD.org) Message-Id: <201909102244.x8AMiAol041719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jgh set sender to jgh@FreeBSD.org using -f From: Jason Helfman Date: Tue, 10 Sep 2019 22:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352199 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: jgh X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 352199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 22:44:10 -0000 Author: jgh (doc,ports committer) Date: Tue Sep 10 22:44:09 2019 New Revision: 352199 URL: https://svnweb.freebsd.org/changeset/base/352199 Log: - fix a minor typo PR: 240447 Submitted by: brigadir15@gmail.com MFC after: 1 week Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Tue Sep 10 22:26:31 2019 (r352198) +++ head/share/man/man7/security.7 Tue Sep 10 22:44:09 2019 (r352199) @@ -1016,7 +1016,7 @@ hardware information leak. amd64. Controls the mitigation of L1 Terminal Fault in bhyve hypervisor. .It Dv kern.elf32.aslr.enable -Controls system-global Address Space Layour Randomization (ASLR) for +Controls system-global Address Space Layout Randomization (ASLR) for normal non-PIE (Position Independent Executable) 32bit binaries. See also .Xr proccontrol 1 From owner-svn-src-all@freebsd.org Tue Sep 10 23:51:47 2019 Return-Path: Delivered-To: svn-src-all@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 65D32E83B1; Tue, 10 Sep 2019 23:51:47 +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 46Shdb25cbz4B4M; Tue, 10 Sep 2019 23:51:47 +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 2C70D2DC91; Tue, 10 Sep 2019 23:51:47 +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 x8ANplJa079702; Tue, 10 Sep 2019 23:51:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ANplJv079701; Tue, 10 Sep 2019 23:51:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909102351.x8ANplJv079701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Sep 2019 23:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352200 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 23:51:47 -0000 Author: mav Date: Tue Sep 10 23:51:46 2019 New Revision: 352200 URL: https://svnweb.freebsd.org/changeset/base/352200 Log: Remove struct ata_res_pass16, unneeded after r352082. MFC after: 4 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Sep 10 22:44:09 2019 (r352199) +++ head/sbin/camcontrol/camcontrol.c Tue Sep 10 23:51:46 2019 (r352200) @@ -153,22 +153,6 @@ struct camcontrol_opts { const char *subopt; }; -struct ata_res_pass16 { - u_int16_t reserved[5]; - u_int8_t flags; - u_int8_t error; - u_int8_t sector_count_exp; - u_int8_t sector_count; - u_int8_t lba_low_exp; - u_int8_t lba_low; - u_int8_t lba_mid_exp; - u_int8_t lba_mid; - u_int8_t lba_high_exp; - u_int8_t lba_high; - u_int8_t device; - u_int8_t status; -}; - struct ata_set_max_pwd { u_int16_t reserved1; From owner-svn-src-all@freebsd.org Wed Sep 11 03:25:31 2019 Return-Path: Delivered-To: svn-src-all@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 6705CEC7FD; Wed, 11 Sep 2019 03:25:31 +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 46SnNC23Kvz4MMM; Wed, 11 Sep 2019 03:25:31 +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 2B1863B3; Wed, 11 Sep 2019 03:25:31 +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 x8B3PVj1010086; Wed, 11 Sep 2019 03:25:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B3PUtB010085; Wed, 11 Sep 2019 03:25:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909110325.x8B3PUtB010085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Sep 2019 03:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352201 - in head/sys/cam: . scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: . scsi X-SVN-Commit-Revision: 352201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 03:25:31 -0000 Author: mav Date: Wed Sep 11 03:25:30 2019 New Revision: 352201 URL: https://svnweb.freebsd.org/changeset/base/352201 Log: Fix assumptions of only one device per SES slot. It is typical to have one, but no longer true for multi-actuator HDDs with separate LUN for each actuator. MFC after: 4 days Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Sep 10 23:51:46 2019 (r352200) +++ head/sys/cam/cam_periph.c Wed Sep 11 03:25:30 2019 (r352201) @@ -402,7 +402,9 @@ retry: } xpt_unlock_buses(); sbuf_finish(&local_sb); - sbuf_cpy(sb, sbuf_data(&local_sb)); + if (sbuf_len(sb) != 0) + sbuf_cat(sb, ","); + sbuf_cat(sb, sbuf_data(&local_sb)); sbuf_delete(&local_sb); return (count); } Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Sep 10 23:51:46 2019 (r352200) +++ head/sys/cam/scsi/scsi_enc_ses.c Wed Sep 11 03:25:30 2019 (r352201) @@ -883,6 +883,7 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele struct device_match_result *device_match; struct device_match_pattern *device_pattern; ses_path_iter_args_t *args; + struct cam_path *path; args = (ses_path_iter_args_t *)arg; match_pattern.type = DEV_MATCH_DEVICE; @@ -908,23 +909,26 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele cdm.match_buf_len = sizeof(match_result); cdm.matches = &match_result; - xpt_action((union ccb *)&cdm); - xpt_free_path(cdm.ccb_h.path); + do { + xpt_action((union ccb *)&cdm); - if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP - || (cdm.status != CAM_DEV_MATCH_LAST - && cdm.status != CAM_DEV_MATCH_MORE) - || cdm.num_matches == 0) - return; + if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP || + (cdm.status != CAM_DEV_MATCH_LAST && + cdm.status != CAM_DEV_MATCH_MORE) || + cdm.num_matches == 0) + break; - device_match = &match_result.result.device_result; - if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, - device_match->path_id, - device_match->target_id, - device_match->target_lun) != CAM_REQ_CMP) - return; + device_match = &match_result.result.device_result; + if (xpt_create_path(&path, /*periph*/NULL, + device_match->path_id, + device_match->target_id, + device_match->target_lun) == CAM_REQ_CMP) { - args->callback(enc, elem, cdm.ccb_h.path, args->callback_arg); + args->callback(enc, elem, path, args->callback_arg); + + xpt_free_path(path); + } + } while (cdm.status == CAM_DEV_MATCH_MORE); xpt_free_path(cdm.ccb_h.path); } From owner-svn-src-all@freebsd.org Wed Sep 11 04:55:11 2019 Return-Path: Delivered-To: svn-src-all@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 5E7F0EE97F; Wed, 11 Sep 2019 04:55:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SqMg1t0wz4Qq3; Wed, 11 Sep 2019 04:55:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FBB313D8; Wed, 11 Sep 2019 04:55:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8B4tAga062845; Wed, 11 Sep 2019 04:55:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B4tAn9062844; Wed, 11 Sep 2019 04:55:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909110455.x8B4tAn9062844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Sep 2019 04:55:10 +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: r352202 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 352202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 04:55:11 -0000 Author: kib Date: Wed Sep 11 04:55:10 2019 New Revision: 352202 URL: https://svnweb.freebsd.org/changeset/base/352202 Log: MFC r351830: madvise(MADV_FREE): Quick fix to time rewind. PR: 240061 Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Sep 11 03:25:30 2019 (r352201) +++ stable/12/sys/vm/vm_map.c Wed Sep 11 04:55:10 2019 (r352202) @@ -2735,6 +2735,18 @@ vm_map_madvise( if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; + /* + * MADV_FREE would otherwise rewind time to + * the creation of the shadow object. Because + * we hold the VM map read-locked, neither the + * entry's object nor the presence of a + * backing object can change. + */ + if (behav == MADV_FREE && + current->object.vm_object != NULL && + current->object.vm_object->backing_object != NULL) + continue; + pstart = OFF_TO_IDX(current->offset); pend = pstart + atop(current->end - current->start); useStart = current->start; From owner-svn-src-all@freebsd.org Wed Sep 11 04:59:28 2019 Return-Path: Delivered-To: svn-src-all@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 1AAEEEEA71; Wed, 11 Sep 2019 04:59:28 +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 46SqSb6n1Zz4R0Y; Wed, 11 Sep 2019 04:59:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C853A13E4; Wed, 11 Sep 2019 04:59:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8B4xRLQ063105; Wed, 11 Sep 2019 04:59:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B4xRum063104; Wed, 11 Sep 2019 04:59:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909110459.x8B4xRum063104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Sep 2019 04:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352203 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 352203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 04:59:28 -0000 Author: kib Date: Wed Sep 11 04:59:27 2019 New Revision: 352203 URL: https://svnweb.freebsd.org/changeset/base/352203 Log: MFC r351830: madvise(MADV_FREE): Quick fix to time rewind. PR: 240061 Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Sep 11 04:55:10 2019 (r352202) +++ stable/11/sys/vm/vm_map.c Wed Sep 11 04:59:27 2019 (r352203) @@ -2279,6 +2279,18 @@ vm_map_madvise( if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; + /* + * MADV_FREE would otherwise rewind time to + * the creation of the shadow object. Because + * we hold the VM map read-locked, neither the + * entry's object nor the presence of a + * backing object can change. + */ + if (behav == MADV_FREE && + current->object.vm_object != NULL && + current->object.vm_object->backing_object != NULL) + continue; + pstart = OFF_TO_IDX(current->offset); pend = pstart + atop(current->end - current->start); useStart = current->start; From owner-svn-src-all@freebsd.org Wed Sep 11 07:03:18 2019 Return-Path: Delivered-To: svn-src-all@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 26CADF1147; Wed, 11 Sep 2019 07:03:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46StCV0FJdz4Whc; Wed, 11 Sep 2019 07:03:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCF42AF1; Wed, 11 Sep 2019 07:03:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8B73HBZ039169; Wed, 11 Sep 2019 07:03:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B73HwC039167; Wed, 11 Sep 2019 07:03:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909110703.x8B73HwC039167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Sep 2019 07:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352204 - head/contrib/libedit X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/libedit X-SVN-Commit-Revision: 352204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 07:03:18 -0000 Author: bapt Date: Wed Sep 11 07:03:17 2019 New Revision: 352204 URL: https://svnweb.freebsd.org/changeset/base/352204 Log: Readd _el_fn_sh_complete for backward compatibility This function is not needed anymore, it allows old sh binary to continue to run and avoid breaking backward compatibility. Note that is now just calls the regular _el_fn_complete which does a proper job at quoting. Discussed with: jilles Modified: head/contrib/libedit/filecomplete.c head/contrib/libedit/histedit.h Modified: head/contrib/libedit/filecomplete.c ============================================================================== --- head/contrib/libedit/filecomplete.c Wed Sep 11 04:59:27 2019 (r352203) +++ head/contrib/libedit/filecomplete.c Wed Sep 11 07:03:17 2019 (r352204) @@ -823,3 +823,13 @@ _el_fn_complete(EditLine *el, int ch __attribute__((__ break_chars, NULL, NULL, (size_t)100, NULL, NULL, NULL, NULL); } + +/* + * el-compatible wrapper around rl_complete; needed for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_sh_complete(EditLine *el, int ch) +{ + return _el_fn_complete(el, ch); +} Modified: head/contrib/libedit/histedit.h ============================================================================== --- head/contrib/libedit/histedit.h Wed Sep 11 04:59:27 2019 (r352203) +++ head/contrib/libedit/histedit.h Wed Sep 11 07:03:17 2019 (r352204) @@ -113,6 +113,7 @@ int el_parse(EditLine *, int, const char **); int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); unsigned char _el_fn_complete(EditLine *, int); +unsigned char _el_fn_sh_complete(EditLine *, int); /* * el_set/el_get parameters From owner-svn-src-all@freebsd.org Wed Sep 11 07:53:49 2019 Return-Path: Delivered-To: svn-src-all@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 C9FD8F1E56; Wed, 11 Sep 2019 07:53:49 +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 46SvKn4zYJz4Ygt; Wed, 11 Sep 2019 07:53:49 +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 8DAE933F2; Wed, 11 Sep 2019 07:53:49 +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 x8B7rnEf068417; Wed, 11 Sep 2019 07:53:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B7rn8R068416; Wed, 11 Sep 2019 07:53:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909110753.x8B7rn8R068416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Sep 2019 07:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352205 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 352205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 07:53:49 -0000 Author: hselasky Date: Wed Sep 11 07:53:49 2019 New Revision: 352205 URL: https://svnweb.freebsd.org/changeset/base/352205 Log: Fix broken DECLARE_TASKLET() macro after r347852. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Wed Sep 11 07:03:17 2019 (r352204) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Wed Sep 11 07:53:49 2019 (r352205) @@ -197,8 +197,8 @@ struct tasklet_struct { unsigned long data; }; -#define DECLARE_TASKLET(name, func, data) \ -struct tasklet_struct name = { { NULL, NULL }, func, ATOMIC_INIT(0), data } +#define DECLARE_TASKLET(_name, _func, _data) \ +struct tasklet_struct _name = { .func = (_func), .data = (_data) } #define tasklet_hi_schedule(t) tasklet_schedule(t) From owner-svn-src-all@freebsd.org Wed Sep 11 08:20:14 2019 Return-Path: Delivered-To: svn-src-all@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 2636DF2EF6; Wed, 11 Sep 2019 08:20:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46SvwF5lvfz4Znl; Wed, 11 Sep 2019 08:20:13 +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 A947D3960; Wed, 11 Sep 2019 08:20:13 +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 x8B8KDLi080570; Wed, 11 Sep 2019 08:20:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B8KD57080569; Wed, 11 Sep 2019 08:20:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909110820.x8B8KD57080569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Sep 2019 08:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352206 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 352206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 08:20:14 -0000 Author: hselasky Date: Wed Sep 11 08:20:13 2019 New Revision: 352206 URL: https://svnweb.freebsd.org/changeset/base/352206 Log: Fix synchronous work drain issue in the LinuxKPI. A work callback may restart itself. Loop in the drain function to see if the work has been rescheduled and stop the subsequent reschedules, if any. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Wed Sep 11 07:53:49 2019 (r352205) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Wed Sep 11 08:20:13 2019 (r352206) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Hans Petter Selasky + * Copyright (c) 2017-2019 Hans Petter Selasky * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -323,24 +323,26 @@ linux_cancel_work_sync(struct work_struct *work) [WORK_ST_CANCEL] = WORK_ST_IDLE, /* cancel and drain */ }; struct taskqueue *tq; + bool retval = false; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_cancel_work_sync() might sleep"); - +retry: switch (linux_update_state(&work->state, states)) { case WORK_ST_IDLE: case WORK_ST_TIMER: - return (0); + return (retval); case WORK_ST_EXEC: tq = work->work_queue->taskqueue; if (taskqueue_cancel(tq, &work->work_task, NULL) != 0) taskqueue_drain(tq, &work->work_task); - return (0); + goto retry; /* work may have restarted itself */ default: tq = work->work_queue->taskqueue; if (taskqueue_cancel(tq, &work->work_task, NULL) != 0) taskqueue_drain(tq, &work->work_task); - return (1); + retval = true; + goto retry; } } @@ -421,18 +423,19 @@ linux_cancel_delayed_work_sync(struct delayed_work *dw [WORK_ST_CANCEL] = WORK_ST_IDLE, /* cancel and drain */ }; struct taskqueue *tq; + bool retval = false; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_cancel_delayed_work_sync() might sleep"); - +retry: switch (linux_update_state(&dwork->work.state, states)) { case WORK_ST_IDLE: - return (0); + return (retval); case WORK_ST_EXEC: tq = dwork->work.work_queue->taskqueue; if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) taskqueue_drain(tq, &dwork->work.work_task); - return (0); + goto retry; /* work may have restarted itself */ case WORK_ST_TIMER: case WORK_ST_CANCEL: if (linux_cancel_timer(dwork, 1)) { @@ -442,14 +445,16 @@ linux_cancel_delayed_work_sync(struct delayed_work *dw */ tq = dwork->work.work_queue->taskqueue; taskqueue_drain(tq, &dwork->work.work_task); - return (1); + retval = true; + goto retry; } /* FALLTHROUGH */ default: tq = dwork->work.work_queue->taskqueue; if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) taskqueue_drain(tq, &dwork->work.work_task); - return (1); + retval = true; + goto retry; } } From owner-svn-src-all@freebsd.org Wed Sep 11 08:24:47 2019 Return-Path: Delivered-To: svn-src-all@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 C4E3DF31A4; Wed, 11 Sep 2019 08:24:47 +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 46Sw1W4rsSz4bFJ; Wed, 11 Sep 2019 08:24:47 +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 854723BA0; Wed, 11 Sep 2019 08:24:47 +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 x8B8Ol5x086209; Wed, 11 Sep 2019 08:24:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8B8Olsj086208; Wed, 11 Sep 2019 08:24:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909110824.x8B8Olsj086208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Sep 2019 08:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352207 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 352207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 08:24:47 -0000 Author: hselasky Date: Wed Sep 11 08:24:47 2019 New Revision: 352207 URL: https://svnweb.freebsd.org/changeset/base/352207 Log: Use true and false when dealing with bool type in the LinuxKPI. No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Wed Sep 11 08:20:13 2019 (r352206) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Wed Sep 11 08:24:47 2019 (r352207) @@ -92,7 +92,7 @@ linux_work_exec_unblock(struct work_struct *work) { struct workqueue_struct *wq; struct work_exec *exec; - bool retval = 0; + bool retval = false; wq = work->work_queue; if (unlikely(wq == NULL)) @@ -102,7 +102,7 @@ linux_work_exec_unblock(struct work_struct *work) TAILQ_FOREACH(exec, &wq->exec_head, entry) { if (exec->target == work) { exec->target = NULL; - retval = 1; + retval = true; break; } } @@ -144,14 +144,14 @@ linux_queue_work_on(int cpu __unused, struct workqueue case WORK_ST_EXEC: case WORK_ST_CANCEL: if (linux_work_exec_unblock(work) != 0) - return (1); + return (true); /* FALLTHROUGH */ case WORK_ST_IDLE: work->work_queue = wq; taskqueue_enqueue(wq->taskqueue, &work->work_task); - return (1); + return (true); default: - return (0); /* already on a queue */ + return (false); /* already on a queue */ } } @@ -181,7 +181,7 @@ linux_queue_delayed_work_on(int cpu, struct workqueue_ case WORK_ST_CANCEL: if (delay == 0 && linux_work_exec_unblock(&dwork->work) != 0) { dwork->timer.expires = jiffies; - return (1); + return (true); } /* FALLTHROUGH */ case WORK_ST_IDLE: @@ -201,9 +201,9 @@ linux_queue_delayed_work_on(int cpu, struct workqueue_ &linux_delayed_work_timer_fn, dwork); mtx_unlock(&dwork->timer.mtx); } - return (1); + return (true); default: - return (0); /* already on a queue */ + return (false); /* already on a queue */ } } @@ -391,7 +391,7 @@ linux_cancel_delayed_work(struct delayed_work *dwork) if (linux_cancel_timer(dwork, 0)) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); - return (1); + return (true); } /* FALLTHROUGH */ case WORK_ST_TASK: @@ -399,11 +399,11 @@ linux_cancel_delayed_work(struct delayed_work *dwork) if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) == 0) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); - return (1); + return (true); } /* FALLTHROUGH */ default: - return (0); + return (false); } } @@ -467,14 +467,14 @@ bool linux_flush_work(struct work_struct *work) { struct taskqueue *tq; - int retval; + bool retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_work() might sleep"); switch (atomic_read(&work->state)) { case WORK_ST_IDLE: - return (0); + return (false); default: tq = work->work_queue->taskqueue; retval = taskqueue_poll_is_busy(tq, &work->work_task); @@ -492,14 +492,14 @@ bool linux_flush_delayed_work(struct delayed_work *dwork) { struct taskqueue *tq; - int retval; + bool retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_delayed_work() might sleep"); switch (atomic_read(&dwork->work.state)) { case WORK_ST_IDLE: - return (0); + return (false); case WORK_ST_TIMER: if (linux_cancel_timer(dwork, 1)) linux_delayed_work_enqueue(dwork); @@ -523,9 +523,9 @@ linux_work_pending(struct work_struct *work) case WORK_ST_TIMER: case WORK_ST_TASK: case WORK_ST_CANCEL: - return (1); + return (true); default: - return (0); + return (false); } } @@ -539,12 +539,12 @@ linux_work_busy(struct work_struct *work) switch (atomic_read(&work->state)) { case WORK_ST_IDLE: - return (0); + return (false); case WORK_ST_EXEC: tq = work->work_queue->taskqueue; return (taskqueue_poll_is_busy(tq, &work->work_task)); default: - return (1); + return (true); } } From owner-svn-src-all@freebsd.org Wed Sep 11 12:58:08 2019 Return-Path: Delivered-To: svn-src-all@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 01052D3022; Wed, 11 Sep 2019 12:58:08 +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 46T24v6LSVz3Plc; Wed, 11 Sep 2019 12:58:07 +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 B90846C85; Wed, 11 Sep 2019 12:58:07 +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 x8BCw7YV047551; Wed, 11 Sep 2019 12:58:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BCw6Gb047546; Wed, 11 Sep 2019 12:58:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111258.x8BCw6Gb047546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 12:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352208 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 352208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 12:58:08 -0000 Author: emaste Date: Wed Sep 11 12:58:06 2019 New Revision: 352208 URL: https://svnweb.freebsd.org/changeset/base/352208 Log: make linux_renameat2 args consistent with linux_renameat Use 'dfd' consistently for a directory fd. Modified: head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/syscalls.master head/sys/arm64/linux/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Wed Sep 11 08:24:47 2019 (r352207) +++ head/sys/amd64/linux/syscalls.master Wed Sep 11 12:58:06 2019 (r352208) @@ -550,8 +550,8 @@ 315 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ void *attr, l_uint size, l_uint flags); } ; Linux 3.15: -316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ +316 AUE_NULL STD { int linux_renameat2(l_int olddfd, \ + const char *oldname, l_int newdfd, \ const char *newname, unsigned int flags); } ; Linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Wed Sep 11 08:24:47 2019 (r352207) +++ head/sys/amd64/linux32/syscalls.master Wed Sep 11 12:58:06 2019 (r352208) @@ -610,8 +610,8 @@ 352 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ void *attr, l_uint size, l_uint flags); } ; Linux 3.15: -353 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ +353 AUE_NULL STD { int linux_renameat2(l_int olddfd, \ + const char *oldname, l_int newdfd, \ const char *newname, unsigned int flags); } ; Linux 3.17: 354 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Wed Sep 11 08:24:47 2019 (r352207) +++ head/sys/arm64/linux/syscalls.master Wed Sep 11 12:58:06 2019 (r352208) @@ -1459,9 +1459,9 @@ } 276 AUE_NULL STD { int linux_renameat2( - l_int oldfd, + l_int olddfd, const char *oldname, - l_int newfd, + l_int newdfd, const char *newname, unsigned int flags ); Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Wed Sep 11 08:24:47 2019 (r352207) +++ head/sys/i386/linux/syscalls.master Wed Sep 11 12:58:06 2019 (r352208) @@ -619,8 +619,8 @@ 352 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ void *attr, l_uint size, l_uint flags); } ; Linux 3.15: -353 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ +353 AUE_NULL STD { int linux_renameat2(l_int olddfd, \ + const char *oldname, l_int newdfd, \ const char *newname, unsigned int flags); } ; Linux 3.17: 354 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ From owner-svn-src-all@freebsd.org Wed Sep 11 12:58:55 2019 Return-Path: Delivered-To: svn-src-all@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 395CED30A2; Wed, 11 Sep 2019 12:58:55 +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 46T25q0mvrz3Pww; Wed, 11 Sep 2019 12:58:55 +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 F21846C86; Wed, 11 Sep 2019 12:58:54 +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 x8BCws5l047639; Wed, 11 Sep 2019 12:58:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BCwrlP047631; Wed, 11 Sep 2019 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111258.x8BCwrlP047631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 12:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352209 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 352209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 12:58:55 -0000 Author: emaste Date: Wed Sep 11 12:58:53 2019 New Revision: 352209 URL: https://svnweb.freebsd.org/changeset/base/352209 Log: regen linuxulator sysent after r352208 Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_systrace_args.c head/sys/arm64/linux/linux_proto.h head/sys/arm64/linux/linux_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/amd64/linux/linux_proto.h Wed Sep 11 12:58:53 2019 (r352209) @@ -1125,9 +1125,9 @@ struct linux_sched_getattr_args { char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_renameat2_args { - char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; - char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/amd64/linux/linux_systrace_args.c Wed Sep 11 12:58:53 2019 (r352209) @@ -2297,9 +2297,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_renameat2 */ case 316: { struct linux_renameat2_args *p = params; - iarg[0] = p->oldfd; /* l_int */ + iarg[0] = p->olddfd; /* l_int */ uarg[1] = (intptr_t) p->oldname; /* const char * */ - iarg[2] = p->newfd; /* l_int */ + iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ uarg[4] = p->flags; /* unsigned int */ *n_args = 5; Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/amd64/linux32/linux32_proto.h Wed Sep 11 12:58:53 2019 (r352209) @@ -1199,9 +1199,9 @@ struct linux_sched_getattr_args { char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_renameat2_args { - char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; - char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/amd64/linux32/linux32_systrace_args.c Wed Sep 11 12:58:53 2019 (r352209) @@ -2424,9 +2424,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_renameat2 */ case 353: { struct linux_renameat2_args *p = params; - iarg[0] = p->oldfd; /* l_int */ + iarg[0] = p->olddfd; /* l_int */ uarg[1] = (intptr_t) p->oldname; /* const char * */ - iarg[2] = p->newfd; /* l_int */ + iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ uarg[4] = p->flags; /* unsigned int */ *n_args = 5; Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/arm64/linux/linux_proto.h Wed Sep 11 12:58:53 2019 (r352209) @@ -971,9 +971,9 @@ struct linux_sched_getattr_args { char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_renameat2_args { - char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; - char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/arm64/linux/linux_systrace_args.c Wed Sep 11 12:58:53 2019 (r352209) @@ -1972,9 +1972,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_renameat2 */ case 276: { struct linux_renameat2_args *p = params; - iarg[0] = p->oldfd; /* l_int */ + iarg[0] = p->olddfd; /* l_int */ uarg[1] = (intptr_t) p->oldname; /* const char * */ - iarg[2] = p->newfd; /* l_int */ + iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ uarg[4] = p->flags; /* unsigned int */ *n_args = 5; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/i386/linux/linux_proto.h Wed Sep 11 12:58:53 2019 (r352209) @@ -1217,9 +1217,9 @@ struct linux_sched_getattr_args { char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_renameat2_args { - char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; - char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Wed Sep 11 12:58:06 2019 (r352208) +++ head/sys/i386/linux/linux_systrace_args.c Wed Sep 11 12:58:53 2019 (r352209) @@ -2500,9 +2500,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_renameat2 */ case 353: { struct linux_renameat2_args *p = params; - iarg[0] = p->oldfd; /* l_int */ + iarg[0] = p->olddfd; /* l_int */ uarg[1] = (intptr_t) p->oldname; /* const char * */ - iarg[2] = p->newfd; /* l_int */ + iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ uarg[4] = p->flags; /* unsigned int */ *n_args = 5; From owner-svn-src-all@freebsd.org Wed Sep 11 13:02:01 2019 Return-Path: Delivered-To: svn-src-all@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 32651D333C; Wed, 11 Sep 2019 13:02:01 +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 46T29P0cNMz3QJd; Wed, 11 Sep 2019 13:02:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3C56D05; Wed, 11 Sep 2019 13:02:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BD208a051092; Wed, 11 Sep 2019 13:02:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BD1xjR051082; Wed, 11 Sep 2019 13:01:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111301.x8BD1xjR051082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 13:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352210 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 352210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 13:02:01 -0000 Author: emaste Date: Wed Sep 11 13:01:59 2019 New Revision: 352210 URL: https://svnweb.freebsd.org/changeset/base/352210 Log: linux: add trivial renameat2 implementation Just return EINVAL if flags != 0. The Linux man page documents one case of EINVAL as "The filesystem does not support one of the flags in flags." After r351723 userland binaries will try using new system calls. Reported by: mjg Reviewed by: mjg, trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21590 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/arm64/linux/linux_dummy.c head/sys/compat/linux/linux_file.c head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Wed Sep 11 12:58:53 2019 (r352209) +++ head/sys/amd64/linux/linux_dummy.c Wed Sep 11 13:01:59 2019 (r352210) @@ -130,8 +130,6 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.14: */ -DUMMY(renameat2); /* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 12:58:53 2019 (r352209) +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 13:01:59 2019 (r352210) @@ -137,8 +137,6 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.14: */ -DUMMY(renameat2); /* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Wed Sep 11 12:58:53 2019 (r352209) +++ head/sys/arm64/linux/linux_dummy.c Wed Sep 11 13:01:59 2019 (r352210) @@ -130,8 +130,6 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.14: */ -DUMMY(renameat2); /* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Wed Sep 11 12:58:53 2019 (r352209) +++ head/sys/compat/linux/linux_file.c Wed Sep 11 13:01:59 2019 (r352210) @@ -686,8 +686,28 @@ linux_rename(struct thread *td, struct linux_rename_ar int linux_renameat(struct thread *td, struct linux_renameat_args *args) { + struct linux_renameat2_args renameat2_args = { + .olddfd = args->olddfd, + .oldname = args->oldname, + .newdfd = args->newdfd, + .newname = args->newname, + .flags = 0 + }; + + return (linux_renameat2(td, &renameat2_args)); +} + +int +linux_renameat2(struct thread *td, struct linux_renameat2_args *args) +{ char *from, *to; int error, olddfd, newdfd; + + if (args->flags != 0) { + linux_msg(td, "renameat2 unsupported flags 0x%x\n", + args->flags); + return (EINVAL); + } olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd; newdfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd; Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Wed Sep 11 12:58:53 2019 (r352209) +++ head/sys/i386/linux/linux_dummy.c Wed Sep 11 13:01:59 2019 (r352210) @@ -134,8 +134,6 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.14: */ -DUMMY(renameat2); -/* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); /* Linux 3.18: */ From owner-svn-src-all@freebsd.org Wed Sep 11 13:27:11 2019 Return-Path: Delivered-To: svn-src-all@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 41078D4069; Wed, 11 Sep 2019 13:27: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 46T2kR10kCz3x4K; Wed, 11 Sep 2019 13:27: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 DFB2F71FC; Wed, 11 Sep 2019 13:27:10 +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 x8BDRA3C065737; Wed, 11 Sep 2019 13:27:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BDRArf065735; Wed, 11 Sep 2019 13:27:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909111327.x8BDRArf065735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 11 Sep 2019 13:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352211 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 352211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 13:27:11 -0000 Author: kevans Date: Wed Sep 11 13:27:10 2019 New Revision: 352211 URL: https://svnweb.freebsd.org/changeset/base/352211 Log: bectl(8): Add a "check" command This command simply returns 0 at the moment and explicitly takes no arguments. This should be used by utilities wanting to see if bectl can operate on the system they're running, or with a specific root (`bectl -r`). It may grow more checks than "will libbe successfully init" in the future, but for now this is enough as that checks for the dataset mounted at "/" and that it looks capable of being a BE root (e.g. it's not a top-level dataset) bectl commands can now specify if they want to be silent, and this will turn off libbe_print_on_error so they can control the output as needed. This is already used in `bectl check`, and may be turned on in the future for some other commands where libbe errors are better suppressed as the failure mode may be obvious. Requested by: David Fullard MFC after: 3 days Modified: head/sbin/bectl/bectl.8 head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Wed Sep 11 13:01:59 2019 (r352210) +++ head/sbin/bectl/bectl.8 Wed Sep 11 13:27:10 2019 (r352211) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 4, 2019 +.Dd September 11, 2019 .Dt BECTL 8 .Os .Sh NAME @@ -30,6 +30,8 @@ .Op Fl t .Ar beName .Nm +.Cm check +.Nm .Cm create .Op Fl r .Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot @@ -103,6 +105,15 @@ as the default boot filesystem. If the .Op Fl t flag is given, this takes effect only for the next boot. +.It Xo +.Cm check +.Xc +Performs a silent sanity check on the current system. +If boot environments are supported and used, +.Nm +will exit with a status code of 0. +Any other status code is not currently defined and may, in the future, grow +special meaning for different degrees of sanity check failures. .It Xo .Cm create .Op Fl r Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Wed Sep 11 13:01:59 2019 (r352210) +++ head/sbin/bectl/bectl.c Wed Sep 11 13:27:10 2019 (r352211) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include "bectl.h" static int bectl_cmd_activate(int argc, char *argv[]); +static int bectl_cmd_check(int argc, char *argv[]); static int bectl_cmd_create(int argc, char *argv[]); static int bectl_cmd_destroy(int argc, char *argv[]); static int bectl_cmd_export(int argc, char *argv[]); @@ -72,6 +73,7 @@ usage(bool explicit) "\tbectl add (path)*\n" #endif "\tbectl activate [-t] beName\n" + "\tbectl check\n" "\tbectl create [-r] [-e {nonActiveBe | beName@snapshot}] beName\n" "\tbectl create [-r] beName@snapshot\n" "\tbectl destroy [-F] {beName | beName@snapshot}\n" @@ -97,40 +99,40 @@ usage(bool explicit) struct command_map_entry { const char *command; int (*fn)(int argc, char *argv[]); + /* True if libbe_print_on_error should be disabled */ + bool silent; }; static struct command_map_entry command_map[] = { - { "activate", bectl_cmd_activate }, - { "create", bectl_cmd_create }, - { "destroy", bectl_cmd_destroy }, - { "export", bectl_cmd_export }, - { "import", bectl_cmd_import }, + { "activate", bectl_cmd_activate,false }, + { "create", bectl_cmd_create, false }, + { "destroy", bectl_cmd_destroy, false }, + { "export", bectl_cmd_export, false }, + { "import", bectl_cmd_import, false }, #if SOON - { "add", bectl_cmd_add }, + { "add", bectl_cmd_add, false }, #endif - { "jail", bectl_cmd_jail }, - { "list", bectl_cmd_list }, - { "mount", bectl_cmd_mount }, - { "rename", bectl_cmd_rename }, - { "unjail", bectl_cmd_unjail }, - { "unmount", bectl_cmd_unmount }, + { "jail", bectl_cmd_jail, false }, + { "list", bectl_cmd_list, false }, + { "mount", bectl_cmd_mount, false }, + { "rename", bectl_cmd_rename, false }, + { "unjail", bectl_cmd_unjail, false }, + { "unmount", bectl_cmd_unmount, false }, + { "check", bectl_cmd_check, true }, }; -static int -get_cmd_index(const char *cmd, int *idx) +static struct command_map_entry * +get_cmd_info(const char *cmd) { - int map_size; + size_t i; - map_size = nitems(command_map); - for (int i = 0; i < map_size; ++i) { - if (strcmp(cmd, command_map[i].command) == 0) { - *idx = i; - return (0); - } + for (i = 0; i < nitems(command_map); ++i) { + if (strcmp(cmd, command_map[i].command) == 0) + return (&command_map[i]); } - return (1); + return (NULL); } @@ -509,14 +511,28 @@ bectl_cmd_unmount(int argc, char *argv[]) return (err); } +static int +bectl_cmd_check(int argc, char *argv[] __unused) +{ + /* The command is left as argv[0] */ + if (argc != 1) { + fprintf(stderr, "bectl check: wrong number of arguments\n"); + return (usage(false)); + } + + return (0); +} + int main(int argc, char *argv[]) { + struct command_map_entry *cmd; const char *command; char *root; - int command_index, rc; + int rc; + cmd = NULL; root = NULL; if (argc < 2) return (usage(false)); @@ -544,18 +560,17 @@ main(int argc, char *argv[]) if ((strcmp(command, "-?") == 0) || (strcmp(command, "-h") == 0)) return (usage(true)); - if (get_cmd_index(command, &command_index)) { + if ((cmd = get_cmd_info(command)) == NULL) { fprintf(stderr, "unknown command: %s\n", command); return (usage(false)); } - if ((be = libbe_init(root)) == NULL) return (-1); - libbe_print_on_error(be, true); + libbe_print_on_error(be, !cmd->silent); - rc = command_map[command_index].fn(argc, argv); + rc = cmd->fn(argc, argv); libbe_close(be); return (rc); From owner-svn-src-all@freebsd.org Wed Sep 11 13:34:20 2019 Return-Path: Delivered-To: svn-src-all@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 8FB44D4400; Wed, 11 Sep 2019 13:34:20 +0000 (UTC) (envelope-from imp@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 46T2th3C5fz3xZD; Wed, 11 Sep 2019 13:34:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51FCA73B2; Wed, 11 Sep 2019 13:34:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BDYKgG071535; Wed, 11 Sep 2019 13:34:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BDYKNu071534; Wed, 11 Sep 2019 13:34:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909111334.x8BDYKNu071534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 11 Sep 2019 13:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352212 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 352212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 13:34:20 -0000 Author: imp Date: Wed Sep 11 13:34:19 2019 New Revision: 352212 URL: https://svnweb.freebsd.org/changeset/base/352212 Log: Assume all the short args have optional args so allocate space for the ':'. It's slightly wasteful, but much easier (and the savings in bytes at runtime would be tiny, but the code to do it larger). Submitted by: Sebastian Huber Modified: head/sbin/nvmecontrol/comnd.c Modified: head/sbin/nvmecontrol/comnd.c ============================================================================== --- head/sbin/nvmecontrol/comnd.c Wed Sep 11 13:27:10 2019 (r352211) +++ head/sbin/nvmecontrol/comnd.c Wed Sep 11 13:34:19 2019 (r352212) @@ -189,7 +189,7 @@ arg_parse(int argc, char * const * argv, const struct lopts = malloc((n + 2) * sizeof(struct option)); if (lopts == NULL) err(1, "option memory"); - p = shortopts = malloc((n + 3) * sizeof(char)); + p = shortopts = malloc((2 * n + 3) * sizeof(char)); if (shortopts == NULL) err(1, "shortopts memory"); idx = 0; From owner-svn-src-all@freebsd.org Wed Sep 11 13:35:22 2019 Return-Path: Delivered-To: svn-src-all@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 DC99BD4498; Wed, 11 Sep 2019 13:35:22 +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 46T2vt5WyZz3xj5; Wed, 11 Sep 2019 13:35:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0D7F73B3; Wed, 11 Sep 2019 13:35:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BDZM3a071643; Wed, 11 Sep 2019 13:35:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BDZM3R071642; Wed, 11 Sep 2019 13:35:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111335.x8BDZM3R071642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 13:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352213 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 352213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 13:35:22 -0000 Author: emaste Date: Wed Sep 11 13:35:22 2019 New Revision: 352213 URL: https://svnweb.freebsd.org/changeset/base/352213 Log: fw_stub.awk: use @generated tag in generated files Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in enerated files). Use the @generated tag in makesyscalls.sh as we've done for other generated files. Modified: head/sys/tools/fw_stub.awk Modified: head/sys/tools/fw_stub.awk ============================================================================== --- head/sys/tools/fw_stub.awk Wed Sep 11 13:34:19 2019 (r352212) +++ head/sys/tools/fw_stub.awk Wed Sep 11 13:35:22 2019 (r352213) @@ -123,8 +123,10 @@ ctmpfilename = cfilename ".tmp"; modname = opt_m; gsub(/[-\.]/, "_", modname); +# Avoid a literal generated file tag here. +generated = "@" "generated"; printc("/*\ - * Automatically generated by:\ + * Automatically " generated " by:\ * $FreeBSD$\ */"); printc("#include "); From owner-svn-src-all@freebsd.org Wed Sep 11 15:39:30 2019 Return-Path: Delivered-To: svn-src-all@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 C464CD76B5; Wed, 11 Sep 2019 15:39:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T5g65V9rz44QC; Wed, 11 Sep 2019 15:39:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE3E892A; Wed, 11 Sep 2019 15:39:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BFdUPV042567; Wed, 11 Sep 2019 15:39:30 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BFdSHo042554; Wed, 11 Sep 2019 15:39:28 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909111539.x8BFdSHo042554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 11 Sep 2019 15:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352214 - in head/usr.bin/locale: . tests X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/usr.bin/locale: . tests X-SVN-Commit-Revision: 352214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 15:39:30 -0000 Author: yuripv Date: Wed Sep 11 15:39:28 2019 New Revision: 352214 URL: https://svnweb.freebsd.org/changeset/base/352214 Log: locale: more output fixes - make abday, day, abmon, mon, am_pm output quoting match linux - workaround localeconv() issue for mon_grouping and grouping (PR172215) - for other values not available in default locale, output -1 instead of 127 (CHAR_MAX) as returned by localeconv() With these changes, output of `locale` and `locale -k` for all keywords specified by POSIX exactly matches the linux one. PR: 237752 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D21599 Added: head/usr.bin/locale/tests/no_flags_posix_messages.out (contents, props changed) head/usr.bin/locale/tests/no_flags_posix_monetary.out (contents, props changed) head/usr.bin/locale/tests/no_flags_posix_numeric.out (contents, props changed) head/usr.bin/locale/tests/no_flags_posix_time.out (contents, props changed) Modified: head/usr.bin/locale/locale.c head/usr.bin/locale/tests/Makefile head/usr.bin/locale/tests/k_flag_posix_monetary.out head/usr.bin/locale/tests/k_flag_posix_numeric.out head/usr.bin/locale/tests/k_flag_posix_time.out head/usr.bin/locale/tests/locale_test.sh Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/locale.c Wed Sep 11 15:39:28 2019 (r352214) @@ -54,7 +54,7 @@ #include "setlocale.h" /* Local prototypes */ -char *format_grouping(const char *); +char *format_grouping(char *); void init_locales_list(void); void list_charmaps(void); void list_locales(void); @@ -119,6 +119,12 @@ enum { }; enum { + TYPE_NUM, + TYPE_STR, + TYPE_UNQ +}; + +enum { SRC_LINFO, SRC_LCONV, SRC_LTIME @@ -126,218 +132,218 @@ enum { static const struct _kwinfo { const char *name; - int isstr; /* true - string, false - number */ + int type; int catid; /* LC_* */ int source; int value_ref; const char *comment; } kwinfo [] = { - { "charmap", 1, LC_CTYPE, SRC_LINFO, + { "charmap", TYPE_STR, LC_CTYPE, SRC_LINFO, CODESET, "" }, /* hack */ /* LC_MONETARY - POSIX */ - { "int_curr_symbol", 1, LC_MONETARY, SRC_LCONV, + { "int_curr_symbol", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_INT_CURR_SYMBOL, "" }, - { "currency_symbol", 1, LC_MONETARY, SRC_LCONV, + { "currency_symbol", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_CURRENCY_SYMBOL, "" }, - { "mon_decimal_point", 1, LC_MONETARY, SRC_LCONV, + { "mon_decimal_point", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_MON_DECIMAL_POINT, "" }, - { "mon_thousands_sep", 1, LC_MONETARY, SRC_LCONV, + { "mon_thousands_sep", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_MON_THOUSANDS_SEP, "" }, - { "mon_grouping", 1, LC_MONETARY, SRC_LCONV, + { "mon_grouping", TYPE_UNQ, LC_MONETARY, SRC_LCONV, KW_MON_GROUPING, "" }, - { "positive_sign", 1, LC_MONETARY, SRC_LCONV, + { "positive_sign", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_POSITIVE_SIGN, "" }, - { "negative_sign", 1, LC_MONETARY, SRC_LCONV, + { "negative_sign", TYPE_STR, LC_MONETARY, SRC_LCONV, KW_NEGATIVE_SIGN, "" }, - { "int_frac_digits", 0, LC_MONETARY, SRC_LCONV, + { "int_frac_digits", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_FRAC_DIGITS, "" }, - { "frac_digits", 0, LC_MONETARY, SRC_LCONV, + { "frac_digits", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_FRAC_DIGITS, "" }, - { "p_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + { "p_cs_precedes", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_P_CS_PRECEDES, "" }, - { "p_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + { "p_sep_by_space", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_P_SEP_BY_SPACE, "" }, - { "n_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + { "n_cs_precedes", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_N_CS_PRECEDES, "" }, - { "n_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + { "n_sep_by_space", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_N_SEP_BY_SPACE, "" }, - { "p_sign_posn", 0, LC_MONETARY, SRC_LCONV, + { "p_sign_posn", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_P_SIGN_POSN, "" }, - { "n_sign_posn", 0, LC_MONETARY, SRC_LCONV, + { "n_sign_posn", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_N_SIGN_POSN, "" }, - { "int_p_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + { "int_p_cs_precedes", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_P_CS_PRECEDES, "" }, - { "int_p_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + { "int_p_sep_by_space", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_P_SEP_BY_SPACE, "" }, - { "int_n_cs_precedes", 0, LC_MONETARY, SRC_LCONV, + { "int_n_cs_precedes", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_N_CS_PRECEDES, "" }, - { "int_n_sep_by_space", 0, LC_MONETARY, SRC_LCONV, + { "int_n_sep_by_space", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_N_SEP_BY_SPACE, "" }, - { "int_p_sign_posn", 0, LC_MONETARY, SRC_LCONV, + { "int_p_sign_posn", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_P_SIGN_POSN, "" }, - { "int_n_sign_posn", 0, LC_MONETARY, SRC_LCONV, + { "int_n_sign_posn", TYPE_NUM, LC_MONETARY, SRC_LCONV, KW_INT_N_SIGN_POSN, "" }, /* LC_NUMERIC - POSIX */ - { "decimal_point", 1, LC_NUMERIC, SRC_LINFO, + { "decimal_point", TYPE_STR, LC_NUMERIC, SRC_LINFO, RADIXCHAR, "" }, - { "thousands_sep", 1, LC_NUMERIC, SRC_LINFO, + { "thousands_sep", TYPE_STR, LC_NUMERIC, SRC_LINFO, THOUSEP, "" }, - { "grouping", 1, LC_NUMERIC, SRC_LCONV, + { "grouping", TYPE_UNQ, LC_NUMERIC, SRC_LCONV, KW_GROUPING, "" }, /* LC_NUMERIC - local additions */ - { "radixchar", 1, LC_NUMERIC, SRC_LINFO, + { "radixchar", TYPE_STR, LC_NUMERIC, SRC_LINFO, RADIXCHAR, "Same as decimal_point (FreeBSD only)" }, /* compat */ - { "thousep", 1, LC_NUMERIC, SRC_LINFO, + { "thousep", TYPE_STR, LC_NUMERIC, SRC_LINFO, THOUSEP, "Same as thousands_sep (FreeBSD only)" }, /* compat */ /* LC_TIME - POSIX */ - { "abday", 1, LC_TIME, SRC_LTIME, + { "abday", TYPE_STR, LC_TIME, SRC_LTIME, KW_TIME_ABDAY, "" }, - { "day", 1, LC_TIME, SRC_LTIME, + { "day", TYPE_STR, LC_TIME, SRC_LTIME, KW_TIME_DAY, "" }, - { "abmon", 1, LC_TIME, SRC_LTIME, + { "abmon", TYPE_STR, LC_TIME, SRC_LTIME, KW_TIME_ABMON, "" }, - { "mon", 1, LC_TIME, SRC_LTIME, + { "mon", TYPE_STR, LC_TIME, SRC_LTIME, KW_TIME_MON, "" }, - { "d_t_fmt", 1, LC_TIME, SRC_LINFO, + { "d_t_fmt", TYPE_STR, LC_TIME, SRC_LINFO, D_T_FMT, "" }, - { "d_fmt", 1, LC_TIME, SRC_LINFO, + { "d_fmt", TYPE_STR, LC_TIME, SRC_LINFO, D_FMT, "" }, - { "t_fmt", 1, LC_TIME, SRC_LINFO, + { "t_fmt", TYPE_STR, LC_TIME, SRC_LINFO, T_FMT, "" }, - { "am_pm", 1, LC_TIME, SRC_LTIME, + { "am_pm", TYPE_STR, LC_TIME, SRC_LTIME, KW_TIME_AM_PM, "" }, - { "t_fmt_ampm", 1, LC_TIME, SRC_LINFO, + { "t_fmt_ampm", TYPE_STR, LC_TIME, SRC_LINFO, T_FMT_AMPM, "" }, - { "era", 1, LC_TIME, SRC_LINFO, + { "era", TYPE_UNQ, LC_TIME, SRC_LINFO, ERA, "(unavailable)" }, - { "era_d_fmt", 1, LC_TIME, SRC_LINFO, + { "era_d_fmt", TYPE_STR, LC_TIME, SRC_LINFO, ERA_D_FMT, "(unavailable)" }, - { "era_d_t_fmt", 1, LC_TIME, SRC_LINFO, + { "era_d_t_fmt", TYPE_STR, LC_TIME, SRC_LINFO, ERA_D_T_FMT, "(unavailable)" }, - { "era_t_fmt", 1, LC_TIME, SRC_LINFO, + { "era_t_fmt", TYPE_STR, LC_TIME, SRC_LINFO, ERA_T_FMT, "(unavailable)" }, - { "alt_digits", 1, LC_TIME, SRC_LINFO, + { "alt_digits", TYPE_UNQ, LC_TIME, SRC_LINFO, ALT_DIGITS, "" }, /* LC_TIME - local additions */ - { "abday_1", 1, LC_TIME, SRC_LINFO, + { "abday_1", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_1, "(FreeBSD only)" }, - { "abday_2", 1, LC_TIME, SRC_LINFO, + { "abday_2", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_2, "(FreeBSD only)" }, - { "abday_3", 1, LC_TIME, SRC_LINFO, + { "abday_3", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_3, "(FreeBSD only)" }, - { "abday_4", 1, LC_TIME, SRC_LINFO, + { "abday_4", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_4, "(FreeBSD only)" }, - { "abday_5", 1, LC_TIME, SRC_LINFO, + { "abday_5", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_5, "(FreeBSD only)" }, - { "abday_6", 1, LC_TIME, SRC_LINFO, + { "abday_6", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_6, "(FreeBSD only)" }, - { "abday_7", 1, LC_TIME, SRC_LINFO, + { "abday_7", TYPE_STR, LC_TIME, SRC_LINFO, ABDAY_7, "(FreeBSD only)" }, - { "day_1", 1, LC_TIME, SRC_LINFO, + { "day_1", TYPE_STR, LC_TIME, SRC_LINFO, DAY_1, "(FreeBSD only)" }, - { "day_2", 1, LC_TIME, SRC_LINFO, + { "day_2", TYPE_STR, LC_TIME, SRC_LINFO, DAY_2, "(FreeBSD only)" }, - { "day_3", 1, LC_TIME, SRC_LINFO, + { "day_3", TYPE_STR, LC_TIME, SRC_LINFO, DAY_3, "(FreeBSD only)" }, - { "day_4", 1, LC_TIME, SRC_LINFO, + { "day_4", TYPE_STR, LC_TIME, SRC_LINFO, DAY_4, "(FreeBSD only)" }, - { "day_5", 1, LC_TIME, SRC_LINFO, + { "day_5", TYPE_STR, LC_TIME, SRC_LINFO, DAY_5, "(FreeBSD only)" }, - { "day_6", 1, LC_TIME, SRC_LINFO, + { "day_6", TYPE_STR, LC_TIME, SRC_LINFO, DAY_6, "(FreeBSD only)" }, - { "day_7", 1, LC_TIME, SRC_LINFO, + { "day_7", TYPE_STR, LC_TIME, SRC_LINFO, DAY_7, "(FreeBSD only)" }, - { "abmon_1", 1, LC_TIME, SRC_LINFO, + { "abmon_1", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_1, "(FreeBSD only)" }, - { "abmon_2", 1, LC_TIME, SRC_LINFO, + { "abmon_2", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_2, "(FreeBSD only)" }, - { "abmon_3", 1, LC_TIME, SRC_LINFO, + { "abmon_3", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_3, "(FreeBSD only)" }, - { "abmon_4", 1, LC_TIME, SRC_LINFO, + { "abmon_4", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_4, "(FreeBSD only)" }, - { "abmon_5", 1, LC_TIME, SRC_LINFO, + { "abmon_5", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_5, "(FreeBSD only)" }, - { "abmon_6", 1, LC_TIME, SRC_LINFO, + { "abmon_6", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_6, "(FreeBSD only)" }, - { "abmon_7", 1, LC_TIME, SRC_LINFO, + { "abmon_7", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_7, "(FreeBSD only)" }, - { "abmon_8", 1, LC_TIME, SRC_LINFO, + { "abmon_8", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_8, "(FreeBSD only)" }, - { "abmon_9", 1, LC_TIME, SRC_LINFO, + { "abmon_9", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_9, "(FreeBSD only)" }, - { "abmon_10", 1, LC_TIME, SRC_LINFO, + { "abmon_10", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_10, "(FreeBSD only)" }, - { "abmon_11", 1, LC_TIME, SRC_LINFO, + { "abmon_11", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_11, "(FreeBSD only)" }, - { "abmon_12", 1, LC_TIME, SRC_LINFO, + { "abmon_12", TYPE_STR, LC_TIME, SRC_LINFO, ABMON_12, "(FreeBSD only)" }, - { "mon_1", 1, LC_TIME, SRC_LINFO, + { "mon_1", TYPE_STR, LC_TIME, SRC_LINFO, MON_1, "(FreeBSD only)" }, - { "mon_2", 1, LC_TIME, SRC_LINFO, + { "mon_2", TYPE_STR, LC_TIME, SRC_LINFO, MON_2, "(FreeBSD only)" }, - { "mon_3", 1, LC_TIME, SRC_LINFO, + { "mon_3", TYPE_STR, LC_TIME, SRC_LINFO, MON_3, "(FreeBSD only)" }, - { "mon_4", 1, LC_TIME, SRC_LINFO, + { "mon_4", TYPE_STR, LC_TIME, SRC_LINFO, MON_4, "(FreeBSD only)" }, - { "mon_5", 1, LC_TIME, SRC_LINFO, + { "mon_5", TYPE_STR, LC_TIME, SRC_LINFO, MON_5, "(FreeBSD only)" }, - { "mon_6", 1, LC_TIME, SRC_LINFO, + { "mon_6", TYPE_STR, LC_TIME, SRC_LINFO, MON_6, "(FreeBSD only)" }, - { "mon_7", 1, LC_TIME, SRC_LINFO, + { "mon_7", TYPE_STR, LC_TIME, SRC_LINFO, MON_7, "(FreeBSD only)" }, - { "mon_8", 1, LC_TIME, SRC_LINFO, + { "mon_8", TYPE_STR, LC_TIME, SRC_LINFO, MON_8, "(FreeBSD only)" }, - { "mon_9", 1, LC_TIME, SRC_LINFO, + { "mon_9", TYPE_STR, LC_TIME, SRC_LINFO, MON_9, "(FreeBSD only)" }, - { "mon_10", 1, LC_TIME, SRC_LINFO, + { "mon_10", TYPE_STR, LC_TIME, SRC_LINFO, MON_10, "(FreeBSD only)" }, - { "mon_11", 1, LC_TIME, SRC_LINFO, + { "mon_11", TYPE_STR, LC_TIME, SRC_LINFO, MON_11, "(FreeBSD only)" }, - { "mon_12", 1, LC_TIME, SRC_LINFO, + { "mon_12", TYPE_STR, LC_TIME, SRC_LINFO, MON_12, "(FreeBSD only)" }, - { "altmon_1", 1, LC_TIME, SRC_LINFO, + { "altmon_1", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_1, "(FreeBSD only)" }, - { "altmon_2", 1, LC_TIME, SRC_LINFO, + { "altmon_2", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_2, "(FreeBSD only)" }, - { "altmon_3", 1, LC_TIME, SRC_LINFO, + { "altmon_3", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_3, "(FreeBSD only)" }, - { "altmon_4", 1, LC_TIME, SRC_LINFO, + { "altmon_4", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_4, "(FreeBSD only)" }, - { "altmon_5", 1, LC_TIME, SRC_LINFO, + { "altmon_5", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_5, "(FreeBSD only)" }, - { "altmon_6", 1, LC_TIME, SRC_LINFO, + { "altmon_6", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_6, "(FreeBSD only)" }, - { "altmon_7", 1, LC_TIME, SRC_LINFO, + { "altmon_7", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_7, "(FreeBSD only)" }, - { "altmon_8", 1, LC_TIME, SRC_LINFO, + { "altmon_8", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_8, "(FreeBSD only)" }, - { "altmon_9", 1, LC_TIME, SRC_LINFO, + { "altmon_9", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_9, "(FreeBSD only)" }, - { "altmon_10", 1, LC_TIME, SRC_LINFO, + { "altmon_10", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_10, "(FreeBSD only)" }, - { "altmon_11", 1, LC_TIME, SRC_LINFO, + { "altmon_11", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_11, "(FreeBSD only)" }, - { "altmon_12", 1, LC_TIME, SRC_LINFO, + { "altmon_12", TYPE_STR, LC_TIME, SRC_LINFO, ALTMON_12, "(FreeBSD only)" }, - { "am_str", 1, LC_TIME, SRC_LINFO, + { "am_str", TYPE_STR, LC_TIME, SRC_LINFO, AM_STR, "(FreeBSD only)" }, - { "pm_str", 1, LC_TIME, SRC_LINFO, + { "pm_str", TYPE_STR, LC_TIME, SRC_LINFO, PM_STR, "(FreeBSD only)" }, - { "d_md_order", 1, LC_TIME, SRC_LINFO, + { "d_md_order", TYPE_STR, LC_TIME, SRC_LINFO, D_MD_ORDER, "(FreeBSD only)" }, /* local */ /* LC_MESSAGES - POSIX */ - { "yesexpr", 1, LC_MESSAGES, SRC_LINFO, + { "yesexpr", TYPE_STR, LC_MESSAGES, SRC_LINFO, YESEXPR, "" }, - { "noexpr", 1, LC_MESSAGES, SRC_LINFO, + { "noexpr", TYPE_STR, LC_MESSAGES, SRC_LINFO, NOEXPR, "" }, /* LC_MESSAGES - local additions */ - { "yesstr", 1, LC_MESSAGES, SRC_LINFO, + { "yesstr", TYPE_STR, LC_MESSAGES, SRC_LINFO, YESSTR, "(POSIX legacy)" }, /* compat */ - { "nostr", 1, LC_MESSAGES, SRC_LINFO, + { "nostr", TYPE_STR, LC_MESSAGES, SRC_LINFO, NOSTR, "(POSIX legacy)" } /* compat */ }; @@ -610,13 +616,20 @@ showlocale(void) } char * -format_grouping(const char *binary) +format_grouping(char *binary) { static char rval[64]; const char *cp; size_t roff; int len; + /* + * XXX This check will need to be modified if/when localeconv() is + * fixed (PR172215). + */ + if (*binary == CHAR_MAX) + return (binary); + rval[0] = '\0'; roff = 0; for (cp = binary; *cp != '\0'; ++cp) { @@ -752,7 +765,7 @@ kwval_ltime(int id) e_item = ABMON_12; break; case KW_TIME_AM_PM: - if (asprintf(&rval, "%s\";\"%s", + if (asprintf(&rval, "%s;%s", nl_langinfo(AM_STR), nl_langinfo(PM_STR)) == -1) err(1, "asprintf"); @@ -763,11 +776,9 @@ kwval_ltime(int id) if (kwsbuf == NULL) err(1, "sbuf"); for (i = s_item; i <= e_item; i++) { - if (i != s_item) - (void) sbuf_cat(kwsbuf, "\""); (void) sbuf_cat(kwsbuf, nl_langinfo(i)); if (i != e_item) - (void) sbuf_cat(kwsbuf, "\";"); + (void) sbuf_cat(kwsbuf, ";"); } (void) sbuf_finish(kwsbuf); rval = strdup(sbuf_data(kwsbuf)); @@ -781,10 +792,11 @@ kwval_ltime(int id) * keyword value and properties lookup */ int -kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr, int *alloc) +kwval_lookup(const char *kwname, char **kwval, int *cat, int *type, int *alloc) { int rval; size_t i; + static char nastr[3] = "-1"; rval = 0; *alloc = 0; @@ -792,13 +804,22 @@ kwval_lookup(const char *kwname, char **kwval, int *ca if (strcasecmp(kwname, kwinfo[i].name) == 0) { rval = 1; *cat = kwinfo[i].catid; - *isstr = kwinfo[i].isstr; + *type = kwinfo[i].type; switch (kwinfo[i].source) { case SRC_LINFO: *kwval = nl_langinfo(kwinfo[i].value_ref); break; case SRC_LCONV: *kwval = kwval_lconv(kwinfo[i].value_ref); + /* + * XXX This check will need to be modified + * if/when localeconv() is fixed (PR172215). + */ + if (**kwval == CHAR_MAX) { + if (*type == TYPE_NUM) + *type = TYPE_UNQ; + *kwval = nastr; + } break; case SRC_LTIME: *kwval = kwval_ltime(kwinfo[i].value_ref); @@ -819,10 +840,10 @@ kwval_lookup(const char *kwname, char **kwval, int *ca void showdetails(const char *kw) { - int isstr, cat, tmpval, alloc; + int type, cat, tmpval, alloc; char *kwval; - if (kwval_lookup(kw, &kwval, &cat, &isstr, &alloc) == 0) { + if (kwval_lookup(kw, &kwval, &cat, &type, &alloc) == 0) { /* * invalid keyword specified. * XXX: any actions? @@ -839,20 +860,30 @@ showdetails(const char *kw) } if (prt_keywords) { - if (isstr) { - printf("%s=\"%s\"\n", kw, kwval); - } else { - tmpval = (char) *kwval; + switch (type) { + case TYPE_NUM: + tmpval = (char)*kwval; printf("%s=%d\n", kw, tmpval); + break; + case TYPE_STR: + printf("%s=\"%s\"\n", kw, kwval); + break; + case TYPE_UNQ: + printf("%s=%s\n", kw, kwval); + break; } } if (!prt_categories && !prt_keywords) { - if (isstr) { - printf("%s\n", kwval); - } else { - tmpval = (char) *kwval; + switch (type) { + case TYPE_NUM: + tmpval = (char)*kwval; printf("%d\n", tmpval); + break; + case TYPE_STR: + case TYPE_UNQ: + printf("%s\n", kwval); + break; } } @@ -901,7 +932,7 @@ showkeywordslist(char *substring) printf(FMT, kwinfo[i].name, lookup_localecat(kwinfo[i].catid), - (kwinfo[i].isstr == 0) ? "number" : "string", + (kwinfo[i].type == TYPE_NUM) ? "number" : "string", kwinfo[i].comment); } } Modified: head/usr.bin/locale/tests/Makefile ============================================================================== --- head/usr.bin/locale/tests/Makefile Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/tests/Makefile Wed Sep 11 15:39:28 2019 (r352214) @@ -8,5 +8,9 @@ ${PACKAGE}FILES+= k_flag_posix_monetary.out ${PACKAGE}FILES+= k_flag_posix_numeric.out ${PACKAGE}FILES+= k_flag_posix_time.out ${PACKAGE}FILES+= k_flag_posix_messages.out +${PACKAGE}FILES+= no_flags_posix_monetary.out +${PACKAGE}FILES+= no_flags_posix_numeric.out +${PACKAGE}FILES+= no_flags_posix_time.out +${PACKAGE}FILES+= no_flags_posix_messages.out .include Modified: head/usr.bin/locale/tests/k_flag_posix_monetary.out ============================================================================== --- head/usr.bin/locale/tests/k_flag_posix_monetary.out Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/tests/k_flag_posix_monetary.out Wed Sep 11 15:39:28 2019 (r352214) @@ -2,20 +2,20 @@ int_curr_symbol="" currency_symbol="" mon_decimal_point="" mon_thousands_sep="" -mon_grouping="127" +mon_grouping=-1 positive_sign="" negative_sign="" -int_frac_digits=127 -frac_digits=127 -p_cs_precedes=127 -p_sep_by_space=127 -n_cs_precedes=127 -n_sep_by_space=127 -p_sign_posn=127 -n_sign_posn=127 -int_p_cs_precedes=127 -int_n_cs_precedes=127 -int_p_sep_by_space=127 -int_n_sep_by_space=127 -int_p_sign_posn=127 -int_n_sign_posn=127 +int_frac_digits=-1 +frac_digits=-1 +p_cs_precedes=-1 +p_sep_by_space=-1 +n_cs_precedes=-1 +n_sep_by_space=-1 +p_sign_posn=-1 +n_sign_posn=-1 +int_p_cs_precedes=-1 +int_n_cs_precedes=-1 +int_p_sep_by_space=-1 +int_n_sep_by_space=-1 +int_p_sign_posn=-1 +int_n_sign_posn=-1 Modified: head/usr.bin/locale/tests/k_flag_posix_numeric.out ============================================================================== --- head/usr.bin/locale/tests/k_flag_posix_numeric.out Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/tests/k_flag_posix_numeric.out Wed Sep 11 15:39:28 2019 (r352214) @@ -1,3 +1,3 @@ decimal_point="." thousands_sep="" -grouping="127" +grouping=-1 Modified: head/usr.bin/locale/tests/k_flag_posix_time.out ============================================================================== --- head/usr.bin/locale/tests/k_flag_posix_time.out Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/tests/k_flag_posix_time.out Wed Sep 11 15:39:28 2019 (r352214) @@ -1,14 +1,14 @@ -abday="Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat" -day="Sunday";"Monday";"Tuesday";"Wednesday";"Thursday";"Friday";"Saturday" -abmon="Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec" -mon="January";"February";"March";"April";"May";"June";"July";"August";"September";"October";"November";"December" +abday="Sun;Mon;Tue;Wed;Thu;Fri;Sat" +day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday" +abmon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec" +mon="January;February;March;April;May;June;July;August;September;October;November;December" d_t_fmt="%a %b %e %H:%M:%S %Y" d_fmt="%m/%d/%y" t_fmt="%H:%M:%S" -am_pm="AM";"PM" +am_pm="AM;PM" t_fmt_ampm="%I:%M:%S %p" -era="" +era= era_d_fmt="" era_t_fmt="" era_d_t_fmt="" -alt_digits="" +alt_digits= Modified: head/usr.bin/locale/tests/locale_test.sh ============================================================================== --- head/usr.bin/locale/tests/locale_test.sh Wed Sep 11 13:35:22 2019 (r352213) +++ head/usr.bin/locale/tests/locale_test.sh Wed Sep 11 15:39:28 2019 (r352214) @@ -29,7 +29,8 @@ atf_test_case k_flag_posix k_flag_posix_head() { - atf_set "descr" "Verify -k handles all POSIX specified keywords" + atf_set "descr" \ + "Verify output of 'locale -k' for all POSIX specified keywords" } k_flag_posix_body() { @@ -92,7 +93,75 @@ k_flag_posix_body() noexpr } +atf_test_case no_flags_posix +no_flags_posix_head() +{ + atf_set "descr" \ + "Verify output of 'locale' for all POSIX specified keywords" +} +no_flags_posix_body() +{ + export LC_ALL="C" + + # LC_MONETARY + atf_check -o file:"$(atf_get_srcdir)/no_flags_posix_monetary.out" \ + locale \ + int_curr_symbol \ + currency_symbol \ + mon_decimal_point \ + mon_thousands_sep \ + mon_grouping \ + positive_sign \ + negative_sign \ + int_frac_digits \ + frac_digits \ + p_cs_precedes \ + p_sep_by_space \ + n_cs_precedes \ + n_sep_by_space \ + p_sign_posn \ + n_sign_posn \ + int_p_cs_precedes \ + int_n_cs_precedes \ + int_p_sep_by_space \ + int_n_sep_by_space \ + int_p_sign_posn \ + int_n_sign_posn + + # LC_NUMERIC + atf_check -o file:"$(atf_get_srcdir)/no_flags_posix_numeric.out" \ + locale \ + decimal_point \ + thousands_sep \ + grouping + + # LC_TIME + atf_check -o file:"$(atf_get_srcdir)/no_flags_posix_time.out" \ + locale \ + abday \ + day \ + abmon \ + mon \ + d_t_fmt \ + d_fmt \ + t_fmt \ + am_pm \ + t_fmt_ampm \ + era \ + era_d_fmt \ + era_t_fmt \ + era_d_t_fmt \ + alt_digits + + # LC_MESSAGES + atf_check -o file:"$(atf_get_srcdir)/no_flags_posix_messages.out" \ + locale \ + yesexpr \ + noexpr +} + atf_init_test_cases() { atf_add_test_case k_flag_posix + atf_add_test_case no_flags_posix } Added: head/usr.bin/locale/tests/no_flags_posix_messages.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/no_flags_posix_messages.out Wed Sep 11 15:39:28 2019 (r352214) @@ -0,0 +1,2 @@ +^[yY] +^[nN] Added: head/usr.bin/locale/tests/no_flags_posix_monetary.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/no_flags_posix_monetary.out Wed Sep 11 15:39:28 2019 (r352214) @@ -0,0 +1,21 @@ + + + + +-1 + + +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 +-1 Added: head/usr.bin/locale/tests/no_flags_posix_numeric.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/no_flags_posix_numeric.out Wed Sep 11 15:39:28 2019 (r352214) @@ -0,0 +1,3 @@ +. + +-1 Added: head/usr.bin/locale/tests/no_flags_posix_time.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/locale/tests/no_flags_posix_time.out Wed Sep 11 15:39:28 2019 (r352214) @@ -0,0 +1,14 @@ +Sun;Mon;Tue;Wed;Thu;Fri;Sat +Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday +Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec +January;February;March;April;May;June;July;August;September;October;November;December +%a %b %e %H:%M:%S %Y +%m/%d/%y +%H:%M:%S +AM;PM +%I:%M:%S %p + + + + + From owner-svn-src-all@freebsd.org Wed Sep 11 15:41:37 2019 Return-Path: Delivered-To: svn-src-all@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 02102D7937; Wed, 11 Sep 2019 15:41:37 +0000 (UTC) (envelope-from rrs@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 46T5jX6HHFz44lK; Wed, 11 Sep 2019 15:41:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BC4598A9D; Wed, 11 Sep 2019 15:41:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BFfa88047553; Wed, 11 Sep 2019 15:41:36 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BFfaRr047552; Wed, 11 Sep 2019 15:41:36 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201909111541.x8BFfaRr047552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 11 Sep 2019 15:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352215 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 15:41:37 -0000 Author: rrs Date: Wed Sep 11 15:41:36 2019 New Revision: 352215 URL: https://svnweb.freebsd.org/changeset/base/352215 Log: With the recent commit of ktls, we no longer have a sb_tls_flags, its just the sb_flags. Also the ratelimit code, now that the defintion is in sockbuf.h, does not need the ktls.h file (or its predecessor). Sponsored by: Netflix Inc Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c ============================================================================== --- head/sys/netinet/tcp_ratelimit.c Wed Sep 11 15:39:28 2019 (r352214) +++ head/sys/netinet/tcp_ratelimit.c Wed Sep 11 15:41:36 2019 (r352215) @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KERN_TLS -#include -#endif #include #include #include @@ -1069,7 +1066,7 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *if return (NULL); } #ifdef KERN_TLS - if (tp->t_inpcb->inp_socket->so_snd.sb_tls_flags & SB_TLS_IFNET) { + if (tp->t_inpcb->inp_socket->so_snd.sb_flags & SB_TLS_IFNET) { /* * We currently can't do both TLS and hardware * pacing From owner-svn-src-all@freebsd.org Wed Sep 11 16:00:03 2019 Return-Path: Delivered-To: svn-src-all@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 D9EE7D7EAE; Wed, 11 Sep 2019 16:00:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T66q4qxLz45Zv; Wed, 11 Sep 2019 16:00:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA3A8CB5; Wed, 11 Sep 2019 16:00:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BG03tF055112; Wed, 11 Sep 2019 16:00:03 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BG03or055111; Wed, 11 Sep 2019 16:00:03 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909111600.x8BG03or055111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 11 Sep 2019 16:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352216 - head/usr.bin/locale X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.bin/locale X-SVN-Commit-Revision: 352216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 16:00:03 -0000 Author: yuripv Date: Wed Sep 11 16:00:03 2019 New Revision: 352216 URL: https://svnweb.freebsd.org/changeset/base/352216 Log: locale: initialize variables to make gcc happy Reported by: jenkins Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Wed Sep 11 15:41:36 2019 (r352215) +++ head/usr.bin/locale/locale.c Wed Sep 11 16:00:03 2019 (r352216) @@ -745,7 +745,7 @@ kwval_ltime(int id) { char *rval; struct sbuf *kwsbuf; - nl_item i, s_item, e_item; + nl_item i, s_item = 0, e_item = 0; switch (id) { case KW_TIME_DAY: From owner-svn-src-all@freebsd.org Wed Sep 11 16:06:05 2019 Return-Path: Delivered-To: svn-src-all@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 B7C50D85E1; Wed, 11 Sep 2019 16:06:05 +0000 (UTC) (envelope-from oshogbo@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 46T6Fn4QDsz46ZQ; Wed, 11 Sep 2019 16:06:05 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7770B8E7D; Wed, 11 Sep 2019 16:06:05 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BG65eC060655; Wed, 11 Sep 2019 16:06:05 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BG65Em060654; Wed, 11 Sep 2019 16:06:05 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909111606.x8BG65Em060654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 11 Sep 2019 16:06: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: r352217 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 16:06:05 -0000 Author: oshogbo Date: Wed Sep 11 16:06:05 2019 New Revision: 352217 URL: https://svnweb.freebsd.org/changeset/base/352217 Log: Fix miss merge in r352179. Modified: stable/12/sys/kern/kern_exit.c Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Wed Sep 11 16:00:03 2019 (r352216) +++ stable/12/sys/kern/kern_exit.c Wed Sep 11 16:06:05 2019 (r352217) @@ -437,7 +437,6 @@ exit1(struct thread *td, int rval, int signo) LIST_REMOVE(p, p_hash); sx_xunlock(&allproc_lock); - sx_xlock(&proctree_lock); PROC_LOCK(p); p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Wed Sep 11 16:16:54 2019 Return-Path: Delivered-To: svn-src-all@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 9003AD89AE; Wed, 11 Sep 2019 16:16:54 +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 46T6VG3GZ9z478g; Wed, 11 Sep 2019 16:16:54 +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 53E519041; Wed, 11 Sep 2019 16:16:54 +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 x8BGGstf066822; Wed, 11 Sep 2019 16:16:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BGGsrd066821; Wed, 11 Sep 2019 16:16:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201909111616.x8BGGsrd066821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 11 Sep 2019 16:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352218 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 16:16:54 -0000 Author: kp Date: Wed Sep 11 16:16:53 2019 New Revision: 352218 URL: https://svnweb.freebsd.org/changeset/base/352218 Log: riscv: Small fix to CPU compatibility identification fdt_is_compatible_strict() inspects the first compatible property. We need to inspect the following properties for 'riscv'. ofw_bus_node_is_compatible() does a recursive search. This patch fixes "Can't find CPU" error message when bootverbose = true. Submitted by: Nicholas O'Brien (nickisobrien_gmail.com) Reviewed by: philip, kp Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D21576 Modified: head/sys/riscv/riscv/identcpu.c Modified: head/sys/riscv/riscv/identcpu.c ============================================================================== --- head/sys/riscv/riscv/identcpu.c Wed Sep 11 16:06:05 2019 (r352217) +++ head/sys/riscv/riscv/identcpu.c Wed Sep 11 16:16:53 2019 (r352218) @@ -141,7 +141,7 @@ fill_elf_hwcap(void *dummy __unused) * ISAs, keep only the extension bits that are common to all harts. */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if (!fdt_is_compatible_strict(node, "riscv")) { + if (!ofw_bus_node_is_compatible(node, "riscv")) { if (bootverbose) printf("fill_elf_hwcap: Can't find cpu\n"); return; From owner-svn-src-all@freebsd.org Wed Sep 11 16:24:04 2019 Return-Path: Delivered-To: svn-src-all@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 AFAC2D8D00; Wed, 11 Sep 2019 16:24:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T6fX33zpz47h2; Wed, 11 Sep 2019 16:24:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C9AA9202; Wed, 11 Sep 2019 16:24:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BGO4Nn072509; Wed, 11 Sep 2019 16:24:04 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BGO41M072508; Wed, 11 Sep 2019 16:24:04 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909111624.x8BGO41M072508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 11 Sep 2019 16:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352219 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 352219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 16:24:04 -0000 Author: lwhsu Date: Wed Sep 11 16:24:03 2019 New Revision: 352219 URL: https://svnweb.freebsd.org/changeset/base/352219 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid PR: 240510 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed Sep 11 16:16:53 2019 (r352218) +++ head/tests/sys/kern/ptrace_test.c Wed Sep 11 16:24:03 2019 (r352219) @@ -1006,6 +1006,10 @@ ATF_TC_BODY(ptrace__getppid, tc) int cpipe[2], dpipe[2], status; char c; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240510"); + + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); From owner-svn-src-all@freebsd.org Wed Sep 11 17:01:32 2019 Return-Path: Delivered-To: svn-src-all@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 B0D1AD9CCC; Wed, 11 Sep 2019 17:01:32 +0000 (UTC) (envelope-from brooks@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 46T7Tm4Hv6z49Pg; Wed, 11 Sep 2019 17:01:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 767BB97F4; Wed, 11 Sep 2019 17:01:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BH1WY1093768; Wed, 11 Sep 2019 17:01:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BH1WaI093767; Wed, 11 Sep 2019 17:01:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201909111701.x8BH1WaI093767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 11 Sep 2019 17:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352220 - head/lib/libbsnmp/libbsnmp X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libbsnmp/libbsnmp X-SVN-Commit-Revision: 352220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 17:01:32 -0000 Author: brooks Date: Wed Sep 11 17:01:31 2019 New Revision: 352220 URL: https://svnweb.freebsd.org/changeset/base/352220 Log: Avoid the use of the non-portable -D argument to ls. This was used to store the mtime of the source file in a commment in a generated header file. This is of little-to-no diagnostic value and the result doesn't even end up in the source tree. Reported by: arichardson Reviewed by: arichardson MFC after: 1 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21605 Modified: head/lib/libbsnmp/libbsnmp/Makefile Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Wed Sep 11 16:24:03 2019 (r352219) +++ head/lib/libbsnmp/libbsnmp/Makefile Wed Sep 11 17:01:31 2019 (r352220) @@ -26,9 +26,7 @@ MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 snmptc.h : tc.def (\ - echo -n "/* autogenerated from tc.def; ";\ - ls -l -D "%F %T" ${.ALLSRC} | awk '{printf("%s %s", $$6, $$7)}';\ - echo "*/";\ + echo "/* autogenerated from tc.def */";\ echo "#ifndef snmptc_h_1529923773";\ echo "#define snmptc_h_1529923773";\ gensnmptree -E -f <${.ALLSRC};\ From owner-svn-src-all@freebsd.org Wed Sep 11 17:04:14 2019 Return-Path: Delivered-To: svn-src-all@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 778CED9DCC; Wed, 11 Sep 2019 17:04:14 +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 46T7Xt2bTNz49my; Wed, 11 Sep 2019 17:04:14 +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 3D75B9955; Wed, 11 Sep 2019 17:04:14 +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 x8BH4EiC096184; Wed, 11 Sep 2019 17:04:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BH4DW5096180; Wed, 11 Sep 2019 17:04:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111704.x8BH4DW5096180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 17:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352221 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 352221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 17:04:14 -0000 Author: emaste Date: Wed Sep 11 17:04:13 2019 New Revision: 352221 URL: https://svnweb.freebsd.org/changeset/base/352221 Log: linuxulator: seccomp syscall first appeared in Linux 3.17 Reference: http://man7.org/linux/man-pages/man2/seccomp.2.html Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/arm64/linux/linux_dummy.c head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:01:31 2019 (r352220) +++ head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) @@ -131,9 +131,10 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.15: */ -DUMMY(seccomp); DUMMY(memfd_create); DUMMY(kexec_file_load); +/* Linux 3.17: */ +DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:01:31 2019 (r352220) +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:04:13 2019 (r352221) @@ -138,8 +138,9 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.15: */ -DUMMY(seccomp); DUMMY(memfd_create); +/* Linux 3.17: */ +DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:01:31 2019 (r352220) +++ head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) @@ -131,8 +131,9 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.15: */ -DUMMY(seccomp); DUMMY(memfd_create); +/* Linux 3.17: */ +DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:01:31 2019 (r352220) +++ head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) @@ -134,8 +134,9 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.14: */ -DUMMY(seccomp); DUMMY(memfd_create); +/* Linux 3.17: */ +DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ From owner-svn-src-all@freebsd.org Wed Sep 11 17:05:51 2019 Return-Path: Delivered-To: svn-src-all@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 4CB87D9E62; Wed, 11 Sep 2019 17:05:51 +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 46T7Zl1Kcrz49yC; Wed, 11 Sep 2019 17:05:51 +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 11D249956; Wed, 11 Sep 2019 17:05:51 +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 x8BH5o02096303; Wed, 11 Sep 2019 17:05:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BH5oF8096299; Wed, 11 Sep 2019 17:05:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111705.x8BH5oF8096299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 17:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352222 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 352222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 17:05:51 -0000 Author: emaste Date: Wed Sep 11 17:05:49 2019 New Revision: 352222 URL: https://svnweb.freebsd.org/changeset/base/352222 Log: linuxulator: memfd_create first appeared in Linux 3.17 Reference: http://man7.org/linux/man-pages/man2/memfd_create.2.html Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/arm64/linux/linux_dummy.c head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) +++ head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:05:49 2019 (r352222) @@ -131,9 +131,9 @@ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); /* Linux 3.15: */ -DUMMY(memfd_create); DUMMY(kexec_file_load); /* Linux 3.17: */ +DUMMY(memfd_create); DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:04:13 2019 (r352221) +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:05:49 2019 (r352222) @@ -137,9 +137,8 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.15: */ -DUMMY(memfd_create); /* Linux 3.17: */ +DUMMY(memfd_create); DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) +++ head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:05:49 2019 (r352222) @@ -130,9 +130,8 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.15: */ -DUMMY(memfd_create); /* Linux 3.17: */ +DUMMY(memfd_create); DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:04:13 2019 (r352221) +++ head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:05:49 2019 (r352222) @@ -133,9 +133,8 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.14: */ -DUMMY(memfd_create); /* Linux 3.17: */ +DUMMY(memfd_create); DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); From owner-svn-src-all@freebsd.org Wed Sep 11 17:29:45 2019 Return-Path: Delivered-To: svn-src-all@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 04CE0DA8B1; Wed, 11 Sep 2019 17:29:45 +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 46T86J6Jqlz4C7S; Wed, 11 Sep 2019 17:29:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7BC09CEE; Wed, 11 Sep 2019 17:29:44 +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 x8BHTiok008755; Wed, 11 Sep 2019 17:29:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BHTiLD008754; Wed, 11 Sep 2019 17:29:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111729.x8BHTiLD008754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 17:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352223 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 352223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 17:29:45 -0000 Author: emaste Date: Wed Sep 11 17:29:44 2019 New Revision: 352223 URL: https://svnweb.freebsd.org/changeset/base/352223 Log: linuxulator: add stub arm64 linux_genassym.c This will be fleshed out in the future but allows us to build the arm64 linuxulator using the same infrastructure as x86. Added: head/sys/arm64/linux/linux_genassym.c (contents, props changed) Added: head/sys/arm64/linux/linux_genassym.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_genassym.c Wed Sep 11 17:29:44 2019 (r352223) @@ -0,0 +1,2 @@ +#include +__FBSDID("$FreeBSD$"); From owner-svn-src-all@freebsd.org Wed Sep 11 17:56:49 2019 Return-Path: Delivered-To: svn-src-all@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 A442CDB062; Wed, 11 Sep 2019 17:56:49 +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 46T8jY3tpvz4DKd; Wed, 11 Sep 2019 17:56:49 +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 64544A22C; Wed, 11 Sep 2019 17:56:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BHunGO026379; Wed, 11 Sep 2019 17:56:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BHum6I026373; Wed, 11 Sep 2019 17:56:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909111756.x8BHum6I026373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Sep 2019 17:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352224 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 352224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 17:56:49 -0000 Author: emaste Date: Wed Sep 11 17:56:48 2019 New Revision: 352224 URL: https://svnweb.freebsd.org/changeset/base/352224 Log: Update comments and ordering in linux*_dummy.c - sort alphabetically - getcpu arrived in Linux 2.6.19 - fanotify_* arrived in 2.6.36 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/arm64/linux/linux_dummy.c head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:29:44 2019 (r352223) +++ head/sys/amd64/linux/linux_dummy.c Wed Sep 11 17:56:48 2019 (r352224) @@ -99,11 +99,13 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(tee); DUMMY(sync_file_range); +DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); +/* Linux 2.6.19: */ +DUMMY(getcpu); /* Linux 2.6.22: */ DUMMY(signalfd); /* Linux 2.6.27: */ @@ -111,7 +113,7 @@ DUMMY(signalfd4); DUMMY(inotify_init1); /* Linux 2.6.31: */ DUMMY(perf_event_open); -/* Linux 2.6.38: */ +/* Linux 2.6.36: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); /* Linux 2.6.39: */ @@ -120,7 +122,6 @@ DUMMY(open_by_handle_at); DUMMY(clock_adjtime); /* Linux 3.0: */ DUMMY(setns); -DUMMY(getcpu); /* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:29:44 2019 (r352223) +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 11 17:56:48 2019 (r352224) @@ -119,7 +119,7 @@ DUMMY(signalfd4); DUMMY(inotify_init1); /* Linux 2.6.31: */ DUMMY(perf_event_open); -/* Linux 2.6.33: */ +/* Linux 2.6.36: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); /* Linux 2.6.39: */ Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:29:44 2019 (r352223) +++ head/sys/arm64/linux/linux_dummy.c Wed Sep 11 17:56:48 2019 (r352224) @@ -101,17 +101,19 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(tee); DUMMY(sync_file_range); +DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); +/* Linux 2.6.19: */ +DUMMY(getcpu); /* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); /* Linux 2.6.31: */ DUMMY(perf_event_open); -/* Linux 2.6.38: */ +/* Linux 2.6.36: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); /* Linux 2.6.39: */ @@ -120,7 +122,6 @@ DUMMY(open_by_handle_at); DUMMY(clock_adjtime); /* Linux 3.0: */ DUMMY(setns); -DUMMY(getcpu); /* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:29:44 2019 (r352223) +++ head/sys/i386/linux/linux_dummy.c Wed Sep 11 17:56:48 2019 (r352224) @@ -115,7 +115,7 @@ DUMMY(signalfd4); DUMMY(inotify_init1); /* Linux 2.6.31: */ DUMMY(perf_event_open); -/* Linux 2.6.33: */ +/* Linux 2.6.36: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); /* Linux 2.6.39: */ From owner-svn-src-all@freebsd.org Wed Sep 11 18:07:15 2019 Return-Path: Delivered-To: svn-src-all@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 F0D24DB2F9; Wed, 11 Sep 2019 18:07:15 +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 46T8xb67Smz4DlP; Wed, 11 Sep 2019 18:07:15 +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 B1628A3E7; Wed, 11 Sep 2019 18:07:15 +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 x8BI7FiE032424; Wed, 11 Sep 2019 18:07:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BI7FTR032423; Wed, 11 Sep 2019 18:07:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201909111807.x8BI7FTR032423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 11 Sep 2019 18:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352225 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 18:07:16 -0000 Author: kp Date: Wed Sep 11 18:07:15 2019 New Revision: 352225 URL: https://svnweb.freebsd.org/changeset/base/352225 Log: riscv: Add missing header r352218 missing an include statement, causing the build to fail. Submitted by: Nicholas O'Brien (nickisobrien_gmail.com) Sponsored by: Axiado Modified: head/sys/riscv/riscv/identcpu.c Modified: head/sys/riscv/riscv/identcpu.c ============================================================================== --- head/sys/riscv/riscv/identcpu.c Wed Sep 11 17:56:48 2019 (r352224) +++ head/sys/riscv/riscv/identcpu.c Wed Sep 11 18:07:15 2019 (r352225) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include #include +#include #endif char machine[] = "riscv"; From owner-svn-src-all@freebsd.org Wed Sep 11 18:08:41 2019 Return-Path: Delivered-To: svn-src-all@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 2A63ADB3B2; Wed, 11 Sep 2019 18:08:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T8zF00GCz4Dwt; Wed, 11 Sep 2019 18:08:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8B8FA3E9; Wed, 11 Sep 2019 18:08:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BI8eMi032542; Wed, 11 Sep 2019 18:08:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BI8eVi032541; Wed, 11 Sep 2019 18:08:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909111808.x8BI8eVi032541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Sep 2019 18:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352226 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 352226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 18:08:41 -0000 Author: asomers Date: Wed Sep 11 18:08:40 2019 New Revision: 352226 URL: https://svnweb.freebsd.org/changeset/base/352226 Log: ping: fix a string in an error message MFC after: 3 days Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Wed Sep 11 18:07:15 2019 (r352225) +++ head/sbin/ping/ping.c Wed Sep 11 18:08:40 2019 (r352226) @@ -719,7 +719,7 @@ main(int argc, char *const *argv) */ caph_cache_catpages(); if (caph_enter_casper() < 0) - err(1, "cap_enter"); + err(1, "caph_enter_casper"); cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights) < 0) From owner-svn-src-all@freebsd.org Wed Sep 11 18:40:06 2019 Return-Path: Delivered-To: svn-src-all@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 4C972DC722; Wed, 11 Sep 2019 18:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T9gV1Kk0z4HBB; Wed, 11 Sep 2019 18:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DA8EA94E; Wed, 11 Sep 2019 18:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BIe5VG050564; Wed, 11 Sep 2019 18:40:05 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BIe5k2050563; Wed, 11 Sep 2019 18:40:05 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909111840.x8BIe5k2050563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 11 Sep 2019 18:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352227 - head/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/regex X-SVN-Commit-Revision: 352227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 18:40:06 -0000 Author: lwhsu Date: Wed Sep 11 18:40:05 2019 New Revision: 352227 URL: https://svnweb.freebsd.org/changeset/base/352227 Log: Only skip problematic test in CI env. PR: 237450 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Wed Sep 11 18:08:40 2019 (r352226) +++ head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Wed Sep 11 18:40:05 2019 (r352227) @@ -187,7 +187,8 @@ ATF_TC_BODY(regcomp_too_big, tc) struct rlimit limit; #if defined(__i386__) - atf_tc_skip("https://bugs.freebsd.org/237450"); + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/237450"); #endif limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024; From owner-svn-src-all@freebsd.org Wed Sep 11 18:48:26 2019 Return-Path: Delivered-To: svn-src-all@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 CF842DC9D8; Wed, 11 Sep 2019 18:48:26 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46T9s657gFz4HZc; Wed, 11 Sep 2019 18:48:26 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F082AB05; Wed, 11 Sep 2019 18:48:26 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BImQUc056189; Wed, 11 Sep 2019 18:48:26 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BImQnn056188; Wed, 11 Sep 2019 18:48:26 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201909111848.x8BImQnn056188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 11 Sep 2019 18:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352228 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 18:48:26 -0000 Author: gallatin Date: Wed Sep 11 18:48:26 2019 New Revision: 352228 URL: https://svnweb.freebsd.org/changeset/base/352228 Log: Avoid unneeded call to arc4random() in syncache_add() Don't call arc4random() unconditionally to initialize sc_iss, and then when syncookies are enabled, just overwrite it with the return value from from syncookie_generate(). Instead, only call arc4random() to initialize sc_iss when syncookies are not enabled. Note that on a system under a syn flood attack, arc4random() becomes quite expensive, and the chacha_poly crypto that it calls is one of the more expensive things happening on the system. Removing this unneeded arc4random() call reduces CPU from about 40% to about 35% in my test scenario (Broadwell Xeon, 6Mpps syn flood attack). Reviewed by: rrs, tuxen, bz Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21591 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Sep 11 18:40:05 2019 (r352227) +++ head/sys/netinet/tcp_syncache.c Wed Sep 11 18:48:26 2019 (r352228) @@ -1543,7 +1543,6 @@ skip_alloc: sc->sc_todctx = todctx; #endif sc->sc_irs = th->th_seq; - sc->sc_iss = arc4random(); sc->sc_flags = 0; sc->sc_flowlabel = 0; @@ -1617,6 +1616,8 @@ skip_alloc: if (V_tcp_syncookies) sc->sc_iss = syncookie_generate(sch, sc); + else + sc->sc_iss = arc4random(); #ifdef INET6 if (autoflowlabel) { if (V_tcp_syncookies) From owner-svn-src-all@freebsd.org Wed Sep 11 18:54:46 2019 Return-Path: Delivered-To: svn-src-all@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 5355BDCD73; Wed, 11 Sep 2019 18:54:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TB0Q1YjCz4J7T; Wed, 11 Sep 2019 18:54:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19550ACDF; Wed, 11 Sep 2019 18:54:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BIsjJm062006; Wed, 11 Sep 2019 18:54:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BIsjKc062005; Wed, 11 Sep 2019 18:54:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909111854.x8BIsjKc062005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Sep 2019 18:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352229 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 352229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 18:54:46 -0000 Author: asomers Date: Wed Sep 11 18:54:45 2019 New Revision: 352229 URL: https://svnweb.freebsd.org/changeset/base/352229 Log: ping: Verify whether a datagram timestamp was actually received. ping(8) uses SO_TIMESTAMP, which attaches a timestamp to each IP datagram at the time it's received by the kernel. Except that occasionally it doesn't. Add a check to see whether such a timestamp was actually set before trying to read it. This fixes segfaults that can happen when the kernel doesn't attach a timestamp. The bug has always existed, but prior to r351461 it manifested as an implausible round-trip-time, not a segfault. Reported by: pho MFC after: 3 days MFC-With: 351461 Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Wed Sep 11 18:48:26 2019 (r352228) +++ head/sbin/ping/ping.c Wed Sep 11 18:54:45 2019 (r352229) @@ -931,7 +931,8 @@ main(int argc, char *const *argv) continue; } #ifdef SO_TIMESTAMP - if (cmsg->cmsg_level == SOL_SOCKET && + if (cmsg != NULL && + cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP && cmsg->cmsg_len == CMSG_LEN(sizeof *tv)) { /* Copy to avoid alignment problems: */ From owner-svn-src-all@freebsd.org Wed Sep 11 19:29:41 2019 Return-Path: Delivered-To: svn-src-all@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 A1E74DDC36; Wed, 11 Sep 2019 19:29:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TBmj3LBfz4L7q; Wed, 11 Sep 2019 19:29:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E020B285; Wed, 11 Sep 2019 19:29:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BJTfdf080647; Wed, 11 Sep 2019 19:29:41 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BJTeV2080574; Wed, 11 Sep 2019 19:29:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909111929.x8BJTeV2080574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Sep 2019 19:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352230 - in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 352230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 19:29:41 -0000 Author: asomers Date: Wed Sep 11 19:29:40 2019 New Revision: 352230 URL: https://svnweb.freebsd.org/changeset/base/352230 Log: fusefs: Fix iosize for FUSE_WRITE in 7.8 compat mode When communicating with a FUSE server that implements version 7.8 (or older) of the FUSE protocol, the FUSE_WRITE request structure is 16 bytes shorter than normal. The protocol version check wasn't applied universally, leading to an extra 16 bytes being sent to such servers. The extra bytes were allocated and bzero()d, so there was no information disclosure. Reviewed by: emaste MFC after: 3 days MFC-With: r350665 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21557 Modified: head/sys/fs/fuse/fuse_io.c head/tests/sys/fs/fusefs/mockfs.cc head/tests/sys/fs/fusefs/mockfs.hh Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Wed Sep 11 18:54:45 2019 (r352229) +++ head/sys/fs/fuse/fuse_io.c Wed Sep 11 19:29:40 2019 (r352230) @@ -555,9 +555,17 @@ fuse_write_directbackend(struct vnode *vp, struct uio fdisp_init(&fdi, 0); while (uio->uio_resid > 0) { + size_t sizeof_fwi; + + if (fuse_libabi_geq(data, 7, 9)) { + sizeof_fwi = sizeof(*fwi); + } else { + sizeof_fwi = FUSE_COMPAT_WRITE_IN_SIZE; + } + chunksize = MIN(uio->uio_resid, data->max_write); - fdi.iosize = sizeof(*fwi) + chunksize; + fdi.iosize = sizeof_fwi + chunksize; fdisp_make_vp(&fdi, FUSE_WRITE, vp, uio->uio_td, cred); fwi = fdi.indata; @@ -567,11 +575,8 @@ fuse_write_directbackend(struct vnode *vp, struct uio fwi->write_flags = write_flags; if (fuse_libabi_geq(data, 7, 9)) { fwi->flags = fufh_type_2_fflags(fufh->fufh_type); - fwi_data = (char *)fdi.indata + sizeof(*fwi); - } else { - fwi_data = (char *)fdi.indata + - FUSE_COMPAT_WRITE_IN_SIZE; } + fwi_data = (char *)fdi.indata + sizeof_fwi; if ((err = uiomove(fwi_data, chunksize, uio))) break; @@ -629,7 +634,7 @@ retry: break; } else { /* Resend the unwritten portion of data */ - fdi.iosize = sizeof(*fwi) + diff; + fdi.iosize = sizeof_fwi + diff; /* Refresh fdi without clearing data buffer */ fdisp_refresh_vp(&fdi, FUSE_WRITE, vp, uio->uio_td, cred); Modified: head/tests/sys/fs/fusefs/mockfs.cc ============================================================================== --- head/tests/sys/fs/fusefs/mockfs.cc Wed Sep 11 18:54:45 2019 (r352229) +++ head/tests/sys/fs/fusefs/mockfs.cc Wed Sep 11 19:29:40 2019 (r352230) @@ -155,14 +155,15 @@ void sigint_handler(int __unused sig) { // Don't do anything except interrupt the daemon's read(2) call } -void MockFS::debug_request(const mockfs_buf_in &in) +void MockFS::debug_request(const mockfs_buf_in &in, ssize_t buflen) { printf("%-11s ino=%2" PRIu64, opcode2opname(in.header.opcode), in.header.nodeid); if (verbosity > 1) { - printf(" uid=%5u gid=%5u pid=%5u unique=%" PRIu64 " len=%u", + printf(" uid=%5u gid=%5u pid=%5u unique=%" PRIu64 " len=%u" + " buflen=%zd", in.header.uid, in.header.gid, in.header.pid, - in.header.unique, in.header.len); + in.header.unique, in.header.len, buflen); } switch (in.header.opcode) { const char *name, *value; @@ -470,7 +471,7 @@ MockFS::~MockFS() { close(m_kq); } -void MockFS::audit_request(const mockfs_buf_in &in) { +void MockFS::audit_request(const mockfs_buf_in &in, ssize_t buflen) { uint32_t inlen = in.header.len; size_t fih = sizeof(in.header); switch (in.header.opcode) { @@ -478,19 +479,24 @@ void MockFS::audit_request(const mockfs_buf_in &in) { case FUSE_RMDIR: case FUSE_SYMLINK: case FUSE_UNLINK: - ASSERT_GT(inlen, fih) << "Missing request filename"; + EXPECT_GT(inlen, fih) << "Missing request filename"; + // No redundant information for checking buflen break; case FUSE_FORGET: - ASSERT_EQ(inlen, fih + sizeof(in.body.forget)); + EXPECT_EQ(inlen, fih + sizeof(in.body.forget)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_GETATTR: - ASSERT_EQ(inlen, fih + sizeof(in.body.getattr)); + EXPECT_EQ(inlen, fih + sizeof(in.body.getattr)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_SETATTR: - ASSERT_EQ(inlen, fih + sizeof(in.body.setattr)); + EXPECT_EQ(inlen, fih + sizeof(in.body.setattr)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_READLINK: - ASSERT_EQ(inlen, fih) << "Unexpected request body"; + EXPECT_EQ(inlen, fih) << "Unexpected request body"; + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_MKNOD: { @@ -499,33 +505,39 @@ void MockFS::audit_request(const mockfs_buf_in &in) { s = sizeof(in.body.mknod); else s = FUSE_COMPAT_MKNOD_IN_SIZE; - ASSERT_GE(inlen, fih + s) << "Missing request body"; - ASSERT_GT(inlen, fih + s) << "Missing request filename"; + EXPECT_GE(inlen, fih + s) << "Missing request body"; + EXPECT_GT(inlen, fih + s) << "Missing request filename"; + // No redundant information for checking buflen break; } case FUSE_MKDIR: - ASSERT_GE(inlen, fih + sizeof(in.body.mkdir)) << + EXPECT_GE(inlen, fih + sizeof(in.body.mkdir)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.mkdir)) << + EXPECT_GT(inlen, fih + sizeof(in.body.mkdir)) << "Missing request filename"; + // No redundant information for checking buflen break; case FUSE_RENAME: - ASSERT_GE(inlen, fih + sizeof(in.body.rename)) << + EXPECT_GE(inlen, fih + sizeof(in.body.rename)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.rename)) << + EXPECT_GT(inlen, fih + sizeof(in.body.rename)) << "Missing request filename"; + // No redundant information for checking buflen break; case FUSE_LINK: - ASSERT_GE(inlen, fih + sizeof(in.body.link)) << + EXPECT_GE(inlen, fih + sizeof(in.body.link)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.link)) << + EXPECT_GT(inlen, fih + sizeof(in.body.link)) << "Missing request filename"; + // No redundant information for checking buflen break; case FUSE_OPEN: - ASSERT_EQ(inlen, fih + sizeof(in.body.open)); + EXPECT_EQ(inlen, fih + sizeof(in.body.open)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_READ: - ASSERT_EQ(inlen, fih + sizeof(in.body.read)); + EXPECT_EQ(inlen, fih + sizeof(in.body.read)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_WRITE: { @@ -535,75 +547,94 @@ void MockFS::audit_request(const mockfs_buf_in &in) { s = sizeof(in.body.write); else s = FUSE_COMPAT_WRITE_IN_SIZE; - ASSERT_GE(inlen, fih + s) << "Missing request body"; // I suppose a 0-byte write should be allowed + EXPECT_GE(inlen, fih + s) << "Missing request body"; + EXPECT_EQ((size_t)buflen, fih + s + in.body.write.size); break; } case FUSE_DESTROY: case FUSE_STATFS: - ASSERT_EQ(inlen, fih); + EXPECT_EQ(inlen, fih); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_RELEASE: - ASSERT_EQ(inlen, fih + sizeof(in.body.release)); + EXPECT_EQ(inlen, fih + sizeof(in.body.release)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_FSYNC: case FUSE_FSYNCDIR: - ASSERT_EQ(inlen, fih + sizeof(in.body.fsync)); + EXPECT_EQ(inlen, fih + sizeof(in.body.fsync)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_SETXATTR: - ASSERT_GE(inlen, fih + sizeof(in.body.setxattr)) << + EXPECT_GE(inlen, fih + sizeof(in.body.setxattr)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.setxattr)) << + EXPECT_GT(inlen, fih + sizeof(in.body.setxattr)) << "Missing request attribute name"; + // No redundant information for checking buflen break; case FUSE_GETXATTR: - ASSERT_GE(inlen, fih + sizeof(in.body.getxattr)) << + EXPECT_GE(inlen, fih + sizeof(in.body.getxattr)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.getxattr)) << + EXPECT_GT(inlen, fih + sizeof(in.body.getxattr)) << "Missing request attribute name"; + // No redundant information for checking buflen break; case FUSE_LISTXATTR: - ASSERT_EQ(inlen, fih + sizeof(in.body.listxattr)); + EXPECT_EQ(inlen, fih + sizeof(in.body.listxattr)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_REMOVEXATTR: - ASSERT_GT(inlen, fih) << "Missing request attribute name"; + EXPECT_GT(inlen, fih) << "Missing request attribute name"; + // No redundant information for checking buflen break; case FUSE_FLUSH: - ASSERT_EQ(inlen, fih + sizeof(in.body.flush)); + EXPECT_EQ(inlen, fih + sizeof(in.body.flush)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_INIT: - ASSERT_EQ(inlen, fih + sizeof(in.body.init)); + EXPECT_EQ(inlen, fih + sizeof(in.body.init)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_OPENDIR: - ASSERT_EQ(inlen, fih + sizeof(in.body.opendir)); + EXPECT_EQ(inlen, fih + sizeof(in.body.opendir)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_READDIR: - ASSERT_EQ(inlen, fih + sizeof(in.body.readdir)); + EXPECT_EQ(inlen, fih + sizeof(in.body.readdir)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_RELEASEDIR: - ASSERT_EQ(inlen, fih + sizeof(in.body.releasedir)); + EXPECT_EQ(inlen, fih + sizeof(in.body.releasedir)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_GETLK: - ASSERT_EQ(inlen, fih + sizeof(in.body.getlk)); + EXPECT_EQ(inlen, fih + sizeof(in.body.getlk)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_SETLK: case FUSE_SETLKW: - ASSERT_EQ(inlen, fih + sizeof(in.body.setlk)); + EXPECT_EQ(inlen, fih + sizeof(in.body.setlk)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_ACCESS: - ASSERT_EQ(inlen, fih + sizeof(in.body.access)); + EXPECT_EQ(inlen, fih + sizeof(in.body.access)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_CREATE: - ASSERT_GE(inlen, fih + sizeof(in.body.create)) << + EXPECT_GE(inlen, fih + sizeof(in.body.create)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.create)) << + EXPECT_GT(inlen, fih + sizeof(in.body.create)) << "Missing request filename"; + // No redundant information for checking buflen break; case FUSE_INTERRUPT: - ASSERT_EQ(inlen, fih + sizeof(in.body.interrupt)); + EXPECT_EQ(inlen, fih + sizeof(in.body.interrupt)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_BMAP: - ASSERT_EQ(inlen, fih + sizeof(in.body.bmap)); + EXPECT_EQ(inlen, fih + sizeof(in.body.bmap)); + EXPECT_EQ((size_t)buflen, inlen); break; case FUSE_NOTIFY_REPLY: case FUSE_BATCH_FORGET: @@ -618,10 +649,13 @@ void MockFS::audit_request(const mockfs_buf_in &in) { } void MockFS::init(uint32_t flags) { + ssize_t buflen; + std::unique_ptr in(new mockfs_buf_in); std::unique_ptr out(new mockfs_buf_out); - read_request(*in); + read_request(*in, buflen); + audit_request(*in, buflen); ASSERT_EQ(FUSE_INIT, in->header.opcode); out->header.unique = in->header.unique; @@ -659,13 +693,15 @@ void MockFS::loop() { std::unique_ptr in(new mockfs_buf_in); ASSERT_TRUE(in != NULL); while (!m_quit) { + ssize_t buflen; + bzero(in.get(), sizeof(*in)); - read_request(*in); + read_request(*in, buflen); if (m_quit) break; if (verbosity > 0) - debug_request(*in); - audit_request(*in); + debug_request(*in, buflen); + audit_request(*in, buflen); if (pid_ok((pid_t)in->header.pid)) { process(*in, out); } else { @@ -766,8 +802,7 @@ void MockFS::process_default(const mockfs_buf_in& in, out.push_back(std::move(out0)); } -void MockFS::read_request(mockfs_buf_in &in) { - ssize_t res; +void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) { int nready = 0; fd_set readfds; pollfd fds[1]; Modified: head/tests/sys/fs/fusefs/mockfs.hh ============================================================================== --- head/tests/sys/fs/fusefs/mockfs.hh Wed Sep 11 18:54:45 2019 (r352229) +++ head/tests/sys/fs/fusefs/mockfs.hh Wed Sep 11 19:29:40 2019 (r352230) @@ -283,8 +283,8 @@ class MockFS { /* Timestamp granularity in nanoseconds */ unsigned m_time_gran; - void audit_request(const mockfs_buf_in &in); - void debug_request(const mockfs_buf_in&); + void audit_request(const mockfs_buf_in &in, ssize_t buflen); + void debug_request(const mockfs_buf_in&, ssize_t buflen); void debug_response(const mockfs_buf_out&); /* Initialize a session after mounting */ @@ -300,8 +300,14 @@ class MockFS { /* Entry point for the daemon thread */ static void* service(void*); - /* Read, but do not process, a single request from the kernel */ - void read_request(mockfs_buf_in& in); + /* + * Read, but do not process, a single request from the kernel + * + * @param in Return storage for the FUSE request + * @param res Return value of read(2). If positive, the amount of + * data read from the fuse device. + */ + void read_request(mockfs_buf_in& in, ssize_t& res); /* Write a single response back to the kernel */ void write_response(const mockfs_buf_out &out); From owner-svn-src-all@freebsd.org Wed Sep 11 19:48:33 2019 Return-Path: Delivered-To: svn-src-all@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 37D95DE5F2; Wed, 11 Sep 2019 19:48:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TCBT0hkKz4M74; Wed, 11 Sep 2019 19:48:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFCD3B65D; Wed, 11 Sep 2019 19:48:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BJmWEW092484; Wed, 11 Sep 2019 19:48:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BJmWZn092483; Wed, 11 Sep 2019 19:48:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909111948.x8BJmWZn092483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Sep 2019 19:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352231 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 19:48:33 -0000 Author: asomers Date: Wed Sep 11 19:48:32 2019 New Revision: 352231 URL: https://svnweb.freebsd.org/changeset/base/352231 Log: getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable When SO_TIMESTAMP is set, the kernel will attempt to attach a timestamp as ancillary data to each IP datagram that is received on the socket. However, it may fail, for example due to insufficient memory. In that case the packet will still be received but not timestamp will be attached. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21607 Modified: head/lib/libc/sys/getsockopt.2 Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 (r352230) +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 (r352231) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd February 10, 2019 +.Dd September 11, 2019 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -431,7 +431,8 @@ option is enabled on a .Dv SOCK_DGRAM socket, the .Xr recvmsg 2 -call will return a timestamp corresponding to when the datagram was received. +call may return a timestamp corresponding to when the datagram was received. +However, it may not, for example due to a resource shortage. The .Va msg_control field in the From owner-svn-src-all@freebsd.org Wed Sep 11 20:13:39 2019 Return-Path: Delivered-To: svn-src-all@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 3481FDEF27; Wed, 11 Sep 2019 20:13:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TClR1Bg3z4NTJ; Wed, 11 Sep 2019 20:13:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C212BD67; Wed, 11 Sep 2019 20:13:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BKDda0010505; Wed, 11 Sep 2019 20:13:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BKDdIi010504; Wed, 11 Sep 2019 20:13:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909112013.x8BKDdIi010504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Sep 2019 20:13:39 +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: r352232 - stable/12/sbin/ping6 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sbin/ping6 X-SVN-Commit-Revision: 352232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 20:13:39 -0000 Author: asomers Date: Wed Sep 11 20:13:38 2019 New Revision: 352232 URL: https://svnweb.freebsd.org/changeset/base/352232 Log: MFC r350993, r350997, r351079-r351080, r351082, r351090, r351101-r351102 r350993: Consistently use the byteorder functions in the correct direction Though ntohs and htons are functionally identical, they have different meanings.Using the correct one helps to document the code. Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21219 r350997: ping6: use the monotonic clock to measure durations Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21226 r351079: ping6: quiet warning about unused copyright variable Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21270 r351080: ping6: quiet an undefined variable warning GCC 4.2 isn't smart enough to know that this variable is already defined by the time it's used. Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21269 r351082: ping6: fix uninitialized variable warning for intvl GCC isn't smart enough to realize that this variable was always initialized. Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21271 r351090: ping6: Fix data type of the buffer for ancillary data of a received message The old code worked, but wasted some stack space. Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21275 r351101: ping6: fix uninitialized variable warnings when MK_CASPER=no Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21273 r351102: ping6: Fix alignment errors This fixes -Wcast-align errors when compiled with WARNS=6. Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21217 Modified: stable/12/sbin/ping6/ping6.c Modified: stable/12/sbin/ping6/ping6.c ============================================================================== --- stable/12/sbin/ping6/ping6.c Wed Sep 11 19:48:32 2019 (r352231) +++ stable/12/sbin/ping6/ping6.c Wed Sep 11 20:13:38 2019 (r352232) @@ -65,6 +65,7 @@ * SUCH DAMAGE. */ +#if 0 #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ @@ -72,10 +73,9 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -#if 0 static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; -#endif #endif /* not lint */ +#endif #include __FBSDID("$FreeBSD$"); @@ -107,7 +107,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -133,6 +132,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef IPSEC @@ -144,7 +144,7 @@ __FBSDID("$FreeBSD$"); struct tv32 { u_int32_t tv32_sec; - u_int32_t tv32_usec; + u_int32_t tv32_nsec; }; #define MAXPACKETLEN 131072 @@ -288,7 +288,6 @@ static void pr_rthdr(void *, size_t); static int pr_bitrange(u_int32_t, int, int); static void pr_retip(struct ip6_hdr *, u_char *); static void summary(void); -static void tvsub(struct timeval *, struct timeval *); static int setpolicy(int, char *); static char *nigroup(char *, int); static void usage(void); @@ -296,7 +295,7 @@ static void usage(void); int main(int argc, char *argv[]) { - struct timeval last, intvl; + struct timespec last, intvl; struct sockaddr_in6 from, *sin6; struct addrinfo hints, *res; struct sigaction si_sa; @@ -308,13 +307,14 @@ main(int argc, char *argv[]) int ip6optlen = 0; struct cmsghdr *scmsgp = NULL; /* For control (ancillary) data received from recvmsg() */ - struct cmsghdr cm[CONTROLLEN]; + u_char cm[CONTROLLEN]; #if defined(SO_SNDBUF) && defined(SO_RCVBUF) u_long lsockbufsize; int sockbufsize = 0; #endif int usepktinfo = 0; - struct in6_pktinfo *pktinfo = NULL; + struct in6_pktinfo pktinfo; + char *cmsg_pktinfo = NULL; struct ip6_rthdr *rthdr = NULL; #ifdef IPSEC_POLICY_IPSEC char *policy_in = NULL; @@ -333,7 +333,11 @@ main(int argc, char *argv[]) /* just to be sure */ memset(&smsghdr, 0, sizeof(smsghdr)); memset(&smsgiov, 0, sizeof(smsgiov)); + memset(&pktinfo, 0, sizeof(pktinfo)); + intvl.tv_sec = interval / 1000; + intvl.tv_nsec = interval % 1000 * 1000000; + alarmtimeout = preload = 0; datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN]; capdns = capdns_setup(); @@ -456,15 +460,15 @@ main(int argc, char *argv[]) errx(1, "%s: only root may use interval < 1s", strerror(EPERM)); } - intvl.tv_sec = (long)t; - intvl.tv_usec = - (long)((t - intvl.tv_sec) * 1000000); + intvl.tv_sec = (time_t)t; + intvl.tv_nsec = + (long)((t - intvl.tv_sec) * 1000000000); if (intvl.tv_sec < 0) errx(1, "illegal timing interval %s", optarg); /* less than 1/hz does not make sense */ - if (intvl.tv_sec == 0 && intvl.tv_usec < 1) { + if (intvl.tv_sec == 0 && intvl.tv_nsec < 1000) { warnx("too small interval, raised to .000001"); - intvl.tv_usec = 1; + intvl.tv_nsec = 1000; } options |= F_INTERVAL; break; @@ -894,11 +898,10 @@ main(int argc, char *argv[]) errx(1, "can't allocate enough memory"); smsghdr.msg_control = (caddr_t)scmsg; smsghdr.msg_controllen = ip6optlen; - scmsgp = (struct cmsghdr *)scmsg; + scmsgp = CMSG_FIRSTHDR(&smsghdr); } if (usepktinfo) { - pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp)); - memset(pktinfo, 0, sizeof(*pktinfo)); + cmsg_pktinfo = CMSG_DATA(scmsgp); scmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); scmsgp->cmsg_level = IPPROTO_IPV6; scmsgp->cmsg_type = IPV6_PKTINFO; @@ -909,7 +912,7 @@ main(int argc, char *argv[]) if (ifname) { #ifndef USE_SIN6_SCOPE_ID /* pktinfo must have already been allocated */ - if ((pktinfo->ipi6_ifindex = if_nametoindex(ifname)) == 0) + if ((pktinfo.ipi6_ifindex = if_nametoindex(ifname)) == 0) errx(1, "%s: invalid interface name", ifname); #else if ((dst.sin6_scope_id = if_nametoindex(ifname)) == 0) @@ -920,7 +923,7 @@ main(int argc, char *argv[]) scmsgp->cmsg_len = CMSG_LEN(sizeof(int)); scmsgp->cmsg_level = IPPROTO_IPV6; scmsgp->cmsg_type = IPV6_HOPLIMIT; - *(int *)(CMSG_DATA(scmsgp)) = hoplimit; + memcpy(CMSG_DATA(scmsgp), &hoplimit, sizeof(hoplimit)); scmsgp = CMSG_NXTHDR(&smsghdr, scmsgp); } @@ -959,6 +962,7 @@ main(int argc, char *argv[]) } /* From now on we will use only reverse DNS lookups. */ +#ifdef WITH_CASPER if (capdns != NULL) { const char *types[1]; @@ -966,7 +970,7 @@ main(int argc, char *argv[]) if (cap_dns_type_limit(capdns, types, nitems(types)) < 0) err(1, "unable to limit access to system.dns service"); } - +#endif if (!(options & F_SRCADDR)) { /* * get the source address. XXX since we revoked the root @@ -983,9 +987,9 @@ main(int argc, char *argv[]) src.sin6_port = ntohs(DUMMY_PORT); src.sin6_scope_id = dst.sin6_scope_id; - if (pktinfo && + if (usepktinfo && setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTINFO, - (void *)pktinfo, sizeof(*pktinfo))) + (void *)&pktinfo, sizeof(pktinfo))) err(1, "UDP setsockopt(IPV6_PKTINFO)"); if (hoplimit != -1 && @@ -1012,6 +1016,10 @@ main(int argc, char *argv[]) close(dummy); } + /* Save pktinfo in the ancillary data. */ + if (usepktinfo) + memcpy(cmsg_pktinfo, &pktinfo, sizeof(pktinfo)); + if (connect(ssend, (struct sockaddr *)&dst, sizeof(dst)) != 0) err(1, "connect() ssend"); @@ -1102,7 +1110,7 @@ main(int argc, char *argv[]) while (preload--) pinger(); } - gettimeofday(&last, NULL); + clock_gettime(CLOCK_MONOTONIC, &last); sigemptyset(&si_sa.sa_mask); si_sa.sa_flags = 0; @@ -1121,15 +1129,12 @@ main(int argc, char *argv[]) } if (options & F_FLOOD) { intvl.tv_sec = 0; - intvl.tv_usec = 10000; - } else if ((options & F_INTERVAL) == 0) { - intvl.tv_sec = interval / 1000; - intvl.tv_usec = interval % 1000 * 1000; + intvl.tv_nsec = 10000000; } almost_done = 0; while (seenint == 0) { - struct timeval now, timeout; + struct timespec now, timeout; struct msghdr m; struct iovec iov[2]; fd_set rfds; @@ -1147,21 +1152,13 @@ main(int argc, char *argv[]) #endif FD_ZERO(&rfds); FD_SET(srecv, &rfds); - gettimeofday(&now, NULL); - timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; - timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; - while (timeout.tv_usec < 0) { - timeout.tv_usec += 1000000; - timeout.tv_sec--; - } - while (timeout.tv_usec > 1000000) { - timeout.tv_usec -= 1000000; - timeout.tv_sec++; - } + clock_gettime(CLOCK_MONOTONIC, &now); + timespecadd(&last, &intvl, &timeout); + timespecsub(&timeout, &now, &timeout); if (timeout.tv_sec < 0) - timeout.tv_sec = timeout.tv_usec = 0; + timespecclear(&timeout); - n = select(srecv + 1, &rfds, NULL, NULL, &timeout); + n = pselect(srecv + 1, &rfds, NULL, NULL, &timeout, NULL); if (n < 0) continue; /* EINTR */ if (n == 1) { @@ -1222,17 +1219,18 @@ main(int argc, char *argv[]) * if we've received any packets or (waittime) * milliseconds if we haven't. */ - intvl.tv_usec = 0; + intvl.tv_nsec = 0; if (nreceived) { intvl.tv_sec = 2 * tmax / 1000; if (intvl.tv_sec == 0) intvl.tv_sec = 1; } else { intvl.tv_sec = waittime / 1000; - intvl.tv_usec = waittime % 1000 * 1000; + intvl.tv_nsec = + waittime % 1000 * 1000000; } } - gettimeofday(&last, NULL); + clock_gettime(CLOCK_MONOTONIC, &last); if (ntransmitted - nreceived - 1 > nmissedmax) { nmissedmax = ntransmitted - nreceived - 1; if (options & F_MISSED) @@ -1275,7 +1273,7 @@ onsignal(int sig) * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet * will be added on by the kernel. The ID field is our UNIX process ID, * and the sequence number is an ascending integer. The first 8 bytes - * of the data portion are used to hold a UNIX "timeval" struct in VAX + * of the data portion are used to hold a UNIX "timespec" struct in VAX * byte-order, to compute the round-trip time. */ static size_t @@ -1317,6 +1315,8 @@ pinger(void) CLR(seq % mx_dup_ck); if (options & F_FQDN) { + uint16_t s; + icp->icmp6_type = ICMP6_NI_QUERY; icp->icmp6_code = ICMP6_NI_SUBJ_IPV6; nip->ni_qtype = htons(NI_QTYPE_FQDN); @@ -1324,13 +1324,15 @@ pinger(void) memcpy(nip->icmp6_ni_nonce, nonce, sizeof(nip->icmp6_ni_nonce)); - *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq); + s = htons(seq); + memcpy(nip->icmp6_ni_nonce, &s, sizeof(s)); memcpy(&outpack[ICMP6_NIQLEN], &dst.sin6_addr, sizeof(dst.sin6_addr)); cc = ICMP6_NIQLEN + sizeof(dst.sin6_addr); datalen = 0; } else if (options & F_FQDNOLD) { + uint16_t s; /* packet format in 03 draft - no Subject data on queries */ icp->icmp6_type = ICMP6_NI_QUERY; icp->icmp6_code = 0; /* code field is always 0 */ @@ -1339,11 +1341,14 @@ pinger(void) memcpy(nip->icmp6_ni_nonce, nonce, sizeof(nip->icmp6_ni_nonce)); - *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq); + s = htons(seq); + memcpy(nip->icmp6_ni_nonce, &s, sizeof(s)); cc = ICMP6_NIQLEN; datalen = 0; } else if (options & F_NODEADDR) { + uint16_t s; + icp->icmp6_type = ICMP6_NI_QUERY; icp->icmp6_code = ICMP6_NI_SUBJ_IPV6; nip->ni_qtype = htons(NI_QTYPE_NODEADDR); @@ -1351,13 +1356,16 @@ pinger(void) memcpy(nip->icmp6_ni_nonce, nonce, sizeof(nip->icmp6_ni_nonce)); - *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq); + s = htons(seq); + memcpy(nip->icmp6_ni_nonce, &s, sizeof(s)); memcpy(&outpack[ICMP6_NIQLEN], &dst.sin6_addr, sizeof(dst.sin6_addr)); cc = ICMP6_NIQLEN + sizeof(dst.sin6_addr); datalen = 0; } else if (options & F_SUPTYPES) { + uint16_t s; + icp->icmp6_type = ICMP6_NI_QUERY; icp->icmp6_code = ICMP6_NI_SUBJ_FQDN; /*empty*/ nip->ni_qtype = htons(NI_QTYPE_SUPTYPES); @@ -1366,21 +1374,29 @@ pinger(void) memcpy(nip->icmp6_ni_nonce, nonce, sizeof(nip->icmp6_ni_nonce)); - *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq); + s = htons(seq); + memcpy(nip->icmp6_ni_nonce, &s, sizeof(s)); + cc = ICMP6_NIQLEN; datalen = 0; } else { icp->icmp6_type = ICMP6_ECHO_REQUEST; icp->icmp6_code = 0; icp->icmp6_id = htons(ident); - icp->icmp6_seq = ntohs(seq); + icp->icmp6_seq = htons(seq); if (timing) { - struct timeval tv; - struct tv32 *tv32; - (void)gettimeofday(&tv, NULL); - tv32 = (struct tv32 *)&outpack[ICMP6ECHOLEN]; - tv32->tv32_sec = htonl(tv.tv_sec); - tv32->tv32_usec = htonl(tv.tv_usec); + struct timespec tv; + struct tv32 tv32; + (void)clock_gettime(CLOCK_MONOTONIC, &tv); + /* + * Truncate seconds down to 32 bits in order + * to fit the timestamp within 8 bytes of the + * packet. We're only concerned with + * durations, not absolute times. + */ + tv32.tv32_sec = (uint32_t)htonl(tv.tv_sec); + tv32.tv32_nsec = (uint32_t)htonl(tv.tv_nsec); + memcpy(&outpack[ICMP6ECHOLEN], &tv32, sizeof(tv32)); } cc = ICMP6ECHOLEN + datalen; } @@ -1525,8 +1541,8 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) const u_char *cp = NULL; u_char *dp, *end = buf + cc; struct in6_pktinfo *pktinfo = NULL; - struct timeval tv, tp; - struct tv32 *tpp; + struct timespec tv, tp; + struct tv32 tpp; double triptime = 0; int dupflag; size_t off; @@ -1534,7 +1550,7 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) u_int16_t seq; char dnsname[MAXDNAME + 1]; - (void)gettimeofday(&tv, NULL); + (void)clock_gettime(CLOCK_MONOTONIC, &tv); if (!mhdr || !mhdr->msg_name || mhdr->msg_namelen != sizeof(struct sockaddr_in6) || @@ -1571,12 +1587,12 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) seq = ntohs(icp->icmp6_seq); ++nreceived; if (timing) { - tpp = (struct tv32 *)(icp + 1); - tp.tv_sec = ntohl(tpp->tv32_sec); - tp.tv_usec = ntohl(tpp->tv32_usec); - tvsub(&tv, &tp); + memcpy(&tpp, icp + 1, sizeof(tpp)); + tp.tv_sec = ntohl(tpp.tv32_sec); + tp.tv_nsec = ntohl(tpp.tv32_nsec); + timespecsub(&tv, &tp, &tv); triptime = ((double)tv.tv_sec) * 1000.0 + - ((double)tv.tv_usec) / 1000.0; + ((double)tv.tv_nsec) / 1000000.0; tsum += triptime; tsumsq += triptime * triptime; if (triptime < tmin) @@ -1637,7 +1653,8 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) } } } else if (icp->icmp6_type == ICMP6_NI_REPLY && mynireply(ni)) { - seq = ntohs(*(u_int16_t *)ni->icmp6_ni_nonce); + memcpy(&seq, ni->icmp6_ni_nonce, sizeof(seq)); + seq = ntohs(seq); ++nreceived; if (TST(seq % mx_dup_ck)) { ++nrepeats; @@ -1716,6 +1733,7 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) } } if (options & F_VERBOSE) { + u_long t; int32_t ttl; int comma = 0; @@ -1738,7 +1756,8 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) putchar(')'); goto fqdnend; } - ttl = (int32_t)ntohl(*(u_long *)&buf[off+ICMP6ECHOLEN+8]); + memcpy(&t, &buf[off+ICMP6ECHOLEN+8], sizeof(t)); + ttl = (int32_t)ntohl(t); if (comma) printf(","); if (!(ni->ni_flags & NI_FQDN_FLAG_VALIDTTL)) { @@ -2101,11 +2120,13 @@ pr_nodeaddr(struct icmp6_nodeinfo *ni, int nilen) if (nilen % (sizeof(u_int32_t) + sizeof(struct in6_addr)) == 0) withttl = 1; while (nilen > 0) { - u_int32_t ttl; + u_int32_t ttl = 0; if (withttl) { - /* XXX: alignment? */ - ttl = (u_int32_t)ntohl(*(u_int32_t *)cp); + uint32_t t; + + memcpy(&t, cp, sizeof(t)); + ttl = (u_int32_t)ntohl(t); cp += sizeof(u_int32_t); nilen -= sizeof(u_int32_t); } @@ -2144,8 +2165,12 @@ get_hoplim(struct msghdr *mhdr) if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_HOPLIMIT && - cm->cmsg_len == CMSG_LEN(sizeof(int))) - return(*(int *)CMSG_DATA(cm)); + cm->cmsg_len == CMSG_LEN(sizeof(int))) { + int r; + + memcpy(&r, CMSG_DATA(cm), sizeof(r)); + return(r); + } } return(-1); @@ -2154,6 +2179,7 @@ get_hoplim(struct msghdr *mhdr) static struct in6_pktinfo * get_rcvpktinfo(struct msghdr *mhdr) { + static struct in6_pktinfo pi; struct cmsghdr *cm; for (cm = (struct cmsghdr *)CMSG_FIRSTHDR(mhdr); cm; @@ -2163,8 +2189,10 @@ get_rcvpktinfo(struct msghdr *mhdr) if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_PKTINFO && - cm->cmsg_len == CMSG_LEN(sizeof(struct in6_pktinfo))) - return((struct in6_pktinfo *)CMSG_DATA(cm)); + cm->cmsg_len == CMSG_LEN(sizeof(struct in6_pktinfo))) { + memcpy(&pi, CMSG_DATA(cm), sizeof(pi)); + return(&pi); + } } return(NULL); @@ -2175,7 +2203,7 @@ get_pathmtu(struct msghdr *mhdr) { #ifdef IPV6_RECVPATHMTU struct cmsghdr *cm; - struct ip6_mtuinfo *mtuctl = NULL; + struct ip6_mtuinfo mtuctl; for (cm = (struct cmsghdr *)CMSG_FIRSTHDR(mhdr); cm; cm = (struct cmsghdr *)CMSG_NXTHDR(mhdr, cm)) { @@ -2185,7 +2213,7 @@ get_pathmtu(struct msghdr *mhdr) if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_PATHMTU && cm->cmsg_len == CMSG_LEN(sizeof(struct ip6_mtuinfo))) { - mtuctl = (struct ip6_mtuinfo *)CMSG_DATA(cm); + memcpy(&mtuctl, CMSG_DATA(cm), sizeof(mtuctl)); /* * If the notified destination is different from @@ -2195,17 +2223,17 @@ get_pathmtu(struct msghdr *mhdr) * have used the default scope zone ID for sending, * in which case the scope ID value is 0. */ - if (!IN6_ARE_ADDR_EQUAL(&mtuctl->ip6m_addr.sin6_addr, + if (!IN6_ARE_ADDR_EQUAL(&mtuctl.ip6m_addr.sin6_addr, &dst.sin6_addr) || - (mtuctl->ip6m_addr.sin6_scope_id && + (mtuctl.ip6m_addr.sin6_scope_id && dst.sin6_scope_id && - mtuctl->ip6m_addr.sin6_scope_id != + mtuctl.ip6m_addr.sin6_scope_id != dst.sin6_scope_id)) { if ((options & F_VERBOSE) != 0) { printf("path MTU for %s is notified. " "(ignored)\n", - pr_addr((struct sockaddr *)&mtuctl->ip6m_addr, - sizeof(mtuctl->ip6m_addr))); + pr_addr((struct sockaddr *)&mtuctl.ip6m_addr, + sizeof(mtuctl.ip6m_addr))); } return(0); } @@ -2214,11 +2242,11 @@ get_pathmtu(struct msghdr *mhdr) * Ignore an invalid MTU. XXX: can we just believe * the kernel check? */ - if (mtuctl->ip6m_mtu < IPV6_MMTU) + if (mtuctl.ip6m_mtu < IPV6_MMTU) return(0); /* notification for our destination. return the MTU. */ - return((int)mtuctl->ip6m_mtu); + return((int)mtuctl.ip6m_mtu); } } #endif @@ -2226,21 +2254,6 @@ get_pathmtu(struct msghdr *mhdr) } /* - * tvsub -- - * Subtract 2 timeval structs: out = out - in. Out is assumed to - * be >= in. - */ -static void -tvsub(struct timeval *out, struct timeval *in) -{ - if ((out->tv_usec -= in->tv_usec) < 0) { - --out->tv_sec; - out->tv_usec += 1000000; - } - out->tv_sec -= in->tv_sec; -} - -/* * onint -- * SIGINT handler. */ @@ -2605,6 +2618,8 @@ pr_retip(struct ip6_hdr *ip6, u_char *end) nh = ip6->ip6_nxt; cp += hlen; while (end - cp >= 8) { + struct ah ah; + switch (nh) { case IPPROTO_HOPOPTS: printf("HBH "); @@ -2629,8 +2644,9 @@ pr_retip(struct ip6_hdr *ip6, u_char *end) #ifdef IPSEC case IPPROTO_AH: printf("AH "); - hlen = (((struct ah *)cp)->ah_len+2) << 2; - nh = ((struct ah *)cp)->ah_nxt; + memcpy(&ah, cp, sizeof(ah)); + hlen = (ah.ah_len+2) << 2; + nh = ah.ah_nxt; break; #endif case IPPROTO_ICMPV6: @@ -2815,9 +2831,10 @@ static cap_channel_t * capdns_setup(void) { cap_channel_t *capcas, *capdnsloc; +#ifdef WITH_CASPER const char *types[2]; int families[1]; - +#endif capcas = cap_init(); if (capcas == NULL) err(1, "unable to create casper process"); @@ -2826,6 +2843,7 @@ capdns_setup(void) cap_close(capcas); if (capdnsloc == NULL) err(1, "unable to open system.dns service"); +#ifdef WITH_CASPER types[0] = "NAME2ADDR"; types[1] = "ADDR2NAME"; if (cap_dns_type_limit(capdnsloc, types, nitems(types)) < 0) @@ -2833,6 +2851,6 @@ capdns_setup(void) families[0] = AF_INET6; if (cap_dns_family_limit(capdnsloc, families, nitems(families)) < 0) err(1, "unable to limit access to system.dns service"); - +#endif return (capdnsloc); } From owner-svn-src-all@freebsd.org Wed Sep 11 21:16:25 2019 Return-Path: Delivered-To: svn-src-all@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 940BCE03A1; Wed, 11 Sep 2019 21:16:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TF7s3NK3z4Qtb; Wed, 11 Sep 2019 21:16:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f44.google.com with SMTP id j4so49347685iog.11; Wed, 11 Sep 2019 14:16:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=80gqsFFEdrW1j703C+twV70Opz7niJM44d541YSEXT4=; b=rTKmDUweOjrlrjjvJKzEYHbKpGE0se5O+1LajRS18i3Avvqd5Wpsu5IqU4bXHDfI+R D9nxlvJRa4fGHB3Embeqg+tiiVTU+rURNe5dC4xBHmEHO2zmc8sDLriF8Q05W1StEL9Q 0selNARo3YgGE9TA0dN3lggnrNY6Ofels7vz/lHN6xU76Mt0Qg21eRZ0Fsd7VRGQ+lqi eWP3Gn9VQzeuwah+7wo11vSVzf35nMo4EpzZP+zR9ojMAfsvHh3ByvQNS2KI7UB5jMRI bUS1QpUGdOMv1LI2QsubXi9Af7ephHSa0yGIYUqpl6b+3ZV55Q+Iht1qYiu9E63zEomL eM0w== X-Gm-Message-State: APjAAAUAbmPV3ESvDA7PS4mRRr0xp+KhSwaC+LX29R5kZf1n0ho7E3iY fqVfrV8Sq+2IRCLxUoUwelnucTOF X-Google-Smtp-Source: APXvYqx3J1Nanm2WcAqhf4USGDICd5kJgsASKf8wX+PFEzkFKj5ZT2L0Cl82fjCbHuJtnkkLsWddhQ== X-Received: by 2002:a6b:8b50:: with SMTP id n77mr44318156iod.195.1568236583862; Wed, 11 Sep 2019 14:16:23 -0700 (PDT) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id d1sm18008387iok.17.2019.09.11.14.16.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2019 14:16:23 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id k13so34155208ioj.1; Wed, 11 Sep 2019 14:16:23 -0700 (PDT) X-Received: by 2002:a5d:8599:: with SMTP id f25mr39297518ioj.265.1568236583509; Wed, 11 Sep 2019 14:16:23 -0700 (PDT) MIME-Version: 1.0 References: <201909111848.x8BImQnn056188@repo.freebsd.org> In-Reply-To: <201909111848.x8BImQnn056188@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 11 Sep 2019 14:16:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352228 - head/sys/netinet To: Andrew Gallatin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46TF7s3NK3z4Qtb X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 21:16:25 -0000 Small nitpick: On Wed, Sep 11, 2019 at 11:48 AM Andrew Gallatin wro= te: > Note that on a system under a syn flood attack, arc4random() > becomes quite expensive, and the chacha_poly crypto that it calls arc4random uses chacha20 =E2=80=94 there is no "poly" involved. Best, Conrad From owner-svn-src-all@freebsd.org Wed Sep 11 21:24:17 2019 Return-Path: Delivered-To: svn-src-all@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 870D6E07A7; Wed, 11 Sep 2019 21:24:17 +0000 (UTC) (envelope-from cem@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 46TFJx31HMz4RPG; Wed, 11 Sep 2019 21:24:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B06DCA23; Wed, 11 Sep 2019 21:24:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8BLOHdk051613; Wed, 11 Sep 2019 21:24:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BLOFtt051601; Wed, 11 Sep 2019 21:24:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909112124.x8BLOFtt051601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Sep 2019 21:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352233 - in head: sys/fs/msdosfs sys/kern sys/sys usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/fs/msdosfs sys/kern sys/sys usr.sbin/makefs/msdos X-SVN-Commit-Revision: 352233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 21:24:17 -0000 Author: cem Date: Wed Sep 11 21:24:14 2019 New Revision: 352233 URL: https://svnweb.freebsd.org/changeset/base/352233 Log: buf: Add B_INVALONERR flag to discard data Setting the B_INVALONERR flag before a synchronous write causes the buf cache to forcibly invalidate contents if the write fails (BIO_ERROR). This is intended to be used to allow layers above the buffer cache to make more informed decisions about when discarding dirty buffers without successful write is acceptable. As a proof of concept, use in msdosfs to handle failures to mark the on-disk 'dirty' bit during rw mount or ro->rw update. Extending this to other filesystems is left as future work. PR: 210316 Reviewed by: kib (with objections) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21539 Modified: head/sys/fs/msdosfs/fat.h head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/kern/vfs_bio.c head/sys/sys/buf.h head/usr.sbin/makefs/msdos/msdosfs_denode.c head/usr.sbin/makefs/msdos/msdosfs_fat.c head/usr.sbin/makefs/msdos/msdosfs_lookup.c head/usr.sbin/makefs/msdos/msdosfs_vfsops.c head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/fat.h ============================================================================== --- head/sys/fs/msdosfs/fat.h Wed Sep 11 20:13:38 2019 (r352232) +++ head/sys/fs/msdosfs/fat.h Wed Sep 11 21:24:14 2019 (r352233) @@ -103,7 +103,13 @@ int fatentry(int function, struct msdosfsmount *pmp, u int freeclusterchain(struct msdosfsmount *pmp, u_long startchain); int extendfile(struct denode *dep, u_long count, struct buf **bpp, u_long *ncp, int flags); void fc_purge(struct denode *dep, u_int frcn); -int markvoldirty(struct msdosfsmount *pmp, int dirty); +int markvoldirty_upgrade(struct msdosfsmount *pmp, bool dirty, bool rw_upgrade); + +static inline int +markvoldirty(struct msdosfsmount *pmp, bool dirty) +{ + return (markvoldirty_upgrade(pmp, dirty, false)); +} #endif /* _KERNEL || MAKEFS */ #endif /* !_FS_MSDOSFS_FAT_H_ */ Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/sys/fs/msdosfs/msdosfs_fat.c Wed Sep 11 21:24:14 2019 (r352233) @@ -1117,7 +1117,7 @@ extendfile(struct denode *dep, u_long count, struct bu * ? (other errors from called routines) */ int -markvoldirty(struct msdosfsmount *pmp, int dirty) +markvoldirty_upgrade(struct msdosfsmount *pmp, bool dirty, bool rw_upgrade) { struct buf *bp; u_long bn, bo, bsize, byteoffset, fatval; @@ -1130,8 +1130,11 @@ markvoldirty(struct msdosfsmount *pmp, int dirty) if (FAT12(pmp)) return (0); - /* Can't change the bit on a read-only filesystem. */ - if (pmp->pm_flags & MSDOSFSMNT_RONLY) + /* + * Can't change the bit on a read-only filesystem, except as part of + * ro->rw upgrade. + */ + if ((pmp->pm_flags & MSDOSFSMNT_RONLY) != 0 && !rw_upgrade) return (EROFS); /* @@ -1166,6 +1169,29 @@ markvoldirty(struct msdosfsmount *pmp, int dirty) fatval |= 0x8000; putushort(&bp->b_data[bo], fatval); } + + /* + * The concern here is that a devvp may be readonly, without reporting + * itself as such through the usual channels. In that case, we'd like + * it if attempting to mount msdosfs rw didn't panic the system. + * + * markvoldirty is invoked as the first write on backing devvps when + * either msdosfs is mounted for the first time, or a ro mount is + * upgraded to rw. + * + * In either event, if a write error occurs dirtying the volume: + * - No user data has been permitted to be written to cache yet. + * - We can abort the high-level operation (mount, or ro->rw) safely. + * - We don't derive any benefit from leaving a zombie dirty buf in + * the cache that can not be cleaned or evicted. + * + * So, mark B_INVALONERR to have bwrite() -> brelse() detect that + * condition and force-invalidate our write to the block if it occurs. + * + * PR 210316 provides more context on the discovery and diagnosis of + * the problem, as well as earlier attempts to solve it. + */ + bp->b_flags |= B_INVALONERR; /* Write out the modified FAT block synchronously. */ return (bwrite(bp)); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Wed Sep 11 21:24:14 2019 (r352233) @@ -311,16 +311,25 @@ msdosfs_mount(struct mount *mp) if (error) return (error); + /* Now that the volume is modifiable, mark it dirty. */ + error = markvoldirty_upgrade(pmp, true, true); + if (error) { + /* + * If dirtying the superblock failed, drop GEOM + * 'w' refs (we're still RO). + */ + g_topology_lock(); + (void)g_access(pmp->pm_cp, 0, -1, 0); + g_topology_unlock(); + + return (error); + } + pmp->pm_fmod = 1; pmp->pm_flags &= ~MSDOSFSMNT_RONLY; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_RDONLY; MNT_IUNLOCK(mp); - - /* Now that the volume is modifiable, mark it dirty. */ - error = markvoldirty(pmp, 1); - if (error) - return (error); } } /* @@ -701,10 +710,8 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) if (ronly) pmp->pm_flags |= MSDOSFSMNT_RONLY; else { - if ((error = markvoldirty(pmp, 1)) != 0) { - (void)markvoldirty(pmp, 0); + if ((error = markvoldirty(pmp, 1)) != 0) goto error_exit; - } pmp->pm_fmod = 1; } mp->mnt_data = pmp; Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/sys/kern/vfs_bio.c Wed Sep 11 21:24:14 2019 (r352233) @@ -2614,6 +2614,19 @@ brelse(struct buf *bp) BO_UNLOCK(bp->b_bufobj); bdirty(bp); } + + if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && + (bp->b_flags & B_INVALONERR)) { + /* + * Forced invalidation of dirty buffer contents, to be used + * after a failed write in the rare case that the loss of the + * contents is acceptable. The buffer is invalidated and + * freed. + */ + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + bp->b_flags &= ~(B_ASYNC | B_CACHE); + } + if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && (bp->b_error != ENXIO || !LIST_EMPTY(&bp->b_dep)) && !(bp->b_flags & B_INVAL)) { Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Wed Sep 11 20:13:38 2019 (r352232) +++ head/sys/sys/buf.h Wed Sep 11 21:24:14 2019 (r352233) @@ -196,6 +196,11 @@ struct buf { * may not be used with the stage 1 data write under NFS * but may be used for the commit rpc portion. * + * B_INVALONERR This flag is set on dirty buffers. It specifies that a + * write error should forcibly invalidate the buffer + * contents. This flag should be used with caution, as it + * discards data. It is incompatible with B_ASYNC. + * * B_VMIO Indicates that the buffer is tied into an VM object. * The buffer's data is always PAGE_SIZE aligned even * if b_bufsize and b_bcount are not. ( b_bufsize is @@ -226,7 +231,7 @@ struct buf { #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ -#define B_00040000 0x00040000 /* Available flag. */ +#define B_INVALONERR 0x00040000 /* Invalidate on write error. */ #define B_00080000 0x00080000 /* Available flag. */ #define B_00100000 0x00100000 /* Available flag. */ #define B_00200000 0x00200000 /* Available flag. */ @@ -243,7 +248,7 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26b21\25b20" \ - "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ + "\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Sep 11 21:24:14 2019 (r352233) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_fat.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/usr.sbin/makefs/msdos/msdosfs_fat.c Wed Sep 11 21:24:14 2019 (r352233) @@ -54,6 +54,7 @@ #include #include +#include #include #include #include Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Sep 11 21:24:14 2019 (r352233) @@ -53,6 +53,7 @@ #include #include +#include #include #include Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Sep 11 21:24:14 2019 (r352233) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Wed Sep 11 20:13:38 2019 (r352232) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Wed Sep 11 21:24:14 2019 (r352233) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Wed Sep 11 21:50:14 2019 Return-Path: Delivered-To: svn-src-all@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 C9091E0E46 for ; Wed, 11 Sep 2019 21:50:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46TFtt2qpXz4SFW for ; Wed, 11 Sep 2019 21:50:14 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568238612; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=lnhemp8RmnbVowuzl6zsBj3dUt6KHe6AbKeDyFuKQ8gn0OcPf/valE5iQSIh/P/bcZcE44/ZWtM5z qGtrk9H+BFm9ethWWU36bAnwPOT/wqyisHAXgSGC0xy2pvOiOxlWNT1218GwpU4h+wvzQz9O6aR+yQ tT4gBJeF3EI42HmIpAr/g8AMe3C+pDwtqTv0dFE3V6S0myK1vxq/FJBN8AOHl8u9d9h/lETWB8rc0m S4lc+Hoj+Bi/iycTrx5vRRZ1bgeEiatDixvaM9WbeZDgz00jxLE7dsiETr+KD5VoXiVd3HYyYupr37 UkAYQtaLDyVPEYW74TBIJng9euJRoog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=l/dTDqAsV1kHlqTpnMmxfL3cNNYg/MSs2AtV1h0Fs6I=; b=ikuut5c73l7U4qe7yfXYTDoRoft89sGwATd9tVlGupYSWzzgDnMFm//ARftPofdKoDPuJfTDa5Kqd YKqThpLMQVxOgV8bgC0uq9N1nstMSE8fanIOr9bqQzmRFYiZ3SjXyLLG5tmm0Hq6V8s67ZwpQod6Yg AwD2lMPC4u+SywYnXNlE57/rwaaG0oz2RMb6IzJEFcIIC9oGHvO1YUao8mfV82oz4kpBUDz/bvyHOR XwnPVhV4eWpPSAekZDJW6hCO1gdCjdIdmO6UWALqTcFGYCDMre3ftivI7rTZ3/fqEnQ23VKNYNUG0K AFmanT4PJiZLPJSDEgnSpRVre37PggA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=l/dTDqAsV1kHlqTpnMmxfL3cNNYg/MSs2AtV1h0Fs6I=; b=nhlapw1nLz47LREXB9h0J7rqg9IQwLZEui7CnRzR9Ve36n1AMVZZzZMHiGvxG2XlcJ4i/2ytToMYu 5RcSYyQIFgVDPExkQ/Cg9ztymAYSpvUGox3JwJzdyCEWkr2LfCSF65f87h6uNMYKHGO5UbXnLZGSAS nzLIUvwBkzI4uAJAfdZg3LdLgtn9py3GOaSnZGDB1eHmaUIBBr0uzPdI4E8o0EM/0Alq4k4zQ7V+ly sJU69dkEYfuGtxdv03syQnxsT6x+JpKeOQ1VBCzLPK/Wd/MpiK+bbXbuHNy+HqTCOGTo/uuQF2qyYA g+YByCqXAurB6Wr2jXVxHjTsKOGXYTw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1ff9ce29-d4de-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 1ff9ce29-d4de-11e9-b67d-cdd75d6ce7a8; Wed, 11 Sep 2019 21:50:11 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8BLo9dx074593; Wed, 11 Sep 2019 15:50:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> Subject: Re: svn commit: r352231 - head/lib/libc/sys From: Ian Lepore To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 11 Sep 2019 15:50:09 -0600 In-Reply-To: <201909111948.x8BJmWZn092483@repo.freebsd.org> References: <201909111948.x8BJmWZn092483@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46TFtt2qpXz4SFW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 21:50:14 -0000 On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > Author: asomers > Date: Wed Sep 11 19:48:32 2019 > New Revision: 352231 > URL: https://svnweb.freebsd.org/changeset/base/352231 > > Log: > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > When SO_TIMESTAMP is set, the kernel will attempt to attach a timestamp as > ancillary data to each IP datagram that is received on the socket. However, > it may fail, for example due to insufficient memory. In that case the > packet will still be received but not timestamp will be attached. > > Reviewed by: kib > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D21607 > > Modified: > head/lib/libc/sys/getsockopt.2 > > Modified: head/lib/libc/sys/getsockopt.2 > ============================================================================== > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 (r352230) > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 (r352231) > @@ -28,7 +28,7 @@ > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > .\" $FreeBSD$ > .\" > -.Dd February 10, 2019 > +.Dd September 11, 2019 > .Dt GETSOCKOPT 2 > .Os > .Sh NAME > @@ -431,7 +431,8 @@ option is enabled on a > .Dv SOCK_DGRAM > socket, the > .Xr recvmsg 2 > -call will return a timestamp corresponding to when the datagram was received. > +call may return a timestamp corresponding to when the datagram was received. > +However, it may not, for example due to a resource shortage. > The > .Va msg_control > field in the > So I guess this actually happened to someone... is it a common thing for the timestamp to fail? I ask because ntpd relies on SO_TIMESTAMP and if this situation really happens and can persist for a long time, ntpd would effectively stop working. -- Ian From owner-svn-src-all@freebsd.org Wed Sep 11 21:55:34 2019 Return-Path: Delivered-To: svn-src-all@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 BAA17E12A7; Wed, 11 Sep 2019 21:55:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TG124WpWz4Sgh; Wed, 11 Sep 2019 21:55:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f46.google.com with SMTP id c195so2699318lfg.9; Wed, 11 Sep 2019 14:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qKsqgvGf/QFB5zoWyXHIhBPLrQIOGZoIVX4TrfSBceE=; b=rwxDvXj7smvasXr5SUv7S8raMTktV03IJy9141exAkFoUouuMQ8/VlZqUrdWePqDqo NOfXdANBbNa3bLZE4SInWjDS2RK6DfQ0QS/y0fUxl9p0ZSRx5ZSgoA2/gTQZsm3tAF/a PHJ4ta2/pWDfDcvG6pfBmFQgSPvr84FSsFyzKdemTJrassNuwSLLXHfGZp0S/iCJ3PMx WU7qf7rMvCvhJFI/tNUtXx4TP3QAfowgFvwQ1CbQZ6+46q8hHSZFbOoQA6n8L3cxwgAL AW++OPHu936s1TxbmcrfQCrm4miIVklXySFfG0S78P51DYibDfZAaNuQmLJIb4+R1B5f b4tw== X-Gm-Message-State: APjAAAW6OIb9KAdKJJtVMm4Wle5PcimA88fcaK9VXoBLSpPqOR5WkLjL edrqdQj4aJ5EQybUggMbsvAPbLequuG5O6PKa3eePA== X-Google-Smtp-Source: APXvYqwOpv9zux2IEEf4wAaNLLM1t++dsm2J+qKdrIKABbkgdnBQbfRCUDDNUb5tY+TNCnCJ5ikV0ahMCdmJizx+G/A= X-Received: by 2002:a19:cc4f:: with SMTP id c76mr25217749lfg.117.1568238932559; Wed, 11 Sep 2019 14:55:32 -0700 (PDT) MIME-Version: 1.0 References: <201909111948.x8BJmWZn092483@repo.freebsd.org> <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> In-Reply-To: <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> From: Alan Somers Date: Wed, 11 Sep 2019 15:55:20 -0600 Message-ID: Subject: Re: svn commit: r352231 - head/lib/libc/sys To: Ian Lepore , Peter Holm Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46TG124WpWz4Sgh X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 21:55:34 -0000 On Wed, Sep 11, 2019 at 3:50 PM Ian Lepore wrote: > On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > > Author: asomers > > Date: Wed Sep 11 19:48:32 2019 > > New Revision: 352231 > > URL: https://svnweb.freebsd.org/changeset/base/352231 > > > > Log: > > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > > > When SO_TIMESTAMP is set, the kernel will attempt to attach a > timestamp as > > ancillary data to each IP datagram that is received on the socket. > However, > > it may fail, for example due to insufficient memory. In that case the > > packet will still be received but not timestamp will be attached. > > > > Reviewed by: kib > > MFC after: 3 days > > Differential Revision: https://reviews.freebsd.org/D21607 > > > > Modified: > > head/lib/libc/sys/getsockopt.2 > > > > Modified: head/lib/libc/sys/getsockopt.2 > > > ============================================================================== > > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 > (r352230) > > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 > (r352231) > > @@ -28,7 +28,7 @@ > > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > > .\" $FreeBSD$ > > .\" > > -.Dd February 10, 2019 > > +.Dd September 11, 2019 > > .Dt GETSOCKOPT 2 > > .Os > > .Sh NAME > > @@ -431,7 +431,8 @@ option is enabled on a > > .Dv SOCK_DGRAM > > socket, the > > .Xr recvmsg 2 > > -call will return a timestamp corresponding to when the datagram was > received. > > +call may return a timestamp corresponding to when the datagram was > received. > > +However, it may not, for example due to a resource shortage. > > The > > .Va msg_control > > field in the > > > > So I guess this actually happened to someone... is it a common thing > for the timestamp to fail? I ask because ntpd relies on SO_TIMESTAMP > and if this situation really happens and can persist for a long time, > ntpd would effectively stop working. > > -- Ian > pho discovered how to trigger it. If you start 50 ping processes simultaneously, sometimes a few will fail. Will ntpd be ok with a single failure, as long as the timestamp is received correctly in a subsequent packet? -Alan From owner-svn-src-all@freebsd.org Wed Sep 11 22:05:36 2019 Return-Path: Delivered-To: svn-src-all@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 A1883E1611 for ; Wed, 11 Sep 2019 22:05:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46TGDc1w5Pz4T75 for ; Wed, 11 Sep 2019 22:05:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568239534; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=R7N7H7Urg1ZvaaKZdL8vK1wGanENtuzCM59HHeZTP4pbbM6+3u0OpldgvrSVHypEpx2b0iq0GehXb jbGcAqk0ZFGI593AiiBK45WrqRrcgFuGYnfP+DqninsbigzWVf3fFct7Zrbcy8bMtyxDJPXhU8LBFw 03h4/hPGRquGHwY0kczp9Nw11aw7xKbW4cw+cj6SuiXFhZht+JCGnjI4xjuzZjZLe/vl7Hj3VTRFNP oy9JgFGHA2DVPGGRzg1Z4v8sluUP0S4U9W6oUhS0z9ja0N3hvq41tpRcf6Jv/h7gEr7/GfhaFV4dKy g5bxVBu3JGGNvKZep/bqbeUdGuM6Jmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=UjprSAEeNU1TmzhyEQxWiTz/5siIsZ5+QIju1i0PhAw=; b=nBTg4uAh/dFFqeEDIYAJ4aILzsTD7S1RIcweLlw8DW8KfVExR14y2Sak66bzMReQVBEcHw1HlPUkm aBIZHnghoD+2lD+VpO2F6rDmB3Xh44EU9gn+tPu7AMECv6hfkaOcGUsY8mR9Vz2Z8bnrbw2oeHX0Ng IIZdXBwq6DD2IAbFGSCgdiU0B4SRT/8+8AQ/klxzAnNtuAjHgvayl8vYpLHp04XOwt4Gc+NaF0ZhVF Mi4C9jtR+M9fyjhIuUpwM7Km3KTXCWmtltmYNrT2pEFRP2rcJIXtHBWqP6eQrNJZHHC2SYxAWofNB1 AYa7gPiGycXOsKHIbAsfzBsZStug2wQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=UjprSAEeNU1TmzhyEQxWiTz/5siIsZ5+QIju1i0PhAw=; b=P6lC5kGbWFI6i+qsQa8HoFuq9rQVnQnasjjTB8Hna3+bwUM7WBwK1fq3nZVMk/ktuJVRFfLh/y+/n 2G8ip/ZGTI7/LO8dSZ1B8R07k3OSe6ic3INRbEbPnTctzeizT9jMYkfw0+EZo1HsR41Ll59DzXAGo9 4/eNZrLy64jkaI0fNqjtE8goCCfrWBBDnwAj6KhwssR+c5QrAJ7a63Rg3Rq9Alp4PfhNnx2gs7sK9E 5d8YrYgjkjQzDIoFJpbS7L7cUTADmto+6pB8IHE/7pQEDcE+idzWmKnw7yvNM62iOiFwWVddGAqRH3 LIBJGKfRO8OseQ7T0amdtz7R2oOnEkw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 45ba74c0-d4e0-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 45ba74c0-d4e0-11e9-85ed-13b9aae3a1d2; Wed, 11 Sep 2019 22:05:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8BM5VZE074664; Wed, 11 Sep 2019 16:05:31 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352231 - head/lib/libc/sys From: Ian Lepore To: Alan Somers , Peter Holm Cc: src-committers , svn-src-all , svn-src-head Date: Wed, 11 Sep 2019 16:05:31 -0600 In-Reply-To: References: <201909111948.x8BJmWZn092483@repo.freebsd.org> <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46TGDc1w5Pz4T75 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 22:05:36 -0000 On Wed, 2019-09-11 at 15:55 -0600, Alan Somers wrote: > On Wed, Sep 11, 2019 at 3:50 PM Ian Lepore wrote: > > > On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Wed Sep 11 19:48:32 2019 > > > New Revision: 352231 > > > URL: https://svnweb.freebsd.org/changeset/base/352231 > > > > > > Log: > > > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > > > > > When SO_TIMESTAMP is set, the kernel will attempt to attach a > > > > timestamp as > > > ancillary data to each IP datagram that is received on the socket. > > > > However, > > > it may fail, for example due to insufficient memory. In that case the > > > packet will still be received but not timestamp will be attached. > > > > > > Reviewed by: kib > > > MFC after: 3 days > > > Differential Revision: https://reviews.freebsd.org/D21607 > > > > > > Modified: > > > head/lib/libc/sys/getsockopt.2 > > > > > > Modified: head/lib/libc/sys/getsockopt.2 > > > > > > > ============================================================================== > > > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 > > > > (r352230) > > > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 > > > > (r352231) > > > @@ -28,7 +28,7 @@ > > > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > > > .\" $FreeBSD$ > > > .\" > > > -.Dd February 10, 2019 > > > +.Dd September 11, 2019 > > > .Dt GETSOCKOPT 2 > > > .Os > > > .Sh NAME > > > @@ -431,7 +431,8 @@ option is enabled on a > > > .Dv SOCK_DGRAM > > > socket, the > > > .Xr recvmsg 2 > > > -call will return a timestamp corresponding to when the datagram was > > > > received. > > > +call may return a timestamp corresponding to when the datagram was > > > > received. > > > +However, it may not, for example due to a resource shortage. > > > The > > > .Va msg_control > > > field in the > > > > > > > So I guess this actually happened to someone... is it a common thing > > for the timestamp to fail? I ask because ntpd relies on SO_TIMESTAMP > > and if this situation really happens and can persist for a long time, > > ntpd would effectively stop working. > > > > -- Ian > > > > pho discovered how to trigger it. If you start 50 ping processes > simultaneously, sometimes a few will fail. Will ntpd be ok with a single > failure, as long as the timestamp is received correctly in a subsequent > packet? > -Alan Yeah, nptd is resilient to missing data and intermittent comms, within reason. If it goes hours without getting a timestamp, system time would start to drift. Running 50 concurrent pings sounds like something that won't come up in the real world. :) -- Ian From owner-svn-src-all@freebsd.org Wed Sep 11 23:41:11 2019 Return-Path: Delivered-To: svn-src-all@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 38F85E377A; Wed, 11 Sep 2019 23:41:11 +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 46TJLt6x3xz4XZg; Wed, 11 Sep 2019 23:41:10 +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 D2C69E1A0; Wed, 11 Sep 2019 23:41:10 +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 x8BNfAkw030272; Wed, 11 Sep 2019 23:41:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BNfA8s030269; Wed, 11 Sep 2019 23:41:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909112341.x8BNfA8s030269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Sep 2019 23:41:10 +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: r352234 - in stable/12/sys: crypto/aesni opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: crypto/aesni opencrypto X-SVN-Commit-Revision: 352234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 23:41:11 -0000 Author: mav Date: Wed Sep 11 23:41:09 2019 New Revision: 352234 URL: https://svnweb.freebsd.org/changeset/base/352234 Log: MFC r342024 (by mmacy): Generalize AES iov optimization Right now, aesni_cipher_alloc does a bit of special-casing for CRYPTO_F_IOV, to not do any allocation if the first uio is large enough for the requested size. While working on ZFS crypto port, I ran into horrible performance because the code uses scatter-gather, and many of the times the data to encrypt was in the second entry. This code looks through the list, and tries to see if there is a single uio that can contain the requested data, and, if so, uses that. This has a slight impact on the current consumers, in that the check is a little more complicated for the ones that use CRYPTO_F_IOV -- but none of them meet the criteria for testing more than one. Modified: stable/12/sys/crypto/aesni/aesni.c stable/12/sys/opencrypto/criov.c stable/12/sys/opencrypto/cryptodev.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/crypto/aesni/aesni.c ============================================================================== --- stable/12/sys/crypto/aesni/aesni.c Wed Sep 11 21:24:14 2019 (r352233) +++ stable/12/sys/crypto/aesni/aesni.c Wed Sep 11 23:41:09 2019 (r352234) @@ -403,29 +403,14 @@ static uint8_t * aesni_cipher_alloc(struct cryptodesc *enccrd, struct cryptop *crp, bool *allocated) { - struct mbuf *m; - struct uio *uio; - struct iovec *iov; uint8_t *addr; - if (crp->crp_flags & CRYPTO_F_IMBUF) { - m = (struct mbuf *)crp->crp_buf; - if (m->m_next != NULL) - goto alloc; - addr = mtod(m, uint8_t *); - } else if (crp->crp_flags & CRYPTO_F_IOV) { - uio = (struct uio *)crp->crp_buf; - if (uio->uio_iovcnt != 1) - goto alloc; - iov = uio->uio_iov; - addr = (uint8_t *)iov->iov_base; - } else - addr = (uint8_t *)crp->crp_buf; - *allocated = false; - addr += enccrd->crd_skip; - return (addr); - -alloc: + addr = crypto_contiguous_subsegment(crp->crp_flags, + crp->crp_buf, enccrd->crd_skip, enccrd->crd_len); + if (addr != NULL) { + *allocated = false; + return (addr); + } addr = malloc(enccrd->crd_len, M_AESNI, M_NOWAIT); if (addr != NULL) { *allocated = true; Modified: stable/12/sys/opencrypto/criov.c ============================================================================== --- stable/12/sys/opencrypto/criov.c Wed Sep 11 21:24:14 2019 (r352233) +++ stable/12/sys/opencrypto/criov.c Wed Sep 11 23:41:09 2019 (r352234) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -239,3 +241,55 @@ crypto_mbuftoiov(struct mbuf *mbuf, struct iovec **iov *cnt = i; return 0; } + +static inline void * +m_contiguous_subsegment(struct mbuf *m, size_t skip, size_t len) +{ + int rel_off; + + MPASS(skip <= INT_MAX); + + m = m_getptr(m, (int)skip, &rel_off); + if (m == NULL) + return (NULL); + + MPASS(rel_off >= 0); + skip = rel_off; + if (skip + len > m->m_len) + return (NULL); + + return (mtod(m, char*) + skip); +} + +static inline void * +cuio_contiguous_segment(struct uio *uio, size_t skip, size_t len) +{ + int rel_off, idx; + + MPASS(skip <= INT_MAX); + idx = cuio_getptr(uio, (int)skip, &rel_off); + if (idx < 0) + return (NULL); + + MPASS(rel_off >= 0); + skip = rel_off; + if (skip + len > uio->uio_iov[idx].iov_len) + return (NULL); + return ((char *)uio->uio_iov[idx].iov_base + skip); +} + +void * +crypto_contiguous_subsegment(int crp_flags, void *crpbuf, + size_t skip, size_t len) +{ + if ((crp_flags & CRYPTO_F_IMBUF) != 0) + return (m_contiguous_subsegment(crpbuf, skip, len)); + else if ((crp_flags & CRYPTO_F_IOV) != 0) + return (cuio_contiguous_segment(crpbuf, skip, len)); + else { + MPASS((crp_flags & (CRYPTO_F_IMBUF | CRYPTO_F_IOV)) != + (CRYPTO_F_IMBUF | CRYPTO_F_IOV)); + return ((char*)crpbuf + skip); + } +} + Modified: stable/12/sys/opencrypto/cryptodev.h ============================================================================== --- stable/12/sys/opencrypto/cryptodev.h Wed Sep 11 21:24:14 2019 (r352233) +++ stable/12/sys/opencrypto/cryptodev.h Wed Sep 11 23:41:09 2019 (r352234) @@ -571,5 +571,7 @@ extern void crypto_copydata(int flags, caddr_t buf, in extern int crypto_apply(int flags, caddr_t buf, int off, int len, int (*f)(void *, void *, u_int), void *arg); +extern void *crypto_contiguous_subsegment(int, void *, size_t, size_t); + #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ From owner-svn-src-all@freebsd.org Wed Sep 11 23:46:00 2019 Return-Path: Delivered-To: svn-src-all@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 1ADBBE3978; Wed, 11 Sep 2019 23:46:00 +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 46TJSR6ym4z4Xv8; Wed, 11 Sep 2019 23:45:59 +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 D1957E337; Wed, 11 Sep 2019 23:45:59 +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 x8BNjxVj034176; Wed, 11 Sep 2019 23:45:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8BNjwFD034170; Wed, 11 Sep 2019 23:45:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909112345.x8BNjwFD034170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Sep 2019 23:45: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: r352235 - in stable/12/sys: conf crypto/aesni modules/aesni X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: conf crypto/aesni modules/aesni X-SVN-Commit-Revision: 352235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 23:46:00 -0000 Author: mav Date: Wed Sep 11 23:45:58 2019 New Revision: 352235 URL: https://svnweb.freebsd.org/changeset/base/352235 Log: MFC r348268 (by sef), r348293 (by cem): Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication code. The primary client of this is probably going to be ZFS encryption. Added: stable/12/sys/crypto/aesni/aesni_ccm.c - copied, changed from r348268, head/sys/crypto/aesni/aesni_ccm.c Modified: stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.i386 stable/12/sys/crypto/aesni/aesni.c stable/12/sys/crypto/aesni/aesni.h stable/12/sys/crypto/aesni/aesni_wrap.c stable/12/sys/modules/aesni/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/conf/files.amd64 Wed Sep 11 23:45:58 2019 (r352235) @@ -175,6 +175,11 @@ aesni_ghash.o optional aesni \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" +aesni_ccm.o optional aesni \ + dependency "$S/crypto/aesni/aesni_ccm.c" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + no-implicit-rule \ + clean "aesni_ccm.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ Modified: stable/12/sys/conf/files.i386 ============================================================================== --- stable/12/sys/conf/files.i386 Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/conf/files.i386 Wed Sep 11 23:45:58 2019 (r352235) @@ -127,6 +127,11 @@ aesni_ghash.o optional aesni \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" +aesni_ccm.o optional aesni \ + dependency "$S/crypto/aesni/aesni_ccm.c" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + no-implicit-rule \ + clean "aesni_ccm.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ Modified: stable/12/sys/crypto/aesni/aesni.c ============================================================================== --- stable/12/sys/crypto/aesni/aesni.c Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/crypto/aesni/aesni.c Wed Sep 11 23:45:58 2019 (r352235) @@ -131,9 +131,10 @@ aesni_probe(device_t dev) return (EINVAL); } else if (has_aes && has_sha) device_set_desc(dev, - "AES-CBC,AES-XTS,AES-GCM,AES-ICM,SHA1,SHA256"); + "AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS,SHA1,SHA256"); else if (has_aes) - device_set_desc(dev, "AES-CBC,AES-XTS,AES-GCM,AES-ICM"); + device_set_desc(dev, + "AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS"); else device_set_desc(dev, "SHA1,SHA256"); @@ -193,6 +194,8 @@ aesni_attach(device_t dev) crypto_register(sc->cid, CRYPTO_AES_192_NIST_GMAC, 0, 0); crypto_register(sc->cid, CRYPTO_AES_256_NIST_GMAC, 0, 0); crypto_register(sc->cid, CRYPTO_AES_XTS, 0, 0); + crypto_register(sc->cid, CRYPTO_AES_CCM_16, 0, 0); + crypto_register(sc->cid, CRYPTO_AES_CCM_CBC_MAC, 0, 0); } if (sc->has_sha) { crypto_register(sc->cid, CRYPTO_SHA1, 0, 0); @@ -226,6 +229,7 @@ aesni_newsession(device_t dev, crypto_session_t cses, struct aesni_session *ses; struct cryptoini *encini, *authini; bool gcm_hash, gcm; + bool cbc_hash, ccm; int error; KASSERT(cses != NULL, ("EDOOFUS")); @@ -242,10 +246,17 @@ aesni_newsession(device_t dev, crypto_session_t cses, encini = NULL; gcm = false; gcm_hash = false; + ccm = cbc_hash = false; + for (; cri != NULL; cri = cri->cri_next) { switch (cri->cri_alg) { case CRYPTO_AES_NIST_GCM_16: - gcm = true; + case CRYPTO_AES_CCM_16: + if (cri->cri_alg == CRYPTO_AES_NIST_GCM_16) { + gcm = true; + } else if (cri->cri_alg == CRYPTO_AES_CCM_16) { + ccm = true; + } /* FALLTHROUGH */ case CRYPTO_AES_CBC: case CRYPTO_AES_ICM: @@ -258,6 +269,10 @@ aesni_newsession(device_t dev, crypto_session_t cses, } encini = cri; break; + case CRYPTO_AES_CCM_CBC_MAC: + cbc_hash = true; + authini = cri; + break; case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: @@ -265,7 +280,12 @@ aesni_newsession(device_t dev, crypto_session_t cses, * nothing to do here, maybe in the future cache some * values for GHASH */ + if (authini != NULL) { + CRYPTDEB("authini already set"); + return (EINVAL); + } gcm_hash = true; + authini = cri; break; case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: @@ -295,9 +315,16 @@ unhandled: * GMAC algorithms are only supported with simultaneous GCM. Likewise * GCM is not supported without GMAC. */ - if (gcm_hash != gcm) + if (gcm_hash != gcm) { + CRYPTDEB("gcm_hash != gcm"); return (EINVAL); + } + if (cbc_hash != ccm) { + CRYPTDEB("cbc_hash != ccm"); + return (EINVAL); + } + if (encini != NULL) ses->algo = encini->cri_alg; if (authini != NULL) @@ -338,6 +365,7 @@ aesni_process(device_t dev, struct cryptop *crp, int h for (crd = crp->crp_desc; crd != NULL; crd = crd->crd_next) { switch (crd->crd_alg) { case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: needauth = 1; /* FALLTHROUGH */ case CRYPTO_AES_CBC: @@ -353,6 +381,7 @@ aesni_process(device_t dev, struct cryptop *crp, int h case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: + case CRYPTO_AES_CCM_CBC_MAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224: @@ -647,6 +676,7 @@ aesni_cipher_process(struct aesni_session *ses, struct if (enccrd != NULL) { if ((enccrd->crd_alg == CRYPTO_AES_ICM || + enccrd->crd_alg == CRYPTO_AES_CCM_16 || enccrd->crd_alg == CRYPTO_AES_NIST_GCM_16) && (enccrd->crd_flags & CRD_F_IV_EXPLICIT) == 0) return (EINVAL); @@ -700,8 +730,9 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c int error, ivlen; bool encflag, allocated, authallocated; - KASSERT(ses->algo != CRYPTO_AES_NIST_GCM_16 || authcrd != NULL, - ("AES_NIST_GCM_16 must include MAC descriptor")); + KASSERT((ses->algo != CRYPTO_AES_NIST_GCM_16 && + ses->algo != CRYPTO_AES_CCM_16) || authcrd != NULL, + ("AES_NIST_GCM_16/AES_CCM_16 must include MAC descriptor")); ivlen = 0; authbuf = NULL; @@ -711,7 +742,8 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c return (ENOMEM); authallocated = false; - if (ses->algo == CRYPTO_AES_NIST_GCM_16) { + if (ses->algo == CRYPTO_AES_NIST_GCM_16 || + ses->algo == CRYPTO_AES_CCM_16) { authbuf = aesni_cipher_alloc(authcrd, crp, &authallocated); if (authbuf == NULL) { error = ENOMEM; @@ -737,6 +769,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c ivlen = 8; break; case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: ivlen = 12; /* should support arbitarily larger */ break; } @@ -786,7 +819,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c case CRYPTO_AES_NIST_GCM_16: if (!encflag) crypto_copydata(crp->crp_flags, crp->crp_buf, - authcrd->crd_inject, GMAC_DIGEST_LEN, tag); + authcrd->crd_inject, sizeof(tag), tag); else bzero(tag, sizeof tag); @@ -797,7 +830,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c if (authcrd != NULL) crypto_copyback(crp->crp_flags, crp->crp_buf, - authcrd->crd_inject, GMAC_DIGEST_LEN, tag); + authcrd->crd_inject, sizeof(tag), tag); } else { if (!AES_GCM_decrypt(buf, buf, authbuf, iv, tag, enccrd->crd_len, authcrd->crd_len, ivlen, @@ -805,9 +838,28 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c error = EBADMSG; } break; + case CRYPTO_AES_CCM_16: + if (!encflag) + crypto_copydata(crp->crp_flags, crp->crp_buf, + authcrd->crd_inject, sizeof(tag), tag); + else + bzero(tag, sizeof tag); + if (encflag) { + AES_CCM_encrypt(buf, buf, authbuf, iv, tag, + enccrd->crd_len, authcrd->crd_len, ivlen, + ses->enc_schedule, ses->rounds); + if (authcrd != NULL) + crypto_copyback(crp->crp_flags, crp->crp_buf, + authcrd->crd_inject, sizeof(tag), tag); + } else { + if (!AES_CCM_decrypt(buf, buf, authbuf, iv, tag, + enccrd->crd_len, authcrd->crd_len, ivlen, + ses->enc_schedule, ses->rounds)) + error = EBADMSG; + } + break; } - - if (allocated) + if (allocated && error == 0) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); Modified: stable/12/sys/crypto/aesni/aesni.h ============================================================================== --- stable/12/sys/crypto/aesni/aesni.h Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/crypto/aesni/aesni.h Wed Sep 11 23:45:58 2019 (r352235) @@ -111,6 +111,15 @@ int AES_GCM_decrypt(const unsigned char *in, unsigned const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, const unsigned char *key, int nr); +/* CCM + CBC-MAC functions */ +void AES_CCM_encrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *ivec, + unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, + const unsigned char *key, int nr); +int AES_CCM_decrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *ivec, + const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, + const unsigned char *key, int nr); int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, int keylen); Copied and modified: stable/12/sys/crypto/aesni/aesni_ccm.c (from r348268, head/sys/crypto/aesni/aesni_ccm.c) ============================================================================== --- head/sys/crypto/aesni/aesni_ccm.c Sat May 25 07:26:30 2019 (r348268, copy source) +++ stable/12/sys/crypto/aesni/aesni_ccm.c Wed Sep 11 23:45:58 2019 (r352235) @@ -58,7 +58,7 @@ static inline __m128i xor_and_encrypt(__m128i a, __m128i b, const unsigned char *k, int nr) { - __m128 retval = _mm_xor_si128(a, b); + __m128i retval = _mm_xor_si128(a, b); retval = AESNI_ENC(retval, k, nr); return (retval); Modified: stable/12/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- stable/12/sys/crypto/aesni/aesni_wrap.c Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/crypto/aesni/aesni_wrap.c Wed Sep 11 23:45:58 2019 (r352235) @@ -446,6 +446,7 @@ aesni_cipher_setup_common(struct aesni_session *ses, c switch (ses->algo) { case CRYPTO_AES_ICM: case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: decsched = 0; /* FALLTHROUGH */ case CRYPTO_AES_CBC: Modified: stable/12/sys/modules/aesni/Makefile ============================================================================== --- stable/12/sys/modules/aesni/Makefile Wed Sep 11 23:41:09 2019 (r352234) +++ stable/12/sys/modules/aesni/Makefile Wed Sep 11 23:45:58 2019 (r352235) @@ -8,16 +8,20 @@ SRCS= aesni.c SRCS+= aeskeys_${MACHINE_CPUARCH}.S SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h -OBJS+= aesni_ghash.o aesni_wrap.o +OBJS+= aesni_ghash.o aesni_wrap.o aesni_ccm.o OBJS+= intel_sha1.o intel_sha256.o # Remove -nostdinc so we can get the intrinsics. aesni_ghash.o: aesni_ghash.c - # XXX - gcc won't understand -mpclmul ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC} ${CTFCONVERT_CMD} +aesni_ccm.o: aesni_ccm.c + ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ + -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC} + ${CTFCONVERT_CMD} + aesni_wrap.o: aesni_wrap.c ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ -mmmx -msse -msse4 -maes ${.IMPSRC} @@ -35,6 +39,7 @@ intel_sha256.o: intel_sha256.c aesni_ghash.o: aesni.h aesni_wrap.o: aesni.h +aesni_ccm.o: aesni.h intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h From owner-svn-src-all@freebsd.org Thu Sep 12 00:15:08 2019 Return-Path: Delivered-To: svn-src-all@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 F0566E458B; Thu, 12 Sep 2019 00:15:08 +0000 (UTC) (envelope-from philip@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 46TK646hYgz4YtB; Thu, 12 Sep 2019 00:15:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C8B03E863; Thu, 12 Sep 2019 00:15:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C0F8Rg051853; Thu, 12 Sep 2019 00:15:08 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C0F72t051842; Thu, 12 Sep 2019 00:15:07 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201909120015.x8C0F72t051842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 12 Sep 2019 00:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352236 - vendor/tzdata/dist X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/dist X-SVN-Commit-Revision: 352236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 00:15:09 -0000 Author: philip Date: Thu Sep 12 00:15:06 2019 New Revision: 352236 URL: https://svnweb.freebsd.org/changeset/base/352236 Log: Import tzdata 2019c Modified: vendor/tzdata/dist/NEWS vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/backzone vendor/tzdata/dist/europe vendor/tzdata/dist/leap-seconds.list vendor/tzdata/dist/leapseconds vendor/tzdata/dist/leapseconds.awk vendor/tzdata/dist/northamerica vendor/tzdata/dist/southamerica vendor/tzdata/dist/theory.html vendor/tzdata/dist/version Modified: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/NEWS Thu Sep 12 00:15:06 2019 (r352236) @@ -1,5 +1,80 @@ News for the tz database +Release 2019c - 2019-09-11 08:59:48 -0700 + + Briefly: + Fiji observes DST from 2019-11-10 to 2020-01-12. + Norfolk Island starts observing Australian-style DST. + + Changes to future timestamps + + Fiji's next DST transitions will be 2019-11-10 and 2020-01-12 + instead of 2019-11-03 and 2020-01-19. (Thanks to Raymond Kumar.) + Adjust future guesses accordingly. + + Norfolk Island will observe Australian-style DST starting in + spring 2019. The first transition is on 2019-10-06. (Thanks to + Kyle Czech and Michael Deckers.) + + Changes to past timestamps + + Many corrections to time in Turkey from 1940 through 1985. + (Thanks to Oya Vulaş via Alois Treindl, and to Kıvanç Yazan.) + + The Norfolk Island 1975-03-02 transition was at 02:00 standard + time, not 02:00 DST. (Thanks to Michael Deckers.) + + South Korea observed DST from 1948 through 1951. Although this + info was supposed to appear in release 2014j, a typo inadvertently + suppressed the change. (Thanks to Alois Treindl.) + + Detroit observed DST in 1967 and 1968 following the US DST rules, + except that its 1967 DST began on June 14 at 00:01. (Thanks to + Alois Treindl for pointing out that the old data entries were + probably wrong.) + + Fix several errors in pre-1970 transitions in Perry County, IN. + (Thanks to Alois Triendl for pointing out the 1967/9 errors.) + + Edmonton did not observe DST in 1967 or 1969. In 1946 Vancouver + ended DST on 09-29 not 10-13, and Vienna ended DST on 10-07 not + 10-06. In 1945 Königsberg (now Kaliningrad) switched from +01/+02 + to +02/+03 on 04-10 not 01-01, and its +02/+03 is abbreviated + EET/EEST, not CET/CEST. (Thanks to Alois Triendl.) In 1946 + Königsberg switched to +03 on 04-07 not 01-01. + + In 1946 Louisville switched from CST to CDT on 04-28 at 00:01, not + 01-01 at 00:00. (Thanks to Alois Treindl and Michael Deckers.) + Also, it switched from CST to CDT on 1950-04-30, not 1947-04-27. + + The 1892-05-01 transition in Brussels was at 00:17:30, not at noon. + (Thanks to Michael Deckers.) + + Changes to past time zone abbreviations and DST flags + + Hong Kong Winter Time, observed from 1941-10-01 to 1941-12-25, + is now flagged as DST and is abbreviated HKWT not HKT. + + Changes to code + + leapseconds.awk now relies only on its input data, rather than + also relying on its comments. (Inspired by code from Dennis + Ferguson and Chris Woodbury.) + + The code now defends against CRLFs in leap-seconds.list. + (Thanks to Brian Inglis and Chris Woodbury.) + + Changes to documentation and commentary + + theory.html discusses leap seconds. (Thanks to Steve Summit.) + + Nashville's newspapers dueled about the time of day in the 1950s. + (Thanks to John Seigenthaler.) + + Liechtenstein observed Swiss DST in 1941/2. + (Thanks to Alois Treindl.) + + Release 2019b - 2019-07-01 00:09:53 -0700 Briefly: Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/asia Thu Sep 12 00:15:06 2019 (r352236) @@ -8,7 +8,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2018-06-19): +# From Paul Eggert (2019-07-11): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -47,13 +47,13 @@ # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China -# 8:00 PST PDT* Philippine Standard Time +# 8:00 HKT HKST Hong Kong (HKWT* for Winter Time in late 1941) +# 8:00 PST PDT* Philippines # 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea when at +09 -# 9:30 ACST Australian Central Standard Time -# *I invented the abbreviation PDT; see "Philippines" below. +# *I invented the abbreviations HKWT and PDT; see below. # Otherwise, these tables typically use numeric abbreviations like +03 # and +0330 for integer hour and minute UT offsets. Although earlier # editions invented alphabetic time zone abbreviations for every @@ -653,6 +653,15 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. # https://i.imgur.com/dge4kFJ.png +# From Paul Eggert (2019-07-11): +# "Hong Kong winter time" is considered to be daylight saving. +# "Hong Kong had adopted daylight saving on June 15 as a wartime measure, +# clocks moving forward one hour until October 1, when they would be put back +# by just half an hour for 'Hong Kong Winter time', so that daylight saving +# operated year round." -- Low Z. The longest day: when wartime Hong Kong +# introduced daylight saving. South China Morning Post. 2019-06-28. +# https://www.scmp.com/magazines/post-magazine/short-reads/article/3016281/longest-day-when-wartime-hong-kong-introduced + # From P Chan (2018-12-31): # * According to the Hong Kong Daylight-Saving Regulations, 1941, the # 1941 spring-forward transition was at 03:00. @@ -754,7 +763,7 @@ Rule HK 1979 only - Oct 21 3:30 0 - Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 8:00 - HKT 1941 Jun 15 3:00 8:00 1:00 HKST 1941 Oct 1 4:00 - 8:30 - HKT 1941 Dec 25 + 8:00 0:30 HKWT 1941 Dec 25 9:00 - JST 1945 Nov 18 2:00 8:00 HK HK%sT @@ -2419,7 +2428,7 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 8:30 - KST 1912 Jan 1 9:00 - JST 1945 Sep 8 - 9:00 - KST 1954 Mar 21 + 9:00 ROK K%sT 1954 Mar 21 8:30 ROK K%sT 1961 Aug 10 9:00 ROK K%sT Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 @@ -3604,7 +3613,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # and in South Vietnam in particular (after 1954): # To 07:00 on 1911-05-01. # To 08:00 on 1942-12-31 at 23:00. -# To 09:00 in 1945-03-14 at 23:00. +# To 09:00 on 1945-03-14 at 23:00. # To 07:00 on 1945-09-02 in Vietnam. # To 08:00 on 1947-04-01 in French-controlled Indochina. # To 07:00 on 1955-07-01 in South Vietnam. Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/australasia Thu Sep 12 00:15:06 2019 (r352236) @@ -367,13 +367,18 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # From Raymond Kumar (2018-07-13): # http://www.fijitimes.com/government-approves-2018-daylight-saving/ # ... The daylight saving period will end at 3am on Sunday January 13, 2019. -# -# From Paul Eggert (2018-07-15): -# For now, guess DST from 02:00 the first Sunday in November to 03:00 -# the first Sunday on or after January 13. January transitions reportedly + +# From Paul Eggert (2019-08-06): +# Today Raymond Kumar reported the Government of Fiji Gazette Supplement No. 27 +# (2019-08-02) said that Fiji observes DST "commencing at 2.00 am on +# Sunday, 10 November 2019 and ending at 3.00 am on Sunday, 12 January 2020." +# For now, guess DST from 02:00 the second Sunday in November to 03:00 +# the first Sunday on or after January 12. January transitions reportedly # depend on when school terms start. Although the guess is ad hoc, it matches -# transitions since late 2014 and seems more likely to match future -# practice than guessing no DST. +# transitions planned this year and seems more likely to match future practice +# than guessing no DST. +# From Michael Deckers (2019-08-06): +# https://www.laws.gov.fj/LawsAsMade/downloadfile/848 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - @@ -384,8 +389,9 @@ Rule Fiji 2010 2013 - Oct Sun>=21 2:00 1:00 - Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - -Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 - -Rule Fiji 2015 max - Jan Sun>=13 3:00 0 - +Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - +Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - +Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 @@ -604,10 +610,11 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Alofi # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - +1112 1951 - 11:30 - +1130 1974 Oct 27 02:00 - 11:30 1:00 +1230 1975 Mar 2 02:00 - 11:30 - +1130 2015 Oct 4 02:00 - 11:00 - +11 + 11:30 - +1130 1974 Oct 27 02:00s + 11:30 1:00 +1230 1975 Mar 2 02:00s + 11:30 - +1130 2015 Oct 4 02:00s + 11:00 - +11 2019 Jul + 11:00 AN +11/+12 # Palau (Belau) # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -1875,12 +1882,21 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. # http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf -# From Paul Eggert (2015-09-23): +# From Paul Eggert (2019-08-28): # Transitions before 2015 are from timeanddate.com, which consulted # the Norfolk Island Museum and the Australian Bureau of Meteorology's # Norfolk Island station, and found no record of Norfolk observing DST # other than in 1974/5. See: # https://www.timeanddate.com/time/australia/norfolk-island.html +# However, disagree with timeanddate about the 1975-03-02 transition; +# timeanddate has 02:00 but 02:00s corresponds to what the NSW law said +# (thanks to Michael Deckers). + +# Norfolk started observing Australian DST in spring 2019. +# From Kyle Czech (2019-08-13): +# https://www.legislation.gov.au/Details/F2018L01702 +# From Michael Deckers (2019-08-14): +# https://www.legislation.gov.au/Details/F2019C00010 # Palau # See commentary for Micronesia. Modified: vendor/tzdata/dist/backzone ============================================================================== --- vendor/tzdata/dist/backzone Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/backzone Thu Sep 12 00:15:06 2019 (r352236) @@ -507,19 +507,35 @@ Zone Asia/Muscat 3:54:24 - LMT 1920 #Zone Asia/Panaji [not enough info to complete] # Cambodia -# From Paul Eggert (2014-10-11): -# See Asia/Ho_Chi_Minh for the source for most of this data. Also, guess -# (1) Cambodia reverted to UT +07 on 1945-09-02, when Vietnam did, and -# (2) they also reverted to +07 on 1953-11-09, the date of independence. -# These guesses are probably wrong but they're better than guessing no -# transitions there. + +# From an adoptive daughter of the late Cambodian ruler Prince Sihanouk, +# via Alois Treindl (2019-08-08): +# +# King Sihanouk said that, during the Japanese occupation, starting with +# what historians refer to as "le coup de force du 9 mars 1945", Cambodia, +# like the entire French Indochina, used Tokyo time zone. After Japan +# surrendered, 2 September 1945, Cambodia fell under French rule again and +# adopted Hanoi time zone again. +# +# However, on 7 January 1946, Sihanouk and Tioulong managed to obtain a +# status of "internal autonomy" from the government of Charles de Gaulle. +# Although many fields remained under the administration of the French +# (customs, taxes, justice, defence, foreign affairs, etc.), the Cambodian +# administration was responsible for religious matters and traditional +# celebrations, which included our calendar and time. The time zone was GMT +# + 7 and _no_ DST was applied. +# +# After Sihanouk and Tioulong achieved full independence, on 9 November 1953, +# GMT + 7 was maintained. + +# From Paul Eggert (2019-08-26): +# See Asia/Ho_Chi_Minh for the source for most of rest of this data. + Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jul 1 7:06:30 - PLMT 1911 May 1 7:00 - +07 1942 Dec 31 23:00 8:00 - +08 1945 Mar 14 23:00 9:00 - +09 1945 Sep 2 - 7:00 - +07 1947 Apr 1 - 8:00 - +08 1953 Nov 9 7:00 - +07 # Israel @@ -646,7 +662,7 @@ Zone Europe/Tiraspol 1:58:32 - LMT 1880 # Liechtenstein Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun - 1:00 - CET 1981 + 1:00 Swiss CE%sT 1981 1:00 EU CE%sT # Croatia Modified: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/europe Thu Sep 12 00:15:06 2019 (r352236) @@ -821,11 +821,16 @@ Zone Europe/Andorra 0:06:04 - LMT 1901 # Shanks & Pottenger give 02:00, the BEV 00:00. Go with the BEV, # and guess 02:00 for 1945-04-12. +# From Alois Triendl (2019-07-22): +# In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am. +# Shanks had this right. Source: Die Weltpresse, 5. Oktober 1946, page 5. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Austria 1920 only - Apr 5 2:00s 1:00 S Rule Austria 1920 only - Sep 13 2:00s 0 - Rule Austria 1946 only - Apr 14 2:00s 1:00 S -Rule Austria 1946 1948 - Oct Sun>=1 2:00s 0 - +Rule Austria 1946 only - Oct 7 2:00s 0 - +Rule Austria 1947 1948 - Oct Sun>=1 2:00s 0 - Rule Austria 1947 only - Apr 6 2:00s 1:00 S Rule Austria 1948 only - Apr 18 2:00s 1:00 S Rule Austria 1980 only - Apr 6 0:00 1:00 S @@ -875,15 +880,35 @@ Zone Europe/Minsk 1:50:16 - LMT 1880 # Belgium # -# From Paul Eggert (1997-07-02): +# From Michael Deckers (2019-08-25): +# The exposition in the web page +# https://www.bestor.be/wiki/index.php/Voyager_dans_le_temps._L%E2%80%99introduction_de_la_norme_de_Greenwich_en_Belgique +# gives several contemporary sources from which one can conclude that +# the switch in Europe/Brussels on 1892-05-01 was from 00:17:30 to 00:00:00. +# +# From Paul Eggert (2019-08-28): +# This quote helps explain the late-1914 situation: +# In early November 1914, the Germans imposed the time zone used in central +# Europe and forced the inhabitants to set their watches and public clocks +# sixty minutes ahead. Many were reluctant to accept "German time" and +# continued to use "Belgian time" among themselves. Reflecting the spirit of +# resistance that arose in the population, a song made fun of this change.... +# The song ended: +# Putting your clock forward +# Will but hasten the happy hour +# When we kick out the Boches! +# See: Pluvinage G. Brussels on German time. Cahiers Bruxellois - +# Brusselse Cahiers. 2014;XLVI(1E):15-38. +# https://www.cairn.info/revue-cahiers-bruxellois-2014-1E-page-15.htm +# +# Entries from 1914 through 1917 are taken from "De tijd in België" +# . # Entries from 1918 through 1991 are taken from: # Annuaire de L'Observatoire Royal de Belgique, # Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe année, 1991 # (Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC), # pp 8-9. -# LMT before 1892 was 0:17:30, according to the official journal of Belgium: -# Moniteur Belge, Samedi 30 Avril 1892, N.121. -# Thanks to Pascal Delmoitie for these references. +# Thanks to Pascal Delmoitie for the 1918/1991 references. # The 1918 rules are listed for completeness; they apply to unoccupied Belgium. # Assume Brussels switched to WET in 1918 when the armistice took effect. # @@ -928,7 +953,7 @@ Rule Belgium 1946 only - May 19 2:00s 1:00 S Rule Belgium 1946 only - Oct 7 2:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Europe/Brussels 0:17:30 - LMT 1880 - 0:17:30 - BMT 1892 May 1 12:00 # Brussels MT + 0:17:30 - BMT 1892 May 1 00:17:30 0:00 - WET 1914 Nov 8 1:00 - CET 1916 May 1 0:00 1:00 C-Eur CE%sT 1918 Nov 11 11:00u @@ -1627,6 +1652,13 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908 # advanced to sixty minutes later starting at hour two on 1944-04-02; ... # Starting at hour three on the date 1944-09-17 standard time will be resumed. # +# From Alois Triendl (2019-07-02): +# I spent 6 Euros to buy two archive copies of Il Messaggero, a Roman paper, +# for 1 and 2 April 1944. The edition of 2 April has this note: "Tonight at 2 +# am, put forward the clock by one hour. Remember that in the night between +# today and Monday the 'ora legale' will come in force again." That makes it +# clear that in Rome the change was on Monday, 3 April 1944 at 2 am. +# # From Paul Eggert (2016-10-27): # Go with INRiM for DST rules, except as corrected by Inglis for 1944 # for the Kingdom of Italy. This is consistent with Renzo Baldini. @@ -1774,15 +1806,10 @@ Zone Europe/Riga 1:36:34 - LMT 1880 # From Paul Eggert (2013-09-09): # Shanks & Pottenger say Vaduz is like Zurich. -# From Alois Treindl (2013-09-18): -# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf -# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942. -# I ... translate only the last two paragraphs: -# ... during second world war, in the years 1941 and 1942, Liechtenstein -# introduced daylight saving time, adapting to Switzerland. From 1943 on -# central European time was in force throughout the year. -# From a report of the duke's government to the high council, -# regarding the introduction of a time law, of 31 May 1977. +# From Alois Treindl (2019-07-04): +# I was able to access the online archive of the Vaduz paper Vaterland ... +# I could confirm from the paper that Liechtenstein did in fact follow +# the same DST in 1941 and 1942 as Switzerland did. Link Europe/Zurich Europe/Vaduz @@ -2490,6 +2517,12 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # Europe/Kaliningrad covers... # 39 RU-KGD Kaliningrad Oblast +# From Paul Eggert (2019-07-25): +# Although Shanks lists 1945-01-01 as the date for transition from +# +01/+02 to +02/+03, more likely this is a placeholder. Guess that +# the transition occurred at 1945-04-10 00:00, which is about when +# Königsberg surrendered to Soviet troops. (Thanks to Alois Triendl.) + # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). @@ -2506,8 +2539,8 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # Moscow on 1991-11-03, switched to Moscow-1 on 1992-01-19. Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr - 1:00 C-Eur CE%sT 1945 - 2:00 Poland CE%sT 1946 + 1:00 C-Eur CE%sT 1945 Apr 10 + 2:00 Poland EE%sT 1946 Apr 7 3:00 Russia MSK/MSD 1989 Mar 26 2:00s 2:00 Russia EE%sT 2011 Mar 27 2:00s 3:00 - +03 2014 Oct 26 2:00s @@ -3650,20 +3683,75 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See abo # Turkey +# From Alois Treindl (2019-08-12): +# http://www.astrolojidergisi.com/yazsaati.htm has researched the time zone +# history of Turkey, based on newspaper archives and official documents. +# From Paul Eggert (2019-08-28): +# That source (Oya Vulaş, "Türkiye'de Yaz Saati Uygulamaları") +# is used for 1940/1972, where it seems more reliable than our other +# sources. + +# From Kıvanç Yazan (2019-08-12): +# http://www.resmigazete.gov.tr/arsiv/14539.pdf#page=24 +# 1973-06-03 01:00 -> 02:00, 1973-11-04 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/14829.pdf#page=1 +# 1974-03-31 02:00 -> 03:00, 1974-11-03 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15161.pdf#page=1 +# 1975-03-22 02:00 -> 03:00, 1975-11-02 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15535_1.pdf#page=1 +# 1976-03-21 02:00 -> 03:00, 1976-10-31 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15778.pdf#page=5 +# 1977-04-03 02:00 -> 03:00, 1977-10-16 02:00 -> 01:00, +# 1978-04-02 02:00 -> 03:00 (not applied, see below) +# 1978-10-15 02:00 -> 01:00 (not applied, see below) +# 1979-04-01 02:00 -> 03:00 (not applied, see below) +# 1979-10-14 02:00 -> 01:00 (not applied, see below) +# +# http://www.resmigazete.gov.tr/arsiv/16245.pdf#page=17 +# This cancels the previous decision, and repeats it only for 1978. +# 1978-04-02 02:00 -> 03:00, 1978-10-15 02:00 -> 01:00 +# (not applied due to standard TZ change below) +# +# http://www.resmigazete.gov.tr/arsiv/16331.pdf#page=3 +# This decision changes the default longitude for Turkish time zone from 30 +# degrees East to 45 degrees East. This means a standard TZ change, from +2 +# to +3. This is published & applied on 1978-06-29. At that time, Turkey was +# already on summer time (already on 45E). Hence, this new law just meant an +# "continuous summer time". Note that this was reversed in a few years. +# +# http://www.resmigazete.gov.tr/arsiv/18119_1.pdf#page=1 +# 1983-07-31 02:00 -> 03:00 (note that this jumps TZ to +4) +# 1983-10-02 02:00 -> 01:00 (back to +3) +# +# http://www.resmigazete.gov.tr/arsiv/18561.pdf (page 1 and 34) +# At this time, Turkey is still on +3 with no spring-forward on early +# 1984. This decision is published on 10/31/1984. Page 1 declares +# the decision of reverting the "default longitude change". So the +# standard time should go back to +3 (30E). And page 34 explains when +# that will happen: 1984-11-01 02:00 -> 01:00. You can think of this +# as "end of continuous summer time, change of standard time zone". +# +# http://www.resmigazete.gov.tr/arsiv/18713.pdf#page=1 +# 1985-04-20 01:00 -> 02:00, 1985-09-28 02:00 -> 01:00 + # From Kıvanç Yazan (2016-09-25): # 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with # no exceptions. # 2) 1994's lastSun was overridden with Mar 20 ... # Here are official papers: -# http://www.resmigazete.gov.tr/arsiv/19032.pdf - page 2 for 1986 -# http://www.resmigazete.gov.tr/arsiv/19400.pdf - page 4 for 1987 -# http://www.resmigazete.gov.tr/arsiv/19752.pdf - page 15 for 1988 -# http://www.resmigazete.gov.tr/arsiv/20102.pdf - page 6 for 1989 -# http://www.resmigazete.gov.tr/arsiv/20464.pdf - page 1 for 1990 - 1992 -# http://www.resmigazete.gov.tr/arsiv/21531.pdf - page 15 for 1993 - 1995 -# http://www.resmigazete.gov.tr/arsiv/21879.pdf - page 1 for overriding 1994 -# http://www.resmigazete.gov.tr/arsiv/22588.pdf - page 1 for 1996, 1997 -# http://www.resmigazete.gov.tr/arsiv/23286.pdf - page 10 for 1998 - 2000 +# http://www.resmigazete.gov.tr/arsiv/19032.pdf#page=2 for 1986 +# http://www.resmigazete.gov.tr/arsiv/19400.pdf#page=4 for 1987 +# http://www.resmigazete.gov.tr/arsiv/19752.pdf#page=15 for 1988 +# http://www.resmigazete.gov.tr/arsiv/20102.pdf#page=6 for 1989 +# http://www.resmigazete.gov.tr/arsiv/20464.pdf#page=1 for 1990 - 1992 +# http://www.resmigazete.gov.tr/arsiv/21531.pdf#page=15 for 1993 - 1995 +# http://www.resmigazete.gov.tr/arsiv/21879.pdf#page=1 for overriding 1994 +# http://www.resmigazete.gov.tr/arsiv/22588.pdf#page=1 for 1996, 1997 +# http://www.resmigazete.gov.tr/arsiv/23286.pdf#page=10 for 1998 - 2000 # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 # From Paul Eggert (2016-09-25): @@ -3747,46 +3835,36 @@ Rule Turkey 1922 only - Oct 8 0:00 0 - Rule Turkey 1924 only - May 13 0:00 1:00 S Rule Turkey 1924 1925 - Oct 1 0:00 0 - Rule Turkey 1925 only - May 1 0:00 1:00 S -Rule Turkey 1940 only - Jun 30 0:00 1:00 S -Rule Turkey 1940 only - Oct 5 0:00 0 - +Rule Turkey 1940 only - Jul 1 0:00 1:00 S +Rule Turkey 1940 only - Oct 6 0:00 0 - Rule Turkey 1940 only - Dec 1 0:00 1:00 S Rule Turkey 1941 only - Sep 21 0:00 0 - Rule Turkey 1942 only - Apr 1 0:00 1:00 S -# Whitman omits the next two transition and gives 1945 Oct 1; -# go with Shanks & Pottenger. -Rule Turkey 1942 only - Nov 1 0:00 0 - -Rule Turkey 1945 only - Apr 2 0:00 1:00 S Rule Turkey 1945 only - Oct 8 0:00 0 - Rule Turkey 1946 only - Jun 1 0:00 1:00 S Rule Turkey 1946 only - Oct 1 0:00 0 - Rule Turkey 1947 1948 - Apr Sun>=16 0:00 1:00 S -Rule Turkey 1947 1950 - Oct Sun>=2 0:00 0 - +Rule Turkey 1947 1951 - Oct Sun>=2 0:00 0 - Rule Turkey 1949 only - Apr 10 0:00 1:00 S -Rule Turkey 1950 only - Apr 19 0:00 1:00 S +Rule Turkey 1950 only - Apr 16 0:00 1:00 S Rule Turkey 1951 only - Apr 22 0:00 1:00 S -Rule Turkey 1951 only - Oct 8 0:00 0 - +# DST for 15 months; unusual but we'll let it pass. Rule Turkey 1962 only - Jul 15 0:00 1:00 S -Rule Turkey 1962 only - Oct 8 0:00 0 - +Rule Turkey 1963 only - Oct 30 0:00 0 - Rule Turkey 1964 only - May 15 0:00 1:00 S Rule Turkey 1964 only - Oct 1 0:00 0 - -Rule Turkey 1970 1972 - May Sun>=2 0:00 1:00 S -Rule Turkey 1970 1972 - Oct Sun>=2 0:00 0 - Rule Turkey 1973 only - Jun 3 1:00 1:00 S -Rule Turkey 1973 only - Nov 4 3:00 0 - +Rule Turkey 1973 1976 - Oct Sun>=31 2:00 0 - Rule Turkey 1974 only - Mar 31 2:00 1:00 S -Rule Turkey 1974 only - Nov 3 5:00 0 - -Rule Turkey 1975 only - Mar 30 0:00 1:00 S -Rule Turkey 1975 1976 - Oct lastSun 0:00 0 - -Rule Turkey 1976 only - Jun 1 0:00 1:00 S -Rule Turkey 1977 1978 - Apr Sun>=1 0:00 1:00 S -Rule Turkey 1977 only - Oct 16 0:00 0 - -Rule Turkey 1979 1980 - Apr Sun>=1 3:00 1:00 S -Rule Turkey 1979 1982 - Oct Mon>=11 0:00 0 - -Rule Turkey 1981 1982 - Mar lastSun 3:00 1:00 S -Rule Turkey 1983 only - Jul 31 0:00 1:00 S -Rule Turkey 1983 only - Oct 2 0:00 0 - -Rule Turkey 1985 only - Apr 20 0:00 1:00 S -Rule Turkey 1985 only - Sep 28 0:00 0 - +Rule Turkey 1975 only - Mar 22 2:00 1:00 S +Rule Turkey 1976 only - Mar 21 2:00 1:00 S +Rule Turkey 1977 1978 - Apr Sun>=1 2:00 1:00 S +Rule Turkey 1977 1978 - Oct Sun>=15 2:00 0 - +Rule Turkey 1978 only - Jun 29 0:00 0 - +Rule Turkey 1983 only - Jul 31 2:00 1:00 S +Rule Turkey 1983 only - Oct 2 2:00 0 - +Rule Turkey 1985 only - Apr 20 1:00s 1:00 S +Rule Turkey 1985 only - Sep 28 1:00s 0 - Rule Turkey 1986 1993 - Mar lastSun 1:00s 1:00 S Rule Turkey 1986 1995 - Sep lastSun 1:00s 0 - Rule Turkey 1994 only - Mar 20 1:00s 1:00 S @@ -3795,8 +3873,8 @@ Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Europe/Istanbul 1:55:52 - LMT 1880 1:56:56 - IMT 1910 Oct # Istanbul Mean Time? - 2:00 Turkey EE%sT 1978 Oct 15 - 3:00 Turkey +03/+04 1985 Apr 20 + 2:00 Turkey EE%sT 1978 Jun 29 + 3:00 Turkey +03/+04 1984 Nov 1 2:00 2:00 Turkey EE%sT 2007 2:00 EU EE%sT 2011 Mar 27 1:00u 2:00 - EET 2011 Mar 28 1:00u Modified: vendor/tzdata/dist/leap-seconds.list ============================================================================== --- vendor/tzdata/dist/leap-seconds.list Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/leap-seconds.list Thu Sep 12 00:15:06 2019 (r352236) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 # -#@ 3786480000 +#@ 3802291200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a +#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 Modified: vendor/tzdata/dist/leapseconds ============================================================================== --- vendor/tzdata/dist/leapseconds Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/leapseconds Thu Sep 12 00:15:06 2019 (r352236) @@ -3,36 +3,39 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# leap-seconds.list file, which can be copied from +# NIST format leap-seconds.list file, which can be copied from # -# or -# or . +# or . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds # . -# The International Earth Rotation and Reference Systems Service +# The rules for leap seconds are specified in Annex 1 (Time scales) of: +# Standard-frequency and time-signal emissions. +# International Telecommunication Union - Radiocommunication Sector +# (ITU-R) Recommendation TF.460-6 (02/2002) +# . +# The International Earth Rotation and Reference Systems Service (IERS) # periodically uses leap seconds to keep UTC to within 0.9 s of UT1 -# (which measures the true angular orientation of the earth in space) +# (a proxy for Earth's angle in space as measured by astronomers) # and publishes leap second data in a copyrighted file # . # See: Levine J. Coordinated Universal Time and the leap second. # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995 # . -# There were no leap seconds before 1972, because the official mechanism -# accounting for the discrepancy between atomic time and the earth's rotation -# did not exist. The first ("1 Jan 1972") data line in leap-seconds.list +# There were no leap seconds before 1972, as no official mechanism +# accounted for the discrepancy between atomic time (TAI) and the earth's +# rotation. The first ("1 Jan 1972") data line in leap-seconds.list # does not denote a leap second; it denotes the start of the current definition # of UTC. -# The correction (+ or -) is made at the given time, so lines -# will typically look like: -# Leap YEAR MON DAY 23:59:60 + R/S -# or -# Leap YEAR MON DAY 23:59:59 - R/S - -# If the leap second is Rolling (R) the given time is local time (unused here). +# All leap-seconds are Stationary (S) at the given UTC time. +# The correction (+ or -) is made at the given time, so in the unlikely +# event of a negative leap second, a line would look like this: +# Leap YEAR MON DAY 23:59:59 - S +# Typical lines look like this: +# Leap YEAR MON DAY 23:59:60 + S Leap 1972 Jun 30 23:59:60 + S Leap 1972 Dec 31 23:59:60 + S Leap 1973 Dec 31 23:59:60 + S @@ -62,8 +65,8 @@ Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S # POSIX timestamps for the data in this file: -#updated 1467936000 -#expires 1577491200 +#updated 1467936000 (2016-07-08 00:00:00 UTC) +#expires 1593302400 (2020-06-28 00:00:00 UTC) -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 Modified: vendor/tzdata/dist/leapseconds.awk ============================================================================== --- vendor/tzdata/dist/leapseconds.awk Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/leapseconds.awk Thu Sep 12 00:15:06 2019 (r352236) @@ -1,43 +1,59 @@ -# Generate the 'leapseconds' file from 'leap-seconds.list'. +# Generate zic format 'leapseconds' from NIST format 'leap-seconds.list'. # This file is in the public domain. +# This program uses awk arithmetic. POSIX requires awk to support +# exact integer arithmetic only through 10**10, which means for NTP +# timestamps this program works only to the year 2216, which is the +# year 1900 plus 10**10 seconds. However, in practice +# POSIX-conforming awk implementations invariably use IEEE-754 double +# and so support exact integers through 2**53. By the year 2216, +# POSIX will almost surely require at least 2**53 for awk, so for NTP +# timestamps this program should be good until the year 285,428,681 +# (the year 1900 plus 2**53 seconds). By then leap seconds will be +# long obsolete, as the Earth will likely slow down so much that +# there will be more than 25 hours per day and so some other scheme +# will be needed. + BEGIN { print "# Allowance for leap seconds added to each time zone file." print "" print "# This file is in the public domain." print "" print "# This file is generated automatically from the data in the public-domain" - print "# leap-seconds.list file, which can be copied from" + print "# NIST format leap-seconds.list file, which can be copied from" print "# " - print "# or " - print "# or ." + print "# or ." print "# For more about leap-seconds.list, please see" print "# The NTP Timescale and Leap Seconds" print "# ." print "" - print "# The International Earth Rotation and Reference Systems Service" + print "# The rules for leap seconds are specified in Annex 1 (Time scales) of:" + print "# Standard-frequency and time-signal emissions." + print "# International Telecommunication Union - Radiocommunication Sector" + print "# (ITU-R) Recommendation TF.460-6 (02/2002)" + print "# ." + print "# The International Earth Rotation and Reference Systems Service (IERS)" print "# periodically uses leap seconds to keep UTC to within 0.9 s of UT1" - print "# (which measures the true angular orientation of the earth in space)" + print "# (a proxy for Earth's angle in space as measured by astronomers)" print "# and publishes leap second data in a copyrighted file" print "# ." print "# See: Levine J. Coordinated Universal Time and the leap second." print "# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995" print "# ." print "" - print "# There were no leap seconds before 1972, because the official mechanism" - print "# accounting for the discrepancy between atomic time and the earth's rotation" - print "# did not exist. The first (\"1 Jan 1972\") data line in leap-seconds.list" + print "# There were no leap seconds before 1972, as no official mechanism" + print "# accounted for the discrepancy between atomic time (TAI) and the earth's" + print "# rotation. The first (\"1 Jan 1972\") data line in leap-seconds.list" print "# does not denote a leap second; it denotes the start of the current definition" - print"# of UTC." + print "# of UTC." print "" - print "# The correction (+ or -) is made at the given time, so lines" - print "# will typically look like:" - print "# Leap YEAR MON DAY 23:59:60 + R/S" - print "# or" - print "# Leap YEAR MON DAY 23:59:59 - R/S" - print "" - print "# If the leap second is Rolling (R) the given time is local time (unused here)." + print "# All leap-seconds are Stationary (S) at the given UTC time." + print "# The correction (+ or -) is made at the given time, so in the unlikely" + print "# event of a negative leap second, a line would look like this:" + print "# Leap YEAR MON DAY 23:59:59 - S" + print "# Typical lines look like this:" + print "# Leap YEAR MON DAY 23:59:60 + S" monthabbr[ 1] = "Jan" monthabbr[ 2] = "Feb" @@ -51,45 +67,34 @@ BEGIN { monthabbr[10] = "Oct" monthabbr[11] = "Nov" monthabbr[12] = "Dec" - for (i in monthabbr) { - monthnum[monthabbr[i]] = i - monthlen[i] = 31 - } - monthlen[2] = 28 - monthlen[4] = monthlen[6] = monthlen[9] = monthlen[11] = 30 + + # Strip trailing CR, in case the input has CRLF form a la NIST. + RS = "\r?\n" + + sstamp_init() } -/^#\tUpdated through/ || /^#\tFile expires on:/ { +/^#[ \t]*[Uu]pdated through/ || /^#[ \t]*[Ff]ile expires on/ { last_lines = last_lines $0 "\n" } /^#[$][ \t]/ { updated = $2 } /^#[@][ \t]/ { expires = $2 } -/^#/ { next } +/^[ \t]*#/ { next } { NTP_timestamp = $1 TAI_minus_UTC = $2 - hash_mark = $3 - one = $4 - month = $5 - year = $6 if (old_TAI_minus_UTC) { if (old_TAI_minus_UTC < TAI_minus_UTC) { sign = "23:59:60\t+" } else { sign = "23:59:59\t-" } - m = monthnum[month] - 1 - if (m == 0) { - year--; - m = 12 - } - month = monthabbr[m] - day = monthlen[m] - day += m == 2 && year % 4 == 0 && (year % 100 != 0 || year % 400 == 0) - printf "Leap\t%s\t%s\t%s\t%s\tS\n", year, month, day, sign + sstamp_to_ymdhMs(NTP_timestamp - 1, ss_NTP) + printf "Leap\t%d\t%s\t%d\t%s\tS\n", \ + ss_year, monthabbr[ss_month], ss_mday, sign } old_TAI_minus_UTC = TAI_minus_UTC } @@ -102,7 +107,117 @@ END { print "" print "# POSIX timestamps for the data in this file:" - printf "#updated %s\n", updated - epoch_minus_NTP - printf "#expires %s\n", expires - epoch_minus_NTP + sstamp_to_ymdhMs(updated, ss_NTP) + printf "#updated %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \ + updated - epoch_minus_NTP, \ + ss_year, ss_month, ss_mday, ss_hour, ss_min, ss_sec + sstamp_to_ymdhMs(expires, ss_NTP) + printf "#expires %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \ + expires - epoch_minus_NTP, \ + ss_year, ss_month, ss_mday, ss_hour, ss_min, ss_sec + printf "\n%s", last_lines +} + +# sstamp_to_ymdhMs - convert seconds timestamp to date and time +# +# Call as: +# +# sstamp_to_ymdhMs(sstamp, epoch_days) +# +# where: +# +# sstamp - is the seconds timestamp. +# epoch_days - is the timestamp epoch in Gregorian days since 1600-03-01. +# ss_NTP is appropriate for an NTP sstamp. +# +# Both arguments should be nonnegative integers. +# On return, the following variables are set based on sstamp: +# +# ss_year - Gregorian calendar year +# ss_month - month of the year (1-January to 12-December) +# ss_mday - day of the month (1-31) +# ss_hour - hour (0-23) +# ss_min - minute (0-59) +# ss_sec - second (0-59) +# ss_wday - day of week (0-Sunday to 6-Saturday) +# +# The function sstamp_init should be called prior to using sstamp_to_ymdhMs. + +function sstamp_init() +{ + # Days in month N, where March is month 0 and January month 10. + ss_mon_days[ 0] = 31 + ss_mon_days[ 1] = 30 + ss_mon_days[ 2] = 31 + ss_mon_days[ 3] = 30 + ss_mon_days[ 4] = 31 + ss_mon_days[ 5] = 31 + ss_mon_days[ 6] = 30 + ss_mon_days[ 7] = 31 + ss_mon_days[ 8] = 30 + ss_mon_days[ 9] = 31 + ss_mon_days[10] = 31 + + # Counts of days in a Gregorian year, quad-year, century, and quad-century. + ss_year_days = 365 + ss_quadyear_days = ss_year_days * 4 + 1 + ss_century_days = ss_quadyear_days * 25 - 1 + ss_quadcentury_days = ss_century_days * 4 + 1 + + # Standard day epochs, suitable for epoch_days. + # ss_MJD = 94493 + # ss_POSIX = 135080 + ss_NTP = 109513 +} + +function sstamp_to_ymdhMs(sstamp, epoch_days, \ + quadcentury, century, quadyear, year, month, day) +{ + ss_hour = int(sstamp / 3600) % 24 + ss_min = int(sstamp / 60) % 60 + ss_sec = sstamp % 60 + + # Start with a count of days since 1600-03-01 Gregorian. + day = epoch_days + int(sstamp / (24 * 60 * 60)) + + # Compute a year-month-day date with days of the month numbered + # 0-30, months (March-February) numbered 0-11, and years that start + # start March 1 and end after the last day of February. A quad-year + # starts on March 1 of a year evenly divisible by 4 and ends after + # the last day of February 4 years later. A century starts on and + # ends before March 1 in years evenly divisible by 100. + # A quad-century starts on and ends before March 1 in years divisible + # by 400. While the number of days in a quad-century is a constant, + # the number of days in each other time period can vary by 1. + # Any variation is in the last day of the time period (there might + # or might not be a February 29) where it is easy to deal with. + + quadcentury = int(day / ss_quadcentury_days) + day -= quadcentury * ss_quadcentury_days + ss_wday = (day + 3) % 7 + century = int(day / ss_century_days) + century -= century == 4 + day -= century * ss_century_days + quadyear = int(day / ss_quadyear_days) + day -= quadyear * ss_quadyear_days + year = int(day / ss_year_days) + year -= year == 4 + day -= year * ss_year_days + for (month = 0; month < 11; month++) { + if (day < ss_mon_days[month]) + break + day -= ss_mon_days[month] + } + + # Convert the date to a conventional day of month (1-31), + # month (1-12, January-December) and Gregorian year. + ss_mday = day + 1 + if (month <= 9) { + ss_month = month + 3 + } else { + ss_month = month - 9 + year++ + } + ss_year = 1600 + quadcentury * 400 + century * 100 + quadyear * 4 + year } Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Wed Sep 11 23:45:58 2019 (r352235) +++ vendor/tzdata/dist/northamerica Thu Sep 12 00:15:06 2019 (r352236) @@ -406,6 +406,31 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03 # From Paul Eggert (2015-12-25): # Assume this practice predates 1970, so Fort Pierre can use America/Chicago. +# From Paul Eggert (2015-04-06): +# In 1950s Nashville a public clock had dueling faces, one for conservatives +# and the other for liberals; the two sides didn't agree about the time of day. +# I haven't found a photo of this clock, nor have I tracked down the TIME +# magazine report cited below, but here's the story as told by the late +# American journalist John Seigenthaler, who was there: +# +# "The two [newspaper] owners held strongly contrasting political and +# ideological views. Evans was a New South liberal, Stahlman an Old South +# conservative, and their two papers frequently clashed editorially, often on +# the same day.... In the 1950s as the state legislature was grappling with +# the question of whether to approve daylight saving time for the entire state, +# TIME magazine reported: +# +# "'The Nashville Banner and The Nashville Tennessean rarely agree on anything +# but the time of day - and last week they couldn't agree on that.' +# +# "It was all too true. The clock on the front of the building had two faces - +# The Tennessean side of the building facing west, the other, east. When it +# was high noon Banner time, it was 11 a.m. Tennessean time." +# +# Seigenthaler J. For 100 years, Tennessean had it covered. +# The Tennessean 2007-05-11, republished 2015-04-06. +# https://www.tennessean.com/story/insider/extras/2015/04/06/archives-seigenthaler-for-100-years-the-tennessean-had-it-covered/25348545/ + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -945,21 +970,21 @@ Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov -5:00 US E%sT # # Perry County, Indiana, switched from eastern to central time in April 2006. +# From Alois Triendl (2019-07-09): +# The Indianapolis News, Friday 27 October 1967 states that Perry County +# returned to CST. It went again to EST on 27 April 1969, as documented by the +# Indianapolis star of Saturday 26 April. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER -Rule Perry 1946 only - Apr lastSun 2:00 1:00 D -Rule Perry 1946 only - Sep lastSun 2:00 0 S -Rule Perry 1953 1954 - Apr lastSun 2:00 1:00 D -Rule Perry 1953 1959 - Sep lastSun 2:00 0 S Rule Perry 1955 only - May 1 0:00 1:00 D +Rule Perry 1955 1960 - Sep lastSun 2:00 0 S Rule Perry 1956 1963 - Apr lastSun 2:00 1:00 D -Rule Perry 1960 only - Oct lastSun 2:00 0 S -Rule Perry 1961 only - Sep lastSun 2:00 0 S -Rule Perry 1962 1963 - Oct lastSun 2:00 0 S +Rule Perry 1961 1963 - Oct lastSun 2:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Indiana/Tell_City -5:47:03 - LMT 1883 Nov 18 12:12:57 -6:00 US C%sT 1946 -6:00 Perry C%sT 1964 Apr 26 2:00 - -5:00 - EST 1969 + -5:00 - EST 1967 Oct 29 2:00 + -6:00 US C%sT 1969 Apr 27 2:00 -5:00 US E%sT 1971 -5:00 - EST 2006 Apr 2 2:00 -6:00 US C%sT @@ -1035,16 +1060,27 @@ Zone America/Indiana/Vevay -5:40:16 - LMT 1883 Nov 18 # clear how this matched civil time in Louisville, so for now continue # to assume Louisville switched at noon new local time, like New York. # +# From Michael Deckers (2019-08-06): +# From the contemporary source given by Alois Treindl, +# the switch in Louisville on 1946-04-28 was on 00:01 +# From Paul Eggert (2019-08-26): +# That source was the Louisville Courier-Journal, 1946-04-27, p 4. +# Shanks gives 02:00 for all 20th-century transition times in Louisville. +# Evidently this is wrong for spring 1946. Although also likely wrong +# for other dates, we have no data. +# # Part of Kentucky left its clocks alone in 1974. # This also includes Clark, Floyd, and Harrison counties in Indiana. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Sep 12 00:15:41 2019 Return-Path: Delivered-To: svn-src-all@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 41EBAE4600; Thu, 12 Sep 2019 00:15:41 +0000 (UTC) (envelope-from philip@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 46TK6j11bqz4Z1N; Thu, 12 Sep 2019 00:15:41 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E2C8FE864; Thu, 12 Sep 2019 00:15:40 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C0Fe3f051917; Thu, 12 Sep 2019 00:15:40 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C0FeBP051916; Thu, 12 Sep 2019 00:15:40 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201909120015.x8C0FeBP051916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 12 Sep 2019 00:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r352237 - vendor/tzdata/tzdata2019c X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/tzdata2019c X-SVN-Commit-Revision: 352237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 00:15:41 -0000 Author: philip Date: Thu Sep 12 00:15:40 2019 New Revision: 352237 URL: https://svnweb.freebsd.org/changeset/base/352237 Log: Tag import of tzdata2019c Added: vendor/tzdata/tzdata2019c/ - copied from r352236, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Thu Sep 12 00:19:19 2019 Return-Path: Delivered-To: svn-src-all@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 2973DE46F6; Thu, 12 Sep 2019 00:19:19 +0000 (UTC) (envelope-from philip@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 46TKBv12PJz4Z8p; Thu, 12 Sep 2019 00:19:19 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 012BFE865; Thu, 12 Sep 2019 00:19:19 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C0JID7052127; Thu, 12 Sep 2019 00:19:18 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C0JGX2052117; Thu, 12 Sep 2019 00:19:16 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201909120019.x8C0JGX2052117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 12 Sep 2019 00:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352238 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 352238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 00:19:19 -0000 Author: philip Date: Thu Sep 12 00:19:16 2019 New Revision: 352238 URL: https://svnweb.freebsd.org/changeset/base/352238 Log: Import tzdata 2019c Changes: https://github.com/eggert/tz/blob/2019c/NEWS MFC after: 3 days Modified: head/contrib/tzdata/NEWS head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backzone head/contrib/tzdata/europe head/contrib/tzdata/leap-seconds.list head/contrib/tzdata/leapseconds head/contrib/tzdata/leapseconds.awk head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/NEWS Thu Sep 12 00:19:16 2019 (r352238) @@ -1,5 +1,80 @@ News for the tz database +Release 2019c - 2019-09-11 08:59:48 -0700 + + Briefly: + Fiji observes DST from 2019-11-10 to 2020-01-12. + Norfolk Island starts observing Australian-style DST. + + Changes to future timestamps + + Fiji's next DST transitions will be 2019-11-10 and 2020-01-12 + instead of 2019-11-03 and 2020-01-19. (Thanks to Raymond Kumar.) + Adjust future guesses accordingly. + + Norfolk Island will observe Australian-style DST starting in + spring 2019. The first transition is on 2019-10-06. (Thanks to + Kyle Czech and Michael Deckers.) + + Changes to past timestamps + + Many corrections to time in Turkey from 1940 through 1985. + (Thanks to Oya Vulaş via Alois Treindl, and to Kıvanç Yazan.) + + The Norfolk Island 1975-03-02 transition was at 02:00 standard + time, not 02:00 DST. (Thanks to Michael Deckers.) + + South Korea observed DST from 1948 through 1951. Although this + info was supposed to appear in release 2014j, a typo inadvertently + suppressed the change. (Thanks to Alois Treindl.) + + Detroit observed DST in 1967 and 1968 following the US DST rules, + except that its 1967 DST began on June 14 at 00:01. (Thanks to + Alois Treindl for pointing out that the old data entries were + probably wrong.) + + Fix several errors in pre-1970 transitions in Perry County, IN. + (Thanks to Alois Triendl for pointing out the 1967/9 errors.) + + Edmonton did not observe DST in 1967 or 1969. In 1946 Vancouver + ended DST on 09-29 not 10-13, and Vienna ended DST on 10-07 not + 10-06. In 1945 Königsberg (now Kaliningrad) switched from +01/+02 + to +02/+03 on 04-10 not 01-01, and its +02/+03 is abbreviated + EET/EEST, not CET/CEST. (Thanks to Alois Triendl.) In 1946 + Königsberg switched to +03 on 04-07 not 01-01. + + In 1946 Louisville switched from CST to CDT on 04-28 at 00:01, not + 01-01 at 00:00. (Thanks to Alois Treindl and Michael Deckers.) + Also, it switched from CST to CDT on 1950-04-30, not 1947-04-27. + + The 1892-05-01 transition in Brussels was at 00:17:30, not at noon. + (Thanks to Michael Deckers.) + + Changes to past time zone abbreviations and DST flags + + Hong Kong Winter Time, observed from 1941-10-01 to 1941-12-25, + is now flagged as DST and is abbreviated HKWT not HKT. + + Changes to code + + leapseconds.awk now relies only on its input data, rather than + also relying on its comments. (Inspired by code from Dennis + Ferguson and Chris Woodbury.) + + The code now defends against CRLFs in leap-seconds.list. + (Thanks to Brian Inglis and Chris Woodbury.) + + Changes to documentation and commentary + + theory.html discusses leap seconds. (Thanks to Steve Summit.) + + Nashville's newspapers dueled about the time of day in the 1950s. + (Thanks to John Seigenthaler.) + + Liechtenstein observed Swiss DST in 1941/2. + (Thanks to Alois Treindl.) + + Release 2019b - 2019-07-01 00:09:53 -0700 Briefly: Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/asia Thu Sep 12 00:19:16 2019 (r352238) @@ -8,7 +8,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2018-06-19): +# From Paul Eggert (2019-07-11): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -47,13 +47,13 @@ # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China -# 8:00 PST PDT* Philippine Standard Time +# 8:00 HKT HKST Hong Kong (HKWT* for Winter Time in late 1941) +# 8:00 PST PDT* Philippines # 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea when at +09 -# 9:30 ACST Australian Central Standard Time -# *I invented the abbreviation PDT; see "Philippines" below. +# *I invented the abbreviations HKWT and PDT; see below. # Otherwise, these tables typically use numeric abbreviations like +03 # and +0330 for integer hour and minute UT offsets. Although earlier # editions invented alphabetic time zone abbreviations for every @@ -653,6 +653,15 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. # https://i.imgur.com/dge4kFJ.png +# From Paul Eggert (2019-07-11): +# "Hong Kong winter time" is considered to be daylight saving. +# "Hong Kong had adopted daylight saving on June 15 as a wartime measure, +# clocks moving forward one hour until October 1, when they would be put back +# by just half an hour for 'Hong Kong Winter time', so that daylight saving +# operated year round." -- Low Z. The longest day: when wartime Hong Kong +# introduced daylight saving. South China Morning Post. 2019-06-28. +# https://www.scmp.com/magazines/post-magazine/short-reads/article/3016281/longest-day-when-wartime-hong-kong-introduced + # From P Chan (2018-12-31): # * According to the Hong Kong Daylight-Saving Regulations, 1941, the # 1941 spring-forward transition was at 03:00. @@ -754,7 +763,7 @@ Rule HK 1979 only - Oct 21 3:30 0 - Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 8:00 - HKT 1941 Jun 15 3:00 8:00 1:00 HKST 1941 Oct 1 4:00 - 8:30 - HKT 1941 Dec 25 + 8:00 0:30 HKWT 1941 Dec 25 9:00 - JST 1945 Nov 18 2:00 8:00 HK HK%sT @@ -2419,7 +2428,7 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 8:30 - KST 1912 Jan 1 9:00 - JST 1945 Sep 8 - 9:00 - KST 1954 Mar 21 + 9:00 ROK K%sT 1954 Mar 21 8:30 ROK K%sT 1961 Aug 10 9:00 ROK K%sT Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 @@ -3604,7 +3613,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # and in South Vietnam in particular (after 1954): # To 07:00 on 1911-05-01. # To 08:00 on 1942-12-31 at 23:00. -# To 09:00 in 1945-03-14 at 23:00. +# To 09:00 on 1945-03-14 at 23:00. # To 07:00 on 1945-09-02 in Vietnam. # To 08:00 on 1947-04-01 in French-controlled Indochina. # To 07:00 on 1955-07-01 in South Vietnam. Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/australasia Thu Sep 12 00:19:16 2019 (r352238) @@ -367,13 +367,18 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # From Raymond Kumar (2018-07-13): # http://www.fijitimes.com/government-approves-2018-daylight-saving/ # ... The daylight saving period will end at 3am on Sunday January 13, 2019. -# -# From Paul Eggert (2018-07-15): -# For now, guess DST from 02:00 the first Sunday in November to 03:00 -# the first Sunday on or after January 13. January transitions reportedly + +# From Paul Eggert (2019-08-06): +# Today Raymond Kumar reported the Government of Fiji Gazette Supplement No. 27 +# (2019-08-02) said that Fiji observes DST "commencing at 2.00 am on +# Sunday, 10 November 2019 and ending at 3.00 am on Sunday, 12 January 2020." +# For now, guess DST from 02:00 the second Sunday in November to 03:00 +# the first Sunday on or after January 12. January transitions reportedly # depend on when school terms start. Although the guess is ad hoc, it matches -# transitions since late 2014 and seems more likely to match future -# practice than guessing no DST. +# transitions planned this year and seems more likely to match future practice +# than guessing no DST. +# From Michael Deckers (2019-08-06): +# https://www.laws.gov.fj/LawsAsMade/downloadfile/848 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - @@ -384,8 +389,9 @@ Rule Fiji 2010 2013 - Oct Sun>=21 2:00 1:00 - Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - -Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 - -Rule Fiji 2015 max - Jan Sun>=13 3:00 0 - +Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - +Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - +Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 @@ -604,10 +610,11 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Alofi # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - +1112 1951 - 11:30 - +1130 1974 Oct 27 02:00 - 11:30 1:00 +1230 1975 Mar 2 02:00 - 11:30 - +1130 2015 Oct 4 02:00 - 11:00 - +11 + 11:30 - +1130 1974 Oct 27 02:00s + 11:30 1:00 +1230 1975 Mar 2 02:00s + 11:30 - +1130 2015 Oct 4 02:00s + 11:00 - +11 2019 Jul + 11:00 AN +11/+12 # Palau (Belau) # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -1875,12 +1882,21 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. # http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf -# From Paul Eggert (2015-09-23): +# From Paul Eggert (2019-08-28): # Transitions before 2015 are from timeanddate.com, which consulted # the Norfolk Island Museum and the Australian Bureau of Meteorology's # Norfolk Island station, and found no record of Norfolk observing DST # other than in 1974/5. See: # https://www.timeanddate.com/time/australia/norfolk-island.html +# However, disagree with timeanddate about the 1975-03-02 transition; +# timeanddate has 02:00 but 02:00s corresponds to what the NSW law said +# (thanks to Michael Deckers). + +# Norfolk started observing Australian DST in spring 2019. +# From Kyle Czech (2019-08-13): +# https://www.legislation.gov.au/Details/F2018L01702 +# From Michael Deckers (2019-08-14): +# https://www.legislation.gov.au/Details/F2019C00010 # Palau # See commentary for Micronesia. Modified: head/contrib/tzdata/backzone ============================================================================== --- head/contrib/tzdata/backzone Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/backzone Thu Sep 12 00:19:16 2019 (r352238) @@ -507,19 +507,35 @@ Zone Asia/Muscat 3:54:24 - LMT 1920 #Zone Asia/Panaji [not enough info to complete] # Cambodia -# From Paul Eggert (2014-10-11): -# See Asia/Ho_Chi_Minh for the source for most of this data. Also, guess -# (1) Cambodia reverted to UT +07 on 1945-09-02, when Vietnam did, and -# (2) they also reverted to +07 on 1953-11-09, the date of independence. -# These guesses are probably wrong but they're better than guessing no -# transitions there. + +# From an adoptive daughter of the late Cambodian ruler Prince Sihanouk, +# via Alois Treindl (2019-08-08): +# +# King Sihanouk said that, during the Japanese occupation, starting with +# what historians refer to as "le coup de force du 9 mars 1945", Cambodia, +# like the entire French Indochina, used Tokyo time zone. After Japan +# surrendered, 2 September 1945, Cambodia fell under French rule again and +# adopted Hanoi time zone again. +# +# However, on 7 January 1946, Sihanouk and Tioulong managed to obtain a +# status of "internal autonomy" from the government of Charles de Gaulle. +# Although many fields remained under the administration of the French +# (customs, taxes, justice, defence, foreign affairs, etc.), the Cambodian +# administration was responsible for religious matters and traditional +# celebrations, which included our calendar and time. The time zone was GMT +# + 7 and _no_ DST was applied. +# +# After Sihanouk and Tioulong achieved full independence, on 9 November 1953, +# GMT + 7 was maintained. + +# From Paul Eggert (2019-08-26): +# See Asia/Ho_Chi_Minh for the source for most of rest of this data. + Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jul 1 7:06:30 - PLMT 1911 May 1 7:00 - +07 1942 Dec 31 23:00 8:00 - +08 1945 Mar 14 23:00 9:00 - +09 1945 Sep 2 - 7:00 - +07 1947 Apr 1 - 8:00 - +08 1953 Nov 9 7:00 - +07 # Israel @@ -646,7 +662,7 @@ Zone Europe/Tiraspol 1:58:32 - LMT 1880 # Liechtenstein Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun - 1:00 - CET 1981 + 1:00 Swiss CE%sT 1981 1:00 EU CE%sT # Croatia Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/europe Thu Sep 12 00:19:16 2019 (r352238) @@ -821,11 +821,16 @@ Zone Europe/Andorra 0:06:04 - LMT 1901 # Shanks & Pottenger give 02:00, the BEV 00:00. Go with the BEV, # and guess 02:00 for 1945-04-12. +# From Alois Triendl (2019-07-22): +# In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am. +# Shanks had this right. Source: Die Weltpresse, 5. Oktober 1946, page 5. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Austria 1920 only - Apr 5 2:00s 1:00 S Rule Austria 1920 only - Sep 13 2:00s 0 - Rule Austria 1946 only - Apr 14 2:00s 1:00 S -Rule Austria 1946 1948 - Oct Sun>=1 2:00s 0 - +Rule Austria 1946 only - Oct 7 2:00s 0 - +Rule Austria 1947 1948 - Oct Sun>=1 2:00s 0 - Rule Austria 1947 only - Apr 6 2:00s 1:00 S Rule Austria 1948 only - Apr 18 2:00s 1:00 S Rule Austria 1980 only - Apr 6 0:00 1:00 S @@ -875,15 +880,35 @@ Zone Europe/Minsk 1:50:16 - LMT 1880 # Belgium # -# From Paul Eggert (1997-07-02): +# From Michael Deckers (2019-08-25): +# The exposition in the web page +# https://www.bestor.be/wiki/index.php/Voyager_dans_le_temps._L%E2%80%99introduction_de_la_norme_de_Greenwich_en_Belgique +# gives several contemporary sources from which one can conclude that +# the switch in Europe/Brussels on 1892-05-01 was from 00:17:30 to 00:00:00. +# +# From Paul Eggert (2019-08-28): +# This quote helps explain the late-1914 situation: +# In early November 1914, the Germans imposed the time zone used in central +# Europe and forced the inhabitants to set their watches and public clocks +# sixty minutes ahead. Many were reluctant to accept "German time" and +# continued to use "Belgian time" among themselves. Reflecting the spirit of +# resistance that arose in the population, a song made fun of this change.... +# The song ended: +# Putting your clock forward +# Will but hasten the happy hour +# When we kick out the Boches! +# See: Pluvinage G. Brussels on German time. Cahiers Bruxellois - +# Brusselse Cahiers. 2014;XLVI(1E):15-38. +# https://www.cairn.info/revue-cahiers-bruxellois-2014-1E-page-15.htm +# +# Entries from 1914 through 1917 are taken from "De tijd in België" +# . # Entries from 1918 through 1991 are taken from: # Annuaire de L'Observatoire Royal de Belgique, # Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe année, 1991 # (Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC), # pp 8-9. -# LMT before 1892 was 0:17:30, according to the official journal of Belgium: -# Moniteur Belge, Samedi 30 Avril 1892, N.121. -# Thanks to Pascal Delmoitie for these references. +# Thanks to Pascal Delmoitie for the 1918/1991 references. # The 1918 rules are listed for completeness; they apply to unoccupied Belgium. # Assume Brussels switched to WET in 1918 when the armistice took effect. # @@ -928,7 +953,7 @@ Rule Belgium 1946 only - May 19 2:00s 1:00 S Rule Belgium 1946 only - Oct 7 2:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Europe/Brussels 0:17:30 - LMT 1880 - 0:17:30 - BMT 1892 May 1 12:00 # Brussels MT + 0:17:30 - BMT 1892 May 1 00:17:30 0:00 - WET 1914 Nov 8 1:00 - CET 1916 May 1 0:00 1:00 C-Eur CE%sT 1918 Nov 11 11:00u @@ -1627,6 +1652,13 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908 # advanced to sixty minutes later starting at hour two on 1944-04-02; ... # Starting at hour three on the date 1944-09-17 standard time will be resumed. # +# From Alois Triendl (2019-07-02): +# I spent 6 Euros to buy two archive copies of Il Messaggero, a Roman paper, +# for 1 and 2 April 1944. The edition of 2 April has this note: "Tonight at 2 +# am, put forward the clock by one hour. Remember that in the night between +# today and Monday the 'ora legale' will come in force again." That makes it +# clear that in Rome the change was on Monday, 3 April 1944 at 2 am. +# # From Paul Eggert (2016-10-27): # Go with INRiM for DST rules, except as corrected by Inglis for 1944 # for the Kingdom of Italy. This is consistent with Renzo Baldini. @@ -1774,15 +1806,10 @@ Zone Europe/Riga 1:36:34 - LMT 1880 # From Paul Eggert (2013-09-09): # Shanks & Pottenger say Vaduz is like Zurich. -# From Alois Treindl (2013-09-18): -# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf -# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942. -# I ... translate only the last two paragraphs: -# ... during second world war, in the years 1941 and 1942, Liechtenstein -# introduced daylight saving time, adapting to Switzerland. From 1943 on -# central European time was in force throughout the year. -# From a report of the duke's government to the high council, -# regarding the introduction of a time law, of 31 May 1977. +# From Alois Treindl (2019-07-04): +# I was able to access the online archive of the Vaduz paper Vaterland ... +# I could confirm from the paper that Liechtenstein did in fact follow +# the same DST in 1941 and 1942 as Switzerland did. Link Europe/Zurich Europe/Vaduz @@ -2490,6 +2517,12 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # Europe/Kaliningrad covers... # 39 RU-KGD Kaliningrad Oblast +# From Paul Eggert (2019-07-25): +# Although Shanks lists 1945-01-01 as the date for transition from +# +01/+02 to +02/+03, more likely this is a placeholder. Guess that +# the transition occurred at 1945-04-10 00:00, which is about when +# Königsberg surrendered to Soviet troops. (Thanks to Alois Triendl.) + # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). @@ -2506,8 +2539,8 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # Moscow on 1991-11-03, switched to Moscow-1 on 1992-01-19. Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr - 1:00 C-Eur CE%sT 1945 - 2:00 Poland CE%sT 1946 + 1:00 C-Eur CE%sT 1945 Apr 10 + 2:00 Poland EE%sT 1946 Apr 7 3:00 Russia MSK/MSD 1989 Mar 26 2:00s 2:00 Russia EE%sT 2011 Mar 27 2:00s 3:00 - +03 2014 Oct 26 2:00s @@ -3650,20 +3683,75 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See abo # Turkey +# From Alois Treindl (2019-08-12): +# http://www.astrolojidergisi.com/yazsaati.htm has researched the time zone +# history of Turkey, based on newspaper archives and official documents. +# From Paul Eggert (2019-08-28): +# That source (Oya Vulaş, "Türkiye'de Yaz Saati Uygulamaları") +# is used for 1940/1972, where it seems more reliable than our other +# sources. + +# From Kıvanç Yazan (2019-08-12): +# http://www.resmigazete.gov.tr/arsiv/14539.pdf#page=24 +# 1973-06-03 01:00 -> 02:00, 1973-11-04 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/14829.pdf#page=1 +# 1974-03-31 02:00 -> 03:00, 1974-11-03 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15161.pdf#page=1 +# 1975-03-22 02:00 -> 03:00, 1975-11-02 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15535_1.pdf#page=1 +# 1976-03-21 02:00 -> 03:00, 1976-10-31 02:00 -> 01:00 +# +# http://www.resmigazete.gov.tr/arsiv/15778.pdf#page=5 +# 1977-04-03 02:00 -> 03:00, 1977-10-16 02:00 -> 01:00, +# 1978-04-02 02:00 -> 03:00 (not applied, see below) +# 1978-10-15 02:00 -> 01:00 (not applied, see below) +# 1979-04-01 02:00 -> 03:00 (not applied, see below) +# 1979-10-14 02:00 -> 01:00 (not applied, see below) +# +# http://www.resmigazete.gov.tr/arsiv/16245.pdf#page=17 +# This cancels the previous decision, and repeats it only for 1978. +# 1978-04-02 02:00 -> 03:00, 1978-10-15 02:00 -> 01:00 +# (not applied due to standard TZ change below) +# +# http://www.resmigazete.gov.tr/arsiv/16331.pdf#page=3 +# This decision changes the default longitude for Turkish time zone from 30 +# degrees East to 45 degrees East. This means a standard TZ change, from +2 +# to +3. This is published & applied on 1978-06-29. At that time, Turkey was +# already on summer time (already on 45E). Hence, this new law just meant an +# "continuous summer time". Note that this was reversed in a few years. +# +# http://www.resmigazete.gov.tr/arsiv/18119_1.pdf#page=1 +# 1983-07-31 02:00 -> 03:00 (note that this jumps TZ to +4) +# 1983-10-02 02:00 -> 01:00 (back to +3) +# +# http://www.resmigazete.gov.tr/arsiv/18561.pdf (page 1 and 34) +# At this time, Turkey is still on +3 with no spring-forward on early +# 1984. This decision is published on 10/31/1984. Page 1 declares +# the decision of reverting the "default longitude change". So the +# standard time should go back to +3 (30E). And page 34 explains when +# that will happen: 1984-11-01 02:00 -> 01:00. You can think of this +# as "end of continuous summer time, change of standard time zone". +# +# http://www.resmigazete.gov.tr/arsiv/18713.pdf#page=1 +# 1985-04-20 01:00 -> 02:00, 1985-09-28 02:00 -> 01:00 + # From Kıvanç Yazan (2016-09-25): # 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with # no exceptions. # 2) 1994's lastSun was overridden with Mar 20 ... # Here are official papers: -# http://www.resmigazete.gov.tr/arsiv/19032.pdf - page 2 for 1986 -# http://www.resmigazete.gov.tr/arsiv/19400.pdf - page 4 for 1987 -# http://www.resmigazete.gov.tr/arsiv/19752.pdf - page 15 for 1988 -# http://www.resmigazete.gov.tr/arsiv/20102.pdf - page 6 for 1989 -# http://www.resmigazete.gov.tr/arsiv/20464.pdf - page 1 for 1990 - 1992 -# http://www.resmigazete.gov.tr/arsiv/21531.pdf - page 15 for 1993 - 1995 -# http://www.resmigazete.gov.tr/arsiv/21879.pdf - page 1 for overriding 1994 -# http://www.resmigazete.gov.tr/arsiv/22588.pdf - page 1 for 1996, 1997 -# http://www.resmigazete.gov.tr/arsiv/23286.pdf - page 10 for 1998 - 2000 +# http://www.resmigazete.gov.tr/arsiv/19032.pdf#page=2 for 1986 +# http://www.resmigazete.gov.tr/arsiv/19400.pdf#page=4 for 1987 +# http://www.resmigazete.gov.tr/arsiv/19752.pdf#page=15 for 1988 +# http://www.resmigazete.gov.tr/arsiv/20102.pdf#page=6 for 1989 +# http://www.resmigazete.gov.tr/arsiv/20464.pdf#page=1 for 1990 - 1992 +# http://www.resmigazete.gov.tr/arsiv/21531.pdf#page=15 for 1993 - 1995 +# http://www.resmigazete.gov.tr/arsiv/21879.pdf#page=1 for overriding 1994 +# http://www.resmigazete.gov.tr/arsiv/22588.pdf#page=1 for 1996, 1997 +# http://www.resmigazete.gov.tr/arsiv/23286.pdf#page=10 for 1998 - 2000 # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 # From Paul Eggert (2016-09-25): @@ -3747,46 +3835,36 @@ Rule Turkey 1922 only - Oct 8 0:00 0 - Rule Turkey 1924 only - May 13 0:00 1:00 S Rule Turkey 1924 1925 - Oct 1 0:00 0 - Rule Turkey 1925 only - May 1 0:00 1:00 S -Rule Turkey 1940 only - Jun 30 0:00 1:00 S -Rule Turkey 1940 only - Oct 5 0:00 0 - +Rule Turkey 1940 only - Jul 1 0:00 1:00 S +Rule Turkey 1940 only - Oct 6 0:00 0 - Rule Turkey 1940 only - Dec 1 0:00 1:00 S Rule Turkey 1941 only - Sep 21 0:00 0 - Rule Turkey 1942 only - Apr 1 0:00 1:00 S -# Whitman omits the next two transition and gives 1945 Oct 1; -# go with Shanks & Pottenger. -Rule Turkey 1942 only - Nov 1 0:00 0 - -Rule Turkey 1945 only - Apr 2 0:00 1:00 S Rule Turkey 1945 only - Oct 8 0:00 0 - Rule Turkey 1946 only - Jun 1 0:00 1:00 S Rule Turkey 1946 only - Oct 1 0:00 0 - Rule Turkey 1947 1948 - Apr Sun>=16 0:00 1:00 S -Rule Turkey 1947 1950 - Oct Sun>=2 0:00 0 - +Rule Turkey 1947 1951 - Oct Sun>=2 0:00 0 - Rule Turkey 1949 only - Apr 10 0:00 1:00 S -Rule Turkey 1950 only - Apr 19 0:00 1:00 S +Rule Turkey 1950 only - Apr 16 0:00 1:00 S Rule Turkey 1951 only - Apr 22 0:00 1:00 S -Rule Turkey 1951 only - Oct 8 0:00 0 - +# DST for 15 months; unusual but we'll let it pass. Rule Turkey 1962 only - Jul 15 0:00 1:00 S -Rule Turkey 1962 only - Oct 8 0:00 0 - +Rule Turkey 1963 only - Oct 30 0:00 0 - Rule Turkey 1964 only - May 15 0:00 1:00 S Rule Turkey 1964 only - Oct 1 0:00 0 - -Rule Turkey 1970 1972 - May Sun>=2 0:00 1:00 S -Rule Turkey 1970 1972 - Oct Sun>=2 0:00 0 - Rule Turkey 1973 only - Jun 3 1:00 1:00 S -Rule Turkey 1973 only - Nov 4 3:00 0 - +Rule Turkey 1973 1976 - Oct Sun>=31 2:00 0 - Rule Turkey 1974 only - Mar 31 2:00 1:00 S -Rule Turkey 1974 only - Nov 3 5:00 0 - -Rule Turkey 1975 only - Mar 30 0:00 1:00 S -Rule Turkey 1975 1976 - Oct lastSun 0:00 0 - -Rule Turkey 1976 only - Jun 1 0:00 1:00 S -Rule Turkey 1977 1978 - Apr Sun>=1 0:00 1:00 S -Rule Turkey 1977 only - Oct 16 0:00 0 - -Rule Turkey 1979 1980 - Apr Sun>=1 3:00 1:00 S -Rule Turkey 1979 1982 - Oct Mon>=11 0:00 0 - -Rule Turkey 1981 1982 - Mar lastSun 3:00 1:00 S -Rule Turkey 1983 only - Jul 31 0:00 1:00 S -Rule Turkey 1983 only - Oct 2 0:00 0 - -Rule Turkey 1985 only - Apr 20 0:00 1:00 S -Rule Turkey 1985 only - Sep 28 0:00 0 - +Rule Turkey 1975 only - Mar 22 2:00 1:00 S +Rule Turkey 1976 only - Mar 21 2:00 1:00 S +Rule Turkey 1977 1978 - Apr Sun>=1 2:00 1:00 S +Rule Turkey 1977 1978 - Oct Sun>=15 2:00 0 - +Rule Turkey 1978 only - Jun 29 0:00 0 - +Rule Turkey 1983 only - Jul 31 2:00 1:00 S +Rule Turkey 1983 only - Oct 2 2:00 0 - +Rule Turkey 1985 only - Apr 20 1:00s 1:00 S +Rule Turkey 1985 only - Sep 28 1:00s 0 - Rule Turkey 1986 1993 - Mar lastSun 1:00s 1:00 S Rule Turkey 1986 1995 - Sep lastSun 1:00s 0 - Rule Turkey 1994 only - Mar 20 1:00s 1:00 S @@ -3795,8 +3873,8 @@ Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Europe/Istanbul 1:55:52 - LMT 1880 1:56:56 - IMT 1910 Oct # Istanbul Mean Time? - 2:00 Turkey EE%sT 1978 Oct 15 - 3:00 Turkey +03/+04 1985 Apr 20 + 2:00 Turkey EE%sT 1978 Jun 29 + 3:00 Turkey +03/+04 1984 Nov 1 2:00 2:00 Turkey EE%sT 2007 2:00 EU EE%sT 2011 Mar 27 1:00u 2:00 - EET 2011 Mar 28 1:00u Modified: head/contrib/tzdata/leap-seconds.list ============================================================================== --- head/contrib/tzdata/leap-seconds.list Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/leap-seconds.list Thu Sep 12 00:19:16 2019 (r352238) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 # -#@ 3786480000 +#@ 3802291200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a +#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 Modified: head/contrib/tzdata/leapseconds ============================================================================== --- head/contrib/tzdata/leapseconds Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/leapseconds Thu Sep 12 00:19:16 2019 (r352238) @@ -3,36 +3,39 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# leap-seconds.list file, which can be copied from +# NIST format leap-seconds.list file, which can be copied from # -# or -# or . +# or . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds # . -# The International Earth Rotation and Reference Systems Service +# The rules for leap seconds are specified in Annex 1 (Time scales) of: +# Standard-frequency and time-signal emissions. +# International Telecommunication Union - Radiocommunication Sector +# (ITU-R) Recommendation TF.460-6 (02/2002) +# . +# The International Earth Rotation and Reference Systems Service (IERS) # periodically uses leap seconds to keep UTC to within 0.9 s of UT1 -# (which measures the true angular orientation of the earth in space) +# (a proxy for Earth's angle in space as measured by astronomers) # and publishes leap second data in a copyrighted file # . # See: Levine J. Coordinated Universal Time and the leap second. # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995 # . -# There were no leap seconds before 1972, because the official mechanism -# accounting for the discrepancy between atomic time and the earth's rotation -# did not exist. The first ("1 Jan 1972") data line in leap-seconds.list +# There were no leap seconds before 1972, as no official mechanism +# accounted for the discrepancy between atomic time (TAI) and the earth's +# rotation. The first ("1 Jan 1972") data line in leap-seconds.list # does not denote a leap second; it denotes the start of the current definition # of UTC. -# The correction (+ or -) is made at the given time, so lines -# will typically look like: -# Leap YEAR MON DAY 23:59:60 + R/S -# or -# Leap YEAR MON DAY 23:59:59 - R/S - -# If the leap second is Rolling (R) the given time is local time (unused here). +# All leap-seconds are Stationary (S) at the given UTC time. +# The correction (+ or -) is made at the given time, so in the unlikely +# event of a negative leap second, a line would look like this: +# Leap YEAR MON DAY 23:59:59 - S +# Typical lines look like this: +# Leap YEAR MON DAY 23:59:60 + S Leap 1972 Jun 30 23:59:60 + S Leap 1972 Dec 31 23:59:60 + S Leap 1973 Dec 31 23:59:60 + S @@ -62,8 +65,8 @@ Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S # POSIX timestamps for the data in this file: -#updated 1467936000 -#expires 1577491200 +#updated 1467936000 (2016-07-08 00:00:00 UTC) +#expires 1593302400 (2020-06-28 00:00:00 UTC) -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 Modified: head/contrib/tzdata/leapseconds.awk ============================================================================== --- head/contrib/tzdata/leapseconds.awk Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/leapseconds.awk Thu Sep 12 00:19:16 2019 (r352238) @@ -1,43 +1,59 @@ -# Generate the 'leapseconds' file from 'leap-seconds.list'. +# Generate zic format 'leapseconds' from NIST format 'leap-seconds.list'. # This file is in the public domain. +# This program uses awk arithmetic. POSIX requires awk to support +# exact integer arithmetic only through 10**10, which means for NTP +# timestamps this program works only to the year 2216, which is the +# year 1900 plus 10**10 seconds. However, in practice +# POSIX-conforming awk implementations invariably use IEEE-754 double +# and so support exact integers through 2**53. By the year 2216, +# POSIX will almost surely require at least 2**53 for awk, so for NTP +# timestamps this program should be good until the year 285,428,681 +# (the year 1900 plus 2**53 seconds). By then leap seconds will be +# long obsolete, as the Earth will likely slow down so much that +# there will be more than 25 hours per day and so some other scheme +# will be needed. + BEGIN { print "# Allowance for leap seconds added to each time zone file." print "" print "# This file is in the public domain." print "" print "# This file is generated automatically from the data in the public-domain" - print "# leap-seconds.list file, which can be copied from" + print "# NIST format leap-seconds.list file, which can be copied from" print "# " - print "# or " - print "# or ." + print "# or ." print "# For more about leap-seconds.list, please see" print "# The NTP Timescale and Leap Seconds" print "# ." print "" - print "# The International Earth Rotation and Reference Systems Service" + print "# The rules for leap seconds are specified in Annex 1 (Time scales) of:" + print "# Standard-frequency and time-signal emissions." + print "# International Telecommunication Union - Radiocommunication Sector" + print "# (ITU-R) Recommendation TF.460-6 (02/2002)" + print "# ." + print "# The International Earth Rotation and Reference Systems Service (IERS)" print "# periodically uses leap seconds to keep UTC to within 0.9 s of UT1" - print "# (which measures the true angular orientation of the earth in space)" + print "# (a proxy for Earth's angle in space as measured by astronomers)" print "# and publishes leap second data in a copyrighted file" print "# ." print "# See: Levine J. Coordinated Universal Time and the leap second." print "# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995" print "# ." print "" - print "# There were no leap seconds before 1972, because the official mechanism" - print "# accounting for the discrepancy between atomic time and the earth's rotation" - print "# did not exist. The first (\"1 Jan 1972\") data line in leap-seconds.list" + print "# There were no leap seconds before 1972, as no official mechanism" + print "# accounted for the discrepancy between atomic time (TAI) and the earth's" + print "# rotation. The first (\"1 Jan 1972\") data line in leap-seconds.list" print "# does not denote a leap second; it denotes the start of the current definition" - print"# of UTC." + print "# of UTC." print "" - print "# The correction (+ or -) is made at the given time, so lines" - print "# will typically look like:" - print "# Leap YEAR MON DAY 23:59:60 + R/S" - print "# or" - print "# Leap YEAR MON DAY 23:59:59 - R/S" - print "" - print "# If the leap second is Rolling (R) the given time is local time (unused here)." + print "# All leap-seconds are Stationary (S) at the given UTC time." + print "# The correction (+ or -) is made at the given time, so in the unlikely" + print "# event of a negative leap second, a line would look like this:" + print "# Leap YEAR MON DAY 23:59:59 - S" + print "# Typical lines look like this:" + print "# Leap YEAR MON DAY 23:59:60 + S" monthabbr[ 1] = "Jan" monthabbr[ 2] = "Feb" @@ -51,45 +67,34 @@ BEGIN { monthabbr[10] = "Oct" monthabbr[11] = "Nov" monthabbr[12] = "Dec" - for (i in monthabbr) { - monthnum[monthabbr[i]] = i - monthlen[i] = 31 - } - monthlen[2] = 28 - monthlen[4] = monthlen[6] = monthlen[9] = monthlen[11] = 30 + + # Strip trailing CR, in case the input has CRLF form a la NIST. + RS = "\r?\n" + + sstamp_init() } -/^#\tUpdated through/ || /^#\tFile expires on:/ { +/^#[ \t]*[Uu]pdated through/ || /^#[ \t]*[Ff]ile expires on/ { last_lines = last_lines $0 "\n" } /^#[$][ \t]/ { updated = $2 } /^#[@][ \t]/ { expires = $2 } -/^#/ { next } +/^[ \t]*#/ { next } { NTP_timestamp = $1 TAI_minus_UTC = $2 - hash_mark = $3 - one = $4 - month = $5 - year = $6 if (old_TAI_minus_UTC) { if (old_TAI_minus_UTC < TAI_minus_UTC) { sign = "23:59:60\t+" } else { sign = "23:59:59\t-" } - m = monthnum[month] - 1 - if (m == 0) { - year--; - m = 12 - } - month = monthabbr[m] - day = monthlen[m] - day += m == 2 && year % 4 == 0 && (year % 100 != 0 || year % 400 == 0) - printf "Leap\t%s\t%s\t%s\t%s\tS\n", year, month, day, sign + sstamp_to_ymdhMs(NTP_timestamp - 1, ss_NTP) + printf "Leap\t%d\t%s\t%d\t%s\tS\n", \ + ss_year, monthabbr[ss_month], ss_mday, sign } old_TAI_minus_UTC = TAI_minus_UTC } @@ -102,7 +107,117 @@ END { print "" print "# POSIX timestamps for the data in this file:" - printf "#updated %s\n", updated - epoch_minus_NTP - printf "#expires %s\n", expires - epoch_minus_NTP + sstamp_to_ymdhMs(updated, ss_NTP) + printf "#updated %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \ + updated - epoch_minus_NTP, \ + ss_year, ss_month, ss_mday, ss_hour, ss_min, ss_sec + sstamp_to_ymdhMs(expires, ss_NTP) + printf "#expires %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \ + expires - epoch_minus_NTP, \ + ss_year, ss_month, ss_mday, ss_hour, ss_min, ss_sec + printf "\n%s", last_lines +} + +# sstamp_to_ymdhMs - convert seconds timestamp to date and time +# +# Call as: +# +# sstamp_to_ymdhMs(sstamp, epoch_days) +# +# where: +# +# sstamp - is the seconds timestamp. +# epoch_days - is the timestamp epoch in Gregorian days since 1600-03-01. +# ss_NTP is appropriate for an NTP sstamp. +# +# Both arguments should be nonnegative integers. +# On return, the following variables are set based on sstamp: +# +# ss_year - Gregorian calendar year +# ss_month - month of the year (1-January to 12-December) +# ss_mday - day of the month (1-31) +# ss_hour - hour (0-23) +# ss_min - minute (0-59) +# ss_sec - second (0-59) +# ss_wday - day of week (0-Sunday to 6-Saturday) +# +# The function sstamp_init should be called prior to using sstamp_to_ymdhMs. + +function sstamp_init() +{ + # Days in month N, where March is month 0 and January month 10. + ss_mon_days[ 0] = 31 + ss_mon_days[ 1] = 30 + ss_mon_days[ 2] = 31 + ss_mon_days[ 3] = 30 + ss_mon_days[ 4] = 31 + ss_mon_days[ 5] = 31 + ss_mon_days[ 6] = 30 + ss_mon_days[ 7] = 31 + ss_mon_days[ 8] = 30 + ss_mon_days[ 9] = 31 + ss_mon_days[10] = 31 + + # Counts of days in a Gregorian year, quad-year, century, and quad-century. + ss_year_days = 365 + ss_quadyear_days = ss_year_days * 4 + 1 + ss_century_days = ss_quadyear_days * 25 - 1 + ss_quadcentury_days = ss_century_days * 4 + 1 + + # Standard day epochs, suitable for epoch_days. + # ss_MJD = 94493 + # ss_POSIX = 135080 + ss_NTP = 109513 +} + +function sstamp_to_ymdhMs(sstamp, epoch_days, \ + quadcentury, century, quadyear, year, month, day) +{ + ss_hour = int(sstamp / 3600) % 24 + ss_min = int(sstamp / 60) % 60 + ss_sec = sstamp % 60 + + # Start with a count of days since 1600-03-01 Gregorian. + day = epoch_days + int(sstamp / (24 * 60 * 60)) + + # Compute a year-month-day date with days of the month numbered + # 0-30, months (March-February) numbered 0-11, and years that start + # start March 1 and end after the last day of February. A quad-year + # starts on March 1 of a year evenly divisible by 4 and ends after + # the last day of February 4 years later. A century starts on and + # ends before March 1 in years evenly divisible by 100. + # A quad-century starts on and ends before March 1 in years divisible + # by 400. While the number of days in a quad-century is a constant, + # the number of days in each other time period can vary by 1. + # Any variation is in the last day of the time period (there might + # or might not be a February 29) where it is easy to deal with. + + quadcentury = int(day / ss_quadcentury_days) + day -= quadcentury * ss_quadcentury_days + ss_wday = (day + 3) % 7 + century = int(day / ss_century_days) + century -= century == 4 + day -= century * ss_century_days + quadyear = int(day / ss_quadyear_days) + day -= quadyear * ss_quadyear_days + year = int(day / ss_year_days) + year -= year == 4 + day -= year * ss_year_days + for (month = 0; month < 11; month++) { + if (day < ss_mon_days[month]) + break + day -= ss_mon_days[month] + } + + # Convert the date to a conventional day of month (1-31), + # month (1-12, January-December) and Gregorian year. + ss_mday = day + 1 + if (month <= 9) { + ss_month = month + 3 + } else { + ss_month = month - 9 + year++ + } + ss_year = 1600 + quadcentury * 400 + century * 100 + quadyear * 4 + year } Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Thu Sep 12 00:15:40 2019 (r352237) +++ head/contrib/tzdata/northamerica Thu Sep 12 00:19:16 2019 (r352238) @@ -406,6 +406,31 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03 # From Paul Eggert (2015-12-25): # Assume this practice predates 1970, so Fort Pierre can use America/Chicago. +# From Paul Eggert (2015-04-06): +# In 1950s Nashville a public clock had dueling faces, one for conservatives +# and the other for liberals; the two sides didn't agree about the time of day. +# I haven't found a photo of this clock, nor have I tracked down the TIME +# magazine report cited below, but here's the story as told by the late +# American journalist John Seigenthaler, who was there: +# +# "The two [newspaper] owners held strongly contrasting political and +# ideological views. Evans was a New South liberal, Stahlman an Old South +# conservative, and their two papers frequently clashed editorially, often on +# the same day.... In the 1950s as the state legislature was grappling with +# the question of whether to approve daylight saving time for the entire state, +# TIME magazine reported: +# +# "'The Nashville Banner and The Nashville Tennessean rarely agree on anything +# but the time of day - and last week they couldn't agree on that.' +# +# "It was all too true. The clock on the front of the building had two faces - +# The Tennessean side of the building facing west, the other, east. When it +# was high noon Banner time, it was 11 a.m. Tennessean time." +# +# Seigenthaler J. For 100 years, Tennessean had it covered. +# The Tennessean 2007-05-11, republished 2015-04-06. +# https://www.tennessean.com/story/insider/extras/2015/04/06/archives-seigenthaler-for-100-years-the-tennessean-had-it-covered/25348545/ + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -945,21 +970,21 @@ Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov -5:00 US E%sT # # Perry County, Indiana, switched from eastern to central time in April 2006. +# From Alois Triendl (2019-07-09): +# The Indianapolis News, Friday 27 October 1967 states that Perry County +# returned to CST. It went again to EST on 27 April 1969, as documented by the +# Indianapolis star of Saturday 26 April. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER -Rule Perry 1946 only - Apr lastSun 2:00 1:00 D -Rule Perry 1946 only - Sep lastSun 2:00 0 S -Rule Perry 1953 1954 - Apr lastSun 2:00 1:00 D -Rule Perry 1953 1959 - Sep lastSun 2:00 0 S Rule Perry 1955 only - May 1 0:00 1:00 D +Rule Perry 1955 1960 - Sep lastSun 2:00 0 S Rule Perry 1956 1963 - Apr lastSun 2:00 1:00 D -Rule Perry 1960 only - Oct lastSun 2:00 0 S -Rule Perry 1961 only - Sep lastSun 2:00 0 S -Rule Perry 1962 1963 - Oct lastSun 2:00 0 S +Rule Perry 1961 1963 - Oct lastSun 2:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Indiana/Tell_City -5:47:03 - LMT 1883 Nov 18 12:12:57 -6:00 US C%sT 1946 -6:00 Perry C%sT 1964 Apr 26 2:00 - -5:00 - EST 1969 + -5:00 - EST 1967 Oct 29 2:00 + -6:00 US C%sT 1969 Apr 27 2:00 -5:00 US E%sT 1971 -5:00 - EST 2006 Apr 2 2:00 -6:00 US C%sT @@ -1035,16 +1060,27 @@ Zone America/Indiana/Vevay -5:40:16 - LMT 1883 Nov 18 # clear how this matched civil time in Louisville, so for now continue # to assume Louisville switched at noon new local time, like New York. # +# From Michael Deckers (2019-08-06): +# From the contemporary source given by Alois Treindl, +# the switch in Louisville on 1946-04-28 was on 00:01 +# From Paul Eggert (2019-08-26): +# That source was the Louisville Courier-Journal, 1946-04-27, p 4. +# Shanks gives 02:00 for all 20th-century transition times in Louisville. +# Evidently this is wrong for spring 1946. Although also likely wrong +# for other dates, we have no data. +# # Part of Kentucky left its clocks alone in 1974. # This also includes Clark, Floyd, and Harrison counties in Indiana. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Sep 12 00:33:02 2019 Return-Path: Delivered-To: svn-src-all@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 5AA79E4C99; Thu, 12 Sep 2019 00:33:02 +0000 (UTC) (envelope-from philip@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 46TKVk1l3lz4Zvd; Thu, 12 Sep 2019 00:33:02 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 055C7EC51; Thu, 12 Sep 2019 00:33:02 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C0X1WU063589; Thu, 12 Sep 2019 00:33:01 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C0X1Gn063588; Thu, 12 Sep 2019 00:33:01 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201909120033.x8C0X1Gn063588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 12 Sep 2019 00:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352239 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 352239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 00:33:02 -0000 Author: philip Date: Thu Sep 12 00:33:01 2019 New Revision: 352239 URL: https://svnweb.freebsd.org/changeset/base/352239 Log: Restore svn:mergeinfo accidentally deleted in r352238 Pointy hat to: philip Modified: Directory Properties: head/contrib/tzdata/ (props changed) From owner-svn-src-all@freebsd.org Thu Sep 12 06:20:21 2019 Return-Path: Delivered-To: svn-src-all@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 3AAABEC705; Thu, 12 Sep 2019 06:20:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TTCT0mKPz3NYd; Thu, 12 Sep 2019 06:20:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1BF21A906; Thu, 12 Sep 2019 06:20:20 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C6KK8h067223; Thu, 12 Sep 2019 06:20:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C6KKfZ067221; Thu, 12 Sep 2019 06:20:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909120620.x8C6KKfZ067221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 12 Sep 2019 06:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352240 - in stable/11/stand/ficl: . softwords X-SVN-Group: stable-11 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/11/stand/ficl: . softwords X-SVN-Commit-Revision: 352240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 06:20:21 -0000 Author: tsoome Date: Thu Sep 12 06:20:20 2019 New Revision: 352240 URL: https://svnweb.freebsd.org/changeset/base/352240 Log: MFC r351865, r351837: ficl: add xemit word ficl: add uIsGreater word (needed for xemit) We need xemit to support userboot.so loading images from CURRENT. Modified: stable/11/stand/ficl/softwords/softcore.fr stable/11/stand/ficl/words.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/ficl/softwords/softcore.fr ============================================================================== --- stable/11/stand/ficl/softwords/softcore.fr Thu Sep 12 00:33:01 2019 (r352239) +++ stable/11/stand/ficl/softwords/softcore.fr Thu Sep 12 06:20:20 2019 (r352240) @@ -199,6 +199,14 @@ set-current \ stop hiding words a-addr 0 b-addr b-u strcat ; +: xemit ( xchar -- ) + dup 0x80 u< if emit exit then \ special case ASCII + 0 swap 0x3F + begin 2dup u> while + 2/ >r dup 0x3F and 0x80 or swap 6 rshift r> + repeat 0x7F xor 2* or + begin dup 0x80 u< 0= while emit repeat drop + ; previous \ lose hidden words from search order Modified: stable/11/stand/ficl/words.c ============================================================================== --- stable/11/stand/ficl/words.c Thu Sep 12 00:33:01 2019 (r352239) +++ stable/11/stand/ficl/words.c Thu Sep 12 06:20:20 2019 (r352240) @@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM) return; } +static void uIsGreater(FICL_VM *pVM) +{ + FICL_UNS u1, u2; +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 1); +#endif + u2 = stackPopUNS(pVM->pStack); + u1 = stackPopUNS(pVM->pStack); + PUSHINT(FICL_BOOL(u1 > u2)); + return; +} + static void bitwiseAnd(FICL_VM *pVM) { CELL x, y; @@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys) dictAppendWord(dp, "type", type, FW_DEFAULT); dictAppendWord(dp, "u.", uDot, FW_DEFAULT); dictAppendWord(dp, "u<", uIsLess, FW_DEFAULT); + dictAppendWord(dp, "u>", uIsGreater, FW_DEFAULT); dictAppendWord(dp, "um*", umStar, FW_DEFAULT); dictAppendWord(dp, "um/mod", umSlashMod, FW_DEFAULT); dictAppendWord(dp, "unloop", unloopCo, FW_COMPILE); From owner-svn-src-all@freebsd.org Thu Sep 12 06:26:23 2019 Return-Path: Delivered-To: svn-src-all@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 1E1C6EC933; Thu, 12 Sep 2019 06:26:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TTLQ6mWGz3Nvn; Thu, 12 Sep 2019 06:26:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C702D1AAB9; Thu, 12 Sep 2019 06:26:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C6QMAN072740; Thu, 12 Sep 2019 06:26:22 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C6QMx7072738; Thu, 12 Sep 2019 06:26:22 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909120626.x8C6QMx7072738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 12 Sep 2019 06:26:22 +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: r352241 - in stable/12/stand/ficl: . softwords X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/12/stand/ficl: . softwords X-SVN-Commit-Revision: 352241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 06:26:23 -0000 Author: tsoome Date: Thu Sep 12 06:26:22 2019 New Revision: 352241 URL: https://svnweb.freebsd.org/changeset/base/352241 Log: MFC r351865, r351837: ficl: add xemit word ficl: add uIsGreater word (needed for xemit) We need xemit to support userboot.so loading images from CURRENT. Modified: stable/12/stand/ficl/softwords/softcore.fr stable/12/stand/ficl/words.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/ficl/softwords/softcore.fr ============================================================================== --- stable/12/stand/ficl/softwords/softcore.fr Thu Sep 12 06:20:20 2019 (r352240) +++ stable/12/stand/ficl/softwords/softcore.fr Thu Sep 12 06:26:22 2019 (r352241) @@ -199,6 +199,14 @@ set-current \ stop hiding words a-addr 0 b-addr b-u strcat ; +: xemit ( xchar -- ) + dup 0x80 u< if emit exit then \ special case ASCII + 0 swap 0x3F + begin 2dup u> while + 2/ >r dup 0x3F and 0x80 or swap 6 rshift r> + repeat 0x7F xor 2* or + begin dup 0x80 u< 0= while emit repeat drop + ; previous \ lose hidden words from search order Modified: stable/12/stand/ficl/words.c ============================================================================== --- stable/12/stand/ficl/words.c Thu Sep 12 06:20:20 2019 (r352240) +++ stable/12/stand/ficl/words.c Thu Sep 12 06:26:22 2019 (r352241) @@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM) return; } +static void uIsGreater(FICL_VM *pVM) +{ + FICL_UNS u1, u2; +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 1); +#endif + u2 = stackPopUNS(pVM->pStack); + u1 = stackPopUNS(pVM->pStack); + PUSHINT(FICL_BOOL(u1 > u2)); + return; +} + static void bitwiseAnd(FICL_VM *pVM) { CELL x, y; @@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys) dictAppendWord(dp, "type", type, FW_DEFAULT); dictAppendWord(dp, "u.", uDot, FW_DEFAULT); dictAppendWord(dp, "u<", uIsLess, FW_DEFAULT); + dictAppendWord(dp, "u>", uIsGreater, FW_DEFAULT); dictAppendWord(dp, "um*", umStar, FW_DEFAULT); dictAppendWord(dp, "um/mod", umSlashMod, FW_DEFAULT); dictAppendWord(dp, "unloop", unloopCo, FW_COMPILE); From owner-svn-src-all@freebsd.org Thu Sep 12 08:54:50 2019 Return-Path: Delivered-To: svn-src-all@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 3BD0CEFF7A; Thu, 12 Sep 2019 08:54:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TXdk0rHyz40ng; Thu, 12 Sep 2019 08:54:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFD441C558; Thu, 12 Sep 2019 08:54:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8C8snF1061208; Thu, 12 Sep 2019 08:54:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8C8smxe061200; Thu, 12 Sep 2019 08:54:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909120854.x8C8smxe061200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Sep 2019 08:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352242 - in head: contrib/gdb/gdb contrib/gdb/gdb/cli gnu/usr.bin/gdb/kgdb X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/gdb/gdb contrib/gdb/gdb/cli gnu/usr.bin/gdb/kgdb X-SVN-Commit-Revision: 352242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 08:54:50 -0000 Author: bapt Date: Thu Sep 12 08:54:48 2019 New Revision: 352242 URL: https://svnweb.freebsd.org/changeset/base/352242 Log: Remove usesless readline compat includes which will reinclude readline.h itself. This simplifies the upcoming update to newer libedit. Modified: head/contrib/gdb/gdb/cli/cli-cmds.c head/contrib/gdb/gdb/cli/cli-setshow.c head/contrib/gdb/gdb/event-top.c head/contrib/gdb/gdb/top.c head/contrib/gdb/gdb/tracepoint.c head/gnu/usr.bin/gdb/kgdb/trgt.c Modified: head/contrib/gdb/gdb/cli/cli-cmds.c ============================================================================== --- head/contrib/gdb/gdb/cli/cli-cmds.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/contrib/gdb/gdb/cli/cli-cmds.c Thu Sep 12 08:54:48 2019 (r352242) @@ -21,7 +21,6 @@ #include "defs.h" #include "readline/readline.h" -#include "readline/tilde.h" #include "completer.h" #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ #include "gdb_wait.h" /* For shell escape implementation */ Modified: head/contrib/gdb/gdb/cli/cli-setshow.c ============================================================================== --- head/contrib/gdb/gdb/cli/cli-setshow.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/contrib/gdb/gdb/cli/cli-setshow.c Thu Sep 12 08:54:48 2019 (r352242) @@ -18,7 +18,6 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "readline/tilde.h" #include "value.h" #include #include "gdb_string.h" Modified: head/contrib/gdb/gdb/event-top.c ============================================================================== --- head/contrib/gdb/gdb/event-top.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/contrib/gdb/gdb/event-top.c Thu Sep 12 08:54:48 2019 (r352242) @@ -34,7 +34,6 @@ /* readline include files */ #include "readline/readline.h" -#include "readline/history.h" /* readline defines this. */ #undef savestring Modified: head/contrib/gdb/gdb/top.c ============================================================================== --- head/contrib/gdb/gdb/top.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/contrib/gdb/gdb/top.c Thu Sep 12 08:54:48 2019 (r352242) @@ -48,7 +48,6 @@ /* readline include files */ #include "readline/readline.h" -#include "readline/history.h" /* readline defines this. */ #undef savestring Modified: head/contrib/gdb/gdb/tracepoint.c ============================================================================== --- head/contrib/gdb/gdb/tracepoint.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/contrib/gdb/gdb/tracepoint.c Thu Sep 12 08:54:48 2019 (r352242) @@ -45,7 +45,6 @@ /* readline include files */ #include "readline/readline.h" -#include "readline/history.h" /* readline defines this. */ #undef savestring Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt.c Thu Sep 12 06:26:22 2019 (r352241) +++ head/gnu/usr.bin/gdb/kgdb/trgt.c Thu Sep 12 08:54:48 2019 (r352242) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Thu Sep 12 11:59:46 2019 Return-Path: Delivered-To: svn-src-all@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 4CC2AF3B49; Thu, 12 Sep 2019 11:59:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Tcl51lL4z49pk; Thu, 12 Sep 2019 11:59:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9A51C26047E; Thu, 12 Sep 2019 13:59:37 +0200 (CEST) Subject: Re: svn commit: r351188 - in head/sys: kern sys To: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908181143.x7IBhxZO011254@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <7fc855eb-ef02-72a7-071f-4b0e13c8db30@selasky.org> Date: Thu, 12 Sep 2019 13:58:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201908181143.x7IBhxZO011254@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46Tcl51lL4z49pk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.57)[ip: (-9.08), ipnet: 2a01:4f8::/29(-1.98), asn: 24940(-1.79), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 11:59:46 -0000 On 2019-08-18 13:43, Jeff Roberson wrote: > Author: jeff > Date: Sun Aug 18 11:43:58 2019 > New Revision: 351188 > URL: https://svnweb.freebsd.org/changeset/base/351188 > > Log: > Add a blocking wait bit to refcount. This allows refs to be used as a simple > barrier. > > Reviewed by: markj, kib > Discussed with: jhb > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D21254 > > Modified: > head/sys/kern/kern_synch.c > head/sys/sys/refcount.h > Hi, I would like to decouple the wait/wakeup logic from the release function, if possible. The main objection here is that we are woken up before any destructor is executed. Also this function is not Giant safe and does neither assert that it can sleep. --HPS From owner-svn-src-all@freebsd.org Thu Sep 12 12:33:10 2019 Return-Path: Delivered-To: svn-src-all@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 054B1F561E; Thu, 12 Sep 2019 12:33:10 +0000 (UTC) (envelope-from wulf@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 46TdTd6L2jz4CrS; Thu, 12 Sep 2019 12:33:09 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BCA131ECCD; Thu, 12 Sep 2019 12:33:09 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CCX9Z0092180; Thu, 12 Sep 2019 12:33:09 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CCX9O3092179; Thu, 12 Sep 2019 12:33:09 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201909121233.x8CCX9O3092179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Thu, 12 Sep 2019 12:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352243 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 352243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 12:33:10 -0000 Author: wulf Date: Thu Sep 12 12:33:09 2019 New Revision: 352243 URL: https://svnweb.freebsd.org/changeset/base/352243 Log: ig4(4): Fix SDA HOLD time set too low on Skylake controllers Execution of "Soft reset" command (IG4_REG_RESETS_SKL) at controller init stage sets SDA_HOLD register value to 0x0001 which is often too low for normal operation. Set SDA_HOLD back to 28 after reset to restore controller functionality. PR: 240339 Reported by: imp, GregV, et al. MFC after: 3 days Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Thu Sep 12 08:54:48 2019 (r352242) +++ head/sys/dev/ichiic/ig4_iic.c Thu Sep 12 12:33:09 2019 (r352243) @@ -590,6 +590,8 @@ ig4iic_attach(ig4iic_softc_t *sc) reg_write(sc, IG4_REG_SS_SCL_LCNT, 125); reg_write(sc, IG4_REG_FS_SCL_HCNT, 100); reg_write(sc, IG4_REG_FS_SCL_LCNT, 125); + if (sc->version == IG4_SKYLAKE) + reg_write(sc, IG4_REG_SDA_HOLD, 28); /* * Use a threshold of 1 so we get interrupted on each character, From owner-svn-src-all@freebsd.org Thu Sep 12 13:51:44 2019 Return-Path: Delivered-To: svn-src-all@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 75500F6DDD; Thu, 12 Sep 2019 13:51:44 +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 46TgDJ2ZKNz4Hjl; Thu, 12 Sep 2019 13:51:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B76C1F99E; Thu, 12 Sep 2019 13:51:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CDpi07038289; Thu, 12 Sep 2019 13:51:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CDpi9r038288; Thu, 12 Sep 2019 13:51:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909121351.x8CDpi9r038288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Sep 2019 13:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352244 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 13:51:44 -0000 Author: kevans Date: Thu Sep 12 13:51:43 2019 New Revision: 352244 URL: https://svnweb.freebsd.org/changeset/base/352244 Log: kenv: assert that an empty static buffer passed in is "empty" Garbage in the passed-in buffer can cause problems if any attempts to read the kenv are inadvertently made between init_static_kenv and the first kern_setenv -- assuming there is one. This is cheap and easy, so do it. This also helps rule out some class of bugs as one tries to debug; tunables fetch from the static environment up until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that rely on BSS clearing while others just grab a page of free memory and use it (e.g. xen). Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Sep 12 12:33:09 2019 (r352243) +++ head/sys/kern/kern_environment.c Thu Sep 12 13:51:43 2019 (r352244) @@ -250,6 +250,8 @@ init_static_kenv(char *buf, size_t len) char *eval; KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); + KASSERT(len == 0 || *buf == '\0', + ("kenv: sized buffer must be initially empty")); /* * We may be called twice, with the second call needed to relocate From owner-svn-src-all@freebsd.org Thu Sep 12 14:34:47 2019 Return-Path: Delivered-To: svn-src-all@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 92BDDF7A6A; Thu, 12 Sep 2019 14:34:47 +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 46Th9z2lsRz4Kq3; Thu, 12 Sep 2019 14:34:47 +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 4207B20252; Thu, 12 Sep 2019 14:34:47 +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 x8CEYloT063538; Thu, 12 Sep 2019 14:34:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CEYlip063537; Thu, 12 Sep 2019 14:34:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909121434.x8CEYlip063537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Sep 2019 14:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352245 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 14:34:47 -0000 Author: kevans Date: Thu Sep 12 14:34:46 2019 New Revision: 352245 URL: https://svnweb.freebsd.org/changeset/base/352245 Log: Follow up r352244: kenv: tighten up assertions As I like to forget: static kenv var formatting is actually such that an empty environment would be double null bytes. We should make sure that a non-zero buffer has at least enough for this, though most of the current usage is with a 4k buffer. Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Sep 12 13:51:43 2019 (r352244) +++ head/sys/kern/kern_environment.c Thu Sep 12 14:34:46 2019 (r352245) @@ -250,7 +250,15 @@ init_static_kenv(char *buf, size_t len) char *eval; KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); - KASSERT(len == 0 || *buf == '\0', + /* + * Suitably sized means it must be able to hold at least one empty + * variable, otherwise things go belly up if a kern_getenv call is + * made without a prior call to kern_setenv as we have a malformed + * environment. + */ + KASSERT(len == 0 || len >= 2, + ("kenv: static env must be initialized or suitably sized")); + KASSERT(len == 0 || (*buf == '\0' && *(buf + 1) == '\0'), ("kenv: sized buffer must be initially empty")); /* From owner-svn-src-all@freebsd.org Thu Sep 12 15:36:49 2019 Return-Path: Delivered-To: svn-src-all@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 49B88D1887; Thu, 12 Sep 2019 15:36:49 +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 46TjYY1Cr2z4P3T; Thu, 12 Sep 2019 15:36:49 +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 0E39820D42; Thu, 12 Sep 2019 15:36:49 +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 x8CFamW6099424; Thu, 12 Sep 2019 15:36:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CFamqK099423; Thu, 12 Sep 2019 15:36:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909121536.x8CFamqK099423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Sep 2019 15:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352246 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 352246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 15:36:49 -0000 Author: kevans Date: Thu Sep 12 15:36:48 2019 New Revision: 352246 URL: https://svnweb.freebsd.org/changeset/base/352246 Log: SIOCSIFNAME: Do nothing if we're not actually changing Instead of throwing EEXIST, just succeed if the name isn't actually changing. We don't need to trigger departure or any of that because there's no change from consumers' perspective. PR: 240539 Reviewed by: brooks MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D21618 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 12 14:34:46 2019 (r352245) +++ head/sys/net/if.c Thu Sep 12 15:36:48 2019 (r352246) @@ -2716,6 +2716,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, if (strlen(new_name) == IFNAMSIZ-1) return (EINVAL); } + if (strcmp(new_name, ifp->if_xname) == 0) + break; if (ifunit(new_name) != NULL) return (EEXIST); From owner-svn-src-all@freebsd.org Thu Sep 12 15:44:54 2019 Return-Path: Delivered-To: svn-src-all@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 228C6D1CF7; Thu, 12 Sep 2019 15:44:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Tjkt03DDz4Pcq; Thu, 12 Sep 2019 15:44:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5D7120F0C; Thu, 12 Sep 2019 15:44:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CFir7H005558; Thu, 12 Sep 2019 15:44:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CFirIb005556; Thu, 12 Sep 2019 15:44:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909121544.x8CFirIb005556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Sep 2019 15:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352247 - in head/usr.sbin/ntp: ntpdc ntpq X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/usr.sbin/ntp: ntpdc ntpq X-SVN-Commit-Revision: 352247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 15:44:54 -0000 Author: bapt Date: Thu Sep 12 15:44:53 2019 New Revision: 352247 URL: https://svnweb.freebsd.org/changeset/base/352247 Log: Remove useless extra definition of libedit flags Note that all the line editor part is done in the libntp Modified: head/usr.sbin/ntp/ntpdc/Makefile head/usr.sbin/ntp/ntpq/Makefile Modified: head/usr.sbin/ntp/ntpdc/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpdc/Makefile Thu Sep 12 15:36:48 2019 (r352246) +++ head/usr.sbin/ntp/ntpdc/Makefile Thu Sep 12 15:44:53 2019 (r352247) @@ -18,8 +18,6 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \ -I${.CURDIR:H} -I${.CURDIR} LIBADD= edit ntp m opts pthread -CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \ - -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit .if ${MK_OPENSSL} != "no" LIBADD+= crypto Modified: head/usr.sbin/ntp/ntpq/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpq/Makefile Thu Sep 12 15:36:48 2019 (r352246) +++ head/usr.sbin/ntp/ntpq/Makefile Thu Sep 12 15:44:53 2019 (r352247) @@ -28,9 +28,6 @@ LIBADD+= crypto LIBADD+= md .endif -CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \ - -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit - CLEANFILES+= .version version.c version.c: From owner-svn-src-all@freebsd.org Thu Sep 12 15:46:58 2019 Return-Path: Delivered-To: svn-src-all@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 D889ED1DF0; Thu, 12 Sep 2019 15:46:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TjnG5NBKz4PmB; Thu, 12 Sep 2019 15:46:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BC8F20F16; Thu, 12 Sep 2019 15:46:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CFkwq2005703; Thu, 12 Sep 2019 15:46:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CFkwB7005702; Thu, 12 Sep 2019 15:46:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909121546.x8CFkwB7005702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Sep 2019 15:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352248 - head/usr.sbin/ntp/libntp X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/ntp/libntp X-SVN-Commit-Revision: 352248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 15:46:58 -0000 Author: bapt Date: Thu Sep 12 15:46:58 2019 New Revision: 352248 URL: https://svnweb.freebsd.org/changeset/base/352248 Log: Get the readline header from the installed header instead of the from the source location. With newer import of libedit, the path to be able to access readline/readline.h will also include header which name will conflict with some expected by ntp in another path and end up breaking the build. Modified: head/usr.sbin/ntp/libntp/Makefile Modified: head/usr.sbin/ntp/libntp/Makefile ============================================================================== --- head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:44:53 2019 (r352247) +++ head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:46:58 2019 (r352248) @@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \ -I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \ -I${SRCTOP}/contrib/ntp/sntp/libopts \ -I${SRCTOP}/lib/libc/${MACHINE_ARCH} \ - -I${SRCTOP}/lib/libedit/edit \ + -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \ -I${.CURDIR:H} \ -I${.CURDIR}/ From owner-svn-src-all@freebsd.org Thu Sep 12 15:50:15 2019 Return-Path: Delivered-To: svn-src-all@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 50B4CD2031; Thu, 12 Sep 2019 15:50:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Tjs30fqHz4PyX; Thu, 12 Sep 2019 15:50:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E570620F27; Thu, 12 Sep 2019 15:50:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CFoEJv005924; Thu, 12 Sep 2019 15:50:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CFoE7M005923; Thu, 12 Sep 2019 15:50:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909121550.x8CFoE7M005923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Sep 2019 15:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352249 - head/gnu/usr.bin/gdb X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/gnu/usr.bin/gdb X-SVN-Commit-Revision: 352249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 15:50:15 -0000 Author: bapt Date: Thu Sep 12 15:50:14 2019 New Revision: 352249 URL: https://svnweb.freebsd.org/changeset/base/352249 Log: Get the readline header from the installed header instead of the from the source location. Modified: head/gnu/usr.bin/gdb/Makefile.inc Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Thu Sep 12 15:46:58 2019 (r352248) +++ head/gnu/usr.bin/gdb/Makefile.inc Thu Sep 12 15:50:14 2019 (r352249) @@ -45,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${SRCTOP}/lib/libedit/edit +CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit GENSRCS+= nm.h tm.h From owner-svn-src-all@freebsd.org Thu Sep 12 15:57:50 2019 Return-Path: Delivered-To: svn-src-all@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 82160D273A; Thu, 12 Sep 2019 15:57:50 +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 46Tk1p2tQfz4Qk6; Thu, 12 Sep 2019 15:57:50 +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 45E6E2110D; Thu, 12 Sep 2019 15:57:50 +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 x8CFvo7r011658; Thu, 12 Sep 2019 15:57:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CFvokG011657; Thu, 12 Sep 2019 15:57:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909121557.x8CFvokG011657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Sep 2019 15:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352250 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 15:57:50 -0000 Author: hselasky Date: Thu Sep 12 15:57:49 2019 New Revision: 352250 URL: https://svnweb.freebsd.org/changeset/base/352250 Log: Fix for undefined behaviour. Left shift of 1 by 31 places cannot be represented in type 'int'. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Thu Sep 12 15:50:14 2019 (r352249) +++ head/sys/sys/refcount.h Thu Sep 12 15:57:49 2019 (r352250) @@ -39,7 +39,7 @@ #define KASSERT(exp, msg) /* */ #endif -#define REFCOUNT_WAITER (1 << 31) /* Refcount has waiter. */ +#define REFCOUNT_WAITER (1U << 31) /* Refcount has waiter. */ #define REFCOUNT_SATURATION_VALUE (3U << 29) #define REFCOUNT_SATURATED(val) (((val) & (1U << 30)) != 0) From owner-svn-src-all@freebsd.org Thu Sep 12 16:20:04 2019 Return-Path: Delivered-To: svn-src-all@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 7E525D3266; Thu, 12 Sep 2019 16:20:04 +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 46TkWS2r6Lz4S1p; Thu, 12 Sep 2019 16:20:04 +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 4528B214F6; Thu, 12 Sep 2019 16:20:04 +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 x8CGK488023460; Thu, 12 Sep 2019 16:20:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGK4qS023459; Thu, 12 Sep 2019 16:20:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909121620.x8CGK4qS023459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Sep 2019 16:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352251 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:20:04 -0000 Author: hselasky Date: Thu Sep 12 16:20:03 2019 New Revision: 352251 URL: https://svnweb.freebsd.org/changeset/base/352251 Log: Use %u instead of %d to print unsigned integer. While at it remove an empty line. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Thu Sep 12 15:57:49 2019 (r352250) +++ head/sys/sys/refcount.h Thu Sep 12 16:20:03 2019 (r352251) @@ -85,11 +85,10 @@ refcount_acquire(volatile u_int *count) static __inline void refcount_acquiren(volatile u_int *count, u_int n) { - u_int old; KASSERT(n < REFCOUNT_SATURATION_VALUE / 2, - ("refcount_acquiren: n %d too large", n)); + ("refcount_acquiren: n=%u too large", n)); old = atomic_fetchadd_int(count, n); if (__predict_false(REFCOUNT_SATURATED(old))) _refcount_update_saturated(count); @@ -115,7 +114,8 @@ refcount_releasen(volatile u_int *count, u_int n) u_int old; KASSERT(n < REFCOUNT_SATURATION_VALUE / 2, - ("refcount_releasen: n %d too large", n)); + ("refcount_releasen: n=%u too large", n)); + atomic_thread_fence_rel(); old = atomic_fetchadd_int(count, -n); if (__predict_false(n >= REFCOUNT_COUNT(old) || From owner-svn-src-all@freebsd.org Thu Sep 12 16:23:22 2019 Return-Path: Delivered-To: svn-src-all@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 D6F02D3517; Thu, 12 Sep 2019 16:23:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TkbG5NY3z4SP0; Thu, 12 Sep 2019 16:23:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C0DA216AB; Thu, 12 Sep 2019 16:23:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CGNMsG029095; Thu, 12 Sep 2019 16:23:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGNMoA029094; Thu, 12 Sep 2019 16:23:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909121623.x8CGNMoA029094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Sep 2019 16:23:22 +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: r352252 - stable/12/sbin/ping6 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sbin/ping6 X-SVN-Commit-Revision: 352252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:23:22 -0000 Author: asomers Date: Thu Sep 12 16:23:22 2019 New Revision: 352252 URL: https://svnweb.freebsd.org/changeset/base/352252 Log: MFC r351172: ping6: Raise WARNS level to 6 Submitted by: Ján Sučan Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21260 Modified: stable/12/sbin/ping6/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping6/Makefile ============================================================================== --- stable/12/sbin/ping6/Makefile Thu Sep 12 16:20:03 2019 (r352251) +++ stable/12/sbin/ping6/Makefile Thu Sep 12 16:23:22 2019 (r352252) @@ -7,7 +7,6 @@ PROG= ping6 MAN= ping6.8 CFLAGS+=-DIPSEC -DKAME_SCOPEID -WARNS?= 3 BINOWN= root BINMODE=4555 From owner-svn-src-all@freebsd.org Thu Sep 12 16:27:00 2019 Return-Path: Delivered-To: svn-src-all@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 C74C2D362E; Thu, 12 Sep 2019 16:27:00 +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 46TkgS4wfzz4SY1; Thu, 12 Sep 2019 16:27:00 +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 8C4D9216B0; Thu, 12 Sep 2019 16:27:00 +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 x8CGR08F029356; Thu, 12 Sep 2019 16:27:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGQxCe029348; Thu, 12 Sep 2019 16:26:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909121626.x8CGQxCe029348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Sep 2019 16:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352253 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 352253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:27:00 -0000 Author: hselasky Date: Thu Sep 12 16:26:59 2019 New Revision: 352253 URL: https://svnweb.freebsd.org/changeset/base/352253 Log: Use REFCOUNT_COUNT() to obtain refcount where appropriate. Refcount waiting will set some flag bits in the refcount value. Make sure these bits get cleared by using the REFCOUNT_COUNT() macro to obtain the actual refcount. Differential Revision: https://reviews.freebsd.org/D21620 Reviewed by: kib@, markj@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/vfs_bio.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_swapout.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Sep 12 16:23:22 2019 (r352252) +++ head/sys/kern/vfs_bio.c Thu Sep 12 16:26:59 2019 (r352253) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2842,9 +2843,9 @@ vfs_vmio_iodone(struct buf *bp) bool bogus; obj = bp->b_bufobj->bo_object; - KASSERT(obj->paging_in_progress >= bp->b_npages, + KASSERT(REFCOUNT_COUNT(obj->paging_in_progress) >= bp->b_npages, ("vfs_vmio_iodone: paging in progress(%d) < b_npages(%d)", - obj->paging_in_progress, bp->b_npages)); + REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages)); vp = bp->b_vp; KASSERT(vp->v_holdcnt > 0, Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Sep 12 16:23:22 2019 (r352252) +++ head/sys/vm/vm_fault.c Thu Sep 12 16:26:59 2019 (r352253) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -339,7 +340,7 @@ vm_fault_restore_map_lock(struct faultstate *fs) { VM_OBJECT_ASSERT_WLOCKED(fs->first_object); - MPASS(fs->first_object->paging_in_progress > 0); + MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0); if (!vm_map_trylock_read(fs->map)) { VM_OBJECT_WUNLOCK(fs->first_object); @@ -394,7 +395,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro MPASS(fs->object == fs->first_object); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); - MPASS(fs->first_object->paging_in_progress > 0); + MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0); MPASS(fs->first_object->backing_object == NULL); MPASS(fs->lookup_still_valid); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Sep 12 16:23:22 2019 (r352252) +++ head/sys/vm/vm_object.c Thu Sep 12 16:26:59 2019 (r352253) @@ -195,9 +195,9 @@ vm_object_zdtor(void *mem, int size, void *arg) ("object %p has reservations", object)); #endif - KASSERT(object->paging_in_progress == 0, + KASSERT(REFCOUNT_COUNT(object->paging_in_progress) == 0, ("object %p paging_in_progress = %d", - object, object->paging_in_progress)); + object, REFCOUNT_COUNT(object->paging_in_progress))); KASSERT(object->resident_page_count == 0, ("object %p resident_page_count = %d", object, object->resident_page_count)); @@ -395,7 +395,7 @@ vm_object_pip_wait(vm_object_t object, char *waitid) VM_OBJECT_ASSERT_WLOCKED(object); - while (object->paging_in_progress) { + while (REFCOUNT_COUNT(object->paging_in_progress) > 0) { VM_OBJECT_WUNLOCK(object); refcount_wait(&object->paging_in_progress, waitid, PVM); VM_OBJECT_WLOCK(object); @@ -408,7 +408,7 @@ vm_object_pip_wait_unlocked(vm_object_t object, char * VM_OBJECT_ASSERT_UNLOCKED(object); - while (object->paging_in_progress) + while (REFCOUNT_COUNT(object->paging_in_progress) > 0) refcount_wait(&object->paging_in_progress, waitid, PVM); } @@ -577,7 +577,7 @@ vm_object_deallocate(vm_object_t object) robject->ref_count++; retry: - if (robject->paging_in_progress) { + if (REFCOUNT_COUNT(robject->paging_in_progress) > 0) { VM_OBJECT_WUNLOCK(object); vm_object_pip_wait(robject, "objde1"); @@ -586,7 +586,7 @@ retry: VM_OBJECT_WLOCK(object); goto retry; } - } else if (object->paging_in_progress) { + } else if (REFCOUNT_COUNT(object->paging_in_progress) > 0) { VM_OBJECT_WUNLOCK(robject); VM_OBJECT_WUNLOCK(object); refcount_wait( @@ -729,7 +729,7 @@ vm_object_terminate(vm_object_t object) */ vm_object_pip_wait(object, "objtrm"); - KASSERT(!object->paging_in_progress, + KASSERT(!REFCOUNT_COUNT(object->paging_in_progress), ("vm_object_terminate: pageout in progress")); KASSERT(object->ref_count == 0, @@ -1660,8 +1660,8 @@ vm_object_collapse(vm_object_t object) break; } - if (object->paging_in_progress != 0 || - backing_object->paging_in_progress != 0) { + if (REFCOUNT_COUNT(object->paging_in_progress) > 0 || + REFCOUNT_COUNT(backing_object->paging_in_progress) > 0) { vm_object_qcollapse(object); VM_OBJECT_WUNLOCK(backing_object); break; Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Thu Sep 12 16:23:22 2019 (r352252) +++ head/sys/vm/vm_swapout.c Thu Sep 12 16:26:59 2019 (r352253) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -193,7 +194,7 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj goto unlock_return; VM_OBJECT_ASSERT_LOCKED(object); if ((object->flags & OBJ_UNMANAGED) != 0 || - object->paging_in_progress != 0) + REFCOUNT_COUNT(object->paging_in_progress) > 0) goto unlock_return; remove_mode = 0; From owner-svn-src-all@freebsd.org Thu Sep 12 16:28:30 2019 Return-Path: Delivered-To: svn-src-all@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 F2111D3708; Thu, 12 Sep 2019 16:28:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TkjB648Jz4SjH; Thu, 12 Sep 2019 16:28:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99A7C216C0; Thu, 12 Sep 2019 16:28:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CGSUt2029469; Thu, 12 Sep 2019 16:28:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGSU06029468; Thu, 12 Sep 2019 16:28:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909121628.x8CGSU06029468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Sep 2019 16:28: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: r352254 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 352254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:28:31 -0000 Author: asomers Date: Thu Sep 12 16:28:30 2019 New Revision: 352254 URL: https://svnweb.freebsd.org/changeset/base/352254 Log: Record mergeinfo for r352232 Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Thu Sep 12 16:45:09 2019 Return-Path: Delivered-To: svn-src-all@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 1C662D3E1D; Thu, 12 Sep 2019 16:45:09 +0000 (UTC) (envelope-from luporl@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 46Tl4N745tz4Th1; Thu, 12 Sep 2019 16:45:08 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B898C21A53; Thu, 12 Sep 2019 16:45:08 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CGj804041107; Thu, 12 Sep 2019 16:45:08 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGj8OA041103; Thu, 12 Sep 2019 16:45:08 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201909121645.x8CGj8OA041103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 12 Sep 2019 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352255 - head/lib/csu/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/lib/csu/powerpc64 X-SVN-Commit-Revision: 352255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:45:09 -0000 Author: luporl Date: Thu Sep 12 16:45:07 2019 New Revision: 352255 URL: https://svnweb.freebsd.org/changeset/base/352255 Log: [PPC64] Add ifunc support in libcsu When ifuncs are used in statically linked binaries, the C runtime must perform the needed dynamic relocations, to make calls to ifuncs work correctly. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21070 Added: head/lib/csu/powerpc64/reloc.c (contents, props changed) Modified: head/lib/csu/powerpc64/Makefile head/lib/csu/powerpc64/crt1.c Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Thu Sep 12 16:28:30 2019 (r352254) +++ head/lib/csu/powerpc64/Makefile Thu Sep 12 16:45:07 2019 (r352255) @@ -5,9 +5,9 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= crtsavres.o Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ +CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include \ - -mlongcall -DCRT_IRELOC_SUPPRESS + -mlongcall -DCRT_IRELOC_RELA FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/powerpc64/crt1.c ============================================================================== --- head/lib/csu/powerpc64/crt1.c Thu Sep 12 16:28:30 2019 (r352254) +++ head/lib/csu/powerpc64/crt1.c Thu Sep 12 16:45:07 2019 (r352255) @@ -45,7 +45,12 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +static uint32_t cpu_features; +static uint32_t cpu_features2; + #include "libc_private.h" #include "crtbrand.c" #include "ignore_init.c" @@ -65,6 +70,30 @@ extern int etext; struct ps_strings *__ps_strings; +static void +init_cpu_features(char **env) +{ + const Elf_Auxinfo *aux; + + /* Find the auxiliary vector on the stack. */ + while (*env++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (const Elf_Auxinfo *)env; + + /* Digest the auxiliary vector. */ + for (; aux->a_type != AT_NULL; aux++) { + switch (aux->a_type) { + case AT_HWCAP: + cpu_features = (uint32_t)aux->a_un.a_val; + break; + case AT_HWCAP2: + cpu_features2 = (uint32_t)aux->a_un.a_val; + break; + } + } +} + + /* The entry function. */ /* * First 5 arguments are specified by the PowerPC SVR4 ABI. @@ -84,8 +113,11 @@ _start(int argc, char **argv, char **env, if (&_DYNAMIC != NULL) atexit(cleanup); - else + else { + init_cpu_features(env); + process_irelocs(); _init_tls(); + } #ifdef GCRT atexit(_mcleanup); Added: head/lib/csu/powerpc64/reloc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/powerpc64/reloc.c Thu Sep 12 16:45:07 2019 (r352255) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2019 Leandro Lupori + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +static void +crt1_handle_rela(const Elf_Rela *r) +{ + typedef Elf_Addr (*ifunc_resolver_t)( + uint32_t, uint32_t, uint64_t, uint64_t, + uint64_t, uint64_t, uint64_t, uint64_t); + Elf_Addr *ptr, *where, target; + + switch (ELF_R_TYPE(r->r_info)) { + case R_PPC_IRELATIVE: + ptr = (Elf_Addr *)r->r_addend; + where = (Elf_Addr *)r->r_offset; + target = ((ifunc_resolver_t)ptr)(cpu_features, cpu_features2, + 0, 0, 0, 0, 0, 0); + *where = target; + break; + } +} From owner-svn-src-all@freebsd.org Thu Sep 12 16:47:39 2019 Return-Path: Delivered-To: svn-src-all@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 2FCE1D3EF1; Thu, 12 Sep 2019 16:47:39 +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 46Tl7H0Yl1z4TrF; Thu, 12 Sep 2019 16:47:39 +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 E75A721A59; Thu, 12 Sep 2019 16:47:38 +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 x8CGlcjF041261; Thu, 12 Sep 2019 16:47:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CGlcPT041260; Thu, 12 Sep 2019 16:47:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909121647.x8CGlcPT041260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Sep 2019 16:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352256 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 16:47:39 -0000 Author: markj Date: Thu Sep 12 16:47:38 2019 New Revision: 352256 URL: https://svnweb.freebsd.org/changeset/base/352256 Log: Remove a redundant NULL pointer check in cpuset_modify_domain(). cpuset_getroot() is guaranteed to return a non-NULL pointer. Reported by: Mark Millard MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Thu Sep 12 16:45:07 2019 (r352255) +++ head/sys/kern/kern_cpuset.c Thu Sep 12 16:47:38 2019 (r352256) @@ -796,7 +796,7 @@ cpuset_modify_domain(struct cpuset *set, struct domain /* * Verify that we have access to this set of domains. */ - if (root && !domainset_valid(dset, domain)) { + if (!domainset_valid(dset, domain)) { error = EINVAL; goto out; } From owner-svn-src-all@freebsd.org Thu Sep 12 17:20:52 2019 Return-Path: Delivered-To: svn-src-all@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 10F5ED4BE5; Thu, 12 Sep 2019 17:20:52 +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 46Tlsb6bW9z4WHH; Thu, 12 Sep 2019 17:20:51 +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 C60BE21FDE; Thu, 12 Sep 2019 17:20:51 +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 x8CHKprq058911; Thu, 12 Sep 2019 17:20:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CHKpsk058910; Thu, 12 Sep 2019 17:20:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909121720.x8CHKpsk058910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Sep 2019 17:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352257 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 17:20:52 -0000 Author: mav Date: Thu Sep 12 17:20:51 2019 New Revision: 352257 URL: https://svnweb.freebsd.org/changeset/base/352257 Log: Report Trusted Computing feature set support. It practically means the device is SED. MFC after: 3 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Sep 12 16:47:38 2019 (r352256) +++ head/sbin/camcontrol/camcontrol.c Thu Sep 12 17:20:51 2019 (r352257) @@ -1717,6 +1717,9 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Trusted Computing %s\n", + ((parm->tcg & 0xc000) == 0x4000) && (parm->tcg & ATA_SUPPORT_TCG) ? + "yes" : "no"); printf("encrypts all user data %s\n", parm->support3 & ATA_ENCRYPTS_ALL_USER_DATA ? "yes" : "no"); printf("Sanitize "); From owner-svn-src-all@freebsd.org Thu Sep 12 17:42:37 2019 Return-Path: Delivered-To: svn-src-all@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 BCC38D5384; Thu, 12 Sep 2019 17:42:37 +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 46TmLj4cx8z4XCb; Thu, 12 Sep 2019 17:42:37 +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 81F0E22515; Thu, 12 Sep 2019 17:42:37 +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 x8CHgbwS076169; Thu, 12 Sep 2019 17:42:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CHgbuW076168; Thu, 12 Sep 2019 17:42:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909121742.x8CHgbuW076168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Sep 2019 17:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352258 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 352258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 17:42:37 -0000 Author: mav Date: Thu Sep 12 17:42:37 2019 New Revision: 352258 URL: https://svnweb.freebsd.org/changeset/base/352258 Log: Remove Tagged Command Queuing feature reporting. I never saw those devices myself, FreeBSD never supported them, and it is officially obsolete since ACS-2 specification. MFC after: 3 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Sep 12 17:20:51 2019 (r352257) +++ head/sbin/camcontrol/camcontrol.c Thu Sep 12 17:42:37 2019 (r352258) @@ -1600,16 +1600,6 @@ atacapprint(struct ata_params *parm) printf("flush cache %s %s\n", parm->support.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no"); - printf("overlap %s\n", - parm->capabilities1 & ATA_SUPPORT_OVERLAP ? "yes" : "no"); - printf("Tagged Command Queuing (TCQ) %s %s", - parm->support.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no", - parm->enabled.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no"); - if (parm->support.command2 & ATA_SUPPORT_QUEUED) { - printf(" %d tags\n", - ATA_QUEUE_LEN(parm->queue) + 1); - } else - printf("\n"); printf("Native Command Queuing (NCQ) "); if (atasata(parm) && (parm->satacapabilities & ATA_SUPPORT_NCQ)) { printf("yes %d tags\n", From owner-svn-src-all@freebsd.org Thu Sep 12 17:53:44 2019 Return-Path: Delivered-To: svn-src-all@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 52EDFD5891 for ; Thu, 12 Sep 2019 17:53:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46TmbW6bL7z4XsZ for ; Thu, 12 Sep 2019 17:53:43 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568310822; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=SCg/vOp39sDjunf0oq3rKRR71f5u3kGMfxy5sBSQcThpPM/0nm0fLGOb77Z390htABXvHhyXV3Bs2 5qfgSXNkuZ7A2RYk7xbnZwt3WFt64l+yCsXl96TyBY9r5AXzv0TfetV6eAq7wigjvaAYwHCyUpGAvR CY9MJ3aLkPZiqs1b+A+qLl5Zk1SPiSB1s9ZUS4U97mhjnL0cmH7R8BhmYq92yqqVqJPl4t4lDMN1XF 4WIMXworgXHSfmnQdsYgzxlMlzG1tGq7AFnYYe+aFaOtD7xR+Q7xBaFWUmWCFCmMbQrEoXbp/alyZB XZfifr7spi2uXPl2U3iFSYLDJ2qfbyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=oDKXb0vrHRISBSuCyJ5cYU3OxKMC0OKzn92hIkKuQ9k=; b=Fbq9gEPNx3FtUNNhwaJaL5y/6FXhX3UjQZChoCSZ7NJgVs/1nUnW6UwGkha9cHLYn7Ff5l1QxN5a0 BEW+md8BofKi2TiPWX9DRZeZq0xjMtMqJnjxAU3Zr435p8iDzMG1y3tbi7QJ8+OoZ1ew9TDQGrP9MY +Y1oz/thLyxXLzxxPFQmUHYRM9LGNFX2TeG6qVnDVzLXOQg6qneEfpPQOi/meQ5EoBrSn4MB5Bm1rt yj/OrfKBeevvKUu4Gq5OT5RUFKdrVNZ/DlwCZJY+QuMWi4eKliElyFW5tCZAIpw+LIPsTeuIqdLmBD MlWQNRiDu45EficmmgqQIZWtpoMKcpQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=oDKXb0vrHRISBSuCyJ5cYU3OxKMC0OKzn92hIkKuQ9k=; b=K4AofM7KellLBri/qCn1kVhS0IElK87N2L08yEulLgZUpmDwr2muX/HorRRKrxoHyJYTkhDMDDUHI /6Q9SENxdHhoIkafQCGlYC6dbyPFS3JEuU9GYE7UVrGOTOXrxeCP4YSuAG5a9zq7OLE2R9WHOJHe2y fQsv8sw8RzcNINFPCuhIgtaZzGwMrc/0cmYTHiEy5DFgaGwqnSeeUBdqYE7ncGUnZR2I6Fc3VpfYUB 2h6Ygn0QRqy+8FeiwAOflSvj4wafAw+W46BbCyZjnyKdV+GrVlGfwD9C799YYqEO4352Oet2EfZI2f IKvTUOEqtE29cjJTPSUvAbiBgigaP/Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 403bf193-d586-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 403bf193-d586-11e9-b67d-cdd75d6ce7a8; Thu, 12 Sep 2019 17:53:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8CHrdCV078403; Thu, 12 Sep 2019 11:53:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> Subject: Re: svn commit: r352248 - head/usr.sbin/ntp/libntp From: Ian Lepore To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 12 Sep 2019 11:53:38 -0600 In-Reply-To: <201909121546.x8CFkwB7005702@repo.freebsd.org> References: <201909121546.x8CFkwB7005702@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46TmbW6bL7z4XsZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 17:53:44 -0000 On Thu, 2019-09-12 at 15:46 +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Sep 12 15:46:58 2019 > New Revision: 352248 > URL: https://svnweb.freebsd.org/changeset/base/352248 > > Log: > Get the readline header from the installed header instead of the from the source > location. > How can this possibly be right? One of the hallmarks of our build system is that it is self-contained in the sense that it uses the sources to build the sources, not sources or files from the host machine being used to do the build. -- Ian > With newer import of libedit, the path to be able to access > readline/readline.h > will also include header which name will conflict with some > expected by ntp in > another path and end up breaking the build. > > Modified: > head/usr.sbin/ntp/libntp/Makefile > > Modified: head/usr.sbin/ntp/libntp/Makefile > ===================================================================== > ========= > --- head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:44:53 2019 (r352 > 247) > +++ head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:46:58 2019 (r352 > 248) > @@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \ > -I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \ > -I${SRCTOP}/contrib/ntp/sntp/libopts \ > -I${SRCTOP}/lib/libc/${MACHINE_ARCH} \ > - -I${SRCTOP}/lib/libedit/edit \ > + -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \ > -I${.CURDIR:H} \ > -I${.CURDIR}/ > > From owner-svn-src-all@freebsd.org Thu Sep 12 18:14:45 2019 Return-Path: Delivered-To: svn-src-all@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 001DED6005; Thu, 12 Sep 2019 18:14:45 +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 46Tn3m6DXRz4Ymq; Thu, 12 Sep 2019 18:14:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4B6622A7C; Thu, 12 Sep 2019 18:14:44 +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 x8CIEi99093863; Thu, 12 Sep 2019 18:14:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CIEifh093862; Thu, 12 Sep 2019 18:14:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909121814.x8CIEifh093862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Sep 2019 18:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352259 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 352259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 18:14:45 -0000 Author: emaste Date: Thu Sep 12 18:14:44 2019 New Revision: 352259 URL: https://svnweb.freebsd.org/changeset/base/352259 Log: arm64: connect Linuxulator to the build More work needs to be done, but it is capable of running basic statically or dynamically linked Linux/arm64 binaries. Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Sep 12 17:42:37 2019 (r352258) +++ head/sys/modules/Makefile Thu Sep 12 18:14:44 2019 (r352259) @@ -207,9 +207,6 @@ SUBDIR= \ libiconv \ libmchain \ lindebugfs \ - ${_linux} \ - ${_linux_common} \ - ${_linux64} \ linuxkpi \ ${_lio} \ lpt \ @@ -466,10 +463,22 @@ SUBDIR+= iscsi_initiator SUBDIR+= fdt .endif +# Linuxulator .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" SUBDIR+= linprocfs SUBDIR+= linsysfs +.endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SUBDIR+= linux +.endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" +SUBDIR+= linux64 +SUBDIR+= linux_common +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" _ena= ena .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ibcore= ibcore @@ -590,7 +599,6 @@ _if_ndis= if_ndis _io= io _ix= ix _ixv= ixv -_linux= linux .if ${MK_SOURCELESS_UCODE} != "no" _lio= lio .endif @@ -692,8 +700,6 @@ _efirt= efirt _iavf= iavf _ioat= ioat _ixl= ixl -_linux64= linux64 -_linux_common= linux_common _nvdimm= nvdimm _pms= pms _qlxge= qlxge From owner-svn-src-all@freebsd.org Thu Sep 12 18:37:27 2019 Return-Path: Delivered-To: svn-src-all@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 B0B6CD6790; Thu, 12 Sep 2019 18:37:27 +0000 (UTC) (envelope-from mizhka@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 46TnYz45tFz4Zlq; Thu, 12 Sep 2019 18:37:27 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6BB7722E22; Thu, 12 Sep 2019 18:37:27 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CIbRtM005863; Thu, 12 Sep 2019 18:37:27 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CIbRCJ005862; Thu, 12 Sep 2019 18:37:27 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201909121837.x8CIbRCJ005862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Thu, 12 Sep 2019 18:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352260 - head/sys/dev/ral X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/sys/dev/ral X-SVN-Commit-Revision: 352260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 18:37:27 -0000 Author: mizhka Date: Thu Sep 12 18:37:26 2019 New Revision: 352260 URL: https://svnweb.freebsd.org/changeset/base/352260 Log: [Bug 240473] add support of Ralink RT5390R Wireless Card This commit adds PCI ID of Ralink RT5390R into ids table of driver ral. Tests show stability of card during day. Network speed is reasonable ( around several megabytes per second). PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240473 Reported by: zetrotrack000@gmail.com Reviewed by: ray Approved by: ray MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D21604 Modified: head/sys/dev/ral/if_ral_pci.c Modified: head/sys/dev/ral/if_ral_pci.c ============================================================================== --- head/sys/dev/ral/if_ral_pci.c Thu Sep 12 18:14:44 2019 (r352259) +++ head/sys/dev/ral/if_ral_pci.c Thu Sep 12 18:37:26 2019 (r352260) @@ -100,6 +100,7 @@ static const struct ral_pci_ident ral_pci_ids[] = { { 0x1814, 0x5390, "Ralink Technology RT5390" }, { 0x1814, 0x5392, "Ralink Technology RT5392" }, { 0x1814, 0x539a, "Ralink Technology RT5390" }, + { 0x1814, 0x539b, "Ralink Technology RT5390" }, { 0x1814, 0x539f, "Ralink Technology RT5390" }, { 0x1a3b, 0x1059, "AWT RT2890" }, { 0, 0, NULL } From owner-svn-src-all@freebsd.org Thu Sep 12 18:44:49 2019 Return-Path: Delivered-To: svn-src-all@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 936E7D6B7F; Thu, 12 Sep 2019 18:44:49 +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 46TnkT3Kdqz4bHG; Thu, 12 Sep 2019 18:44:49 +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 5520923019; Thu, 12 Sep 2019 18:44:49 +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 x8CIinY6011606; Thu, 12 Sep 2019 18:44:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CIimVm011604; Thu, 12 Sep 2019 18:44:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201909121844.x8CIimVm011604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Sep 2019 18:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352261 - in head: contrib/mtree contrib/netbsd-tests/usr.sbin/mtree usr.sbin/fmtree X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: contrib/mtree contrib/netbsd-tests/usr.sbin/mtree usr.sbin/fmtree X-SVN-Commit-Revision: 352261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 18:44:49 -0000 Author: bdrewery Date: Thu Sep 12 18:44:48 2019 New Revision: 352261 URL: https://svnweb.freebsd.org/changeset/base/352261 Log: mtree: Fix -f -f not considering type changes. This only lists the changed type and not other attributes so that it matches the behavior of -C as done in r66747 for fmtree. The NetBSD -ff implementation was copied from fmtree. Reviewed by: imp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D21623 Modified: head/contrib/mtree/specspec.c head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh head/usr.sbin/fmtree/specspec.c Modified: head/contrib/mtree/specspec.c ============================================================================== --- head/contrib/mtree/specspec.c Thu Sep 12 18:37:26 2019 (r352260) +++ head/contrib/mtree/specspec.c Thu Sep 12 18:44:48 2019 (r352261) @@ -145,7 +145,7 @@ compare_nodes(NODE *n1, NODE *n2, char const *path) return (1); } if (n1->type != n2->type) { - differs = 0; + differs = F_TYPE; mismatch(n1, n2, differs, path); return (1); } Modified: head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh ============================================================================== --- head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Thu Sep 12 18:37:26 2019 (r352260) +++ head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Thu Sep 12 18:44:48 2019 (r352261) @@ -411,7 +411,42 @@ netbsd6_nonemptydir_body() FLAVOR=netbsd6 nonemptydir_body } +atf_test_case mtree_specspec_type +mtree_specspec_type_head() +{ + atf_set "descr" "Test that spec comparisons detect type changes" +} +mtree_specspec_type_body() +{ + mkdir testdir + + touch testdir/bar + mtree -c -p testdir > mtree1.spec + + if [ ! -f mtree1.spec ]; then + atf_fail "mtree failed" + fi + + rm -f testdir/bar + ln -s foo testdir/bar + # uid change is expected to be ignored as done in -C + chown -h operator testdir/bar + mtree -c -p testdir > mtree2.spec + + if [ ! -f mtree2.spec ]; then + atf_fail "mtree failed" + fi + + atf_check -s ignore -o save:output \ + -x "mtree -f mtree1.spec -f mtree2.spec" + + if ! cut -f 3 output | egrep -q "bar file" || \ + ! cut -f 3 output | egrep -q "bar link"; then + atf_fail "mtree did not detect type change" + fi +} + atf_init_test_cases() { atf_add_test_case mtree_create @@ -423,6 +458,7 @@ atf_init_test_cases() atf_add_test_case mtree_ignore atf_add_test_case mtree_merge atf_add_test_case mtree_nonemptydir + atf_add_test_case mtree_specspec_type atf_add_test_case netbsd6_create atf_add_test_case netbsd6_check Modified: head/usr.sbin/fmtree/specspec.c ============================================================================== --- head/usr.sbin/fmtree/specspec.c Thu Sep 12 18:37:26 2019 (r352260) +++ head/usr.sbin/fmtree/specspec.c Thu Sep 12 18:44:48 2019 (r352261) @@ -132,7 +132,7 @@ compare_nodes(NODE *n1, NODE *n2, char const *path) return (1); } if (n1->type != n2->type) { - differs = 0; + differs = F_TYPE; mismatch(n1, n2, differs, path); return (1); } From owner-svn-src-all@freebsd.org Thu Sep 12 18:52:00 2019 Return-Path: Delivered-To: svn-src-all@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 3079BD6CB0; Thu, 12 Sep 2019 18:52:00 +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 46Tntm0Y9pz4bXr; Thu, 12 Sep 2019 18:52:00 +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 EAB14231C4; Thu, 12 Sep 2019 18:51:59 +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 x8CIpxAk015607; Thu, 12 Sep 2019 18:51:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CIpxrp015606; Thu, 12 Sep 2019 18:51:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201909121851.x8CIpxrp015606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Sep 2019 18:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352262 - head/contrib/mtree X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/contrib/mtree X-SVN-Commit-Revision: 352262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 18:52:00 -0000 Author: bdrewery Date: Thu Sep 12 18:51:59 2019 New Revision: 352262 URL: https://svnweb.freebsd.org/changeset/base/352262 Log: mtree -c: Fix username logic when getlogin(3) fails. Obtained from: NetBSD (Credit to Sascha Wildner with DragonFlyBSD) MFC after: 2 weeks Modified: head/contrib/mtree/create.c Modified: head/contrib/mtree/create.c ============================================================================== --- head/contrib/mtree/create.c Thu Sep 12 18:44:48 2019 (r352261) +++ head/contrib/mtree/create.c Thu Sep 12 18:51:59 2019 (r352262) @@ -117,7 +117,7 @@ cwalk(FILE *fp) host[sizeof(host) - 1] = '\0'; if ((user = getlogin()) == NULL) { struct passwd *pw; - user = (pw = getpwuid(getuid())) == NULL ? pw->pw_name : + user = (pw = getpwuid(getuid())) != NULL ? pw->pw_name : ""; } From owner-svn-src-all@freebsd.org Thu Sep 12 18:53:31 2019 Return-Path: Delivered-To: svn-src-all@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 4625CD6ED7; Thu, 12 Sep 2019 18:53:31 +0000 (UTC) (envelope-from mizhka@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 46TnwW1CwTz4bq8; Thu, 12 Sep 2019 18:53:31 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0D605231EE; Thu, 12 Sep 2019 18:53:31 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CIrUSM017349; Thu, 12 Sep 2019 18:53:30 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CIrTn6017343; Thu, 12 Sep 2019 18:53:29 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201909121853.x8CIrTn6017343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Thu, 12 Sep 2019 18:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352263 - in head: etc/mtree usr.sbin/jail usr.sbin/jail/tests X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: in head: etc/mtree usr.sbin/jail usr.sbin/jail/tests X-SVN-Commit-Revision: 352263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 18:53:31 -0000 Author: mizhka Date: Thu Sep 12 18:53:29 2019 New Revision: 352263 URL: https://svnweb.freebsd.org/changeset/base/352263 Log: [jail] removal by jid doesn't trigger pre/post stop scripts This commit fixes bug: command "jail -r" didn't trigger pre/post stop commands (and others) defined in config file if jid is specified insted of name. Also it adds basic tests for usr.sbin/jail to avoid regression. Reviewed by: jamie, kevans, ray MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D21328 Added: head/usr.sbin/jail/tests/ head/usr.sbin/jail/tests/Makefile (contents, props changed) head/usr.sbin/jail/tests/commands.jail.conf (contents, props changed) head/usr.sbin/jail/tests/jail_basic_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/jail/Makefile head/usr.sbin/jail/state.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Sep 12 18:51:59 2019 (r352262) +++ head/etc/mtree/BSD.tests.dist Thu Sep 12 18:53:29 2019 (r352263) @@ -1082,6 +1082,8 @@ .. fstyp .. + jail + .. makefs .. mixer Modified: head/usr.sbin/jail/Makefile ============================================================================== --- head/usr.sbin/jail/Makefile Thu Sep 12 18:51:59 2019 (r352262) +++ head/usr.sbin/jail/Makefile Thu Sep 12 18:53:29 2019 (r352263) @@ -24,4 +24,7 @@ CFLAGS+= -DINET CLEANFILES= y.output +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Modified: head/usr.sbin/jail/state.c ============================================================================== --- head/usr.sbin/jail/state.c Thu Sep 12 18:51:59 2019 (r352262) +++ head/usr.sbin/jail/state.c Thu Sep 12 18:53:29 2019 (r352263) @@ -44,7 +44,7 @@ static void dep_add(struct cfjail *from, struct cfjail static int cmp_jailptr(const void *a, const void *b); static int cmp_jailptr_name(const void *a, const void *b); static struct cfjail *find_jail(const char *name); -static int running_jid(const char *name, int flags); +static struct cfjail *running_jail(const char *name, int flags); static struct cfjail **jails_byname; static size_t njails; @@ -72,7 +72,7 @@ dep_setup(int docf) if ((j = TAILQ_FIRST(&cfjails)) && (p = j->intparams[IP_DEPEND])) { TAILQ_FOREACH(s, &p->val, tq) { - if (running_jid(s->s, 0) < 0) { + if (running_jail(s->s, 0) == NULL) { warnx("depends on nonexistent jail " "\"%s\"", s->s); j->flags |= JF_FAILED; @@ -369,11 +369,7 @@ start_state(const char *target, int docf, unsigned sta j = find_jail(target); if (j == NULL && state == JF_STOP) { /* Allow -[rR] to specify a currently running jail. */ - if ((jid = running_jid(target, JAIL_DYING)) > 0) { - j = add_jail(); - j->name = estrdup(target); - j->jid = jid; - } + j = running_jail(target, JAIL_DYING); } if (j == NULL) { warnx("\"%s\" not found", target); @@ -446,6 +442,9 @@ static struct cfjail * find_jail(const char *name) { struct cfjail **jp; + + if (jails_byname == NULL) + return NULL; jp = bsearch(name, jails_byname, njails, sizeof(struct cfjail *), cmp_jailptr_name); @@ -453,26 +452,43 @@ find_jail(const char *name) } /* - * Return the named jail's jid if it is running, and -1 if it isn't. + * Return jail if it is running, and NULL if it isn't. */ -static int -running_jid(const char *name, int flags) +static struct cfjail * +running_jail(const char *name, int flags) { - struct iovec jiov[2]; + struct iovec jiov[4]; + struct cfjail *jail; char *ep; - int jid; - + char jailname[MAXHOSTNAMELEN]; + int jid, ret, len; + if ((jid = strtol(name, &ep, 10)) && !*ep) { - jiov[0].iov_base = __DECONST(char *, "jid"); - jiov[0].iov_len = sizeof("jid"); - jiov[1].iov_base = &jid; - jiov[1].iov_len = sizeof(jid); + memset(jailname,0,sizeof(jailname)); + len = sizeof(jailname); } else { - jiov[0].iov_base = __DECONST(char *, "name"); - jiov[0].iov_len = sizeof("name"); - jiov[1].iov_len = strlen(name) + 1; - jiov[1].iov_base = alloca(jiov[1].iov_len); - strcpy(jiov[1].iov_base, name); + strncpy(jailname, name,sizeof(jailname)); + len = strlen(name) + 1; + jid = 0; } - return jail_get(jiov, 2, flags); + + jiov[0].iov_base = __DECONST(char *, "jid"); + jiov[0].iov_len = sizeof("jid"); + jiov[1].iov_base = &jid; + jiov[1].iov_len = sizeof(jid); + jiov[2].iov_base = __DECONST(char *, "name"); + jiov[2].iov_len = sizeof("name"); + jiov[3].iov_base = &jailname; + jiov[3].iov_len = len; + + if ((ret = jail_get(jiov, 4, flags)) < 0) + return (NULL); + + if ((jail = find_jail(jailname)) == NULL) { + jail = add_jail(); + jail->name = estrdup(jailname); + jail->jid = ret; + } + + return (jail); } Added: head/usr.sbin/jail/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/jail/tests/Makefile Thu Sep 12 18:53:29 2019 (r352263) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH+= jail_basic_test + +${PACKAGE}FILES+= commands.jail.conf + +.include Added: head/usr.sbin/jail/tests/commands.jail.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/jail/tests/commands.jail.conf Thu Sep 12 18:53:29 2019 (r352263) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +exec.prestop = "echo STOP"; +exec.prestart = "echo START"; +persist; + +basejail {} Added: head/usr.sbin/jail/tests/jail_basic_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/jail/tests/jail_basic_test.sh Thu Sep 12 18:53:29 2019 (r352263) @@ -0,0 +1,136 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Michael Zhilin +# +# 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$ + +atf_test_case "basic" "cleanup" +atf_test_case "nested" "cleanup" +atf_test_case "commands" "cleanup" + +basic_head() +{ + atf_set descr 'Basic jail test' + atf_set require.user root +} + +basic_body() +{ + # Create the jail + atf_check -s exit:0 -o ignore jail -c name=basejail persist ip4.addr=192.0.1.1 + # Check output of jls + atf_check -s exit:0 -o ignore jls + atf_check -s exit:0 -o ignore jls -v + atf_check -s exit:0 -o ignore jls -n + # Stop jail + atf_check -s exit:0 -o ignore jail -r basejail + jail -c name=basejail persist ip4.addr=192.0.1.1 + # Stop jail by jid + atf_check -s exit:0 -o ignore jail -r `jls -j basejail jid` + # Recreate + atf_check -s exit:0 -o ignore jail -cm name=basejail persist ip4.addr=192.0.1.1 + # Restart + atf_check -s exit:0 -o ignore jail -rc name=basejail persist ip4.addr=192.0.1.1 +} + +basic_cleanup() +{ + jail -r basejail +} + +nested_head() +{ + atf_set descr 'Hierarchical jails test' + atf_set require.user root +} + +nested_body() +{ + # Create the first jail + jail -c name=basejail persist ip4.addr=192.0.1.1 children.max=1 + atf_check -s exit:0 -o empty \ + jexec basejail \ + jail -c name=nestedjail persist ip4.addr=192.0.1.1 + + atf_check -s exit:1 -o empty -e inline:"jail: prison limit exceeded\n"\ + jexec basejail \ + jail -c name=secondnestedjail persist ip4.addr=192.0.1.1 + # Check output of jls + atf_check -s exit:0 -o ignore \ + jexec basejail jls + atf_check -s exit:0 -o ignore \ + jexec basejail jls -v + atf_check -s exit:0 -o ignore \ + jexec basejail jls -n + # Create jail with no child - children.max should be 0 by default + jail -c name=basejail_nochild persist ip4.addr=192.0.1.1 + atf_check -s exit:1 -o empty \ + -e inline:"jail: jail_set: Operation not permitted\n" \ + jexec basejail_nochild \ + jail -c name=nestedjail persist ip4.addr=192.0.1.1 +} + +nested_cleanup() +{ + jail -r nestedjail + jail -r basejail + jail -r basejail_nochild +} + +commands_header() +{ + atf_set descr 'Commands jail test' + atf_set require.user root +} + +commands_body() +{ + # exec.prestart + atf_check -s exit:0 -o inline:"START\n" \ + jail -f $(atf_get_srcdir)/commands.jail.conf -qc basejail + # exec.prestop by jailname + atf_check -s exit:0 -o inline:"STOP\n" \ + jail -f $(atf_get_srcdir)/commands.jail.conf -qr basejail + # exec.prestop by jid + jail -f $(atf_get_srcdir)/commands.jail.conf -qc basejail + atf_check -s exit:0 -o inline:"STOP\n" \ + jail -f $(atf_get_srcdir)/commands.jail.conf -qr `jls -j basejail jid` +} + +commands_cleanup() +{ + jls -j basejail > /dev/null 2>&1 + if [ $? -e 0 ] + then + jail -r basejail + fi +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" + atf_add_test_case "nested" + atf_add_test_case "commands" +} From owner-svn-src-all@freebsd.org Thu Sep 12 19:16:32 2019 Return-Path: Delivered-To: svn-src-all@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 96C69D7936; Thu, 12 Sep 2019 19:16:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TpR26lY7z4ddq; Thu, 12 Sep 2019 19:16:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 8UZtiVKB2sAGk8UZvidteA; Thu, 12 Sep 2019 13:16:28 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=OrF1C_9Q5Aj8HesGG_8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 1430B7B8; Thu, 12 Sep 2019 12:16:25 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x8CJGO1l004193; Thu, 12 Sep 2019 12:16:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x8CJGOXB004190; Thu, 12 Sep 2019 12:16:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909121916.x8CJGOXB004190@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352248 - head/usr.sbin/ntp/libntp In-reply-to: <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> References: <201909121546.x8CFkwB7005702@repo.freebsd.org> <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> Comments: In-reply-to Ian Lepore message dated "Thu, 12 Sep 2019 11:53:38 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Sep 2019 12:16:24 -0700 X-CMAE-Envelope: MS4wfAc4s2qx31Y4AefuWuc5YSJ8ctj1EPEQtGO8sD8ulKptcOlEcbrl1qwPb8XQ5Zv/6jcAt4gl+qyGlMEPDSjPxl9n2iFsMTKnFN0dPfRtOroyrKZ5amW2 lLR85cEvP8mhJe8TADStMK3QQbC7ULZLfzGcSG/Fsc450KXd90puXxZ+vl4/7ekgQvkdBSP+TMc9qJEZkvboqutCU608ldxzV9rJQFK9UtIqj+vWGfdEA3IZ xr8zWkbmruY+X9LWyB4uK5HIfLtvqS56qwIRkELgrR2hlnDMQKOGXlvyeTSE9aW2AAvW41RhLFJ7GkOaHGfOXg== X-Rspamd-Queue-Id: 46TpR26lY7z4ddq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.12) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RWL_MAILSPIKE_GOOD(0.00)[12.134.59.64.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.40)[ip: (-6.45), ipnet: 64.59.128.0/20(-3.09), asn: 6327(-2.40), country: CA(-0.09)]; RCVD_IN_DNSWL_NONE(0.00)[12.134.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 19:16:32 -0000 In message <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org>, Ian Le pore writes: > On Thu, 2019-09-12 at 15:46 +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Thu Sep 12 15:46:58 2019 > > New Revision: 352248 > > URL: https://svnweb.freebsd.org/changeset/base/352248 > > > > Log: > > Get the readline header from the installed header instead of the from the > source > > location. > > > > How can this possibly be right? One of the hallmarks of our build > system is that it is self-contained in the sense that it uses the > sources to build the sources, not sources or files from the host > machine being used to do the build. > > -- Ian > This is correct: use $DESTDIR if $SYSROOT is undefined. liebedit should already be installed in $SYSROOT by the time we get here. I'd prefer that we simply bail if $SYSROOT is undefined. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > > With newer import of libedit, the path to be able to access > > readline/readline.h > > will also include header which name will conflict with some > > expected by ntp in > > another path and end up breaking the build. > > > > Modified: > > head/usr.sbin/ntp/libntp/Makefile > > > > Modified: head/usr.sbin/ntp/libntp/Makefile > > ===================================================================== > > ========= > > --- head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:44:53 2019 > (r352 > > 247) > > +++ head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:46:58 2019 > (r352 > > 248) > > @@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \ > > -I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \ > > -I${SRCTOP}/contrib/ntp/sntp/libopts \ > > -I${SRCTOP}/lib/libc/${MACHINE_ARCH} \ > > - -I${SRCTOP}/lib/libedit/edit \ > > + -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \ > > -I${.CURDIR:H} \ > > -I${.CURDIR}/ > > > > > > From owner-svn-src-all@freebsd.org Thu Sep 12 19:51:16 2019 Return-Path: Delivered-To: svn-src-all@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 AC717D8B45; Thu, 12 Sep 2019 19:51:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46TqC82YGjz3C70; Thu, 12 Sep 2019 19:51:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x8CJp6uw059240; Thu, 12 Sep 2019 12:51:06 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x8CJp6A3059239; Thu, 12 Sep 2019 12:51:06 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201909121951.x8CJp6A3059239@gndrsh.dnsmgr.net> Subject: Re: svn commit: r352231 - head/lib/libc/sys In-Reply-To: To: Ian Lepore Date: Thu, 12 Sep 2019 12:51:06 -0700 (PDT) CC: Alan Somers , Peter Holm , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46TqC82YGjz3C70 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 19:51:16 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, 2019-09-11 at 15:55 -0600, Alan Somers wrote: > > On Wed, Sep 11, 2019 at 3:50 PM Ian Lepore wrote: > > > > > On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > > > > Author: asomers > > > > Date: Wed Sep 11 19:48:32 2019 > > > > New Revision: 352231 > > > > URL: https://svnweb.freebsd.org/changeset/base/352231 > > > > > > > > Log: > > > > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > > > > > > > When SO_TIMESTAMP is set, the kernel will attempt to attach a > > > > > > timestamp as > > > > ancillary data to each IP datagram that is received on the socket. > > > > > > However, > > > > it may fail, for example due to insufficient memory. In that case the > > > > packet will still be received but not timestamp will be attached. > > > > > > > > Reviewed by: kib > > > > MFC after: 3 days > > > > Differential Revision: https://reviews.freebsd.org/D21607 > > > > > > > > Modified: > > > > head/lib/libc/sys/getsockopt.2 > > > > > > > > Modified: head/lib/libc/sys/getsockopt.2 > > > > > > > > > > ============================================================================== > > > > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 > > > > > > (r352230) > > > > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 > > > > > > (r352231) > > > > @@ -28,7 +28,7 @@ > > > > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd February 10, 2019 > > > > +.Dd September 11, 2019 > > > > .Dt GETSOCKOPT 2 > > > > .Os > > > > .Sh NAME > > > > @@ -431,7 +431,8 @@ option is enabled on a > > > > .Dv SOCK_DGRAM > > > > socket, the > > > > .Xr recvmsg 2 > > > > -call will return a timestamp corresponding to when the datagram was > > > > > > received. > > > > +call may return a timestamp corresponding to when the datagram was > > > > > > received. > > > > +However, it may not, for example due to a resource shortage. > > > > The > > > > .Va msg_control > > > > field in the > > > > > > > > > > So I guess this actually happened to someone... is it a common thing > > > for the timestamp to fail? I ask because ntpd relies on SO_TIMESTAMP > > > and if this situation really happens and can persist for a long time, > > > ntpd would effectively stop working. > > > > > > -- Ian > > > > > > > pho discovered how to trigger it. If you start 50 ping processes > > simultaneously, sometimes a few will fail. Will ntpd be ok with a single > > failure, as long as the timestamp is received correctly in a subsequent > > packet? > > -Alan > > Yeah, nptd is resilient to missing data and intermittent comms, within > reason. If it goes hours without getting a timestamp, system time > would start to drift. Running 50 concurrent pings sounds like > something that won't come up in the real world. :) I would think this is worth investigation, as the 50 pings are most likely not the only trigger event for this problem. > -- Ian -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Sep 12 20:02:34 2019 Return-Path: Delivered-To: svn-src-all@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 CC124D8F91; Thu, 12 Sep 2019 20:02:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TqS93QxXz3D4G; Thu, 12 Sep 2019 20:02:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 8VITiVj6ysAGk8VIVie4gV; Thu, 12 Sep 2019 14:02:31 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=l6cWJHGsNtjFN6-XPN8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 3A29982F; Thu, 12 Sep 2019 13:02:29 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x8CK2SNn005045; Thu, 12 Sep 2019 13:02:28 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x8CK2Sxh005042; Thu, 12 Sep 2019 13:02:28 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909122002.x8CK2Sxh005042@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352231 - head/lib/libc/sys In-reply-to: <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> References: <201909111948.x8BJmWZn092483@repo.freebsd.org> <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> Comments: In-reply-to Ian Lepore message dated "Wed, 11 Sep 2019 15:50:09 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Sep 2019 13:02:28 -0700 X-CMAE-Envelope: MS4wfINYxAlxTGTeriFi7LBjI8+jN9KG+UtqyfvpktikZQ2r3dtqUjfCoWuOCgHfPN2vgSc0piP72FzfG8Zd+fr1fysHhjRFO2QKxXTqrYBfQU0yb6rtDvb3 vq/fCeOZNI5T+YI+Dnrn791FkiHa6uBSHgjQVPlzNatxaNPuZBrQppOMLCYwm0tspn4zCDVphi69HhrMlyisqyeAMNAFfGUWRc7gt4uddtjSuK6jx5UIE2At snY/AehKRNaS7J8ALNRv0JgbBDCeo4ZzXuLm6ZOOLhLSvcYZhod5H0qnfZZlRL3yIUTToUpE6umN+E8GO0RTEg== X-Rspamd-Queue-Id: 46TqS93QxXz3D4G X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.04 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.44)[ip: (-6.64), ipnet: 64.59.128.0/20(-3.08), asn: 6327(-2.39), country: CA(-0.09)]; RCVD_IN_DNSWL_NONE(0.00)[13.134.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 20:02:34 -0000 In message <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org>, Ian Le pore writes: > On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > > Author: asomers > > Date: Wed Sep 11 19:48:32 2019 > > New Revision: 352231 > > URL: https://svnweb.freebsd.org/changeset/base/352231 > > > > Log: > > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > > > When SO_TIMESTAMP is set, the kernel will attempt to attach a timestamp a > s > > ancillary data to each IP datagram that is received on the socket. Howeve > r, > > it may fail, for example due to insufficient memory. In that case the > > packet will still be received but not timestamp will be attached. > > > > Reviewed by: kib > > MFC after: 3 days > > Differential Revision: https://reviews.freebsd.org/D21607 > > > > Modified: > > head/lib/libc/sys/getsockopt.2 > > > > Modified: head/lib/libc/sys/getsockopt.2 > > =========================================================================== > === > > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 2019 (r35223 > 0) > > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 2019 (r35223 > 1) > > @@ -28,7 +28,7 @@ > > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > > .\" $FreeBSD$ > > .\" > > -.Dd February 10, 2019 > > +.Dd September 11, 2019 > > .Dt GETSOCKOPT 2 > > .Os > > .Sh NAME > > @@ -431,7 +431,8 @@ option is enabled on a > > .Dv SOCK_DGRAM > > socket, the > > .Xr recvmsg 2 > > -call will return a timestamp corresponding to when the datagram was receiv > ed. > > +call may return a timestamp corresponding to when the datagram was receive > d. > > +However, it may not, for example due to a resource shortage. > > The > > .Va msg_control > > field in the > > > > So I guess this actually happened to someone... is it a common thing > for the timestamp to fail? I ask because ntpd relies on SO_TIMESTAMP > and if this situation really happens and can persist for a long time, > ntpd would effectively stop working. This reminds me, something that's been on my plate for a couple of weeks. Our NTP upline pinged me a few weeks ago regarding IEEE 1588 driver support for NICs with hardware support. Linux already has it. I was told that someone hrtr has attempted this but that the results weren't optimal. That's all I know. Should I open discussion on arch@? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Sep 12 20:08:45 2019 Return-Path: Delivered-To: svn-src-all@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 9D4DFD90BE for ; Thu, 12 Sep 2019 20:08:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46TqbK1c3Xz3DGh for ; Thu, 12 Sep 2019 20:08:45 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568318924; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=UYFP/vrXt/3GLIVJUL8rRm6ko27fIpo6h2B4Pns1VmrwW/SQnuIxVxydKpQRCOZXC2hcaVv2Jj+yK C7XypvgmPF+ljwPHRpRrN5+mQEGFRGjPNGZi56bI/JYwgtmf0+vATfJYVbSH/iEVQ3+PEZHhpr3plX aQ0YqR2cacZjOShV124hECxiKvGqCpQ2RXhnIZeGTWIQAHd0pb2wPWbEHOc83gra2Rek5ToaQ3a3jf 8Ik2dLcIg+haqImfT8BXAiIQYTwezTMTHnfiiil7YdI0RZF90WyFtcEW5KXXi2jyBmx1PIj5/XrGXx FZLEMlObnDu341pdS8hFiXs7x+Y+Dnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=+SFcU6BMrUjrAXMTS6OGGwBtArUnAoudLl9sEDveU9k=; b=thvX/3I/0DAl1UFByhmnCWG5wLXxksFGaXnVPuJevMyLCJYn2mNSQVkmQWVlbUCEnnausnmR6zBy3 r7StxLmAcaHJBkpuLZyd8NpCYQsS23GfaqoyiAy+jon+5XDXwhC9XO3QQ1qNYV6vl8pS4G4v5571C5 ZpgpeFWUeB0OhvfMAgjNs08+VPS/wKobIXAJFtcF8DFq3zPNVl7SCZPyFXAdWJobTdrZP6i5d8EFqL mis/ZJKyPWEjMINq82MaxhxKTszaFY+jPm1hBS71XtnR3N/E/PEN2yP0Ikj+vMCaI2BDO4QXWpDJ3x IHvznJlazTMyeSswzExhXRr09TLmqsQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=+SFcU6BMrUjrAXMTS6OGGwBtArUnAoudLl9sEDveU9k=; b=dOa3jal0KpkFXN86TFsbKWMPOjEu+3PIRGNIOn0DUhRE31qOCPxhiv5tLFXPJtMZh1qXCkVIWvYrI tHUcaiXU/YX8MOSUGny02whI3mo/lmw/H+Ns80IvIt8BDhpArE0Qihp6QXwDDCQ0B/GPtl9Gth86Cz sdHE8bJkhDcUiA0vjNJfznS5hZN0DwM1/jZQx17cQEJokQn53MWwCwMf8aMW05OR9j0ctGpDs/nFUu fMM0w2yD32VudMCB8xG3y3Dd5x/Eid5BrFg/9ldyyEzp8ETUy83eOjuMrNuWEhMShpRvTs4eZWpopj d/oeVMpQUli9LtAcONj6A4iop5lxjdg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1cdd7cf8-d599-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 1cdd7cf8-d599-11e9-b67d-cdd75d6ce7a8; Thu, 12 Sep 2019 20:08:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8CK8dXN079051; Thu, 12 Sep 2019 14:08:40 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <20f4e7af5b82e47fddf604975ff3e853c231720d.camel@freebsd.org> Subject: Re: svn commit: r352231 - head/lib/libc/sys From: Ian Lepore To: Cy Schubert Cc: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 12 Sep 2019 14:08:39 -0600 In-Reply-To: <201909122002.x8CK2Sxh005042@slippy.cwsent.com> References: <201909111948.x8BJmWZn092483@repo.freebsd.org> <63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org> <201909122002.x8CK2Sxh005042@slippy.cwsent.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46TqbK1c3Xz3DGh X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 20:08:45 -0000 On Thu, 2019-09-12 at 13:02 -0700, Cy Schubert wrote: > In message < > 63cf915c92b92b07e19337849269ec6bd0dc0d1b.camel@freebsd.org>, > Ian Le > pore writes: > > On Wed, 2019-09-11 at 19:48 +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Wed Sep 11 19:48:32 2019 > > > New Revision: 352231 > > > URL: https://svnweb.freebsd.org/changeset/base/352231 > > > > > > Log: > > > getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable > > > > > > When SO_TIMESTAMP is set, the kernel will attempt to attach a > > > timestamp a > > > > s > > > ancillary data to each IP datagram that is received on the > > > socket. Howeve > > > > r, > > > it may fail, for example due to insufficient memory. In that > > > case the > > > packet will still be received but not timestamp will be > > > attached. > > > > > > Reviewed by: kib > > > MFC after: 3 days > > > Differential Revision: https://reviews.freebsd.org/D21607 > > > > > > Modified: > > > head/lib/libc/sys/getsockopt.2 > > > > > > Modified: head/lib/libc/sys/getsockopt.2 > > > ================================================================= > > > ========== > > > > === > > > --- head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:29:40 > > > 2019 (r35223 > > > > 0) > > > +++ head/lib/libc/sys/getsockopt.2 Wed Sep 11 19:48:32 > > > 2019 (r35223 > > > > 1) > > > @@ -28,7 +28,7 @@ > > > .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 > > > .\" $FreeBSD$ > > > .\" > > > -.Dd February 10, 2019 > > > +.Dd September 11, 2019 > > > .Dt GETSOCKOPT 2 > > > .Os > > > .Sh NAME > > > @@ -431,7 +431,8 @@ option is enabled on a > > > .Dv SOCK_DGRAM > > > socket, the > > > .Xr recvmsg 2 > > > -call will return a timestamp corresponding to when the datagram > > > was receiv > > > > ed. > > > +call may return a timestamp corresponding to when the datagram > > > was receive > > > > d. > > > +However, it may not, for example due to a resource shortage. > > > The > > > .Va msg_control > > > field in the > > > > > > > So I guess this actually happened to someone... is it a common > > thing > > for the timestamp to fail? I ask because ntpd relies on > > SO_TIMESTAMP > > and if this situation really happens and can persist for a long > > time, > > ntpd would effectively stop working. > > This reminds me, something that's been on my plate for a couple of > weeks. > Our NTP upline pinged me a few weeks ago regarding IEEE 1588 driver > support > for NICs with hardware support. Linux already has it. I was told > that > someone hrtr has attempted this but that the results weren't > optimal. > That's all I know. Should I open discussion on arch@? It's something I've been wanting to do for a while, and something that would be helpful at $work, so a discussion on it sounds like a good idea. -- Ian From owner-svn-src-all@freebsd.org Thu Sep 12 20:15:05 2019 Return-Path: Delivered-To: svn-src-all@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 A71E3D9390; Thu, 12 Sep 2019 20:15:05 +0000 (UTC) (envelope-from johalun@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 46Tqkd3ty2z3DhH; Thu, 12 Sep 2019 20:15:05 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 63F89240B2; Thu, 12 Sep 2019 20:15:05 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CKF571066059; Thu, 12 Sep 2019 20:15:05 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CKF5Tx066058; Thu, 12 Sep 2019 20:15:05 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201909122015.x8CKF5Tx066058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 12 Sep 2019 20:15: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: r352264 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 352264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 20:15:05 -0000 Author: johalun Date: Thu Sep 12 20:15:04 2019 New Revision: 352264 URL: https://svnweb.freebsd.org/changeset/base/352264 Log: MFC r345100: Implement task_euid() and get_task_state() function macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Thu Sep 12 18:53:29 2019 (r352263) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Thu Sep 12 20:15:04 2019 (r352264) @@ -96,7 +96,9 @@ struct task_struct { #define get_pid(x) (x) #define put_pid(x) do { } while (0) #define current_euid() (curthread->td_ucred->cr_uid) +#define task_euid(task) ((task)->task_thread->td_ucred->cr_uid) +#define get_task_state(task) atomic_read(&(task)->state) #define set_task_state(task, x) atomic_set(&(task)->state, (x)) #define __set_task_state(task, x) ((task)->state.counter = (x)) #define set_current_state(x) set_task_state(current, x) From owner-svn-src-all@freebsd.org Thu Sep 12 20:46:47 2019 Return-Path: Delivered-To: svn-src-all@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 57CA2D9F14; Thu, 12 Sep 2019 20:46:47 +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 46TrRC1dd9z3G2R; Thu, 12 Sep 2019 20:46:47 +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 1C45D24616; Thu, 12 Sep 2019 20:46:47 +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 x8CKkkY4083480; Thu, 12 Sep 2019 20:46:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CKkkrQ083479; Thu, 12 Sep 2019 20:46:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201909122046.x8CKkkrQ083479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Sep 2019 20:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352265 - head/contrib/mtree X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/contrib/mtree X-SVN-Commit-Revision: 352265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 20:46:47 -0000 Author: bdrewery Date: Thu Sep 12 20:46:46 2019 New Revision: 352265 URL: https://svnweb.freebsd.org/changeset/base/352265 Log: mtree -O: Fix not descending on hash collisions MFC after: 2 weeks Obtained from: NetBSD (nakayama) Modified: head/contrib/mtree/only.c Modified: head/contrib/mtree/only.c ============================================================================== --- head/contrib/mtree/only.c Thu Sep 12 20:15:04 2019 (r352264) +++ head/contrib/mtree/only.c Thu Sep 12 20:46:46 2019 (r352265) @@ -1,4 +1,4 @@ -/* $NetBSD: only.c,v 1.2 2013/02/05 00:59:03 christos Exp $ */ +/* $NetBSD: only.c,v 1.3 2017/09/07 04:04:13 nakayama Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: only.c,v 1.2 2013/02/05 00:59:03 christos Exp $"); +__RCSID("$NetBSD: only.c,v 1.3 2017/09/07 04:04:13 nakayama Exp $"); #endif #include @@ -89,11 +89,14 @@ static void hash_insert(char *str, uint32_t h) { struct hentry *e; + char *x; if ((e = malloc(sizeof(*e))) == NULL) mtree_err("memory allocation error"); + if ((x = strdup(str)) == NULL) + mtree_err("memory allocation error"); - e->str = str; + e->str = x; e->hash = h; e->next = table[h]; table[h] = e; @@ -110,10 +113,7 @@ fill(char *str) *ptr = '\0'; if (!hash_find(str, &h)) { - char *x = strdup(str); - if (x == NULL) - mtree_err("memory allocation error"); - hash_insert(x, h); + hash_insert(str, h); fill(str); } *ptr = '/'; @@ -135,6 +135,7 @@ load_only(const char *fname) err(1, "Duplicate entry %s", line); hash_insert(line, h); fill(line); + free(line); } fclose(fp); From owner-svn-src-all@freebsd.org Thu Sep 12 21:12:39 2019 Return-Path: Delivered-To: svn-src-all@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 E18A7DA630; Thu, 12 Sep 2019 21:12:39 +0000 (UTC) (envelope-from johalun@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 46Ts135N3Cz3HB8; Thu, 12 Sep 2019 21:12:39 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9BB6C24B6A; Thu, 12 Sep 2019 21:12:39 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8CLCdfK001134; Thu, 12 Sep 2019 21:12:39 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8CLCd4K001133; Thu, 12 Sep 2019 21:12:39 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201909122112.x8CLCd4K001133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 12 Sep 2019 21:12:39 +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: r352266 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 352266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 21:12:39 -0000 Author: johalun Date: Thu Sep 12 21:12:39 2019 New Revision: 352266 URL: https://svnweb.freebsd.org/changeset/base/352266 Log: MFC r345103: Implement more PCI speed related functions and macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Thu Sep 12 20:46:46 2019 (r352265) +++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Thu Sep 12 21:12:39 2019 (r352266) @@ -139,10 +139,13 @@ struct pci_device_id { #define PCI_EXP_TYPE_RC_EC PCIEM_TYPE_ROOT_EC /* Root Complex Event Collector */ #define PCI_EXP_LNKCAP_SLS_2_5GB 0x01 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP_SLS_5_0GB 0x02 /* Supported Link Speed 5.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_8_0GB 0x04 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_16_0GB 0x08 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCAP_MLW 0x03f0 /* Maximum Link Width */ #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCTL_HAWD PCIEM_LINK_CTL_HAWD #define PCI_EXP_LNKCAP_CLKPM 0x00040000 @@ -157,10 +160,19 @@ enum pci_bus_speed { PCIE_SPEED_2_5GT, PCIE_SPEED_5_0GT, PCIE_SPEED_8_0GT, + PCIE_SPEED_16_0GT, }; enum pcie_link_width { - PCIE_LNK_WIDTH_UNKNOWN = 0xFF, + PCIE_LNK_WIDTH_RESRV = 0x00, + PCIE_LNK_X1 = 0x01, + PCIE_LNK_X2 = 0x02, + PCIE_LNK_X4 = 0x04, + PCIE_LNK_X8 = 0x08, + PCIE_LNK_X12 = 0x0c, + PCIE_LNK_X16 = 0x10, + PCIE_LNK_X32 = 0x20, + PCIE_LNK_WIDTH_UNKNOWN = 0xff, }; typedef int pci_power_t; @@ -889,6 +901,67 @@ static inline int pci_num_vf(struct pci_dev *dev) { return (0); +} + +static inline enum pci_bus_speed +pcie_get_speed_cap(struct pci_dev *dev) +{ + device_t root; + uint32_t lnkcap, lnkcap2; + int error, pos; + + root = device_get_parent(dev->dev.bsddev); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + + if (pci_get_vendor(root) == PCI_VENDOR_ID_VIA || + pci_get_vendor(root) == PCI_VENDOR_ID_SERVERWORKS) + return (PCI_SPEED_UNKNOWN); + + if ((error = pci_find_cap(root, PCIY_EXPRESS, &pos)) != 0) + return (PCI_SPEED_UNKNOWN); + + lnkcap2 = pci_read_config(root, pos + PCIER_LINK_CAP2, 4); + + if (lnkcap2) { /* PCIe r3.0-compliant */ + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } else { /* pre-r3.0 */ + lnkcap = pci_read_config(root, pos + PCIER_LINK_CAP, 4); + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } + return (PCI_SPEED_UNKNOWN); +} + +static inline enum pcie_link_width +pcie_get_width_cap(struct pci_dev *dev) +{ + uint32_t lnkcap; + + pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); + if (lnkcap) + return ((lnkcap & PCI_EXP_LNKCAP_MLW) >> 4); + + return (PCIE_LNK_WIDTH_UNKNOWN); } #endif /* _LINUX_PCI_H_ */ From owner-svn-src-all@freebsd.org Thu Sep 12 21:27:40 2019 Return-Path: Delivered-To: svn-src-all@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 353EADAA11 for ; Thu, 12 Sep 2019 21:27:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TsLM2xmwz3HqS for ; Thu, 12 Sep 2019 21:27:39 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id q22so20452979ljj.2 for ; Thu, 12 Sep 2019 14:27:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=E7gchzoQeG+PKROtq3YQdXbKyh1iYiKnXSC2GbZ9/18=; b=sNvJfjDKmPdLv3A9/1nC75L/VcP7fXsGQXmDMiSDB3xFtNGUQbA7Pa3qqTRUmbu6Jv Sbh4oysUdxhcKP9L6XGONXNjuatjFVFrJv9WH4Oausl7CL+jZGLFKfEmjPRb4F43lFSO Cf4ykYoPczjF2a0iivEqxHQhI8Ji7kHmi/9j8YF+gi1JqfFQRjfgFe9KHYGGgsxhD+y9 Yf4gxTJHvinxPwRNSWFiwfrFfhtrQ570h/gGKhLkRSh3gO73Eb72Lz3AMKoXfxukVbjD +XSXeRTR/ph4XmCjsHbZqixravE1om0g71pO+grIbAaNIscaDQLfY0J5pYjr8ARzTiC9 OFXA== X-Gm-Message-State: APjAAAW+CAMc4y233sx9PY+F0BdXFAE2axpzfzWwE+8d7gSNrZBP3lpX LB4YPUIXK822KMvbVFJdsofGGwYLTKKWG+3d3uc= X-Received: by 2002:a2e:9098:: with SMTP id l24mt5430934ljg.0.1568323657462; Thu, 12 Sep 2019 14:27:37 -0700 (PDT) MIME-Version: 1.0 References: <201908191754.x7JHsf3D000662@repo.freebsd.org> In-Reply-To: <201908191754.x7JHsf3D000662@repo.freebsd.org> From: Alan Somers Date: Thu, 12 Sep 2019 15:27:25 -0600 Message-ID: Subject: Re: svn commit: r351226 - head/sbin/ping Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46TsLM2xmwz3HqS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.17 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.958,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[180.208.85.209.list.dnswl.org : 127.0.5.0]; MISSING_TO(2.00)[]; IP_SCORE(-1.21)[ip: (-0.44), ipnet: 209.85.128.0/17(-3.32), asn: 15169(-2.25), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[180.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 21:27:40 -0000 On Mon, Aug 19, 2019 at 11:54 AM Alan Somers wrote: > Author: asomers > Date: Mon Aug 19 17:54:40 2019 > New Revision: 351226 > URL: https://svnweb.freebsd.org/changeset/base/351226 > > Log: > Fix uninitialized variable warnings when MK_CASPER=3Dno > > Submitted by: J=C3=A1n Su=C4=8Dan > MFC after: 2 weeks > Sponsored by: Google, inc. (Google Summer of Code 2019) > Differential Revision: https://reviews.freebsd.org/D21322 > > Modified: > head/sbin/ping/ping.c > Correction: the commit message should've said "unused variable warnings", not "uninitialized variable warnings". -Alan From owner-svn-src-all@freebsd.org Fri Sep 13 00:53:09 2019 Return-Path: Delivered-To: svn-src-all@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 F1DF6E0575; Fri, 13 Sep 2019 00:53:09 +0000 (UTC) (envelope-from np@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 46TxvT5wCyz3yLW; Fri, 13 Sep 2019 00:53:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF76A2730B; Fri, 13 Sep 2019 00:53:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D0r9tP030262; Fri, 13 Sep 2019 00:53:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D0r9Yk030261; Fri, 13 Sep 2019 00:53:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201909130053.x8D0r9Yk030261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 Sep 2019 00:53: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: r352267 - stable/12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 352267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 00:53:10 -0000 Author: np Date: Fri Sep 13 00:53:09 2019 New Revision: 352267 URL: https://svnweb.freebsd.org/changeset/base/352267 Log: MFC r351446: cxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field implies that window scaling is not in use. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_listen.c Thu Sep 12 21:12:39 2019 (r352266) +++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 00:53:09 2019 (r352267) @@ -994,7 +994,7 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc to->to_mss = be16toh(t4opt->mss); } - if (t4opt->wsf) { + if (t4opt->wsf > 0 && t4opt->wsf < 15) { to->to_flags |= TOF_SCALE; to->to_wscale = t4opt->wsf; } From owner-svn-src-all@freebsd.org Fri Sep 13 00:58:34 2019 Return-Path: Delivered-To: svn-src-all@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 99119E06EE; Fri, 13 Sep 2019 00:58:34 +0000 (UTC) (envelope-from np@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 46Ty1k3W4Gz3yTx; Fri, 13 Sep 2019 00:58:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56CB82730C; Fri, 13 Sep 2019 00:58:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D0wYYW030554; Fri, 13 Sep 2019 00:58:34 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D0wYuJ030553; Fri, 13 Sep 2019 00:58:34 GMT (envelope-from np@FreeBSD.org) Message-Id: <201909130058.x8D0wYuJ030553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 Sep 2019 00:58: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: r352268 - stable/12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 352268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 00:58:34 -0000 Author: np Date: Fri Sep 13 00:58:33 2019 New Revision: 352268 URL: https://svnweb.freebsd.org/changeset/base/352268 Log: MFC r351524: cxgbe/t4_tom: Limit work requests with immediate payload to a single descriptor. The per-tid tx credits are in demand during active Tx and it's best not to use too many just for payload. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 00:53:09 2019 (r352267) +++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 00:58:33 2019 (r352268) @@ -562,7 +562,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) static inline int max_imm_payload(int tx_credits) { - const int n = 2; /* Use only up to 2 desc for imm. data WR */ + const int n = 1; /* Use no more than one desc for imm. data WR */ KASSERT(tx_credits >= 0 && tx_credits <= MAX_OFLD_TX_CREDITS, From owner-svn-src-all@freebsd.org Fri Sep 13 01:12:19 2019 Return-Path: Delivered-To: svn-src-all@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 6FE50E0E3C; Fri, 13 Sep 2019 01:12:19 +0000 (UTC) (envelope-from np@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 46TyKb35Pjz40Pp; Fri, 13 Sep 2019 01:12:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D20227667; Fri, 13 Sep 2019 01:12:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D1CJfI041123; Fri, 13 Sep 2019 01:12:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D1CHEZ041114; Fri, 13 Sep 2019 01:12:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201909130112.x8D1CHEZ041114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 Sep 2019 01:12: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: r352271 - in stable/12/sys/dev/cxgbe: . cxgbei iw_cxgbe tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: . cxgbei iw_cxgbe tom X-SVN-Commit-Revision: 352271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 01:12:19 -0000 Author: np Date: Fri Sep 13 01:12:17 2019 New Revision: 352271 URL: https://svnweb.freebsd.org/changeset/base/352271 Log: MFC r351540, r351590 r351540: cxgbe/t4_tom: Initialize all TOE connection parameters in one place. Remove now-redundant items from toepcb and synq_entry and the code to support them. Let the driver calculate tx_align, rx_coalesce, and sndbuf by default. Reviewed by: jhb@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21387 r351590: cxgbe/t4_tom: Use the correct value of sndbuf in AIO Tx. This should have been part of r351540. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c stable/12/sys/dev/cxgbe/t4_main.c stable/12/sys/dev/cxgbe/tom/t4_connect.c stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c stable/12/sys/dev/cxgbe/tom/t4_ddp.c stable/12/sys/dev/cxgbe/tom/t4_listen.c stable/12/sys/dev/cxgbe/tom/t4_tls.c stable/12/sys/dev/cxgbe/tom/t4_tom.c stable/12/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Fri Sep 13 01:12:17 2019 (r352271) @@ -696,7 +696,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) ISCSI_DATA_DIGEST_SIZE; } so->so_options |= SO_NO_DDP; - toep->ulp_mode = ULP_MODE_ISCSI; + toep->params.ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); Modified: stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Sep 13 01:12:17 2019 (r352271) @@ -1415,7 +1415,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw ret = c4iw_wait_for_reply(rdev, &ep->com.wr_wait, ep->hwtid, qhp->wq.sq.qid, ep->com.so, __func__); - toep->ulp_mode = ULP_MODE_RDMA; + toep->params.ulp_mode = ULP_MODE_RDMA; free_ird(rhp, qhp->attr.max_ird); return ret; Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/t4_main.c Fri Sep 13 01:12:17 2019 (r352271) @@ -6231,15 +6231,15 @@ t4_sysctls(struct adapter *sc) "(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, " "3 = highspeed)"); - sc->tt.sndbuf = 256 * 1024; + sc->tt.sndbuf = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW, - &sc->tt.sndbuf, 0, "max hardware send buffer size"); + &sc->tt.sndbuf, 0, "hardware send buffer"); sc->tt.ddp = 0; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", CTLFLAG_RW, &sc->tt.ddp, 0, "DDP allowed"); - sc->tt.rx_coalesce = 1; + sc->tt.rx_coalesce = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); @@ -6251,7 +6251,7 @@ t4_sysctls(struct adapter *sc) CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, "I", "TCP ports that use inline TLS+TOE RX"); - sc->tt.tx_align = 1; + sc->tt.tx_align = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload"); Modified: stable/12/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_connect.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/tom/t4_connect.c Fri Sep 13 01:12:17 2019 (r352271) @@ -102,7 +102,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_h make_established(toep, be32toh(cpl->snd_isn) - 1, be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt); - if (toep->ulp_mode == ULP_MODE_TLS) + if (ulp_mode(toep) == ULP_MODE_TLS) tls_establish(toep); done: @@ -165,96 +165,6 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_he return (0); } -/* - * Options2 for active open. - */ -static uint32_t -calc_opt2a(struct socket *so, struct toepcb *toep, - const struct offload_settings *s) -{ - struct tcpcb *tp = so_sototcpcb(so); - struct port_info *pi = toep->vi->pi; - struct adapter *sc = pi->adapter; - uint32_t opt2 = 0; - - /* - * rx flow control, rx coalesce, congestion control, and tx pace are all - * explicitly set by the driver. On T5+ the ISS is also set by the - * driver to the value picked by the kernel. - */ - if (is_t4(sc)) { - opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; - opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; - } else { - opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ - opt2 |= F_T5_ISS; /* ISS provided in CPL */ - } - - if (s->sack > 0 || (s->sack < 0 && (tp->t_flags & TF_SACK_PERMIT))) - opt2 |= F_SACK_EN; - - if (s->tstamp > 0 || (s->tstamp < 0 && (tp->t_flags & TF_REQ_TSTMP))) - opt2 |= F_TSTAMPS_EN; - - if (tp->t_flags & TF_REQ_SCALE) - opt2 |= F_WND_SCALE_EN; - - if (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn == 1)) - opt2 |= F_CCTRL_ECN; - - /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ - - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - - /* These defaults are subject to ULP specific fixups later. */ - opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); - - opt2 |= V_PACE(0); - - if (s->cong_algo >= 0) - opt2 |= V_CONG_CNTRL(s->cong_algo); - else if (sc->tt.cong_algorithm >= 0) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); - else { - struct cc_algo *cc = CC_ALGO(tp); - - if (strcasecmp(cc->name, "reno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); - else if (strcasecmp(cc->name, "tahoe") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); - if (strcasecmp(cc->name, "newreno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - if (strcasecmp(cc->name, "highspeed") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); - else { - /* - * Use newreno in case the algorithm selected by the - * host stack is not supported by the hardware. - */ - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - } - } - - if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) - opt2 |= V_RX_COALESCE(M_RX_COALESCE); - - /* Note that ofld_rxq is already set according to s->rxq. */ - opt2 |= F_RSS_QUEUE_VALID; - opt2 |= V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); - -#ifdef USE_DDP_RX_FLOW_CONTROL - if (toep->ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_DDP; -#endif - - if (toep->ulp_mode == ULP_MODE_TLS) { - opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); - opt2 |= F_RX_FC_DISABLE; - } - - return (htobe32(opt2)); -} - void t4_init_connect_cpl_handlers(void) { @@ -322,7 +232,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; struct vi_info *vi; - int mtu_idx, rscale, qid_atid, rc, isipv6, txqid, rxqid; + int qid_atid, rc, isipv6; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); int reason; @@ -353,18 +263,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (!settings.offload) DONT_OFFLOAD_ACTIVE_OPEN(EPERM); - if (settings.txq >= 0 && settings.txq < vi->nofldtxq) - txqid = settings.txq; - else - txqid = arc4random() % vi->nofldtxq; - txqid += vi->first_ofld_txq; - if (settings.rxq >= 0 && settings.rxq < vi->nofldrxq) - rxqid = settings.rxq; - else - rxqid = arc4random() % vi->nofldrxq; - rxqid += vi->first_ofld_rxq; - - toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT | M_ZERO); + toep = alloc_toepcb(vi, M_NOWAIT); if (toep == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); @@ -377,27 +276,16 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (toep->l2te == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; + init_conn_params(vi, &settings, &inp->inp_inc, so, NULL, + toep->l2te->idx, &toep->params); + init_toepcb(vi, toep); + isipv6 = nam->sa_family == AF_INET6; wr = alloc_wrqe(act_open_cpl_size(sc, isipv6), toep->ctrlq); if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - toep->vnet = so->so_vnet; - set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); - SOCKBUF_LOCK(&so->so_rcv); - toep->opt0_rcv_bufsize = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); - SOCKBUF_UNLOCK(&so->so_rcv); - - /* - * The kernel sets request_r_scale based on sb_max whereas we need to - * take hardware's MAX_RCV_WND into account too. This is normally a - * no-op as MAX_RCV_WND is much larger than the default sb_max. - */ - if (tp->t_flags & TF_REQ_SCALE) - rscale = tp->request_r_scale = select_rcv_wscale(); - else - rscale = 0; - mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, &settings); qid_atid = V_TID_QID(toep->ofld_rxq->iq.abs_id) | V_TID_TID(toep->tid) | V_TID_COOKIE(CPL_COOKIE_TOM); @@ -438,9 +326,13 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_port = inp->inp_fport; cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; - cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); - cpl->opt2 = calc_opt2a(so, toep, &settings); + cpl->opt0 = calc_options0(vi, &toep->params); + cpl->opt2 = calc_options2(vi, &toep->params); + + CTR6(KTR_CXGBE, + "%s: atid %u, toep %p, inp %p, opt0 %#016lx, opt2 %#08x", + __func__, toep->tid, toep, inp, be64toh(cpl->opt0), + be32toh(cpl->opt2)); } else { struct cpl_act_open_req *cpl = wrtod(wr); struct cpl_t5_act_open_req *cpl5 = (void *)cpl; @@ -467,13 +359,14 @@ t4_connect(struct toedev *tod, struct socket *so, stru qid_atid)); inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); - cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); - cpl->opt2 = calc_opt2a(so, toep, &settings); - } + cpl->opt0 = calc_options0(vi, &toep->params); + cpl->opt2 = calc_options2(vi, &toep->params); - CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, - toep->tid, tcpstates[tp->t_state], toep, inp); + CTR6(KTR_CXGBE, + "%s: atid %u, toep %p, inp %p, opt0 %#016lx, opt2 %#08x", + __func__, toep->tid, toep, inp, be64toh(cpl->opt0), + be32toh(cpl->opt2)); + } offload_socket(so, toep); rc = t4_l2t_send(sc, wr, toep->l2te); Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 01:12:17 2019 (r352271) @@ -99,7 +99,7 @@ aiotx_mbuf_pages(struct mbuf *m) } void -send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) +send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) { struct wrqe *wr; struct fw_flowc_wr *flowc; @@ -113,17 +113,17 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), ("%s: flowc for tid %u sent already", __func__, toep->tid)); - if (ftxp != NULL) + if (tp != NULL) nparams = 8; else nparams = 6; - if (toep->ulp_mode == ULP_MODE_TLS) + if (ulp_mode(toep) == ULP_MODE_TLS) nparams++; if (toep->tls.fcplenmax != 0) nparams++; - if (toep->tc_idx != -1) { - MPASS(toep->tc_idx >= 0 && - toep->tc_idx < sc->chip_params->nsched_cls); + if (toep->params.tc_idx != -1) { + MPASS(toep->params.tc_idx >= 0 && + toep->params.tc_idx < sc->chip_params->nsched_cls); nparams++; } @@ -155,30 +155,23 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par FLOWC_PARAM(CH, pi->tx_chan); FLOWC_PARAM(PORT, pi->tx_chan); FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); - if (ftxp) { - uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); - - FLOWC_PARAM(SNDNXT, ftxp->snd_nxt); - FLOWC_PARAM(RCVNXT, ftxp->rcv_nxt); - FLOWC_PARAM(SNDBUF, sndbuf); - FLOWC_PARAM(MSS, ftxp->mss); - - CTR6(KTR_CXGBE, - "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x", - __func__, toep->tid, ftxp->mss, sndbuf, ftxp->snd_nxt, - ftxp->rcv_nxt); - } else { - FLOWC_PARAM(SNDBUF, 512); - FLOWC_PARAM(MSS, 512); - - CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); + FLOWC_PARAM(SNDBUF, toep->params.sndbuf); + FLOWC_PARAM(MSS, toep->params.emss); + if (tp) { + FLOWC_PARAM(SNDNXT, tp->snd_nxt); + FLOWC_PARAM(RCVNXT, tp->rcv_nxt); } - if (toep->ulp_mode == ULP_MODE_TLS) - FLOWC_PARAM(ULP_MODE, toep->ulp_mode); + CTR6(KTR_CXGBE, + "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x", + __func__, toep->tid, toep->params.emss, toep->params.sndbuf, + tp ? tp->snd_nxt : 0, tp ? tp->rcv_nxt : 0); + + if (ulp_mode(toep) == ULP_MODE_TLS) + FLOWC_PARAM(ULP_MODE, ulp_mode(toep)); if (toep->tls.fcplenmax != 0) FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); - if (toep->tc_idx != -1) - FLOWC_PARAM(SCHEDCLASS, toep->tc_idx); + if (toep->params.tc_idx != -1) + FLOWC_PARAM(SCHEDCLASS, toep->params.tc_idx); #undef FLOWC_PARAM KASSERT(paramidx == nparams, ("nparams mismatch")); @@ -219,7 +212,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb MPASS(tc_idx >= 0 && tc_idx < sc->chip_params->nsched_cls); } - if (toep->tc_idx != tc_idx) { + if (toep->params.tc_idx != tc_idx) { struct wrqe *wr; struct fw_flowc_wr *flowc; int nparams = 1, flowclen, flowclen16; @@ -258,9 +251,9 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb t4_wrq_tx(sc, wr); } - if (toep->tc_idx >= 0) - t4_release_cl_rl(sc, port_id, toep->tc_idx); - toep->tc_idx = tc_idx; + if (toep->params.tc_idx >= 0) + t4_release_cl_rl(sc, port_id, toep->params.tc_idx); + toep->params.tc_idx = tc_idx; return (0); } @@ -335,30 +328,30 @@ assign_rxopt(struct tcpcb *tp, uint16_t opt) INP_LOCK_ASSERT(inp); - toep->tcp_opt = opt; - toep->mtu_idx = G_TCPOPT_MSS(opt); - tp->t_maxseg = sc->params.mtus[toep->mtu_idx]; + toep->params.mtu_idx = G_TCPOPT_MSS(opt); + tp->t_maxseg = sc->params.mtus[toep->params.mtu_idx]; if (inp->inp_inc.inc_flags & INC_ISIPV6) tp->t_maxseg -= sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else tp->t_maxseg -= sizeof(struct ip) + sizeof(struct tcphdr); - toep->emss = tp->t_maxseg; + toep->params.emss = tp->t_maxseg; if (G_TCPOPT_TSTAMP(opt)) { + toep->params.tstamp = 1; + toep->params.emss -= TCPOLEN_TSTAMP_APPA; tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); - toep->emss -= TCPOLEN_TSTAMP_APPA; - } + } else + toep->params.tstamp = 0; - CTR6(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), t_maxseg %u, emss %u", - __func__, toep->tid, toep->mtu_idx, - sc->params.mtus[G_TCPOPT_MSS(opt)], tp->t_maxseg, toep->emss); - - if (G_TCPOPT_SACK(opt)) + if (G_TCPOPT_SACK(opt)) { + toep->params.sack = 1; tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ - else + } else { + toep->params.sack = 0; tp->t_flags &= ~TF_SACK_PERMIT; /* sack disallowed by peer */ + } if (G_TCPOPT_WSCALE_OK(opt)) tp->t_flags |= TF_RCVD_SCALE; @@ -368,7 +361,13 @@ assign_rxopt(struct tcpcb *tp, uint16_t opt) (TF_RCVD_SCALE | TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; tp->snd_scale = G_TCPOPT_SND_WSCALE(opt); - } + } else + toep->params.wscale = 0; + + CTR6(KTR_CXGBE, + "assign_rxopt: tid %d, mtu_idx %u, emss %u, ts %u, sack %u, wscale %u", + toep->tid, toep->params.mtu_idx, toep->params.emss, + toep->params.tstamp, toep->params.sack, toep->params.wscale); } /* @@ -383,9 +382,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui struct inpcb *inp = toep->inp; struct socket *so = inp->inp_socket; struct tcpcb *tp = intotcpcb(inp); - long bufsize; uint16_t tcpopt = be16toh(opt); - struct flowc_tx_params ftxp; INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || @@ -401,7 +398,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = (u_int)toep->opt0_rcv_bufsize << 10; + tp->rcv_wnd = (u_int)toep->params.opt0_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; @@ -412,20 +409,8 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->snd_max = iss + 1; assign_rxopt(tp, tcpopt); + send_flowc_wr(toep, tp); - SOCKBUF_LOCK(&so->so_snd); - if (so->so_snd.sb_flags & SB_AUTOSIZE && V_tcp_do_autosndbuf) - bufsize = V_tcp_autosndbuf_max; - else - bufsize = sbspace(&so->so_snd); - SOCKBUF_UNLOCK(&so->so_snd); - - ftxp.snd_nxt = tp->snd_nxt; - ftxp.rcv_nxt = tp->rcv_nxt; - ftxp.snd_space = bufsize; - ftxp.mss = toep->emss; - send_flowc_wr(toep, &ftxp); - soisconnected(so); } @@ -481,7 +466,7 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) SOCKBUF_LOCK_ASSERT(sb); rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { if (toep->tls.rcv_over >= rx_credits) { toep->tls.rcv_over -= rx_credits; rx_credits = 0; @@ -600,7 +585,7 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove, int ulp_submode, int txalign) + unsigned int plen, uint8_t credits, int shove, int ulp_submode) { struct fw_ofld_tx_data_wr *txwr = dst; @@ -608,20 +593,18 @@ write_tx_wr(void *dst, struct toepcb *toep, unsigned i V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); - txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(toep->ulp_mode) | + txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(ulp_mode(toep)) | V_TX_ULP_SUBMODE(ulp_submode) | V_TX_URG(0) | V_TX_SHOVE(shove)); txwr->plen = htobe32(plen); - if (txalign > 0) { - struct tcpcb *tp = intotcpcb(toep->inp); - - if (plen < 2 * toep->emss) + if (toep->params.tx_align > 0) { + if (plen < 2 * toep->params.emss) txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE); else txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_ALIGNPLD | - (tp->t_flags & TF_NODELAY ? 0 : + (toep->params.nagle == 0 ? 0 : F_FW_OFLD_TX_DATA_WR_ALIGNPLDSHOVE)); } } @@ -717,11 +700,11 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); - KASSERT(toep->ulp_mode == ULP_MODE_NONE || - toep->ulp_mode == ULP_MODE_TCPDDP || - toep->ulp_mode == ULP_MODE_TLS || - toep->ulp_mode == ULP_MODE_RDMA, - ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + KASSERT(ulp_mode(toep) == ULP_MODE_NONE || + ulp_mode(toep) == ULP_MODE_TCPDDP || + ulp_mode(toep) == ULP_MODE_TLS || + ulp_mode(toep) == ULP_MODE_RDMA, + ("%s: ulp_mode %u for toep %p", __func__, ulp_mode(toep), toep)); #ifdef VERBOSE_TRACES CTR5(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d", @@ -861,8 +844,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, plen, credits, shove, 0, - sc->tt.tx_align); + write_tx_wr(txwr, toep, plen, plen, credits, shove, 0); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -880,8 +862,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, plen, credits, shove, 0, - sc->tt.tx_align); + write_tx_wr(txwr, toep, 0, plen, credits, shove, 0); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -901,7 +882,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep toep->tx_nocompl >= toep->tx_total / 4) compl = 1; - if (compl || toep->ulp_mode == ULP_MODE_RDMA) { + if (compl || ulp_mode(toep) == ULP_MODE_RDMA) { txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); toep->tx_nocompl = 0; toep->plen_nocompl = 0; @@ -975,8 +956,8 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, INP_WLOCK_ASSERT(inp); KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); - KASSERT(toep->ulp_mode == ULP_MODE_ISCSI, - ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + KASSERT(ulp_mode(toep) == ULP_MODE_ISCSI, + ("%s: ulp_mode %u for toep %p", __func__, ulp_mode(toep), toep)); if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) return; @@ -1059,7 +1040,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); write_tx_wr(txwr, toep, plen, adjusted_plen, credits, - shove, ulp_submode, sc->tt.tx_align); + shove, ulp_submode); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -1077,7 +1058,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, txwr = wrtod(wr); credits = howmany(wr_len, 16); write_tx_wr(txwr, toep, 0, adjusted_plen, credits, - shove, ulp_submode, sc->tt.tx_align); + shove, ulp_submode); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -1143,7 +1124,7 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp) ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, 0); @@ -1169,7 +1150,7 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp) toep->flags |= TPF_SEND_FIN; if (tp->t_state >= TCPS_ESTABLISHED) { - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, 0); @@ -1256,7 +1237,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head so = inp->inp_socket; socantrcvmore(so); - if (toep->ulp_mode == ULP_MODE_TCPDDP) { + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { DDP_LOCK(toep); if (__predict_false(toep->ddp.flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) @@ -1264,7 +1245,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head DDP_UNLOCK(toep); } - if (toep->ulp_mode != ULP_MODE_RDMA) { + if (ulp_mode(toep) != ULP_MODE_RDMA) { KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt), ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt, be32toh(cpl->rcv_nxt))); @@ -1575,14 +1556,14 @@ do_rx_data(struct sge_iq *iq, const struct rss_header tp->rcv_nxt += len; if (tp->rcv_wnd < len) { - KASSERT(toep->ulp_mode == ULP_MODE_RDMA, + KASSERT(ulp_mode(toep) == ULP_MODE_RDMA, ("%s: negative window size", __func__)); } tp->rcv_wnd -= len; tp->t_rcvtime = ticks; - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_LOCK(toep); so = inp_inpcbtosocket(inp); sb = &so->so_rcv; @@ -1593,7 +1574,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header __func__, tid, len); m_freem(m); SOCKBUF_UNLOCK(sb); - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_UNLOCK(toep); INP_WUNLOCK(inp); @@ -1624,7 +1605,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header sb->sb_flags &= ~SB_AUTOSIZE; } - if (toep->ulp_mode == ULP_MODE_TCPDDP) { + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { int changed = !(toep->ddp.flags & DDP_ON) ^ cpl->ddp_off; if (toep->ddp.waiting_count != 0 || toep->ddp.active_count != 0) @@ -1667,7 +1648,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header tp->rcv_adv += rx_credits; } - if (toep->ulp_mode == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && + if (ulp_mode(toep) == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && sbavail(sb) != 0) { CTR2(KTR_CXGBE, "%s: tid %u queueing AIO task", __func__, tid); @@ -1675,7 +1656,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header } sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(sb); - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_UNLOCK(toep); INP_WUNLOCK(inp); @@ -1785,7 +1766,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header #endif toep->flags &= ~TPF_TX_SUSPENDED; CURVNET_SET(toep->vnet); - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, plen); @@ -1798,7 +1779,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header SOCKBUF_LOCK(sb); sbu = sbused(sb); - if (toep->ulp_mode == ULP_MODE_ISCSI) { + if (ulp_mode(toep) == ULP_MODE_ISCSI) { if (__predict_false(sbu > 0)) { /* @@ -2013,7 +1994,6 @@ hold_aio(struct kaiocb *job) static void t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) { - struct adapter *sc; struct sockbuf *sb; struct file *fp; struct aiotx_buffer *ab; @@ -2023,7 +2003,6 @@ t4_aiotx_process_job(struct toepcb *toep, struct socke int error; bool moretocome, sendmore; - sc = td_adapter(toep->td); sb = &so->so_snd; SOCKBUF_UNLOCK(sb); fp = job->fd_file; @@ -2107,8 +2086,8 @@ sendanother: moretocome = false; } else moretocome = true; - if (m->m_len > sc->tt.sndbuf) { - m->m_len = sc->tt.sndbuf; + if (m->m_len > toep->params.sndbuf) { + m->m_len = toep->params.sndbuf; sendmore = true; } else sendmore = false; Modified: stable/12/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_ddp.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/tom/t4_ddp.c Fri Sep 13 01:12:17 2019 (r352271) @@ -769,7 +769,7 @@ do_rx_data_ddp(struct sge_iq *iq, const struct rss_hea __func__, vld, tid, toep); } - if (toep->ulp_mode == ULP_MODE_ISCSI) { + if (ulp_mode(toep) == ULP_MODE_ISCSI) { t4_cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); return (0); } Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:12:17 2019 (r352271) @@ -348,7 +348,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry struct ifnet *ifp = m->m_pkthdr.rcvif; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; struct wrqe *wr; struct fw_flowc_wr *flowc; struct cpl_abort_req *req; @@ -368,8 +368,8 @@ send_reset_synqe(struct toedev *tod, struct synq_entry return; /* abort already in progress */ synqe->flags |= TPF_ABORT_SHUTDOWN; - ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; - ofld_rxq = &sc->sge.ofld_rxq[synqe->rxqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; + ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; /* The wrqe will have two WRs - a flowc followed by an abort_req */ flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -836,7 +836,7 @@ done_with_synqe(struct adapter *sc, struct synq_entry { struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; int ntids; INP_WLOCK_ASSERT(inp); @@ -887,7 +887,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss INP_WLOCK(inp); - ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; /* * If we'd initiated an abort earlier the reply to it is responsible for @@ -962,28 +962,6 @@ t4_offload_socket(struct toedev *tod, void *arg, struc synqe->flags |= TPF_SYNQE_EXPANDED; } -static inline void -save_qids_in_synqe(struct synq_entry *synqe, struct vi_info *vi, - struct offload_settings *s) -{ - uint32_t txqid, rxqid; - - if (s->txq >= 0 && s->txq < vi->nofldtxq) - txqid = s->txq; - else - txqid = arc4random() % vi->nofldtxq; - txqid += vi->first_ofld_txq; - - if (s->rxq >= 0 && s->rxq < vi->nofldrxq) - rxqid = s->rxq; - else - rxqid = arc4random() % vi->nofldrxq; - rxqid += vi->first_ofld_rxq; - - synqe->txqid = txqid; - synqe->rxqid = rxqid; -} - static void t4opt_to_tcpopt(const struct tcp_options *t4opt, struct tcpopt *to) { @@ -1006,95 +984,6 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc to->to_flags |= TOF_SACKPERM; } -/* - * Options2 for passive open. - */ -static uint32_t -calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, - const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode, - struct cc_algo *cc, const struct offload_settings *s) -{ - struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid]; - uint32_t opt2 = 0; - - /* - * rx flow control, rx coalesce, congestion control, and tx pace are all - * explicitly set by the driver. On T5+ the ISS is also set by the - * driver to the value picked by the kernel. - */ - if (is_t4(sc)) { - opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; - opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; - } else { - opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ - opt2 |= F_T5_ISS; /* ISS provided in CPL */ - } - - if (tcpopt->sack && (s->sack > 0 || (s->sack < 0 && V_tcp_do_rfc1323))) - opt2 |= F_SACK_EN; - - if (tcpopt->tstamp && - (s->tstamp > 0 || (s->tstamp < 0 && V_tcp_do_rfc1323))) - opt2 |= F_TSTAMPS_EN; - - if (tcpopt->wsf < 15 && V_tcp_do_rfc1323) - opt2 |= F_WND_SCALE_EN; - - if (th->th_flags & (TH_ECE | TH_CWR) && - (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn))) - opt2 |= F_CCTRL_ECN; - - /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ - - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - - /* These defaults are subject to ULP specific fixups later. */ - opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); - - opt2 |= V_PACE(0); - - if (s->cong_algo >= 0) - opt2 |= V_CONG_CNTRL(s->cong_algo); - else if (sc->tt.cong_algorithm >= 0) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); - else { - if (strcasecmp(cc->name, "reno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); - else if (strcasecmp(cc->name, "tahoe") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); - if (strcasecmp(cc->name, "newreno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - if (strcasecmp(cc->name, "highspeed") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); - else { - /* - * Use newreno in case the algorithm selected by the - * host stack is not supported by the hardware. - */ - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - } - } - - if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) - opt2 |= V_RX_COALESCE(M_RX_COALESCE); - - /* Note that ofld_rxq is already set according to s->rxq. */ - opt2 |= F_RSS_QUEUE_VALID; - opt2 |= V_RSS_QUEUE(ofld_rxq->iq.abs_id); - -#ifdef USE_DDP_RX_FLOW_CONTROL - if (ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_DDP; -#endif - - if (ulp_mode == ULP_MODE_TLS) { - opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); - opt2 |= F_RX_FC_DISABLE; - } - - return (htobe32(opt2)); -} - static void pass_accept_req_to_protohdrs(struct adapter *sc, const struct mbuf *m, struct in_conninfo *inc, struct tcphdr *th) @@ -1189,7 +1078,7 @@ send_synack(struct adapter *sc, struct synq_entry *syn { struct wrqe *wr; struct cpl_pass_accept_rpl *rpl; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[0]); @@ -1385,6 +1274,9 @@ found: } atomic_store_int(&synqe->ok_to_respond, 0); + init_conn_params(vi, &settings, &inc, so, &cpl->tcpopt, e->idx, + &synqe->params); + /* * If all goes well t4_syncache_respond will get called during * syncache_add. Note that syncache_add releases the pcb lock. @@ -1395,27 +1287,12 @@ found: if (atomic_load_int(&synqe->ok_to_respond) > 0) { uint64_t opt0; uint32_t opt2; - u_int wnd; - int rscale, mtu_idx, rx_credits; - mtu_idx = find_best_mtu_idx(sc, &inc, &settings); - rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); - wnd = min(wnd, MAX_RCV_WND); - rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); + opt0 = calc_options0(vi, &synqe->params); + opt2 = calc_options2(vi, &synqe->params); - save_qids_in_synqe(synqe, vi, &settings); - synqe->ulp_mode = select_ulp_mode(so, sc, &settings); - - opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, - synqe->ulp_mode, &settings); - opt2 = calc_opt2p(sc, pi, synqe->rxqid, &cpl->tcpopt, &th, - synqe->ulp_mode, CC_ALGO(intotcpcb(inp)), &settings); - insert_tid(sc, tid, synqe, ntids); synqe->tid = tid; - synqe->l2e_idx = e->idx; - synqe->rcv_bufsize = rx_credits; synqe->syn = m; m = NULL; @@ -1427,8 +1304,8 @@ found: } CTR6(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p, mode %d, SYNACK", - __func__, stid, tid, lctx, synqe, synqe->ulp_mode); + "%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x", + __func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2)); } else REJECT_PASS_ACCEPT_REQ(false); @@ -1540,18 +1417,19 @@ reset: return (0); } - KASSERT(synqe->rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], + KASSERT(synqe->params.rxq_idx == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], ("%s: CPL arrived on unexpected rxq. %d %d", __func__, - synqe->rxqid, (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); + synqe->params.rxq_idx, + (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); - toep = alloc_toepcb(vi, synqe->txqid, synqe->rxqid, M_NOWAIT); + toep = alloc_toepcb(vi, M_NOWAIT); if (toep == NULL) goto reset; toep->tid = tid; - toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; + toep->l2te = &sc->l2t->l2tab[synqe->params.l2t_idx]; toep->vnet = lctx->vnet; - set_ulp_mode(toep, synqe->ulp_mode); - toep->opt0_rcv_bufsize = synqe->rcv_bufsize; + bcopy(&synqe->params, &toep->params, sizeof(toep->params)); + init_toepcb(vi, toep); MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.c Fri Sep 13 01:07:19 2019 (r352270) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.c Fri Sep 13 01:12:17 2019 (r352271) @@ -589,7 +589,7 @@ program_key_context(struct tcpcb *tp, struct toepcb *t "KEY_WRITE_TX", uk_ctx->proto_ver); if (G_KEY_GET_LOC(uk_ctx->l_p_key) == KEY_WRITE_RX && - toep->ulp_mode != ULP_MODE_TLS) + ulp_mode(toep) != ULP_MODE_TLS) return (EOPNOTSUPP); /* Don't copy the 'tx' and 'rx' fields. */ @@ -787,7 +787,7 @@ t4_ctloutput_tls(struct socket *so, struct sockopt *so INP_WUNLOCK(inp); break; case TCP_TLSOM_CLR_TLS_TOM: - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { CTR2(KTR_CXGBE, "%s: tid %d CLR_TLS_TOM", __func__, toep->tid); tls_clr_ofld_mode(toep); @@ -796,7 +796,7 @@ t4_ctloutput_tls(struct socket *so, struct sockopt *so INP_WUNLOCK(inp); break; case TCP_TLSOM_CLR_QUIES: - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 13 01:14:59 2019 Return-Path: Delivered-To: svn-src-all@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 1547EE0F1E; Fri, 13 Sep 2019 01:14:59 +0000 (UTC) (envelope-from np@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 46TyNf6pNzz40j9; Fri, 13 Sep 2019 01:14:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C927227683; Fri, 13 Sep 2019 01:14:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D1Ewqq042198; Fri, 13 Sep 2019 01:14:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D1EwA7042197; Fri, 13 Sep 2019 01:14:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201909130114.x8D1EwA7042197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 Sep 2019 01:14: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: r352272 - stable/12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 352272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 01:14:59 -0000 Author: np Date: Fri Sep 13 01:14:58 2019 New Revision: 352272 URL: https://svnweb.freebsd.org/changeset/base/352272 Log: MFC r351445: whitespace nit. Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:12:17 2019 (r352271) +++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:14:58 2019 (r352272) @@ -1034,7 +1034,7 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifne struct l2t_entry *e; struct sockaddr_in6 sin6; struct sockaddr *dst = (void *)&sin6; - + if (inc->inc_flags & INC_ISIPV6) { struct nhop6_basic nh6; From owner-svn-src-all@freebsd.org Fri Sep 13 04:11:20 2019 Return-Path: Delivered-To: svn-src-all@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 7608EE416A; Fri, 13 Sep 2019 04:11:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V2J82XhKz46VS; Fri, 13 Sep 2019 04:11:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (unknown [51.52.172.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B55048881; Fri, 13 Sep 2019 04:11:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r352248 - head/usr.sbin/ntp/libntp To: Ian Lepore , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909121546.x8CFkwB7005702@repo.freebsd.org> <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 13 Sep 2019 05:11:18 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 04:11:20 -0000 On 9/12/19 6:53 PM, Ian Lepore wrote: > On Thu, 2019-09-12 at 15:46 +0000, Baptiste Daroussin wrote: >> Author: bapt >> Date: Thu Sep 12 15:46:58 2019 >> New Revision: 352248 >> URL: https://svnweb.freebsd.org/changeset/base/352248 >> >> Log: >> Get the readline header from the installed header instead of the from the source >> location. >> > > How can this possibly be right? One of the hallmarks of our build > system is that it is self-contained in the sense that it uses the > sources to build the sources, not sources or files from the host > machine being used to do the build. I think the issue is that the readline compat headers are installed at /usr/include/edit/readline/foo.h, so you need the equivalent of -I/usr/include/edit. If there was a way to make -I honor --sysroot (e.g. -I=/usr/include/edit) then that might be the cleaner way to handle this. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Sep 13 05:54:09 2019 Return-Path: Delivered-To: svn-src-all@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 A58FAE649F; Fri, 13 Sep 2019 05:54:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V4Zn3ytfz4BZn; Fri, 13 Sep 2019 05:54:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D472941; Fri, 13 Sep 2019 05:54:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D5s9Cf007425; Fri, 13 Sep 2019 05:54:09 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D5s906007424; Fri, 13 Sep 2019 05:54:09 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201909130554.x8D5s906007424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 13 Sep 2019 05:54: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: r352273 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 352273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 05:54:09 -0000 Author: sjg Date: Fri Sep 13 05:54:09 2019 New Revision: 352273 URL: https://svnweb.freebsd.org/changeset/base/352273 Log: Use file destdir for stage_as sets We cannot use file (without :T) to name targets but we can use the destination directory (with / replaced by _) This has the benefit of minimizing the targets created. MFC r351954 Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org//D21283 Modified: stable/12/share/mk/bsd.files.mk Modified: stable/12/share/mk/bsd.files.mk ============================================================================== --- stable/12/share/mk/bsd.files.mk Fri Sep 13 01:14:58 2019 (r352272) +++ stable/12/share/mk/bsd.files.mk Fri Sep 13 05:54:09 2019 (r352273) @@ -37,7 +37,6 @@ ${group}GRP= ${SHAREGRP} ${group}MODE?= ${SHAREMODE} ${group}DIR?= BINDIR STAGE_SETS+= ${group:C,[/*],_,g} -STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} @@ -57,6 +56,7 @@ DIRS+= ${group}DIR _${group}DIR= ${group}DIR .endif +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}} .for file in ${${group}} ${group}OWN_${file}?= ${${group}OWN} @@ -97,11 +97,16 @@ ${group}NAME_${file}?= ${${group}NAME} .else ${group}NAME_${file}?= ${file:T} .endif # defined(${group}NAME) -STAGE_AS_SETS+= ${file} STAGE_AS_${file}= ${${group}NAME_${file}} -# XXX {group}OWN,GRP,MODE -STAGE_DIR.${file}= ${STAGE_OBJTOP}${${group}DIR_${file}} -stage_as.${file}: ${file} +# we cannot use file safely as a set name +# since we cannot? apply :T +# but we can use the ${group}DIR_${file} +# as a set - meta.stage.mk will :O:u for us +# we need to expand ${group}DIR_${file} and replace +# all '/' and '*' with '_' to make a safe target name. +STAGE_AS_SETS+= ${${_${group}DIR_${file}}:C,[/*],_,g} +STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR_${file}} +stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file} installfiles-${group}: _${group}INS1_${file} _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file} @@ -118,12 +123,16 @@ realinstall: installfiles .ORDER: beforeinstall installfiles .if ${MK_STAGING} != "no" +.if ${FILESGROUPS:@g@${$g}@} != "" .if !empty(STAGE_SETS) buildfiles: stage_files STAGE_TARGETS+= stage_files +stage_files: .if !empty(STAGE_AS_SETS) buildfiles: stage_as STAGE_TARGETS+= stage_as +stage_as: +.endif .endif .endif .endif From owner-svn-src-all@freebsd.org Fri Sep 13 06:36:26 2019 Return-Path: Delivered-To: svn-src-all@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 7624AE7A2F; Fri, 13 Sep 2019 06:36:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V5WZ2YWpz4DTx; Fri, 13 Sep 2019 06:36:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B1E6305E; Fri, 13 Sep 2019 06:36:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D6aQCK031053; Fri, 13 Sep 2019 06:36:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D6aPCY031048; Fri, 13 Sep 2019 06:36:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130636.x8D6aPCY031048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 06:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352274 - head/tools/tools/locale/tools X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/tools/tools/locale/tools X-SVN-Commit-Revision: 352274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 06:36:26 -0000 Author: bapt Date: Fri Sep 13 06:36:24 2019 New Revision: 352274 URL: https://svnweb.freebsd.org/changeset/base/352274 Log: Insert proper copyright/license headers Those scripts are without copyright and license assignement since their creation After grabbing information from The various authors and contributors assign proper license header and copyrights. This has been reported by yuripv in his work on integrating those in Illumos! Reported by: yuripv Discussed with: marino, edwin MFC after: 3 days Modified: head/tools/tools/locale/tools/charmaps.pm head/tools/tools/locale/tools/cldr2def.pl head/tools/tools/locale/tools/extract-colldef.awk head/tools/tools/locale/tools/finalize head/tools/tools/locale/tools/utf8-rollup.pl Modified: head/tools/tools/locale/tools/charmaps.pm ============================================================================== --- head/tools/tools/locale/tools/charmaps.pm Fri Sep 13 05:54:09 2019 (r352273) +++ head/tools/tools/locale/tools/charmaps.pm Fri Sep 13 06:36:24 2019 (r352274) @@ -1,5 +1,29 @@ #!/usr/local/bin/perl -w +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2009 Edwin Groothuis +# +# 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$ # Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Fri Sep 13 05:54:09 2019 (r352273) +++ head/tools/tools/locale/tools/cldr2def.pl Fri Sep 13 06:36:24 2019 (r352274) @@ -1,4 +1,31 @@ #!/usr/local/bin/perl -wC + +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2009 Edwin Groothuis +# Copyright 2015 John Marino +# +# 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$ use strict; Modified: head/tools/tools/locale/tools/extract-colldef.awk ============================================================================== --- head/tools/tools/locale/tools/extract-colldef.awk Fri Sep 13 05:54:09 2019 (r352273) +++ head/tools/tools/locale/tools/extract-colldef.awk Fri Sep 13 06:36:24 2019 (r352274) @@ -1,3 +1,29 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2016 Baptiste Daroussin +# +# 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$ BEGIN { Modified: head/tools/tools/locale/tools/finalize ============================================================================== --- head/tools/tools/locale/tools/finalize Fri Sep 13 05:54:09 2019 (r352273) +++ head/tools/tools/locale/tools/finalize Fri Sep 13 06:36:24 2019 (r352274) @@ -1,5 +1,30 @@ #!/bin/sh # +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2015 John Marino +# +# 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$ # # This is a helper script for the Makefile in the parent directory. Modified: head/tools/tools/locale/tools/utf8-rollup.pl ============================================================================== --- head/tools/tools/locale/tools/utf8-rollup.pl Fri Sep 13 05:54:09 2019 (r352273) +++ head/tools/tools/locale/tools/utf8-rollup.pl Fri Sep 13 06:36:24 2019 (r352274) @@ -1,4 +1,31 @@ #!/usr/local/bin/perl -wC + +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2009 Edwin Groothuis +# Copyright 2015 John Marino +# +# 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$ use strict; From owner-svn-src-all@freebsd.org Fri Sep 13 06:50:03 2019 Return-Path: Delivered-To: svn-src-all@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 F1EE5E7F69; Fri, 13 Sep 2019 06:50:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V5qH684rz4FCJ; Fri, 13 Sep 2019 06:50:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2FA23249; Fri, 13 Sep 2019 06:50:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D6o345037280; Fri, 13 Sep 2019 06:50:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D6o2fb037276; Fri, 13 Sep 2019 06:50:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130650.x8D6o2fb037276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 06:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352275 - in head/lib/libedit: . TEST edit readline X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/lib/libedit: . TEST edit readline X-SVN-Commit-Revision: 352275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 06:50:04 -0000 Author: bapt Date: Fri Sep 13 06:50:02 2019 New Revision: 352275 URL: https://svnweb.freebsd.org/changeset/base/352275 Log: Update libedit to a snapshot from 2019-09-10 This version bring many fixes regarding unicode support It also adds proper support for filename completion (we do not need our custom patches anymore) Improves the libreadline compatibility Note that the same work was done by Yuichiro Naito in https://reviews.freebsd.org/D21196 the main difference is in this case we have reimported libedit in contrib to fix a long standing mess in the previous merges which prevented a proper update workflow. (discussed long ago with pfg@) The only difference with upstream libedit is we have added a compatibility shim for the _elf_fn_sh_complete function which we previously added to support quoting in filename completion and is not needed anymore. This was added to continue supported old /bin/sh binaries and not break backward compatibility (as discussed with jilles@) Reviewed by: Yuichiro Naito MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D21584 Added: head/lib/libedit/readline/ head/lib/libedit/readline/Makefile (contents, props changed) - copied unchanged from r352274, head/lib/libedit/edit/readline/history.h - copied unchanged from r352274, head/lib/libedit/edit/readline/tilde.h Directory Properties: head/lib/libedit/readline/history.h (props changed) head/lib/libedit/readline/tilde.h (props changed) Deleted: head/lib/libedit/Makefile.depend head/lib/libedit/TEST/ head/lib/libedit/chared.c head/lib/libedit/chared.h head/lib/libedit/chartype.c head/lib/libedit/chartype.h head/lib/libedit/common.c head/lib/libedit/config.h head/lib/libedit/edit/ head/lib/libedit/editline.3 head/lib/libedit/editrc.5 head/lib/libedit/el.c head/lib/libedit/el.h head/lib/libedit/eln.c head/lib/libedit/emacs.c head/lib/libedit/filecomplete.c head/lib/libedit/filecomplete.h head/lib/libedit/hist.c head/lib/libedit/hist.h head/lib/libedit/histedit.h head/lib/libedit/history.c head/lib/libedit/keymacro.c head/lib/libedit/keymacro.h head/lib/libedit/makelist head/lib/libedit/map.c head/lib/libedit/map.h head/lib/libedit/parse.c head/lib/libedit/parse.h head/lib/libedit/prompt.c head/lib/libedit/prompt.h head/lib/libedit/read.c head/lib/libedit/read.h head/lib/libedit/readline.c head/lib/libedit/refresh.c head/lib/libedit/refresh.h head/lib/libedit/search.c head/lib/libedit/search.h head/lib/libedit/sig.c head/lib/libedit/sig.h head/lib/libedit/sys.h head/lib/libedit/terminal.c head/lib/libedit/terminal.h head/lib/libedit/tokenizer.c head/lib/libedit/tty.c head/lib/libedit/tty.h head/lib/libedit/vi.c Modified: head/lib/libedit/Makefile Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Fri Sep 13 06:36:24 2019 (r352274) +++ head/lib/libedit/Makefile Fri Sep 13 06:50:02 2019 (r352275) @@ -4,6 +4,9 @@ PACKAGE=clibs +EDITDIR= ${SRCTOP}/contrib/libedit +.PATH: ${EDITDIR} + SHLIB_MAJOR= 7 SHLIBDIR?= /lib @@ -12,75 +15,83 @@ LIB= edit LIBADD= ncursesw -OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ - hist.c keymacro.c map.c chartype.c \ - parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c +SRCS= chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \ + hist.c history.c historyn.c keymacro.c literal.c map.c \ + parse.c prompt.c read.c readline.c refresh.c search.c sig.c \ + terminal.c tokenizer.c tokenizern.c tty.c vi.c -MAN= editline.3 editrc.5 -MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 el_init.3 \ - editline.3 el_get.3 editline.3 el_getc.3 editline.3 el_gets.3 \ - editline.3 history.3 editline.3 history_end.3 \ - editline.3 history_init.3 editline.3 el_insertstr.3 \ - editline.3 el_line.3 editline.3 el_parse.3 editline.3 el_push.3 \ - editline.3 el_reset.3 editline.3 el_resize.3 editline.3 el_set.3 \ +MAN= editline.3 editrc.5 editline.7 + +MLINKS= \ + editline.3 el_deletestr.3 \ + editline.3 el_end.3 \ + editline.3 el_get.3 \ + editline.3 el_getc.3 \ + editline.3 el_gets.3 \ + editline.3 el_init.3 \ + editline.3 el_init_fd.3 \ + editline.3 el_insertstr.3 \ + editline.3 el_line.3 \ + editline.3 el_parse.3 \ + editline.3 el_push.3 \ + editline.3 el_reset.3 \ + editline.3 el_resize.3 \ + editline.3 el_set.3 \ editline.3 el_source.3 \ - editline.3 tok_init.3 editline.3 tok_end.3 editline.3 tok_reset.3 \ - editline.3 tok_line.3 editline.3 tok_str.3 + editline.3 history.3 \ + editline.3 history_end.3 \ + editline.3 history_init.3 \ + editline.3 tok_end.3 \ + editline.3 tok_init.3 \ + editline.3 tok_line.3 \ + editline.3 tok_reset.3 \ + editline.3 tok_str.3 \ + editline.3 el_wdeletestr.3 \ + editline.3 el_wget.3 \ + editline.3 el_wgetc.3 \ + editline.3 el_wgets.3 \ + editline.3 el_winsertstr.3 \ + editline.3 el_wline.3 \ + editline.3 el_wparse.3 \ + editline.3 el_wpush.3 \ + editline.3 el_wset.3 \ + editline.3 history_w.3 \ + editline.3 history_wend.3 \ + editline.3 history_winit.3 \ + editline.3 tok_wend.3 \ + editline.3 tok_winit.3 \ + editline.3 tok_wline.3 \ + editline.3 tok_wreset.3 \ + editline.3 tok_wstr.3 -# For speed and debugging -#SRCS= ${OSRCS} readline.c tokenizer.c history.c -# For protection -SRCS= editline.c readline.c tokenizer.c history.c -SRCS+= common.h emacs.h fcns.h help.h vi.h - -# Widechar -SRCS+= tokenizern.c historyn.c -CLEANFILES+= tokenizern.c historyn.c - INCS= histedit.h -CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h -CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR -#CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH -#CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT +SRCS+= common.h emacs.h fcns.h func.h help.h vi.h +CLEANFILES+= common.h emacs.h fcns.h func.h help.h vi.h +CFLAGS+= -I. -I${EDITDIR} -I${EDITDIR}/readline + AHDR= vi.h emacs.h common.h -ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c +ASRC= ${EDITDIR}/vi.c ${EDITDIR}/emacs.c ${EDITDIR}/common.c -SUBDIR= edit/readline +SUBDIR= readline .for hdr in vi emacs common ${hdr}.h: ${hdr}.c makelist - sh ${.CURDIR}/makelist -h ${.CURDIR}/${hdr}.c > ${.TARGET} + sh ${EDITDIR}/makelist -h ${EDITDIR}/${hdr}.c > ${.TARGET} .endfor fcns.h: ${AHDR} makelist - sh ${.CURDIR}/makelist -fh ${AHDR} > ${.TARGET} + sh ${EDITDIR}/makelist -fh ${AHDR} > ${.TARGET} -fcns.c: ${AHDR} fcns.h makelist - sh ${.CURDIR}/makelist -fc ${AHDR} > ${.TARGET} +func.h: ${AHDR} makelist + sh ${EDITDIR}/makelist -fc ${AHDR} > ${.TARGET} -help.c: ${ASRC} makelist - sh ${.CURDIR}/makelist -bc ${ASRC} > ${.TARGET} - help.h: ${ASRC} makelist - sh ${.CURDIR}/makelist -bh ${ASRC} > ${.TARGET} + sh ${EDITDIR}/makelist -bh ${ASRC} > ${.TARGET} -editline.c: ${OSRCS} - sh ${.CURDIR}/makelist -e ${.ALLSRC:T} > ${.TARGET} - -tokenizern.c: makelist Makefile - sh ${.CURDIR}/makelist -n tokenizer.c > ${.TARGET} - -historyn.c: makelist Makefile - sh ${.CURDIR}/makelist -n history.c > ${.TARGET} - -# minimal dependency to make "make depend" optional -editline.o editline.po editline.pico editline.ln: \ - common.h emacs.h fcns.c fcns.h help.c help.h vi.h - -tc1.o: ${.CURDIR}/TEST/tc1.c +tc1.o: ${EDITDIR}/TEST/tc1.c test: tc1.o libedit.a ${DPADD} ${LIBTERMCAP} ${CC} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} Added: head/lib/libedit/readline/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/readline/Makefile Fri Sep 13 06:50:02 2019 (r352275) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/contrib/libedit/readline +INCS= readline.h history.h tilde.h + +INCSDIR= ${INCLUDEDIR}/edit/readline + +.include Copied: head/lib/libedit/readline/history.h (from r352274, head/lib/libedit/edit/readline/history.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/readline/history.h Fri Sep 13 06:50:02 2019 (r352275, copy of r352274, head/lib/libedit/edit/readline/history.h) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2011 David E. O'Brien + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include Copied: head/lib/libedit/readline/tilde.h (from r352274, head/lib/libedit/edit/readline/tilde.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/readline/tilde.h Fri Sep 13 06:50:02 2019 (r352275, copy of r352274, head/lib/libedit/edit/readline/tilde.h) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2011 David E. O'Brien + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include From owner-svn-src-all@freebsd.org Fri Sep 13 06:58:30 2019 Return-Path: Delivered-To: svn-src-all@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 E8FA7E8236; Fri, 13 Sep 2019 06:58:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6125w2Vz4FhX; Fri, 13 Sep 2019 06:58:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 95E4F9B74; Fri, 13 Sep 2019 06:58:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 5B1EBB5BA4; Fri, 13 Sep 2019 08:58:29 +0200 (CEST) Date: Fri, 13 Sep 2019 08:58:29 +0200 From: Baptiste Daroussin To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352248 - head/usr.sbin/ntp/libntp Message-ID: <20190913065828.a37ffzm3aevu4c7a@ivaldir.net> References: <201909121546.x8CFkwB7005702@repo.freebsd.org> <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="efkwnawvwfnjvqia" Content-Disposition: inline In-Reply-To: <54c8efce3064f685c1948546bebaccc5f56a09c1.camel@freebsd.org> User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 06:58:31 -0000 --efkwnawvwfnjvqia Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2019 at 11:53:38AM -0600, Ian Lepore wrote: > On Thu, 2019-09-12 at 15:46 +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Thu Sep 12 15:46:58 2019 > > New Revision: 352248 > > URL: https://svnweb.freebsd.org/changeset/base/352248 > >=20 > > Log: > > Get the readline header from the installed header instead of the from= the source > > location. > > =20 >=20 > How can this possibly be right? One of the hallmarks of our build > system is that it is self-contained in the sense that it uses the > sources to build the sources, not sources or files from the host > machine being used to do the build. >=20 This is the regular mechanism to find things that are generated or installed during make build world. This is for example used in gnu grep for the same purpose, but also the rpc= =2E* ofed and way more. This does not break at all the self contained nature of the buildworld! What it does is always find the headers in the right place after the install-include early phase of buildworld. Best regards, Bapt --efkwnawvwfnjvqia Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl17PhEACgkQY4mL3PG3 PlqEsxAAmTrIyPWdGD1Qsv8XV9rjAP5XFWdXqVCFn2qawjuPn956eQUp+pp4gg9v 2ofeFl0GmkhfVxrKQnbPBKTkYLsNgYA9sFh95WRU1OhzKyveXVxgwDkGlNMMvB+6 bbDLu/4Ok7VlEQFYEoF7EH15aWTc//nwAhhEeQuLGGfEZIUM5kx1MlXk4bnDAE3M 3mOpAQbSwEsgttuEcO0ceZE/Ekf/36Krdu2DcRxcOhD47/egCVoMS/rahLgPoy3W /hPdazHR1cyr8ulyrJs00iTEZxNDwDuxDyzK6kTGKd3cpd0CSWdjmJjXWlJ906Xb n493+uGFQ7Khq+O5/ZxCF3tvJjqV2U+tkcODk+YlCEFy0RtiH4yDYC1Cc3NuOyEE F05sAw+Bc4MWadmqI9XOebAymAbRnL4UT7lpWH1aDDvQbhnek7NhXbd9nQoKGOGo 2Yz+ApzO70UcwS6VQEtr0shCPuS+QGxRtmlk65CxNhElpyLKoa61fZzoxH1m4ZU3 ZP//Ka2nb7n6tsXkMdGz9i+ND5l8MedDRY2IJKNNV4uPw81tWkFeVa3Ywqk9j34v NBSfTjruTZalO1lz+pT0G8zx+6pj7RKXqPAsSzT0Pj23tXjTBeeZfiUlpRlBqFm5 6nY5OHqQWlSyjvRrT2+5XgKWCZ4LlOfAw65cfoS28JgslFXp8/E= =KbrJ -----END PGP SIGNATURE----- --efkwnawvwfnjvqia-- From owner-svn-src-all@freebsd.org Fri Sep 13 07:08:47 2019 Return-Path: Delivered-To: svn-src-all@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 847CDE8505; Fri, 13 Sep 2019 07:08:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6Dv2zlmz4G6l; Fri, 13 Sep 2019 07:08:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D4A137C2; Fri, 13 Sep 2019 07:08:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D78k3T048655; Fri, 13 Sep 2019 07:08:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D78h5a048639; Fri, 13 Sep 2019 07:08:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130708.x8D78h5a048639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:08: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: r352276 - in stable/12: sbin/devd usr.sbin/apmd usr.sbin/config usr.sbin/ctld usr.sbin/jail usr.sbin/kbdcontrol usr.sbin/ndiscvt usr.sbin/rrenumd X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in stable/12: sbin/devd usr.sbin/apmd usr.sbin/config usr.sbin/ctld usr.sbin/jail usr.sbin/kbdcontrol usr.sbin/ndiscvt usr.sbin/rrenumd X-SVN-Commit-Revision: 352276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:08:47 -0000 Author: bapt Date: Fri Sep 13 07:08:43 2019 New Revision: 352276 URL: https://svnweb.freebsd.org/changeset/base/352276 Log: MFC r352119-r352124, r352130 Stop linking to libl by specifying we do not need yywrap Modified: stable/12/sbin/devd/Makefile stable/12/sbin/devd/token.l stable/12/usr.sbin/apmd/Makefile stable/12/usr.sbin/apmd/apmdlex.l stable/12/usr.sbin/config/Makefile stable/12/usr.sbin/ctld/Makefile stable/12/usr.sbin/ctld/token.l stable/12/usr.sbin/jail/Makefile stable/12/usr.sbin/jail/jaillex.l stable/12/usr.sbin/kbdcontrol/Makefile stable/12/usr.sbin/kbdcontrol/lex.l stable/12/usr.sbin/ndiscvt/Makefile stable/12/usr.sbin/ndiscvt/inf-token.l stable/12/usr.sbin/rrenumd/Makefile stable/12/usr.sbin/rrenumd/lexer.l Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/Makefile ============================================================================== --- stable/12/sbin/devd/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/sbin/devd/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -34,7 +34,7 @@ MAN= devd.8 devd.conf.5 NO_SHARED?=YES -LIBADD= l util +LIBADD= util YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} Modified: stable/12/sbin/devd/token.l ============================================================================== --- stable/12/sbin/devd/token.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/sbin/devd/token.l Fri Sep 13 07:08:43 2019 (r352276) @@ -50,6 +50,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput Modified: stable/12/usr.sbin/apmd/Makefile ============================================================================== --- stable/12/usr.sbin/apmd/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/apmd/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -10,8 +10,6 @@ PACKAGE=apm WARNS?= 3 -LIBADD= l - CFLAGS+= -I${.CURDIR} test: Modified: stable/12/usr.sbin/apmd/apmdlex.l ============================================================================== --- stable/12/usr.sbin/apmd/apmdlex.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/apmd/apmdlex.l Fri Sep 13 07:08:43 2019 (r352276) @@ -44,6 +44,7 @@ int first_time; %} /* We don't need it, avoid the warning. */ +%option noyywrap %option nounput %option noinput Modified: stable/12/usr.sbin/config/Makefile ============================================================================== --- stable/12/usr.sbin/config/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/config/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l nv sbuf +LIBADD= nv sbuf CLEANFILES+= kernconf.c Modified: stable/12/usr.sbin/ctld/Makefile ============================================================================== --- stable/12/usr.sbin/ctld/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/ctld/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -15,7 +15,7 @@ CFLAGS+= -I${SRCTOP}/sys/dev/iscsi #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -LIBADD= bsdxml l md sbuf util ucl m nv +LIBADD= bsdxml md sbuf util ucl m nv YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output Modified: stable/12/usr.sbin/ctld/token.l ============================================================================== --- stable/12/usr.sbin/ctld/token.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/ctld/token.l Fri Sep 13 07:08:43 2019 (r352276) @@ -45,6 +45,7 @@ extern int yylex(void); %} +%option noyywrap %option noinput %option nounput Modified: stable/12/usr.sbin/jail/Makefile ============================================================================== --- stable/12/usr.sbin/jail/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/jail/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -6,7 +6,7 @@ PROG= jail MAN= jail.8 jail.conf.5 SRCS= jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h -LIBADD= jail kvm util l +LIBADD= jail kvm util PACKAGE=jail Modified: stable/12/usr.sbin/jail/jaillex.l ============================================================================== --- stable/12/usr.sbin/jail/jaillex.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/jail/jaillex.l Fri Sep 13 07:08:43 2019 (r352276) @@ -48,6 +48,7 @@ static int lineno = 1; #define YY_DECL int yylex(void) %} +%option noyywrap %option noinput %option nounput Modified: stable/12/usr.sbin/kbdcontrol/Makefile ============================================================================== --- stable/12/usr.sbin/kbdcontrol/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/kbdcontrol/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -8,6 +8,4 @@ SRCS= kbdcontrol.c lex.l WARNS?= 4 CFLAGS+= -I${.CURDIR} -LIBADD= l - .include Modified: stable/12/usr.sbin/kbdcontrol/lex.l ============================================================================== --- stable/12/usr.sbin/kbdcontrol/lex.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/kbdcontrol/lex.l Fri Sep 13 07:08:43 2019 (r352276) @@ -36,6 +36,7 @@ %} +%option noyywrap %option nounput %option noinput Modified: stable/12/usr.sbin/ndiscvt/Makefile ============================================================================== --- stable/12/usr.sbin/ndiscvt/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/ndiscvt/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -13,8 +13,6 @@ MAN+= ndisgen.8 WARNS?= 4 NO_WCAST_ALIGN= -LIBADD= l - YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -I${SRCTOP}/sys Modified: stable/12/usr.sbin/ndiscvt/inf-token.l ============================================================================== --- stable/12/usr.sbin/ndiscvt/inf-token.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/ndiscvt/inf-token.l Fri Sep 13 07:08:43 2019 (r352276) @@ -59,6 +59,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput Modified: stable/12/usr.sbin/rrenumd/Makefile ============================================================================== --- stable/12/usr.sbin/rrenumd/Makefile Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/rrenumd/Makefile Fri Sep 13 07:08:43 2019 (r352276) @@ -23,7 +23,7 @@ YFLAGS= -d WARNS?= 2 -LIBADD= ipsec l y +LIBADD= ipsec CLEANFILES= y.tab.h SRCS+= y.tab.h Modified: stable/12/usr.sbin/rrenumd/lexer.l ============================================================================== --- stable/12/usr.sbin/rrenumd/lexer.l Fri Sep 13 06:50:02 2019 (r352275) +++ stable/12/usr.sbin/rrenumd/lexer.l Fri Sep 13 07:08:43 2019 (r352276) @@ -60,6 +60,7 @@ void yyerror(const char *); int yylex(void); %} +%option noyywrap %option nounput /* common section */ From owner-svn-src-all@freebsd.org Fri Sep 13 07:10:53 2019 Return-Path: Delivered-To: svn-src-all@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 2BC51E8714; Fri, 13 Sep 2019 07:10:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6HJ6YDjz4GN5; Fri, 13 Sep 2019 07:10:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A996337D5; Fri, 13 Sep 2019 07:10:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7AqbE048829; Fri, 13 Sep 2019 07:10:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7Ap15048821; Fri, 13 Sep 2019 07:10:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130710.x8D7Ap15048821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:10:51 +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: r352277 - stable/12/usr.bin/m4 X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/usr.bin/m4 X-SVN-Commit-Revision: 352277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:10:53 -0000 Author: bapt Date: Fri Sep 13 07:10:50 2019 New Revision: 352277 URL: https://svnweb.freebsd.org/changeset/base/352277 Log: MFC r352065-r352070 Sync with OpenBSD, in particular this adds support for -E flags (GNU compatibility) Modified: stable/12/usr.bin/m4/Makefile stable/12/usr.bin/m4/eval.c stable/12/usr.bin/m4/extern.h stable/12/usr.bin/m4/gnum4.c stable/12/usr.bin/m4/m4.1 stable/12/usr.bin/m4/main.c stable/12/usr.bin/m4/misc.c stable/12/usr.bin/m4/tokenizer.l Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/m4/Makefile ============================================================================== --- stable/12/usr.bin/m4/Makefile Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/Makefile Fri Sep 13 07:10:50 2019 (r352277) @@ -8,7 +8,7 @@ PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${SRCTOP}/lib/libopenbsd -LIBADD= y l m openbsd +LIBADD= m openbsd NO_WMISSING_VARIABLE_DECLARATIONS= Modified: stable/12/usr.bin/m4/eval.c ============================================================================== --- stable/12/usr.bin/m4/eval.c Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/eval.c Fri Sep 13 07:10:50 2019 (r352277) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.74 2015/02/05 12:59:57 millert Exp $ */ +/* $OpenBSD: eval.c,v 1.78 2019/06/28 05:35:34 deraadt Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /*- @@ -126,6 +126,7 @@ void expand_builtin(const char *argv[], int argc, int td) { int c, n; + const char *errstr; int ac; static int sysval = 0; @@ -186,13 +187,15 @@ expand_builtin(const char *argv[], int argc, int td) if (argc > 3) { base = strtonum(argv[3], 2, 36, &errstr); if (errstr) { - m4errx(1, "expr: base %s invalid.", argv[3]); + m4errx(1, "expr: base is %s: %s.", + errstr, argv[3]); } } if (argc > 4) { maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); if (errstr) { - m4errx(1, "expr: maxdigits %s invalid.", argv[4]); + m4errx(1, "expr: maxdigits is %s: %s.", + errstr, argv[4]); } } if (argc > 2) @@ -201,8 +204,7 @@ expand_builtin(const char *argv[], int argc, int td) } case IFELTYPE: - if (argc > 4) - doifelse(argv, argc); + doifelse(argv, argc); break; case IFDFTYPE: @@ -232,8 +234,13 @@ expand_builtin(const char *argv[], int argc, int td) * doincr - increment the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) + 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX-1, &errstr); + if (errstr != NULL) + m4errx(1, "incr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n + 1); + } break; case DECRTYPE: @@ -241,8 +248,13 @@ expand_builtin(const char *argv[], int argc, int td) * dodecr - decrement the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) - 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN+1, INT_MAX, &errstr); + if (errstr) + m4errx(1, "decr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n - 1); + } break; case SYSCTYPE: @@ -275,6 +287,10 @@ expand_builtin(const char *argv[], int argc, int td) warn("%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); exit_code = 1; + if (fatal_warns) { + killdiv(); + exit(exit_code); + } } else err(1, "%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); @@ -339,12 +355,18 @@ expand_builtin(const char *argv[], int argc, int td) break; case DIVRTYPE: - if (argc > 2 && (n = atoi(argv[2])) != 0) - dodiv(n); - else { - active = stdout; - oindex = 0; + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX, &errstr); + if (errstr) + m4errx(1, "divert: argument is %s: %s.", + errstr, argv[2]); + if (n != 0) { + dodiv(n); + break; + } } + active = stdout; + oindex = 0; break; case UNDVTYPE: @@ -691,17 +713,17 @@ dotrace(const char *argv[], int argc, int on) static void doifelse(const char *argv[], int argc) { - cycle { - if (STREQ(argv[2], argv[3])) + while (argc > 4) { + if (STREQ(argv[2], argv[3])) { pbstr(argv[4]); - else if (argc == 6) + break; + } else if (argc == 6) { pbstr(argv[5]); - else if (argc > 6) { + break; + } else { argv += 3; argc -= 3; - continue; } - break; } } @@ -824,7 +846,7 @@ dodiv(int n) if (outfile[n] == NULL) { char fname[] = _PATH_DIVNAME; - if ((fd = mkstemp(fname)) < 0 || + if ((fd = mkstemp(fname)) == -1 || unlink(fname) == -1 || (outfile[n] = fdopen(fd, "w+")) == NULL) err(1, "%s: cannot divert", fname); Modified: stable/12/usr.bin/m4/extern.h ============================================================================== --- stable/12/usr.bin/m4/extern.h Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/extern.h Fri Sep 13 07:10:50 2019 (r352277) @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.54 2014/05/12 19:11:19 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.55 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */ /*- @@ -61,6 +61,8 @@ extern void doesyscmd(const char *); extern void getdivfile(const char *); extern void doformat(const char *[], int); +extern void m4_warnx(const char *, ...); + /* look.c */ #define FLAG_UNTRACED 0 @@ -178,4 +180,5 @@ extern int synch_lines; /* line synchronisation direc extern int mimic_gnu; /* behaves like gnu-m4 */ extern int prefix_builtins; /* prefix builtin macros with m4_ */ - +extern int error_warns; /* make warnings cause exit_code = 1 */ +extern int fatal_warns; /* make warnings fatal */ Modified: stable/12/usr.bin/m4/gnum4.c ============================================================================== --- stable/12/usr.bin/m4/gnum4.c Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/gnum4.c Fri Sep 13 07:10:50 2019 (r352277) @@ -1,4 +1,4 @@ -/* $OpenBSD: gnum4.c,v 1.50 2015/04/29 00:13:26 millert Exp $ */ +/* $OpenBSD: gnum4.c,v 1.52 2017/08/21 21:41:13 deraadt Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -259,11 +260,29 @@ exit_regerror(int er, regex_t *re, const char *source) m4errx(1, "regular expression error in %s: %s.", source, errbuf); } +/* warnx() plus check to see if we need to change exit code or exit . + * -E flag functionality. + */ +void +m4_warnx(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + warnx(fmt, ap); + va_end(ap); + + if (fatal_warns) + exit(1); + if (error_warns) + exit_code = 1; +} + static void add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) { if (n > (int)re->re_nsub) - warnx("No subexpression %d", n); + m4_warnx("No subexpression %d", n); /* Subexpressions that did not match are * not an error. */ else if (pm[n].rm_so != -1 && @@ -446,7 +465,7 @@ void dopatsubst(const char *argv[], int argc) { if (argc <= 3) { - warnx("Too few arguments to patsubst"); + m4_warnx("Too few arguments to patsubst"); return; } /* special case: empty regexp */ @@ -498,7 +517,7 @@ doregexp(const char *argv[], int argc) const char *source; if (argc <= 3) { - warnx("Too few arguments to regexp"); + m4_warnx("Too few arguments to regexp"); return; } /* special gnu case */ @@ -615,7 +634,7 @@ void doesyscmd(const char *cmd) { int p[2]; - pid_t pid, cpid; + pid_t cpid; char *argv[4]; int cc; int status; @@ -653,8 +672,10 @@ doesyscmd(const char *cmd) } while (cc > 0 || (cc == -1 && errno == EINTR)); (void) close(p[0]); - while ((pid = wait(&status)) != cpid && pid >= 0) - continue; + while (waitpid(cpid, &status, 0) == -1) { + if (errno != EINTR) + break; + } pbstr(getstring()); } } Modified: stable/12/usr.bin/m4/m4.1 ============================================================================== --- stable/12/usr.bin/m4/m4.1 Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/m4.1 Fri Sep 13 07:10:50 2019 (r352277) @@ -1,5 +1,5 @@ .\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $ -.\" @(#) $OpenBSD: m4.1,v 1.63 2015/09/14 20:06:58 schwarze Exp $ +.\" @(#) $OpenBSD: m4.1,v 1.64 2017/06/15 13:48:42 bcallah Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd $Mdocdate: September 14 2015 $ +.Dd $Mdocdate: June 15 2017 $ .Dt M4 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Nd macro language processor .Sh SYNOPSIS .Nm -.Op Fl gPs +.Op Fl EgPs .Oo .Sm off .Fl D Ar name Op No = Ar value @@ -130,6 +130,21 @@ turn on all options. .Pp By default, trace is set to .Qq eq . +.It Fl E +Set warnings to be fatal. +When a single +.Fl E +flag is specified, if warnings are issued, execution +continues but +.Nm +will exit with a non-zero exit status. +When multiple +.Fl E +flags are specified, execution will halt upon issuing the +first warning and +.Nm +will exit with a non-zero exit status. +This behaviour matches GNU-m4 1.4.9 and later. .It Fl g Activate GNU-m4 compatibility mode. In this mode, translit handles simple character @@ -437,7 +452,9 @@ Returns the current file's name. .Pp But note that the .Ic m4exit -macro can modify the exit status. +macro can modify the exit status, as can the +.Fl E +flag. .Sh STANDARDS The .Nm @@ -446,7 +463,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl dgIPot +.Op Fl dEgIPot and the macros .Ic builtin , .Ic esyscmd , Modified: stable/12/usr.bin/m4/main.c ============================================================================== --- stable/12/usr.bin/m4/main.c Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/main.c Fri Sep 13 07:10:50 2019 (r352277) @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.86 2015/11/03 16:21:47 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.87 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- @@ -81,6 +81,8 @@ char scommt[MAXCCHARS+1] = {SCOMMT}; /* start characte char ecommt[MAXCCHARS+1] = {ECOMMT}; /* end character for comment */ int synch_lines = 0; /* line synchronisation for C preprocessor */ int prefix_builtins = 0; /* -P option to prefix builtin keywords */ +int error_warns = 0; /* -E option to make warnings exit_code = 1 */ +int fatal_warns = 0; /* -E -E option to make warnings fatal */ struct keyblk { const char *knam; /* keyword name */ @@ -186,7 +188,7 @@ main(int argc, char *argv[]) outfile = NULL; resizedivs(MAXOUT); - while ((c = getopt(argc, argv, "gst:d:D:U:o:I:P")) != -1) + while ((c = getopt(argc, argv, "gst:d:D:EU:o:I:P")) != -1) switch(c) { case 'D': /* define something..*/ @@ -196,6 +198,12 @@ main(int argc, char *argv[]) if (*p) *p++ = EOS; dodefine(optarg, p); + break; + case 'E': /* like GNU m4 1.4.9+ */ + if (error_warns == 0) + error_warns = 1; + else + fatal_warns = 1; break; case 'I': addtoincludepath(optarg); Modified: stable/12/usr.bin/m4/misc.c ============================================================================== --- stable/12/usr.bin/m4/misc.c Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/misc.c Fri Sep 13 07:10:50 2019 (r352277) @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.46 2015/12/07 14:12:46 espie Exp $ */ +/* $OpenBSD: misc.c,v 1.47 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /*- @@ -386,7 +386,7 @@ xstrdup(const char *s) void usage(void) { - fprintf(stderr, "usage: m4 [-gPs] [-Dname[=value]] [-d flags] " + fprintf(stderr, "usage: m4 [-EgPs] [-Dname[=value]] [-d flags] " "[-I dirname] [-o filename]\n" "\t[-t macro] [-Uname] [file ...]\n"); exit(1); Modified: stable/12/usr.bin/m4/tokenizer.l ============================================================================== --- stable/12/usr.bin/m4/tokenizer.l Fri Sep 13 07:08:43 2019 (r352276) +++ stable/12/usr.bin/m4/tokenizer.l Fri Sep 13 07:10:50 2019 (r352277) @@ -1,6 +1,6 @@ %option nounput noinput %{ -/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie * @@ -25,6 +25,7 @@ #include #include +extern void m4_warnx(const char *, ...); extern int mimic_gnu; extern int32_t yylval; @@ -42,6 +43,8 @@ oct 0[0-7]* dec [1-9][0-9]* radix 0[rR][0-9]+:[0-9a-zA-Z]+ +%option noyywrap + %% {ws} {/* just skip it */} {hex}|{oct}|{dec} { yylval = number(); return(NUMBER); } @@ -72,7 +75,7 @@ number(void) l = strtol(yytext, NULL, 0); if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || l > INT32_MAX || l < INT32_MIN) { - fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); + m4_warnx("numeric overflow in expr: %s", yytext); } return l; } @@ -88,7 +91,7 @@ parse_radix(void) l = 0; base = strtol(yytext+2, &next, 0); if (base > 36 || next == NULL) { - fprintf(stderr, "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); } else { next++; while (*next != 0) { @@ -101,8 +104,7 @@ parse_radix(void) d = *next - 'A' + 10; } if (d >= base) { - fprintf(stderr, - "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); return 0; } l = base * l + d; From owner-svn-src-all@freebsd.org Fri Sep 13 07:15:49 2019 Return-Path: Delivered-To: svn-src-all@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 14152E884D; Fri, 13 Sep 2019 07:15:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6P06hJBz4Gdh; Fri, 13 Sep 2019 07:15:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8A4239A7; Fri, 13 Sep 2019 07:15:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7FmdT054527; Fri, 13 Sep 2019 07:15:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7Fm7x054526; Fri, 13 Sep 2019 07:15:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130715.x8D7Fm7x054526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:15:48 +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: r352278 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 352278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:15:49 -0000 Author: bapt Date: Fri Sep 13 07:15:48 2019 New Revision: 352278 URL: https://svnweb.freebsd.org/changeset/base/352278 Log: MFC r352126: Remove reference to mklocale regarding the nls directory mklocale never had anything to do with the content of this directory Modified: stable/12/share/man/man7/hier.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/hier.7 ============================================================================== --- stable/12/share/man/man7/hier.7 Fri Sep 13 07:10:50 2019 (r352277) +++ stable/12/share/man/man7/hier.7 Fri Sep 13 07:15:48 2019 (r352278) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 18, 2018 +.Dd September 10, 2019 .Dt HIER 7 .Os .Sh NAME @@ -529,9 +529,7 @@ templates for make; see .Xr make 1 .It Pa nls/ -national language support files; -see -.Xr mklocale 1 +national language support files .It Pa security/ data files for security policies such as .Xr mac_lomac 4 From owner-svn-src-all@freebsd.org Fri Sep 13 07:18:34 2019 Return-Path: Delivered-To: svn-src-all@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 1F709E8949; Fri, 13 Sep 2019 07:18:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6S9753Kz4Gmh; Fri, 13 Sep 2019 07:18:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D156139A8; Fri, 13 Sep 2019 07:18:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7IX5r054694; Fri, 13 Sep 2019 07:18:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7IX63054691; Fri, 13 Sep 2019 07:18:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130718.x8D7IX63054691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:18: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: r352279 - stable/12/lib/libc/locale X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/lib/libc/locale X-SVN-Commit-Revision: 352279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:18:34 -0000 Author: bapt Date: Fri Sep 13 07:18:32 2019 New Revision: 352279 URL: https://svnweb.freebsd.org/changeset/base/352279 Log: MFC r352127: In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1) tools to generate the locales data. state it in the libc manpages. Modified: stable/12/lib/libc/locale/euc.5 stable/12/lib/libc/locale/multibyte.3 stable/12/lib/libc/locale/setlocale.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/locale/euc.5 ============================================================================== --- stable/12/lib/libc/locale/euc.5 Fri Sep 13 07:15:48 2019 (r352278) +++ stable/12/lib/libc/locale/euc.5 Fri Sep 13 07:18:32 2019 (r352279) @@ -31,7 +31,7 @@ .\" @(#)euc.4 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 8, 2003 +.Dd September 9, 2019 .Dt EUC 5 .Os .Sh NAME @@ -58,7 +58,7 @@ .\".Ux .\"based systems. .\"See -.\".Xr mklocale 1 +.\".Xr localedef 1 .\"for a complete description of the .\".Ev LC_CTYPE .\"source file format. @@ -130,5 +130,5 @@ Notice that the global is set to 0x8080, this implies that from those 2 bits the codeset can be determined. .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 Modified: stable/12/lib/libc/locale/multibyte.3 ============================================================================== --- stable/12/lib/libc/locale/multibyte.3 Fri Sep 13 07:15:48 2019 (r352278) +++ stable/12/lib/libc/locale/multibyte.3 Fri Sep 13 07:18:32 2019 (r352279) @@ -32,7 +32,7 @@ .\" @(#)multibyte.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 8, 2004 +.Dd September 9, 2019 .Dt MULTIBYTE 3 .Os .Sh NAME @@ -127,7 +127,7 @@ multibyte characters: .It Xr wctomb 3 Ta "convert a wide-character code to a character" .El .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 , .Xr stdio 3 , .Xr big5 5 , Modified: stable/12/lib/libc/locale/setlocale.3 ============================================================================== --- stable/12/lib/libc/locale/setlocale.3 Fri Sep 13 07:15:48 2019 (r352278) +++ stable/12/lib/libc/locale/setlocale.3 Fri Sep 13 07:18:32 2019 (r352279) @@ -31,7 +31,7 @@ .\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd November 21, 2003 +.Dd September 9, 2019 .Dt SETLOCALE 3 .Os .Sh NAME @@ -150,8 +150,7 @@ and the category .Sh ERRORS No errors are defined. .Sh SEE ALSO -.Xr colldef 1 , -.Xr mklocale 1 , +.Xr localedef 1 , .Xr catopen 3 , .Xr ctype 3 , .Xr localeconv 3 , From owner-svn-src-all@freebsd.org Fri Sep 13 07:21:09 2019 Return-Path: Delivered-To: svn-src-all@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 DCE1BE8A07; Fri, 13 Sep 2019 07:21:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6W95YBvz4H6d; Fri, 13 Sep 2019 07:21:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 883E23B74; Fri, 13 Sep 2019 07:21:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7L9tX054894; Fri, 13 Sep 2019 07:21:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7L6DC054878; Fri, 13 Sep 2019 07:21:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130721.x8D7L6DC054878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352280 - in stable/11: sbin/devd usr.sbin/apmd usr.sbin/config usr.sbin/ctld usr.sbin/jail usr.sbin/kbdcontrol usr.sbin/ndiscvt usr.sbin/rrenumd X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in stable/11: sbin/devd usr.sbin/apmd usr.sbin/config usr.sbin/ctld usr.sbin/jail usr.sbin/kbdcontrol usr.sbin/ndiscvt usr.sbin/rrenumd X-SVN-Commit-Revision: 352280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:21:09 -0000 Author: bapt Date: Fri Sep 13 07:21:06 2019 New Revision: 352280 URL: https://svnweb.freebsd.org/changeset/base/352280 Log: MFC r352119-r352124, r352130 Stop linking to libl by specifying we do not need yywrap Modified: stable/11/sbin/devd/Makefile stable/11/sbin/devd/token.l stable/11/usr.sbin/apmd/Makefile stable/11/usr.sbin/apmd/apmdlex.l stable/11/usr.sbin/config/Makefile stable/11/usr.sbin/ctld/Makefile stable/11/usr.sbin/ctld/token.l stable/11/usr.sbin/jail/Makefile stable/11/usr.sbin/jail/jaillex.l stable/11/usr.sbin/kbdcontrol/Makefile stable/11/usr.sbin/kbdcontrol/lex.l stable/11/usr.sbin/ndiscvt/Makefile stable/11/usr.sbin/ndiscvt/inf-token.l stable/11/usr.sbin/rrenumd/Makefile stable/11/usr.sbin/rrenumd/lexer.l Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/devd/Makefile ============================================================================== --- stable/11/sbin/devd/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/sbin/devd/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -11,7 +11,7 @@ WARNS?= 3 NO_SHARED?=YES -LIBADD= l util +LIBADD= util YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} Modified: stable/11/sbin/devd/token.l ============================================================================== --- stable/11/sbin/devd/token.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/sbin/devd/token.l Fri Sep 13 07:21:06 2019 (r352280) @@ -50,6 +50,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput Modified: stable/11/usr.sbin/apmd/Makefile ============================================================================== --- stable/11/usr.sbin/apmd/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/apmd/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -9,8 +9,6 @@ PACKAGE=apm WARNS?= 3 -LIBADD= l - CFLAGS+= -I${.CURDIR} test: Modified: stable/11/usr.sbin/apmd/apmdlex.l ============================================================================== --- stable/11/usr.sbin/apmd/apmdlex.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/apmd/apmdlex.l Fri Sep 13 07:21:06 2019 (r352280) @@ -44,6 +44,7 @@ int first_time; %} /* We don't need it, avoid the warning. */ +%option noyywrap %option nounput %option noinput Modified: stable/11/usr.sbin/config/Makefile ============================================================================== --- stable/11/usr.sbin/config/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/config/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l nv sbuf +LIBADD= nv sbuf CLEANFILES+= kernconf.c Modified: stable/11/usr.sbin/ctld/Makefile ============================================================================== --- stable/11/usr.sbin/ctld/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/ctld/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -15,7 +15,7 @@ CFLAGS+= -I${SRCTOP}/sys/dev/iscsi #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -LIBADD= bsdxml l md sbuf util ucl m +LIBADD= bsdxml md sbuf util ucl m YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output Modified: stable/11/usr.sbin/ctld/token.l ============================================================================== --- stable/11/usr.sbin/ctld/token.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/ctld/token.l Fri Sep 13 07:21:06 2019 (r352280) @@ -45,6 +45,7 @@ extern int yylex(void); %} +%option noyywrap %option noinput %option nounput Modified: stable/11/usr.sbin/jail/Makefile ============================================================================== --- stable/11/usr.sbin/jail/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/jail/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -6,7 +6,7 @@ PROG= jail MAN= jail.8 jail.conf.5 SRCS= jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h -LIBADD= jail kvm util l +LIBADD= jail kvm util PACKAGE=jail Modified: stable/11/usr.sbin/jail/jaillex.l ============================================================================== --- stable/11/usr.sbin/jail/jaillex.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/jail/jaillex.l Fri Sep 13 07:21:06 2019 (r352280) @@ -48,6 +48,7 @@ static int lineno = 1; #define YY_DECL int yylex(void) %} +%option noyywrap %option noinput %option nounput Modified: stable/11/usr.sbin/kbdcontrol/Makefile ============================================================================== --- stable/11/usr.sbin/kbdcontrol/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/kbdcontrol/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -8,6 +8,4 @@ SRCS= kbdcontrol.c lex.l WARNS?= 4 CFLAGS+= -I${.CURDIR} -LIBADD= l - .include Modified: stable/11/usr.sbin/kbdcontrol/lex.l ============================================================================== --- stable/11/usr.sbin/kbdcontrol/lex.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/kbdcontrol/lex.l Fri Sep 13 07:21:06 2019 (r352280) @@ -36,6 +36,7 @@ %} +%option noyywrap %option nounput %option noinput Modified: stable/11/usr.sbin/ndiscvt/Makefile ============================================================================== --- stable/11/usr.sbin/ndiscvt/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/ndiscvt/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -13,8 +13,6 @@ MAN+= ndisgen.8 WARNS?= 4 NO_WCAST_ALIGN= -LIBADD= l - YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -I${SRCTOP}/sys Modified: stable/11/usr.sbin/ndiscvt/inf-token.l ============================================================================== --- stable/11/usr.sbin/ndiscvt/inf-token.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/ndiscvt/inf-token.l Fri Sep 13 07:21:06 2019 (r352280) @@ -57,6 +57,7 @@ update_lineno(const char *cp) %} +%option noyywrap %option nounput %option noinput Modified: stable/11/usr.sbin/rrenumd/Makefile ============================================================================== --- stable/11/usr.sbin/rrenumd/Makefile Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/rrenumd/Makefile Fri Sep 13 07:21:06 2019 (r352280) @@ -23,7 +23,7 @@ YFLAGS= -d WARNS?= 2 -LIBADD= ipsec l y +LIBADD= ipsec CLEANFILES= y.tab.h SRCS+= y.tab.h Modified: stable/11/usr.sbin/rrenumd/lexer.l ============================================================================== --- stable/11/usr.sbin/rrenumd/lexer.l Fri Sep 13 07:18:32 2019 (r352279) +++ stable/11/usr.sbin/rrenumd/lexer.l Fri Sep 13 07:21:06 2019 (r352280) @@ -58,6 +58,7 @@ void yyerror(const char *); int yylex(void); %} +%option noyywrap %option nounput /* common section */ From owner-svn-src-all@freebsd.org Fri Sep 13 07:22:11 2019 Return-Path: Delivered-To: svn-src-all@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 7F4CCE8C43; Fri, 13 Sep 2019 07:22:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6XM2s5Tz4HNc; Fri, 13 Sep 2019 07:22:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0DD3BE2; Fri, 13 Sep 2019 07:22:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7MACk060584; Fri, 13 Sep 2019 07:22:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7M9Lv060575; Fri, 13 Sep 2019 07:22:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130722.x8D7M9Lv060575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352281 - stable/11/usr.bin/m4 X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/usr.bin/m4 X-SVN-Commit-Revision: 352281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:22:11 -0000 Author: bapt Date: Fri Sep 13 07:22:09 2019 New Revision: 352281 URL: https://svnweb.freebsd.org/changeset/base/352281 Log: MFC r352065-r352070 Sync with OpenBSD, in particular this adds support for -E flags (GNU compatibility) Modified: stable/11/usr.bin/m4/Makefile stable/11/usr.bin/m4/eval.c stable/11/usr.bin/m4/extern.h stable/11/usr.bin/m4/gnum4.c stable/11/usr.bin/m4/m4.1 stable/11/usr.bin/m4/main.c stable/11/usr.bin/m4/misc.c stable/11/usr.bin/m4/tokenizer.l Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/m4/Makefile ============================================================================== --- stable/11/usr.bin/m4/Makefile Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/Makefile Fri Sep 13 07:22:09 2019 (r352281) @@ -8,7 +8,7 @@ PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${SRCTOP}/lib/libopenbsd -LIBADD= y l m openbsd +LIBADD= m openbsd NO_WMISSING_VARIABLE_DECLARATIONS= Modified: stable/11/usr.bin/m4/eval.c ============================================================================== --- stable/11/usr.bin/m4/eval.c Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/eval.c Fri Sep 13 07:22:09 2019 (r352281) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.74 2015/02/05 12:59:57 millert Exp $ */ +/* $OpenBSD: eval.c,v 1.78 2019/06/28 05:35:34 deraadt Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* @@ -124,6 +124,7 @@ void expand_builtin(const char *argv[], int argc, int td) { int c, n; + const char *errstr; int ac; static int sysval = 0; @@ -184,13 +185,15 @@ expand_builtin(const char *argv[], int argc, int td) if (argc > 3) { base = strtonum(argv[3], 2, 36, &errstr); if (errstr) { - m4errx(1, "expr: base %s invalid.", argv[3]); + m4errx(1, "expr: base is %s: %s.", + errstr, argv[3]); } } if (argc > 4) { maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); if (errstr) { - m4errx(1, "expr: maxdigits %s invalid.", argv[4]); + m4errx(1, "expr: maxdigits is %s: %s.", + errstr, argv[4]); } } if (argc > 2) @@ -199,8 +202,7 @@ expand_builtin(const char *argv[], int argc, int td) } case IFELTYPE: - if (argc > 4) - doifelse(argv, argc); + doifelse(argv, argc); break; case IFDFTYPE: @@ -230,8 +232,13 @@ expand_builtin(const char *argv[], int argc, int td) * doincr - increment the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) + 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX-1, &errstr); + if (errstr != NULL) + m4errx(1, "incr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n + 1); + } break; case DECRTYPE: @@ -239,8 +246,13 @@ expand_builtin(const char *argv[], int argc, int td) * dodecr - decrement the value of the * argument */ - if (argc > 2) - pbnum(atoi(argv[2]) - 1); + if (argc > 2) { + n = strtonum(argv[2], INT_MIN+1, INT_MAX, &errstr); + if (errstr) + m4errx(1, "decr: argument is %s: %s.", + errstr, argv[2]); + pbnum(n - 1); + } break; case SYSCTYPE: @@ -273,6 +285,10 @@ expand_builtin(const char *argv[], int argc, int td) warn("%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); exit_code = 1; + if (fatal_warns) { + killdiv(); + exit(exit_code); + } } else err(1, "%s at line %lu: include(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); @@ -337,12 +353,18 @@ expand_builtin(const char *argv[], int argc, int td) break; case DIVRTYPE: - if (argc > 2 && (n = atoi(argv[2])) != 0) - dodiv(n); - else { - active = stdout; - oindex = 0; + if (argc > 2) { + n = strtonum(argv[2], INT_MIN, INT_MAX, &errstr); + if (errstr) + m4errx(1, "divert: argument is %s: %s.", + errstr, argv[2]); + if (n != 0) { + dodiv(n); + break; + } } + active = stdout; + oindex = 0; break; case UNDVTYPE: @@ -689,17 +711,17 @@ dotrace(const char *argv[], int argc, int on) static void doifelse(const char *argv[], int argc) { - cycle { - if (STREQ(argv[2], argv[3])) + while (argc > 4) { + if (STREQ(argv[2], argv[3])) { pbstr(argv[4]); - else if (argc == 6) + break; + } else if (argc == 6) { pbstr(argv[5]); - else if (argc > 6) { + break; + } else { argv += 3; argc -= 3; - continue; } - break; } } @@ -822,7 +844,7 @@ dodiv(int n) if (outfile[n] == NULL) { char fname[] = _PATH_DIVNAME; - if ((fd = mkstemp(fname)) < 0 || + if ((fd = mkstemp(fname)) == -1 || unlink(fname) == -1 || (outfile[n] = fdopen(fd, "w+")) == NULL) err(1, "%s: cannot divert", fname); Modified: stable/11/usr.bin/m4/extern.h ============================================================================== --- stable/11/usr.bin/m4/extern.h Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/extern.h Fri Sep 13 07:22:09 2019 (r352281) @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.54 2014/05/12 19:11:19 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.55 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */ /*- @@ -59,6 +59,8 @@ extern void doesyscmd(const char *); extern void getdivfile(const char *); extern void doformat(const char *[], int); +extern void m4_warnx(const char *, ...); + /* look.c */ #define FLAG_UNTRACED 0 @@ -176,4 +178,5 @@ extern int synch_lines; /* line synchronisation direc extern int mimic_gnu; /* behaves like gnu-m4 */ extern int prefix_builtins; /* prefix builtin macros with m4_ */ - +extern int error_warns; /* make warnings cause exit_code = 1 */ +extern int fatal_warns; /* make warnings fatal */ Modified: stable/11/usr.bin/m4/gnum4.c ============================================================================== --- stable/11/usr.bin/m4/gnum4.c Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/gnum4.c Fri Sep 13 07:22:09 2019 (r352281) @@ -1,4 +1,4 @@ -/* $OpenBSD: gnum4.c,v 1.50 2015/04/29 00:13:26 millert Exp $ */ +/* $OpenBSD: gnum4.c,v 1.52 2017/08/21 21:41:13 deraadt Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -259,11 +260,29 @@ exit_regerror(int er, regex_t *re, const char *source) m4errx(1, "regular expression error in %s: %s.", source, errbuf); } +/* warnx() plus check to see if we need to change exit code or exit . + * -E flag functionality. + */ +void +m4_warnx(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + warnx(fmt, ap); + va_end(ap); + + if (fatal_warns) + exit(1); + if (error_warns) + exit_code = 1; +} + static void add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) { if (n > (int)re->re_nsub) - warnx("No subexpression %d", n); + m4_warnx("No subexpression %d", n); /* Subexpressions that did not match are * not an error. */ else if (pm[n].rm_so != -1 && @@ -446,7 +465,7 @@ void dopatsubst(const char *argv[], int argc) { if (argc <= 3) { - warnx("Too few arguments to patsubst"); + m4_warnx("Too few arguments to patsubst"); return; } /* special case: empty regexp */ @@ -498,7 +517,7 @@ doregexp(const char *argv[], int argc) const char *source; if (argc <= 3) { - warnx("Too few arguments to regexp"); + m4_warnx("Too few arguments to regexp"); return; } /* special gnu case */ @@ -615,7 +634,7 @@ void doesyscmd(const char *cmd) { int p[2]; - pid_t pid, cpid; + pid_t cpid; char *argv[4]; int cc; int status; @@ -653,8 +672,10 @@ doesyscmd(const char *cmd) } while (cc > 0 || (cc == -1 && errno == EINTR)); (void) close(p[0]); - while ((pid = wait(&status)) != cpid && pid >= 0) - continue; + while (waitpid(cpid, &status, 0) == -1) { + if (errno != EINTR) + break; + } pbstr(getstring()); } } Modified: stable/11/usr.bin/m4/m4.1 ============================================================================== --- stable/11/usr.bin/m4/m4.1 Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/m4.1 Fri Sep 13 07:22:09 2019 (r352281) @@ -1,5 +1,5 @@ .\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $ -.\" @(#) $OpenBSD: m4.1,v 1.63 2015/09/14 20:06:58 schwarze Exp $ +.\" @(#) $OpenBSD: m4.1,v 1.64 2017/06/15 13:48:42 bcallah Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd $Mdocdate: September 14 2015 $ +.Dd $Mdocdate: June 15 2017 $ .Dt M4 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Nd macro language processor .Sh SYNOPSIS .Nm -.Op Fl gPs +.Op Fl EgPs .Oo .Sm off .Fl D Ar name Op No = Ar value @@ -130,6 +130,21 @@ turn on all options. .Pp By default, trace is set to .Qq eq . +.It Fl E +Set warnings to be fatal. +When a single +.Fl E +flag is specified, if warnings are issued, execution +continues but +.Nm +will exit with a non-zero exit status. +When multiple +.Fl E +flags are specified, execution will halt upon issuing the +first warning and +.Nm +will exit with a non-zero exit status. +This behaviour matches GNU-m4 1.4.9 and later. .It Fl g Activate GNU-m4 compatibility mode. In this mode, translit handles simple character @@ -437,7 +452,9 @@ Returns the current file's name. .Pp But note that the .Ic m4exit -macro can modify the exit status. +macro can modify the exit status, as can the +.Fl E +flag. .Sh STANDARDS The .Nm @@ -446,7 +463,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl dgIPot +.Op Fl dEgIPot and the macros .Ic builtin , .Ic esyscmd , Modified: stable/11/usr.bin/m4/main.c ============================================================================== --- stable/11/usr.bin/m4/main.c Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/main.c Fri Sep 13 07:22:09 2019 (r352281) @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.86 2015/11/03 16:21:47 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.87 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- @@ -79,6 +79,8 @@ char scommt[MAXCCHARS+1] = {SCOMMT}; /* start characte char ecommt[MAXCCHARS+1] = {ECOMMT}; /* end character for comment */ int synch_lines = 0; /* line synchronisation for C preprocessor */ int prefix_builtins = 0; /* -P option to prefix builtin keywords */ +int error_warns = 0; /* -E option to make warnings exit_code = 1 */ +int fatal_warns = 0; /* -E -E option to make warnings fatal */ struct keyblk { const char *knam; /* keyword name */ @@ -184,7 +186,7 @@ main(int argc, char *argv[]) outfile = NULL; resizedivs(MAXOUT); - while ((c = getopt(argc, argv, "gst:d:D:U:o:I:P")) != -1) + while ((c = getopt(argc, argv, "gst:d:D:EU:o:I:P")) != -1) switch(c) { case 'D': /* define something..*/ @@ -194,6 +196,12 @@ main(int argc, char *argv[]) if (*p) *p++ = EOS; dodefine(optarg, p); + break; + case 'E': /* like GNU m4 1.4.9+ */ + if (error_warns == 0) + error_warns = 1; + else + fatal_warns = 1; break; case 'I': addtoincludepath(optarg); Modified: stable/11/usr.bin/m4/misc.c ============================================================================== --- stable/11/usr.bin/m4/misc.c Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/misc.c Fri Sep 13 07:22:09 2019 (r352281) @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.46 2015/12/07 14:12:46 espie Exp $ */ +/* $OpenBSD: misc.c,v 1.47 2017/06/15 13:48:42 bcallah Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /* @@ -384,7 +384,7 @@ xstrdup(const char *s) void usage(void) { - fprintf(stderr, "usage: m4 [-gPs] [-Dname[=value]] [-d flags] " + fprintf(stderr, "usage: m4 [-EgPs] [-Dname[=value]] [-d flags] " "[-I dirname] [-o filename]\n" "\t[-t macro] [-Uname] [file ...]\n"); exit(1); Modified: stable/11/usr.bin/m4/tokenizer.l ============================================================================== --- stable/11/usr.bin/m4/tokenizer.l Fri Sep 13 07:21:06 2019 (r352280) +++ stable/11/usr.bin/m4/tokenizer.l Fri Sep 13 07:22:09 2019 (r352281) @@ -1,6 +1,6 @@ %option nounput noinput %{ -/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie * @@ -25,6 +25,7 @@ #include #include +extern void m4_warnx(const char *, ...); extern int mimic_gnu; extern int32_t yylval; @@ -42,6 +43,8 @@ oct 0[0-7]* dec [1-9][0-9]* radix 0[rR][0-9]+:[0-9a-zA-Z]+ +%option noyywrap + %% {ws} {/* just skip it */} {hex}|{oct}|{dec} { yylval = number(); return(NUMBER); } @@ -72,7 +75,7 @@ number(void) l = strtol(yytext, NULL, 0); if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || l > INT32_MAX || l < INT32_MIN) { - fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); + m4_warnx("numeric overflow in expr: %s", yytext); } return l; } @@ -88,7 +91,7 @@ parse_radix(void) l = 0; base = strtol(yytext+2, &next, 0); if (base > 36 || next == NULL) { - fprintf(stderr, "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); } else { next++; while (*next != 0) { @@ -101,8 +104,7 @@ parse_radix(void) d = *next - 'A' + 10; } if (d >= base) { - fprintf(stderr, - "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); return 0; } l = base * l + d; From owner-svn-src-all@freebsd.org Fri Sep 13 07:23:47 2019 Return-Path: Delivered-To: svn-src-all@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 75607E8D4D; Fri, 13 Sep 2019 07:23:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6ZC2Z5pz4HXK; Fri, 13 Sep 2019 07:23:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BE813C02; Fri, 13 Sep 2019 07:23:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7NlGk060687; Fri, 13 Sep 2019 07:23:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7NlFq060686; Fri, 13 Sep 2019 07:23:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130723.x8D7NlFq060686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352282 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 352282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:23:47 -0000 Author: bapt Date: Fri Sep 13 07:23:46 2019 New Revision: 352282 URL: https://svnweb.freebsd.org/changeset/base/352282 Log: MFC r352126: Remove reference to mklocale regarding the nls directory mklocale never had anything to do with the content of this directory Modified: stable/11/share/man/man7/hier.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Fri Sep 13 07:22:09 2019 (r352281) +++ stable/11/share/man/man7/hier.7 Fri Sep 13 07:23:46 2019 (r352282) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 11, 2018 +.Dd September 10, 2019 .Dt HIER 7 .Os .Sh NAME @@ -568,9 +568,7 @@ templates for make; see .Xr make 1 .It Pa nls/ -national language support files; -see -.Xr mklocale 1 +national language support files .It Pa security/ data files for security policies such as .Xr mac_lomac 4 From owner-svn-src-all@freebsd.org Fri Sep 13 07:24:30 2019 Return-Path: Delivered-To: svn-src-all@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 9840CE8DD2; Fri, 13 Sep 2019 07:24:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V6b2351Lz4Hfd; Fri, 13 Sep 2019 07:24:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E08C3C05; Fri, 13 Sep 2019 07:24:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D7OUL0060766; Fri, 13 Sep 2019 07:24:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D7OTTo060764; Fri, 13 Sep 2019 07:24:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909130724.x8D7OTTo060764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 07:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352283 - stable/11/lib/libc/locale X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/lib/libc/locale X-SVN-Commit-Revision: 352283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 07:24:30 -0000 Author: bapt Date: Fri Sep 13 07:24:29 2019 New Revision: 352283 URL: https://svnweb.freebsd.org/changeset/base/352283 Log: MFC r352127: In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1) tools to generate the locales data. state it in the libc manpages. Modified: stable/11/lib/libc/locale/euc.5 stable/11/lib/libc/locale/multibyte.3 stable/11/lib/libc/locale/setlocale.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/euc.5 ============================================================================== --- stable/11/lib/libc/locale/euc.5 Fri Sep 13 07:23:46 2019 (r352282) +++ stable/11/lib/libc/locale/euc.5 Fri Sep 13 07:24:29 2019 (r352283) @@ -31,7 +31,7 @@ .\" @(#)euc.4 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 8, 2003 +.Dd September 9, 2019 .Dt EUC 5 .Os .Sh NAME @@ -58,7 +58,7 @@ .\".Ux .\"based systems. .\"See -.\".Xr mklocale 1 +.\".Xr localedef 1 .\"for a complete description of the .\".Ev LC_CTYPE .\"source file format. @@ -130,5 +130,5 @@ Notice that the global is set to 0x8080, this implies that from those 2 bits the codeset can be determined. .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 Modified: stable/11/lib/libc/locale/multibyte.3 ============================================================================== --- stable/11/lib/libc/locale/multibyte.3 Fri Sep 13 07:23:46 2019 (r352282) +++ stable/11/lib/libc/locale/multibyte.3 Fri Sep 13 07:24:29 2019 (r352283) @@ -32,7 +32,7 @@ .\" @(#)multibyte.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 8, 2004 +.Dd September 9, 2019 .Dt MULTIBYTE 3 .Os .Sh NAME @@ -127,7 +127,7 @@ multibyte characters: .It Xr wctomb 3 Ta "convert a wide-character code to a character" .El .Sh SEE ALSO -.Xr mklocale 1 , +.Xr localedef 1 , .Xr setlocale 3 , .Xr stdio 3 , .Xr big5 5 , Modified: stable/11/lib/libc/locale/setlocale.3 ============================================================================== --- stable/11/lib/libc/locale/setlocale.3 Fri Sep 13 07:23:46 2019 (r352282) +++ stable/11/lib/libc/locale/setlocale.3 Fri Sep 13 07:24:29 2019 (r352283) @@ -31,7 +31,7 @@ .\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd November 21, 2003 +.Dd September 9, 2019 .Dt SETLOCALE 3 .Os .Sh NAME @@ -150,8 +150,7 @@ and the category .Sh ERRORS No errors are defined. .Sh SEE ALSO -.Xr colldef 1 , -.Xr mklocale 1 , +.Xr localedef 1 , .Xr catopen 3 , .Xr ctype 3 , .Xr localeconv 3 , From owner-svn-src-all@freebsd.org Fri Sep 13 08:14:47 2019 Return-Path: Delivered-To: svn-src-all@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 41A5BEA941; Fri, 13 Sep 2019 08:14:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46V7j30TGrz4Knn; Fri, 13 Sep 2019 08:14:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E453E4536; Fri, 13 Sep 2019 08:14:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8D8Ekjv090163; Fri, 13 Sep 2019 08:14:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8D8EkPe090161; Fri, 13 Sep 2019 08:14:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909130814.x8D8EkPe090161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 13 Sep 2019 08:14: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: r352284 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 352284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 08:14:47 -0000 Author: tuexen Date: Fri Sep 13 08:14:46 2019 New Revision: 352284 URL: https://svnweb.freebsd.org/changeset/base/352284 Log: MFC r352072: Only update SACK/DSACK lists when a non-empty segment was received. This fixes hitting a KASSERT with a valid packet exchange. PR: 240471 Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Neflix, Inc. Differential Revision: https://reviews.freebsd.org/D21567 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Fri Sep 13 07:24:29 2019 (r352283) +++ stable/12/sys/netinet/tcp_input.c Fri Sep 13 08:14:46 2019 (r352284) @@ -3065,9 +3065,8 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tp->t_flags & TF_SACK_PERMIT) { - if (((tlen == 0) && (save_tlen > 0) && - (SEQ_LT(save_start, save_rnxt)))) { + if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath * above. @@ -3075,20 +3074,20 @@ dodata: /* XXX */ tcp_update_sack_list(tp, save_start, save_start + save_tlen); } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { - /* - * Cleaning sackblks by using zero length - * update. - */ if ((tp->rcv_numsacks >= 1) && (tp->sackblks[0].end == save_start)) { - /* partial overlap, recorded at todrop above */ - tcp_update_sack_list(tp, tp->sackblks[0].start, + /* + * Partial overlap, recorded at todrop + * above. + */ + tcp_update_sack_list(tp, + tp->sackblks[0].start, tp->sackblks[0].end); } else { tcp_update_dsack_list(tp, save_start, save_start + save_tlen); } - } else if ((tlen > 0) && (tlen >= save_tlen)) { + } else if (tlen >= save_tlen) { /* Update of sackblks. */ tcp_update_dsack_list(tp, save_start, save_start + save_tlen); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Fri Sep 13 07:24:29 2019 (r352283) +++ stable/12/sys/netinet/tcp_stacks/rack.c Fri Sep 13 08:14:46 2019 (r352284) @@ -4883,35 +4883,36 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (((tlen == 0) && (save_tlen > 0) && - (SEQ_LT(save_start, save_rnxt)))) { - /* - * DSACK actually handled in the fastpath - * above. - */ - tcp_update_sack_list(tp, save_start, - save_start + save_tlen); - } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { - /* - * Cleaning sackblks by using zero length - * update. - */ - if ((tp->rcv_numsacks >= 1) && - (tp->sackblks[0].end == save_start)) { - /* partial overlap, recorded at todrop above */ - tcp_update_sack_list(tp, tp->sackblks[0].start, - tp->sackblks[0].end); - } else { + if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { + /* + * DSACK actually handled in the fastpath + * above. + */ + tcp_update_sack_list(tp, save_start, + save_start + save_tlen); + } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { + if ((tp->rcv_numsacks >= 1) && + (tp->sackblks[0].end == save_start)) { + /* + * Partial overlap, recorded at todrop + * above. + */ + tcp_update_sack_list(tp, + tp->sackblks[0].start, + tp->sackblks[0].end); + } else { + tcp_update_dsack_list(tp, save_start, + save_start + save_tlen); + } + } else if (tlen >= save_tlen) { + /* Update of sackblks. */ tcp_update_dsack_list(tp, save_start, save_start + save_tlen); + } else if (tlen > 0) { + tcp_update_dsack_list(tp, save_start, + save_start + tlen); } - } else if ((tlen > 0) && (tlen >= save_tlen)) { - /* Update of sackblks. */ - tcp_update_dsack_list(tp, save_start, - save_start + save_tlen); - } else if (tlen > 0) { - tcp_update_dsack_list(tp, save_start, - save_start + tlen); } } else { m_freem(m); From owner-svn-src-all@freebsd.org Fri Sep 13 11:59:58 2019 Return-Path: Delivered-To: svn-src-all@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 85111EF41B; Fri, 13 Sep 2019 11:59:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 46VDhs3K58z4XlF; Fri, 13 Sep 2019 11:59:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E0E81361306; Fri, 13 Sep 2019 21:59:53 +1000 (AEST) Date: Fri, 13 Sep 2019 21:59:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Cy Schubert cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio In-Reply-To: <201909011932.x81JWYts004074@slippy.cwsent.com> Message-ID: <20190913214846.P1215@besplex.bde.org> References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=ZsRUh5Ms3fib6wNPaIgA:9 a=CjuIK1q_8ugA:10 a=EVd9C9LBHkwA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46VDhs3K58z4XlF X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [0.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:211.29.132.0/23:c]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RBL_MAILSPIKE_WORST(2.00)[249.132.29.211.rep.mailspike.net : 127.0.0.10]; RCPT_COUNT_FIVE(0.00)[5]; BAD_REP_POLICIES(0.10)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-5.16), ipnet: 211.28.0.0/14(-3.26), asn: 4804(-2.40), country: AU(0.01)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 11:59:58 -0000 On Sun, 1 Sep 2019, Cy Schubert wrote: I'm replying to this reply since I lost the original mail. > In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: >> Author: emaste >> Date: Sun Sep 1 16:12:05 2019 >> New Revision: 351659 >> URL: https://svnweb.freebsd.org/changeset/base/351659 >> >> Log: >> libc: remove gets >> >> gets is unsafe and shouldn't be used (for many years now). Leave it in >> the existing symbol version so anything that previously linked aginst it >> still runs, but do not allow new software to link against it. >> >> (The compatability/legacy implementation must not be static so that >> the symbol and in particular the compat sym gets@FBSD_1.0 make it >> into libc.) >> >> PR: 222796 (exp-run) >> Reported by: Paul Vixie >> Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlie >> r) >> Relnotes: Yes >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D12298 This breaks for most old standards, and bogotitifies the ifdefs that attempt to support old standards. used to be more careful with these ifdefs than most system headers. C11 removed gets(), but POSIX.1-2017 (Issue 7) still has it (marked as obsolescent). Thus this change breaks support for all versions of POSIX. Bruce From owner-svn-src-all@freebsd.org Fri Sep 13 12:24:22 2019 Return-Path: Delivered-To: svn-src-all@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 235A4F05A7; Fri, 13 Sep 2019 12:24:22 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46VFF10Ls6z4ZHR; Fri, 13 Sep 2019 12:24:20 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 545C5270018B; Fri, 13 Sep 2019 08:24:19 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 545C5270018B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1568377459; bh=a1b+f4yVNP9u/FaoHmc4GpvizRqRGlogYWiAUgk8uSM=; h=Subject:To:From:Date:From; b=dSACIiSF1ht0DK/yT2RZVn7ah0O6BJ36mw29oNtE189gqMqJ1X0Pw/M7Oks09rdUI a4jWGp764D0lnMoOvf1KkSLXmqaqEIl2pqr3RPtBPvx4Z/j2rbPVHfDLEQ3j5ed5G1 BY0L8sDzjXbnUZ57CjKB4TPsTyHaq5sTdhTnFm6O9dzE+USaIDzPOs+i93XXJdElBL uqS4umGDsvTb3rAWgaschourCXANIkg+/1CCVZXWbztxnnFNrMl2DYA3YMpuFeCgRV G+K/ZZff93inuaPhK4sI+x0iE9fd6PACiCNRBNFRQwOtNtuNxBOKvtlWhxPwvf6sB1 rZ0SXSfrztL4w== Subject: Re: svn commit: r352228 - head/sys/netinet To: cem@freebsd.org, Andrew Gallatin Cc: src-committers , svn-src-all , svn-src-head References: <201909111848.x8BImQnn056188@repo.freebsd.org> From: Andrew Gallatin Message-ID: <50ec28c4-7e36-c69b-4003-bff07decf22a@cs.duke.edu> Date: Fri, 13 Sep 2019 08:24:18 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46VFF10Ls6z4ZHR X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.duke.edu header.s=mail0816 header.b=dSACIiSF; dmarc=pass (policy=none) header.from=cs.duke.edu; spf=pass (mx1.freebsd.org: domain of gallatin@cs.duke.edu designates 152.3.140.1 as permitted sender) smtp.mailfrom=gallatin@cs.duke.edu X-Spamd-Result: default: False [-9.36 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[cs.duke.edu:s=mail0816]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:152.3.140.0/23]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DWL_DNSWL_MED(-2.00)[duke.edu.dwl.dnswl.org : 127.0.11.2]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_IN_DNSWL_MED(-0.20)[1.140.3.152.list.dnswl.org : 127.0.11.2]; DKIM_TRACE(0.00)[cs.duke.edu:+]; DMARC_POLICY_ALLOW(-0.50)[cs.duke.edu,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-3.66)[ip: (-9.91), ipnet: 152.3.128.0/17(-4.62), asn: 13371(-3.71), country: US(-0.05)]; ASN(0.00)[asn:13371, ipnet:152.3.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 12:24:22 -0000 On 2019-09-11 17:16, Conrad Meyer wrote: > Small nitpick: > > On Wed, Sep 11, 2019 at 11:48 AM Andrew Gallatin wrote: >> Note that on a system under a syn flood attack, arc4random() >> becomes quite expensive, and the chacha_poly crypto that it calls > > arc4random uses chacha20 — there is no "poly" involved. > > Best, > Conrad > Sorry for the mis-statement. poly is associated with chacha in my mind. In any case, calling arc4random() and the chacha it uses millions of times per second is expensive, and avoiding it provides some headroom. Drew From owner-svn-src-all@freebsd.org Fri Sep 13 14:42:38 2019 Return-Path: Delivered-To: svn-src-all@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 809D7F3492; Fri, 13 Sep 2019 14:42:38 +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 46VJJZ3bx6z3FYv; Fri, 13 Sep 2019 14:42:38 +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 5EC448B2E; Fri, 13 Sep 2019 14:42:38 +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 x8DEgcMX026692; Fri, 13 Sep 2019 14:42:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DEgb84026689; Fri, 13 Sep 2019 14:42:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131442.x8DEgb84026689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 14:42:37 +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: r352285 - in stable/12: sbin/camcontrol sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sbin/camcontrol sys/cam/scsi X-SVN-Commit-Revision: 352285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 14:42:38 -0000 Author: mav Date: Fri Sep 13 14:42:37 2019 New Revision: 352285 URL: https://svnweb.freebsd.org/changeset/base/352285 Log: MFC r352011: Supply SAT layer with valid transfer sizes. This is a rework of r344701, that noticed that number of bytes passes to 8 bit sector count field gets truncated. First decision was to not pass anything, since ATA specs define the field as N/A. But it appeared to be a problem for some SAT devices, that require information about data transfer to operate properly. Some additional investigation shown that it is quite a common practice to set unused fields of ATA commands (fortunately ATA specs formally allow it) to supply the information to SAT layer. I have found SAS-SATA interposer that does not allow pass-through without it. As side effect, reduce code duplication by removing ata_do_28bit_cmd() function, replacing it with more universal ata_do_cmd(). Modified: stable/12/sbin/camcontrol/camcontrol.c stable/12/sbin/camcontrol/fwdownload.c stable/12/sys/cam/scsi/scsi_all.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 08:14:46 2019 (r352284) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 14:42:37 2019 (r352285) @@ -1897,13 +1897,11 @@ ata_cam_send(struct cam_device *device, union ccb *ccb static int ata_do_pass_16(struct cam_device *device, union ccb *ccb, int retries, u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, - u_int8_t tag_action, u_int8_t command, u_int8_t features, - u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int8_t tag_action, u_int8_t command, u_int16_t features, + u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, int timeout, int quiet) { if (data_ptr != NULL) { - ata_flags |= AP_FLAG_BYT_BLOK_BYTES | - AP_FLAG_TLEN_SECT_CNT; if (flags & CAM_DIR_OUT) ata_flags |= AP_FLAG_TDIR_TO_DEV; else @@ -1954,44 +1952,10 @@ ata_try_pass_16(struct cam_device *device) } static int -ata_do_28bit_cmd(struct cam_device *device, union ccb *ccb, int retries, - u_int32_t flags, u_int8_t protocol, u_int8_t tag_action, - u_int8_t command, u_int8_t features, u_int32_t lba, - u_int8_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, - int timeout, int quiet) -{ - - - switch (ata_try_pass_16(device)) { - case -1: - return (1); - case 1: - /* Try using SCSI Passthrough */ - return ata_do_pass_16(device, ccb, retries, flags, protocol, - 0, tag_action, command, features, lba, - sector_count, data_ptr, dxfer_len, - timeout, quiet); - } - - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); - cam_fill_ataio(&ccb->ataio, - retries, - NULL, - flags, - tag_action, - data_ptr, - dxfer_len, - timeout); - - ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); - return ata_cam_send(device, ccb, quiet); -} - -static int ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries, u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, - u_int8_t tag_action, u_int8_t command, u_int8_t features, - u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int8_t tag_action, u_int8_t command, u_int16_t features, + u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, int timeout, int force48bit) { int retval; @@ -2238,14 +2202,15 @@ atahpa_password(struct cam_device *device, int retry_c retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_SET_PWD, /*lba*/0, - /*sector_count*/0, + /*sector_count*/sizeof(*pwd) / 512, /*data_ptr*/(u_int8_t*)pwd, - /*dxfer_len*/sizeof(struct ata_set_max_pwd), + /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, is48bit); @@ -2305,14 +2270,15 @@ atahpa_unlock(struct cam_device *device, int retry_cou retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_UNLOCK, /*lba*/0, - /*sector_count*/0, + /*sector_count*/sizeof(*pwd) / 512, /*data_ptr*/(u_int8_t*)pwd, - /*dxfer_len*/sizeof(struct ata_set_max_pwd), + /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, is48bit); @@ -2482,45 +2448,32 @@ ata_do_identify(struct cam_device *device, int retry_c return (1); } - error = ata_do_28bit_cmd(device, - ccb, - /*retries*/retry_count, - /*flags*/CAM_DIR_IN, - /*protocol*/AP_PROTO_PIO_IN, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/command, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)ptr, - /*dxfer_len*/sizeof(struct ata_params), - /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); +retry: + error = ata_do_cmd(device, + ccb, + /*retries*/retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/command, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(struct ata_params) / 512, + /*data_ptr*/(u_int8_t *)ptr, + /*dxfer_len*/sizeof(struct ata_params), + /*timeout*/timeout ? timeout : 30 * 1000, + /*force48bit*/0); if (error != 0) { - if (retry_command == 0) { - free(ptr); - return (1); + if (retry_command != 0) { + command = retry_command; + retry_command = 0; + goto retry; } - error = ata_do_28bit_cmd(device, - ccb, - /*retries*/retry_count, - /*flags*/CAM_DIR_IN, - /*protocol*/AP_PROTO_PIO_IN, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/retry_command, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)ptr, - /*dxfer_len*/sizeof(struct ata_params), - /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/0); - - if (error != 0) { - free(ptr); - return (1); - } + free(ptr); + return (1); } ident_buf = (struct ata_params *)ptr; @@ -2708,20 +2661,21 @@ atasecurity_freeze(struct cam_device *device, union cc if (quiet == 0) atasecurity_notify(ATA_SECURITY_FREEZE_LOCK, NULL); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_FREEZE_LOCK, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_FREEZE_LOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*force48bit*/0); } static int @@ -2733,20 +2687,22 @@ atasecurity_unlock(struct cam_device *device, union cc if (quiet == 0) atasecurity_notify(ATA_SECURITY_UNLOCK, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_UNLOCK, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_UNLOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } static int @@ -2757,20 +2713,22 @@ atasecurity_disable(struct cam_device *device, union c if (quiet == 0) atasecurity_notify(ATA_SECURITY_DISABLE_PASSWORD, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_DISABLE_PASSWORD, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_DISABLE_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } @@ -2816,20 +2774,21 @@ atasecurity_erase(struct cam_device *device, union ccb if (quiet == 0) atasecurity_notify(ATA_SECURITY_ERASE_PREPARE, NULL); - error = ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_ERASE_PREPARE, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/timeout, - /*quiet*/0); + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_PREPARE, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*force48bit*/0); if (error != 0) return error; @@ -2837,20 +2796,22 @@ atasecurity_erase(struct cam_device *device, union ccb if (quiet == 0) atasecurity_notify(ATA_SECURITY_ERASE_UNIT, pwd); - error = ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_ERASE_UNIT, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/erase_timeout, - /*quiet*/0); + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_UNIT, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/erase_timeout, + /*force48bit*/0); if (error == 0 && quiet == 0) printf("\nErase Complete\n"); @@ -2867,20 +2828,22 @@ atasecurity_set_password(struct cam_device *device, un if (quiet == 0) atasecurity_notify(ATA_SECURITY_SET_PASSWORD, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_SET_PASSWORD, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_SET_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } static void @@ -9481,7 +9444,7 @@ atapm(struct cam_device *device, int argc, char **argv /*data_ptr*/NULL, /*dxfer_len*/0, /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); + /*force48bit*/0); cam_freeccb(ccb); @@ -9534,11 +9497,12 @@ ataaxm(struct cam_device *device, int argc, char **arg } } - retval = ata_do_28bit_cmd(device, + retval = ata_do_cmd(device, ccb, /*retries*/retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_SETFEATURES, /*features*/cmd, @@ -9547,7 +9511,7 @@ ataaxm(struct cam_device *device, int argc, char **arg /*data_ptr*/NULL, /*dxfer_len*/0, /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); + /*force48bit*/0); cam_freeccb(ccb); return (retval); Modified: stable/12/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/12/sbin/camcontrol/fwdownload.c Fri Sep 13 08:14:46 2019 (r352284) +++ stable/12/sbin/camcontrol/fwdownload.c Fri Sep 13 14:42:37 2019 (r352285) @@ -701,11 +701,11 @@ fw_check_device_ready(struct cam_device *dev, camcontr /*flags*/ CAM_DIR_IN, /*tag_action*/ MSG_SIMPLE_Q_TAG, /*protocol*/ AP_PROTO_PIO_IN, - /*ata_flags*/ AP_FLAG_BYT_BLOK_BYTES | + /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS | AP_FLAG_TLEN_SECT_CNT | AP_FLAG_TDIR_FROM_DEV, /*features*/ 0, - /*sector_count*/ (uint8_t) dxfer_len, + /*sector_count*/ dxfer_len / 512, /*lba*/ 0, /*command*/ ATA_ATA_IDENTIFY, /*auxiliary*/ 0, Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Fri Sep 13 08:14:46 2019 (r352284) +++ stable/12/sys/cam/scsi/scsi_all.c Fri Sep 13 14:42:37 2019 (r352285) @@ -8281,10 +8281,10 @@ scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t r tag_action, /*protocol*/AP_PROTO_PIO_IN, /*ata_flags*/AP_FLAG_TDIR_FROM_DEV | - AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_BYT_BLOK_BLOCKS | AP_FLAG_TLEN_SECT_CNT, /*features*/0, - /*sector_count*/dxfer_len, + /*sector_count*/dxfer_len / 512, /*lba*/0, /*command*/ATA_ATA_IDENTIFY, /*device*/ 0, From owner-svn-src-all@freebsd.org Fri Sep 13 14:43:06 2019 Return-Path: Delivered-To: svn-src-all@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 D25DBF34F7; Fri, 13 Sep 2019 14:43:06 +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 46VJK65z4jz3Fjb; Fri, 13 Sep 2019 14:43:06 +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 AFF068B30; Fri, 13 Sep 2019 14:43:06 +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 x8DEh6qD026781; Fri, 13 Sep 2019 14:43:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DEh6Vv026778; Fri, 13 Sep 2019 14:43:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131443.x8DEh6Vv026778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 14:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352286 - in stable/11: sbin/camcontrol sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: sbin/camcontrol sys/cam/scsi X-SVN-Commit-Revision: 352286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 14:43:06 -0000 Author: mav Date: Fri Sep 13 14:43:05 2019 New Revision: 352286 URL: https://svnweb.freebsd.org/changeset/base/352286 Log: Supply SAT layer with valid transfer sizes. This is a rework of r344701, that noticed that number of bytes passes to 8 bit sector count field gets truncated. First decision was to not pass anything, since ATA specs define the field as N/A. But it appeared to be a problem for some SAT devices, that require information about data transfer to operate properly. Some additional investigation shown that it is quite a common practice to set unused fields of ATA commands (fortunately ATA specs formally allow it) to supply the information to SAT layer. I have found SAS-SATA interposer that does not allow pass-through without it. As side effect, reduce code duplication by removing ata_do_28bit_cmd() function, replacing it with more universal ata_do_cmd(). Modified: stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/fwdownload.c stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 14:42:37 2019 (r352285) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 14:43:05 2019 (r352286) @@ -1730,13 +1730,11 @@ ata_cam_send(struct cam_device *device, union ccb *ccb static int ata_do_pass_16(struct cam_device *device, union ccb *ccb, int retries, u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, - u_int8_t tag_action, u_int8_t command, u_int8_t features, - u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int8_t tag_action, u_int8_t command, u_int16_t features, + u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, int timeout, int quiet) { if (data_ptr != NULL) { - ata_flags |= AP_FLAG_BYT_BLOK_BYTES | - AP_FLAG_TLEN_SECT_CNT; if (flags & CAM_DIR_OUT) ata_flags |= AP_FLAG_TDIR_TO_DEV; else @@ -1787,44 +1785,10 @@ ata_try_pass_16(struct cam_device *device) } static int -ata_do_28bit_cmd(struct cam_device *device, union ccb *ccb, int retries, - u_int32_t flags, u_int8_t protocol, u_int8_t tag_action, - u_int8_t command, u_int8_t features, u_int32_t lba, - u_int8_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, - int timeout, int quiet) -{ - - - switch (ata_try_pass_16(device)) { - case -1: - return (1); - case 1: - /* Try using SCSI Passthrough */ - return ata_do_pass_16(device, ccb, retries, flags, protocol, - 0, tag_action, command, features, lba, - sector_count, data_ptr, dxfer_len, - timeout, quiet); - } - - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); - cam_fill_ataio(&ccb->ataio, - retries, - NULL, - flags, - tag_action, - data_ptr, - dxfer_len, - timeout); - - ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); - return ata_cam_send(device, ccb, quiet); -} - -static int ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries, u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, - u_int8_t tag_action, u_int8_t command, u_int8_t features, - u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int8_t tag_action, u_int8_t command, u_int16_t features, + u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, u_int16_t dxfer_len, int timeout, int force48bit) { int retval; @@ -2071,14 +2035,15 @@ atahpa_password(struct cam_device *device, int retry_c retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_SET_PWD, /*lba*/0, - /*sector_count*/0, + /*sector_count*/sizeof(*pwd) / 512, /*data_ptr*/(u_int8_t*)pwd, - /*dxfer_len*/sizeof(struct ata_set_max_pwd), + /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, is48bit); @@ -2138,14 +2103,15 @@ atahpa_unlock(struct cam_device *device, int retry_cou retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_UNLOCK, /*lba*/0, - /*sector_count*/0, + /*sector_count*/sizeof(*pwd) / 512, /*data_ptr*/(u_int8_t*)pwd, - /*dxfer_len*/sizeof(struct ata_set_max_pwd), + /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, is48bit); @@ -2315,45 +2281,32 @@ ata_do_identify(struct cam_device *device, int retry_c return (1); } - error = ata_do_28bit_cmd(device, - ccb, - /*retries*/retry_count, - /*flags*/CAM_DIR_IN, - /*protocol*/AP_PROTO_PIO_IN, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/command, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)ptr, - /*dxfer_len*/sizeof(struct ata_params), - /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); +retry: + error = ata_do_cmd(device, + ccb, + /*retries*/retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/command, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(struct ata_params) / 512, + /*data_ptr*/(u_int8_t *)ptr, + /*dxfer_len*/sizeof(struct ata_params), + /*timeout*/timeout ? timeout : 30 * 1000, + /*force48bit*/0); if (error != 0) { - if (retry_command == 0) { - free(ptr); - return (1); + if (retry_command != 0) { + command = retry_command; + retry_command = 0; + goto retry; } - error = ata_do_28bit_cmd(device, - ccb, - /*retries*/retry_count, - /*flags*/CAM_DIR_IN, - /*protocol*/AP_PROTO_PIO_IN, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/retry_command, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)ptr, - /*dxfer_len*/sizeof(struct ata_params), - /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/0); - - if (error != 0) { - free(ptr); - return (1); - } + free(ptr); + return (1); } error = 1; @@ -2527,20 +2480,21 @@ atasecurity_freeze(struct cam_device *device, union cc if (quiet == 0) atasecurity_notify(ATA_SECURITY_FREEZE_LOCK, NULL); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_FREEZE_LOCK, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_FREEZE_LOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*force48bit*/0); } static int @@ -2552,20 +2506,22 @@ atasecurity_unlock(struct cam_device *device, union cc if (quiet == 0) atasecurity_notify(ATA_SECURITY_UNLOCK, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_UNLOCK, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_UNLOCK, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } static int @@ -2576,20 +2532,22 @@ atasecurity_disable(struct cam_device *device, union c if (quiet == 0) atasecurity_notify(ATA_SECURITY_DISABLE_PASSWORD, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_DISABLE_PASSWORD, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_DISABLE_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } @@ -2635,20 +2593,21 @@ atasecurity_erase(struct cam_device *device, union ccb if (quiet == 0) atasecurity_notify(ATA_SECURITY_ERASE_PREPARE, NULL); - error = ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_ERASE_PREPARE, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/timeout, - /*quiet*/0); + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_PREPARE, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout, + /*force48bit*/0); if (error != 0) return error; @@ -2656,20 +2615,22 @@ atasecurity_erase(struct cam_device *device, union ccb if (quiet == 0) atasecurity_notify(ATA_SECURITY_ERASE_UNIT, pwd); - error = ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_ERASE_UNIT, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/erase_timeout, - /*quiet*/0); + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_ERASE_UNIT, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/erase_timeout, + /*force48bit*/0); if (error == 0 && quiet == 0) printf("\nErase Complete\n"); @@ -2686,20 +2647,22 @@ atasecurity_set_password(struct cam_device *device, un if (quiet == 0) atasecurity_notify(ATA_SECURITY_SET_PASSWORD, pwd); - return ata_do_28bit_cmd(device, - ccb, - retry_count, - /*flags*/CAM_DIR_OUT, - /*protocol*/AP_PROTO_PIO_OUT, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SECURITY_SET_PASSWORD, - /*features*/0, - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/(u_int8_t *)pwd, - /*dxfer_len*/sizeof(*pwd), - /*timeout*/timeout, - /*quiet*/0); + return ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/AP_PROTO_PIO_OUT, + /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SECURITY_SET_PASSWORD, + /*features*/0, + /*lba*/0, + /*sector_count*/sizeof(*pwd) / 512, + /*data_ptr*/(u_int8_t *)pwd, + /*dxfer_len*/sizeof(*pwd), + /*timeout*/timeout, + /*force48bit*/0); } static void @@ -8995,7 +8958,7 @@ atapm(struct cam_device *device, int argc, char **argv /*data_ptr*/NULL, /*dxfer_len*/0, /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); + /*force48bit*/0); cam_freeccb(ccb); @@ -9048,11 +9011,12 @@ ataaxm(struct cam_device *device, int argc, char **arg } } - retval = ata_do_28bit_cmd(device, + retval = ata_do_cmd(device, ccb, /*retries*/retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_SETFEATURES, /*features*/cmd, @@ -9061,7 +9025,7 @@ ataaxm(struct cam_device *device, int argc, char **arg /*data_ptr*/NULL, /*dxfer_len*/0, /*timeout*/timeout ? timeout : 30 * 1000, - /*quiet*/1); + /*force48bit*/0); cam_freeccb(ccb); return (retval); Modified: stable/11/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/11/sbin/camcontrol/fwdownload.c Fri Sep 13 14:42:37 2019 (r352285) +++ stable/11/sbin/camcontrol/fwdownload.c Fri Sep 13 14:43:05 2019 (r352286) @@ -701,11 +701,11 @@ fw_check_device_ready(struct cam_device *dev, camcontr /*flags*/ CAM_DIR_IN, /*tag_action*/ MSG_SIMPLE_Q_TAG, /*protocol*/ AP_PROTO_PIO_IN, - /*ata_flags*/ AP_FLAG_BYT_BLOK_BYTES | + /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS | AP_FLAG_TLEN_SECT_CNT | AP_FLAG_TDIR_FROM_DEV, /*features*/ 0, - /*sector_count*/ (uint8_t) dxfer_len, + /*sector_count*/ dxfer_len / 512, /*lba*/ 0, /*command*/ ATA_ATA_IDENTIFY, /*auxiliary*/ 0, Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Fri Sep 13 14:42:37 2019 (r352285) +++ stable/11/sys/cam/scsi/scsi_all.c Fri Sep 13 14:43:05 2019 (r352286) @@ -8266,10 +8266,10 @@ scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t r tag_action, /*protocol*/AP_PROTO_PIO_IN, /*ata_flags*/AP_FLAG_TDIR_FROM_DEV | - AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_BYT_BLOK_BLOCKS | AP_FLAG_TLEN_SECT_CNT, /*features*/0, - /*sector_count*/dxfer_len, + /*sector_count*/dxfer_len / 512, /*lba*/0, /*command*/ATA_ATA_IDENTIFY, /*device*/ 0, From owner-svn-src-all@freebsd.org Fri Sep 13 14:43:45 2019 Return-Path: Delivered-To: svn-src-all@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 C0809F3568; Fri, 13 Sep 2019 14:43:45 +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 46VJKs4hT1z3Fqt; Fri, 13 Sep 2019 14:43:45 +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 844A78B31; Fri, 13 Sep 2019 14:43:45 +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 x8DEhjJL026933; Fri, 13 Sep 2019 14:43:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DEhiZa026869; Fri, 13 Sep 2019 14:43:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131443.x8DEhiZa026869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 14:43:44 +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: r352287 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 352287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 14:43:45 -0000 Author: mav Date: Fri Sep 13 14:43:44 2019 New Revision: 352287 URL: https://svnweb.freebsd.org/changeset/base/352287 Log: MFC r352018: Unify cam_send_ccb() error reporting. Error there mean that command was not even executed, and all information we have about it is errno, and cam_error_print() call is not very useful. Plus it is most likely a programmatic error, that shoud not happen. Modified: stable/12/sbin/camcontrol/attrib.c stable/12/sbin/camcontrol/camcontrol.c stable/12/sbin/camcontrol/persist.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/attrib.c ============================================================================== --- stable/12/sbin/camcontrol/attrib.c Fri Sep 13 14:43:05 2019 (r352286) +++ stable/12/sbin/camcontrol/attrib.c Fri Sep 13 14:43:44 2019 (r352287) @@ -344,12 +344,6 @@ scsiattrib(struct cam_device *device, int argc, char * if (cam_send_ccb(device, ccb) < 0) { warn("error sending %s ATTRIBUTE", (read_attr != 0) ? "READ" : "WRITE"); - - if (verbosemode != 0) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; goto bailout; } Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 14:43:05 2019 (r352286) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 14:43:44 2019 (r352287) @@ -437,7 +437,7 @@ getdevlist(struct cam_device *device) ccb->cgdl.status = CAM_GDEVLIST_MORE_DEVS; while (ccb->cgdl.status == CAM_GDEVLIST_MORE_DEVS) { if (cam_send_ccb(device, ccb) < 0) { - perror("error getting device list"); + warn("error getting device list"); cam_freeccb(ccb); return (1); } @@ -787,7 +787,7 @@ print_dev_mmcsd(struct device_match_result *dev_result advi->buf = (uint8_t *)&mmc_ident_data; if (cam_send_ccb(dev, ccb) < 0) { - warn("error sending CAMIOCOMMAND ioctl"); + warn("error sending XPT_DEV_ADVINFO CCB"); cam_freeccb(ccb); cam_close_device(dev); return (1); @@ -829,7 +829,7 @@ nvme_get_cdata(struct cam_device *dev, struct nvme_con advi->buf = (uint8_t *)cdata; if (cam_send_ccb(dev, ccb) < 0) { - warn("error sending CAMIOCOMMAND ioctl"); + warn("error sending XPT_DEV_ADVINFO CCB"); cam_freeccb(ccb); cam_close_device(dev); return(1); @@ -895,13 +895,7 @@ testunitready(struct cam_device *device, int task_attr if (cam_send_ccb(device, ccb) < 0) { if (quiet == 0) - perror("error sending test unit ready"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending TEST UNIT READY command"); cam_freeccb(ccb); return (1); } @@ -964,13 +958,7 @@ scsistart(struct cam_device *device, int startstop, in ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending start unit"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending START STOP UNIT command"); cam_freeccb(ccb); return (1); } @@ -1133,13 +1121,7 @@ scsiinquiry(struct cam_device *device, int task_attr, ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending SCSI inquiry"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending INQUIRY command"); cam_freeccb(ccb); return (1); } @@ -1215,13 +1197,7 @@ scsiserial(struct cam_device *device, int task_attr, i ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - warn("error getting serial number"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending INQUIRY command"); cam_freeccb(ccb); free(serial_buf); return (1); @@ -1821,12 +1797,6 @@ scsi_cam_pass_16_send(struct cam_device *device, union warn("error sending ATA %s via pass_16", ata_op_string(&ata_cmd)); } - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - return (1); } @@ -1868,12 +1838,6 @@ ata_cam_send(struct cam_device *device, union ccb *ccb warn("error sending ATA %s", ata_op_string(&(ccb->ataio.cmd))); } - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - return (1); } @@ -4150,13 +4114,7 @@ next_batch: ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(device, ccb) < 0) { - perror("error reading defect list"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending READ DEFECT DATA command"); error = 1; goto defect_bailout; } @@ -5293,7 +5251,7 @@ tagcontrol(struct cam_device *device, int argc, char * if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_REL_SIMQ CCB"); + warn("error sending XPT_REL_SIMQ CCB"); retval = 1; goto tagcontrol_bailout; } @@ -5317,7 +5275,7 @@ tagcontrol(struct cam_device *device, int argc, char * ccb->ccb_h.func_code = XPT_GDEV_STATS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_GDEV_STATS CCB"); + warn("error sending XPT_GDEV_STATS CCB"); retval = 1; goto tagcontrol_bailout; } @@ -5533,9 +5491,6 @@ get_cpi(struct cam_device *device, struct ccb_pathinq ccb->ccb_h.func_code = XPT_PATH_INQ; if (cam_send_ccb(device, ccb) < 0) { warn("get_cpi: error sending Path Inquiry CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); retval = 1; goto get_cpi_bailout; } @@ -5570,10 +5525,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; if (cam_send_ccb(device, ccb) < 0) { - warn("get_cgd: error sending Path Inquiry CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + warn("get_cgd: error sending Get type information CCB"); retval = 1; goto get_cgd_bailout; } @@ -6129,10 +6081,7 @@ get_print_cts(struct cam_device *device, int user_sett ccb->cts.type = CTS_TYPE_USER_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_GET_TRAN_SETTINGS CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + warn("error sending XPT_GET_TRAN_SETTINGS CCB"); retval = 1; goto get_print_cts_bailout; } @@ -6259,32 +6208,13 @@ ratecontrol(struct cam_device *device, int task_attr, break; } } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user * requests. */ - ccb->ccb_h.func_code = XPT_PATH_INQ; - if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_PATH_INQ CCB"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - retval = 1; + if ((retval = get_cpi(device, &cpi)) != 0) goto ratecontrol_bailout; - } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - warnx("XPT_PATH_INQ CCB failed"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - retval = 1; - goto ratecontrol_bailout; - } - bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); if (quiet == 0) { fprintf(stdout, "%s parameters:\n", @@ -6472,11 +6402,7 @@ ratecontrol(struct cam_device *device, int task_attr, } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_SET_TRAN_SETTINGS CCB"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending XPT_SET_TRAN_SETTINGS CCB"); retval = 1; goto ratecontrol_bailout; } @@ -6710,11 +6636,7 @@ doreport: * errors are expected. */ if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending TEST UNIT READY command"); error = 1; goto scsiformat_bailout; } @@ -6901,11 +6823,7 @@ sanitize_wait_scsi(struct cam_device *device, union cc * errors are expected. */ if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending TEST UNIT READY command"); return (1); } @@ -7443,11 +7361,6 @@ retry: if (cam_send_ccb(device, ccb) < 0) { warn("error sending REPORT LUNS command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -7699,11 +7612,6 @@ scsireadcapacity(struct cam_device *device, int argc, if (cam_send_ccb(device, ccb) < 0) { warn("error sending READ CAPACITY command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -7746,11 +7654,6 @@ long_only: if (cam_send_ccb(device, ccb) < 0) { warn("error sending READ CAPACITY (16) command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -9603,7 +9506,7 @@ retry_alloc: ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending REPORT SUPPORTED OPERATION CODES"); + warn("error sending REPORT SUPPORTED OPERATION CODES command"); retval = 1; goto bailout; } Modified: stable/12/sbin/camcontrol/persist.c ============================================================================== --- stable/12/sbin/camcontrol/persist.c Fri Sep 13 14:43:05 2019 (r352286) +++ stable/12/sbin/camcontrol/persist.c Fri Sep 13 14:43:44 2019 (r352287) @@ -858,12 +858,6 @@ retry: if (cam_send_ccb(device, ccb) < 0) { warn("error sending PERSISTENT RESERVE %s", (in != 0) ? "IN" : "OUT"); - - if (verbosemode != 0) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; goto bailout; } From owner-svn-src-all@freebsd.org Fri Sep 13 14:51:00 2019 Return-Path: Delivered-To: svn-src-all@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 D244EF3782; Fri, 13 Sep 2019 14:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VJVD5FDFz3GGB; Fri, 13 Sep 2019 14:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98BCB8B66; Fri, 13 Sep 2019 14:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DEp0vH027622; Fri, 13 Sep 2019 14:51:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DEp0Wj027621; Fri, 13 Sep 2019 14:51:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909131451.x8DEp0Wj027621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Sep 2019 14:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352288 - head/usr.bin/grdc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/grdc X-SVN-Commit-Revision: 352288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 14:51:00 -0000 Author: bapt Date: Fri Sep 13 14:51:00 2019 New Revision: 352288 URL: https://svnweb.freebsd.org/changeset/base/352288 Log: Remove remnant from the pre LIBADD era Modified: head/usr.bin/grdc/Makefile Modified: head/usr.bin/grdc/Makefile ============================================================================== --- head/usr.bin/grdc/Makefile Fri Sep 13 14:43:44 2019 (r352287) +++ head/usr.bin/grdc/Makefile Fri Sep 13 14:51:00 2019 (r352288) @@ -2,7 +2,6 @@ PROG= grdc MAN= grdc.6 -DPADD= ${LIBNCURSESW} LIBADD= ncursesw .include From owner-svn-src-all@freebsd.org Fri Sep 13 15:13:22 2019 Return-Path: Delivered-To: svn-src-all@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 D408BF3D79; Fri, 13 Sep 2019 15:13:22 +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 46VK025DBPz3HNC; Fri, 13 Sep 2019 15:13:22 +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 9689D90A0; Fri, 13 Sep 2019 15:13:22 +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 x8DFDMHU045119; Fri, 13 Sep 2019 15:13:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFDLPj045116; Fri, 13 Sep 2019 15:13:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131513.x8DFDLPj045116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352289 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 352289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:13:22 -0000 Author: mav Date: Fri Sep 13 15:13:21 2019 New Revision: 352289 URL: https://svnweb.freebsd.org/changeset/base/352289 Log: MFC r352018: Unify cam_send_ccb() error reporting. Error there mean that command was not even executed, and all information we have about it is errno, and cam_error_print() call is not very useful. Plus it is most likely a programmatic error, that shoud not happen. Modified: stable/11/sbin/camcontrol/attrib.c stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/persist.c Modified: stable/11/sbin/camcontrol/attrib.c ============================================================================== --- stable/11/sbin/camcontrol/attrib.c Fri Sep 13 14:51:00 2019 (r352288) +++ stable/11/sbin/camcontrol/attrib.c Fri Sep 13 15:13:21 2019 (r352289) @@ -344,12 +344,6 @@ scsiattrib(struct cam_device *device, int argc, char * if (cam_send_ccb(device, ccb) < 0) { warn("error sending %s ATTRIBUTE", (read_attr != 0) ? "READ" : "WRITE"); - - if (verbosemode != 0) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; goto bailout; } Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 14:51:00 2019 (r352288) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:13:21 2019 (r352289) @@ -421,7 +421,7 @@ getdevlist(struct cam_device *device) ccb->cgdl.status = CAM_GDEVLIST_MORE_DEVS; while (ccb->cgdl.status == CAM_GDEVLIST_MORE_DEVS) { if (cam_send_ccb(device, ccb) < 0) { - perror("error getting device list"); + warn("error getting device list"); cam_freeccb(ccb); return (1); } @@ -728,13 +728,7 @@ testunitready(struct cam_device *device, int task_attr if (cam_send_ccb(device, ccb) < 0) { if (quiet == 0) - perror("error sending test unit ready"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending TEST UNIT READY command"); cam_freeccb(ccb); return (1); } @@ -797,13 +791,7 @@ scsistart(struct cam_device *device, int startstop, in ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending start unit"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending START STOP UNIT command"); cam_freeccb(ccb); return (1); } @@ -966,13 +954,7 @@ scsiinquiry(struct cam_device *device, int task_attr, ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending SCSI inquiry"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending INQUIRY command"); cam_freeccb(ccb); return (1); } @@ -1048,13 +1030,7 @@ scsiserial(struct cam_device *device, int task_attr, i ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - warn("error getting serial number"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending INQUIRY command"); cam_freeccb(ccb); free(serial_buf); return (1); @@ -1654,12 +1630,6 @@ scsi_cam_pass_16_send(struct cam_device *device, union warn("error sending ATA %s via pass_16", ata_op_string(&ata_cmd)); } - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - return (1); } @@ -1701,12 +1671,6 @@ ata_cam_send(struct cam_device *device, union ccb *ccb warn("error sending ATA %s", ata_op_string(&(ccb->ataio.cmd))); } - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - return (1); } @@ -3969,13 +3933,7 @@ next_batch: ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(device, ccb) < 0) { - perror("error reading defect list"); - - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - + warn("error sending READ DEFECT DATA command"); error = 1; goto defect_bailout; } @@ -5112,7 +5070,7 @@ tagcontrol(struct cam_device *device, int argc, char * if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_REL_SIMQ CCB"); + warn("error sending XPT_REL_SIMQ CCB"); retval = 1; goto tagcontrol_bailout; } @@ -5136,7 +5094,7 @@ tagcontrol(struct cam_device *device, int argc, char * ccb->ccb_h.func_code = XPT_GDEV_STATS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_GDEV_STATS CCB"); + warn("error sending XPT_GDEV_STATS CCB"); retval = 1; goto tagcontrol_bailout; } @@ -5335,9 +5293,6 @@ get_cpi(struct cam_device *device, struct ccb_pathinq ccb->ccb_h.func_code = XPT_PATH_INQ; if (cam_send_ccb(device, ccb) < 0) { warn("get_cpi: error sending Path Inquiry CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); retval = 1; goto get_cpi_bailout; } @@ -5372,10 +5327,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; if (cam_send_ccb(device, ccb) < 0) { - warn("get_cgd: error sending Path Inquiry CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + warn("get_cgd: error sending Get type information CCB"); retval = 1; goto get_cgd_bailout; } @@ -5927,10 +5879,7 @@ get_print_cts(struct cam_device *device, int user_sett ccb->cts.type = CTS_TYPE_USER_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_GET_TRAN_SETTINGS CCB"); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + warn("error sending XPT_GET_TRAN_SETTINGS CCB"); retval = 1; goto get_print_cts_bailout; } @@ -6057,32 +6006,13 @@ ratecontrol(struct cam_device *device, int task_attr, break; } } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user * requests. */ - ccb->ccb_h.func_code = XPT_PATH_INQ; - if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_PATH_INQ CCB"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - retval = 1; + if ((retval = get_cpi(device, &cpi)) != 0) goto ratecontrol_bailout; - } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - warnx("XPT_PATH_INQ CCB failed"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - retval = 1; - goto ratecontrol_bailout; - } - bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); if (quiet == 0) { fprintf(stdout, "%s parameters:\n", @@ -6270,11 +6200,7 @@ ratecontrol(struct cam_device *device, int task_attr, } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending XPT_SET_TRAN_SETTINGS CCB"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending XPT_SET_TRAN_SETTINGS CCB"); retval = 1; goto ratecontrol_bailout; } @@ -6508,11 +6434,7 @@ doreport: * errors are expected. */ if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending TEST UNIT READY command"); error = 1; goto scsiformat_bailout; } @@ -6699,11 +6621,7 @@ sanitize_wait_scsi(struct cam_device *device, union cc * errors are expected. */ if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + warn("error sending TEST UNIT READY command"); return (1); } @@ -7241,11 +7159,6 @@ retry: if (cam_send_ccb(device, ccb) < 0) { warn("error sending REPORT LUNS command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -7497,11 +7410,6 @@ scsireadcapacity(struct cam_device *device, int argc, if (cam_send_ccb(device, ccb) < 0) { warn("error sending READ CAPACITY command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -7544,11 +7452,6 @@ long_only: if (cam_send_ccb(device, ccb) < 0) { warn("error sending READ CAPACITY (16) command"); - - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -9117,7 +9020,7 @@ retry_alloc: ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - perror("error sending REPORT SUPPORTED OPERATION CODES"); + warn("error sending REPORT SUPPORTED OPERATION CODES command"); retval = 1; goto bailout; } Modified: stable/11/sbin/camcontrol/persist.c ============================================================================== --- stable/11/sbin/camcontrol/persist.c Fri Sep 13 14:51:00 2019 (r352288) +++ stable/11/sbin/camcontrol/persist.c Fri Sep 13 15:13:21 2019 (r352289) @@ -858,12 +858,6 @@ retry: if (cam_send_ccb(device, ccb) < 0) { warn("error sending PERSISTENT RESERVE %s", (in != 0) ? "IN" : "OUT"); - - if (verbosemode != 0) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; goto bailout; } From owner-svn-src-all@freebsd.org Fri Sep 13 15:15:59 2019 Return-Path: Delivered-To: svn-src-all@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 29C40F3E26; Fri, 13 Sep 2019 15:15:59 +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 46VK3314xfz3Hgc; Fri, 13 Sep 2019 15:15:59 +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 03AE190A1; Fri, 13 Sep 2019 15:15:59 +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 x8DFFwCu045313; Fri, 13 Sep 2019 15:15:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFFwL7045312; Fri, 13 Sep 2019 15:15:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131515.x8DFFwL7045312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:15: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: r352290 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 352290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:15:59 -0000 Author: mav Date: Fri Sep 13 15:15:58 2019 New Revision: 352290 URL: https://svnweb.freebsd.org/changeset/base/352290 Log: MFC r352082, r352103: Fix number of problems found while testing on SAT devices. - Remove incomplete and dangerous ata_res decoding from ata_do_cmd(). Instead switch all functions that need the result to use get_ata_status(), doing the same, but more careful, also reducing code duplication. - Made get_ata_status() to also decode fixed format sense. In many cases it is still not enough to make it useful, since it can only report results of 28-bit command, but it is slightly better then nothing. - Organize error reporting in ata_do_cmd(), so that if caller specified AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones). - Make HPA/AMA errors not fatal for `identify` subcommand. - Fix reprobe() not being called on HPA/AMA when in quiet mode. - Remove not very useful messages from `format` and `sanitize` commands with -y flag. Once they started, they often can't be stopped any way. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:13:21 2019 (r352289) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:15:58 2019 (r352290) @@ -1770,7 +1770,7 @@ atacapprint(struct ata_params *parm) } static int -scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb, int quiet) +scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb) { struct ata_pass_16 *ata_pass_16; struct ata_cmd ata_cmd; @@ -1793,24 +1793,21 @@ scsi_cam_pass_16_send(struct cam_device *device, union ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s via pass_16", - ata_op_string(&ata_cmd)); - } + warn("error sending ATA %s via pass_16", ata_op_string(&ata_cmd)); return (1); } + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ if (!(ata_pass_16->flags & AP_FLAG_CHK_COND) && (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s via pass_16 failed", - ata_op_string(&ata_cmd)); - } + warnx("ATA %s via pass_16 failed", ata_op_string(&ata_cmd)); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1819,7 +1816,7 @@ scsi_cam_pass_16_send(struct cam_device *device, union static int -ata_cam_send(struct cam_device *device, union ccb *ccb, int quiet) +ata_cam_send(struct cam_device *device, union ccb *ccb) { if (arglist & CAM_ARG_VERBOSE) { warnx("sending ATA %s with timeout of %u msecs", @@ -1834,24 +1831,21 @@ ata_cam_send(struct cam_device *device, union ccb *ccb ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s", - ata_op_string(&(ccb->ataio.cmd))); - } + warn("error sending ATA %s", ata_op_string(&(ccb->ataio.cmd))); return (1); } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s failed: %d", - ata_op_string(&(ccb->ataio.cmd)), quiet); - } - + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ + if (!(ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) && + (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + warnx("ATA %s failed", ata_op_string(&(ccb->ataio.cmd))); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1863,7 +1857,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, u_int8_t tag_action, u_int8_t command, u_int16_t features, u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, - u_int16_t dxfer_len, int timeout, int quiet) + u_int16_t dxfer_len, int timeout) { if (data_ptr != NULL) { if (flags & CAM_DIR_OUT) @@ -1893,7 +1887,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c /*sense_len*/SSD_FULL_SIZE, timeout); - return scsi_cam_pass_16_send(device, ccb, quiet); + return scsi_cam_pass_16_send(device, ccb); } static int @@ -1929,50 +1923,10 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, return (1); if (retval == 1) { - int error; - - /* Try using SCSI Passthrough */ - error = ata_do_pass_16(device, ccb, retries, flags, protocol, + return (ata_do_pass_16(device, ccb, retries, flags, protocol, ata_flags, tag_action, command, features, lba, sector_count, data_ptr, dxfer_len, - timeout, 0); - - if (ata_flags & AP_FLAG_CHK_COND) { - /* Decode ata_res from sense data */ - struct ata_res_pass16 *res_pass16; - struct ata_res *res; - u_int i; - u_int16_t *ptr; - - /* sense_data is 4 byte aligned */ - ptr = (uint16_t*)(uintptr_t)&ccb->csio.sense_data; - for (i = 0; i < sizeof(*res_pass16) / 2; i++) - ptr[i] = le16toh(ptr[i]); - - /* sense_data is 4 byte aligned */ - res_pass16 = (struct ata_res_pass16 *)(uintptr_t) - &ccb->csio.sense_data; - res = &ccb->ataio.res; - res->flags = res_pass16->flags; - res->status = res_pass16->status; - res->error = res_pass16->error; - res->lba_low = res_pass16->lba_low; - res->lba_mid = res_pass16->lba_mid; - res->lba_high = res_pass16->lba_high; - res->device = res_pass16->device; - res->lba_low_exp = res_pass16->lba_low_exp; - res->lba_mid_exp = res_pass16->lba_mid_exp; - res->lba_high_exp = res_pass16->lba_high_exp; - res->sector_count = res_pass16->sector_count; - res->sector_count_exp = res_pass16->sector_count_exp; - ccb->ccb_h.status &= ~CAM_STATUS_MASK; - if (res->status & ATA_STATUS_ERROR) - ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; - else - ccb->ccb_h.status |= CAM_REQ_CMP; - } - - return (error); + timeout)); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); @@ -1993,7 +1947,7 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, if (ata_flags & AP_FLAG_CHK_COND) ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; - return ata_cam_send(device, ccb, 0); + return ata_cam_send(device, ccb); } static void @@ -2013,52 +1967,43 @@ dump_data(uint16_t *ptr, uint32_t len) } static int -atahpa_proc_resp(struct cam_device *device, union ccb *ccb, - int is48bit, u_int64_t *hpasize) +atahpa_proc_resp(struct cam_device *device, union ccb *ccb, u_int64_t *hpasize) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); } + warnx("Can't get ATA command status"); + return (retval); + } - if (res->error & ATA_ERROR_ID_NOT_FOUND) { + if (status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + + if (error & ATA_ERROR_ID_NOT_FOUND) { warnx("Max address has already been set since " "last power-on or hardware reset"); - } + } else if (hpasize == NULL) + warnx("Command failed with ATA error"); return (1); } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native max data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); - - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - if (hpasize != NULL) { - if (is48bit) { - *hpasize = (((u_int64_t)((res->lba_high_exp << 16) | - (res->lba_mid_exp << 8) | res->lba_low_exp) << 24) | - ((res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low)) + 1; - } else { - *hpasize = (((res->device & 0x0f) << 24) | - (res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low) + 1; - } + if (retval == 2 || retval == 6) + return (1); + *hpasize = lba; } return (0); @@ -2102,7 +2047,7 @@ ata_read_native_max(struct cam_device *device, int ret if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, hpasize); + return atahpa_proc_resp(device, ccb, hpasize); } static int @@ -2146,7 +2091,7 @@ atahpa_set_max(struct cam_device *device, int retry_co if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int @@ -2154,20 +2099,19 @@ atahpa_password(struct cam_device *device, int retry_c u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_SET_PWD, @@ -2176,31 +2120,25 @@ atahpa_password(struct cam_device *device, int retry_c /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_LOCK, @@ -2209,12 +2147,7 @@ atahpa_lock(struct cam_device *device, int retry_count /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2222,20 +2155,19 @@ atahpa_unlock(struct cam_device *device, int retry_cou u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_UNLOCK, @@ -2244,31 +2176,25 @@ atahpa_unlock(struct cam_device *device, int retry_cou /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_freeze_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_FREEZE, @@ -2277,12 +2203,7 @@ atahpa_freeze_lock(struct cam_device *device, int retr /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2311,7 +2232,7 @@ ata_get_native_max(struct cam_device *device, int retr if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); + return atahpa_proc_resp(device, ccb, nativesize); } static int @@ -2343,21 +2264,20 @@ ataama_set(struct cam_device *device, int retry_count, if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int ataama_freeze(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb) { - int error; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_AMAX_ADDR, /*features*/ATA_AMAX_ADDR_FREEZE, @@ -2366,12 +2286,7 @@ ataama_freeze(struct cam_device *device, int retry_cou /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 30 * 1000, - /*force48bit*/1); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + /*force48bit*/1)); } int @@ -2467,7 +2382,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize, nativesize; + u_int64_t hpasize = 0, nativesize = 0; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2486,22 +2401,12 @@ ataidentify(struct cam_device *device, int retry_count } if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { - if (ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - hpasize = 0; + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); } if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { - if (ata_get_native_max(device, retry_count, timeout, ccb, - &nativesize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - nativesize = 0; + ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); } printf("%s%d: ", device->device_name, device->dev_unit_num); @@ -3024,10 +2929,11 @@ atahpa(struct cam_device *device, int retry_count, int } if (action == ATA_HPA_ACTION_PRINT) { - error = ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize); - if (error == 0) - atahpa_print(ident_buf, hpasize, 1); + hpasize = 0; + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); + atahpa_print(ident_buf, hpasize, 1); cam_freeccb(ccb); free(ident_buf); @@ -3070,12 +2976,14 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, - &ident_buf); - atahpa_print(ident_buf, hpasize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + atahpa_print(ident_buf, hpasize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -3191,10 +3099,11 @@ ataama(struct cam_device *device, int retry_count, int } if (action == ATA_AMA_ACTION_PRINT) { - error = ata_get_native_max(device, retry_count, timeout, ccb, + nativesize = 0; + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) + ata_get_native_max(device, retry_count, timeout, ccb, &nativesize); - if (error == 0) - ataama_print(ident_buf, nativesize, 1); + ataama_print(ident_buf, nativesize, 1); cam_freeccb(ccb); free(ident_buf); @@ -3215,11 +3124,14 @@ ataama(struct cam_device *device, int retry_count, int if (error == 0) { error = ataama_set(device, retry_count, timeout, ccb, maxsize); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, &ident_buf); - ataama_print(ident_buf, nativesize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -5754,16 +5666,21 @@ build_ata_cmd(union ccb *ccb, uint32_t retry_count, ui return (retval); } +/* + * Returns: 0 -- success, 1 -- error, 2 -- lba truncated, + * 4 -- count truncated, 6 -- lba and count truncated. + */ int get_ata_status(struct cam_device *dev, union ccb *ccb, uint8_t *error, uint16_t *count, uint64_t *lba, uint8_t *device, uint8_t *status) { - int retval = 0; + int retval; switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { uint8_t opcode; int error_code = 0, sense_key = 0, asc = 0, ascq = 0; + u_int sense_len; /* * In this case, we have SCSI ATA PASS-THROUGH command, 12 @@ -5775,20 +5692,17 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, opcode = ccb->csio.cdb_io.cdb_bytes[0]; if ((opcode != ATA_PASS_12) && (opcode != ATA_PASS_16)) { - retval = 1; warnx("%s: unsupported opcode %02x", __func__, opcode); - goto bailout; + return (1); } retval = scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq); /* Note: the _ccb() variant returns 0 for an error */ - if (retval == 0) { - retval = 1; - goto bailout; - } else - retval = 0; + if (retval == 0) + return (1); + sense_len = ccb->csio.sense_len - ccb->csio.sense_resid; switch (error_code) { case SSD_DESC_CURRENT_ERROR: case SSD_DESC_DEFERRED_ERROR: { @@ -5799,13 +5713,12 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, sense = (struct scsi_sense_data_desc *) &ccb->csio.sense_data; - desc_ptr = scsi_find_desc(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, SSD_DESC_ATA); + desc_ptr = scsi_find_desc(sense, sense_len, + SSD_DESC_ATA); if (desc_ptr == NULL) { cam_error_print(dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; - goto bailout; + return (1); } desc = (struct scsi_sense_ata_ret_desc *)desc_ptr; @@ -5837,22 +5750,47 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, } case SSD_CURRENT_ERROR: case SSD_DEFERRED_ERROR: { -#if 0 - struct scsi_sense_data_fixed *sense; -#endif + uint64_t val; + /* - * XXX KDM need to support fixed sense data. + * In my understanding of SAT-5 specification, saying: + * "without interpreting the contents of the STATUS", + * this should not happen if CK_COND was set, but it + * does at least for some devices, so try to revert. */ - warnx("%s: Fixed sense data not supported yet", - __func__); - retval = 1; - goto bailout; - break; /*NOTREACHED*/ + if ((sense_key == SSD_KEY_ABORTED_COMMAND) && + (asc == 0) && (ascq == 0)) { + *status = ATA_STATUS_ERROR; + *error = ATA_ERROR_ABORT; + *device = 0; + *count = 0; + *lba = 0; + return (0); + } + + if ((sense_key != SSD_KEY_RECOVERED_ERROR) || + (asc != 0x00) || (ascq != 0x1d)) + return (1); + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_INFO, &val, NULL); + *error = (val >> 24) & 0xff; + *status = (val >> 16) & 0xff; + *device = (val >> 8) & 0xff; + *count = val & 0xff; + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_COMMAND, &val, NULL); + *lba = ((val >> 16) & 0xff) | (val & 0xff00) | + ((val & 0xff) << 16); + + /* Report UPPER NONZERO bits as errors 2, 4 and 6. */ + return ((val >> 28) & 0x06); } default: - retval = 1; - goto bailout; - break; + return (1); } break; @@ -5860,11 +5798,11 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, case XPT_ATA_IO: { struct ata_res *res; - /* - * In this case, we have an ATA command, and we need to - * fill in the requested values from the result register - * set. - */ + /* Only some statuses return ATA result register set. */ + if (cam_ccb_status(ccb) != CAM_REQ_CMP && + cam_ccb_status(ccb) != CAM_ATA_STATUS_ERROR) + return (1); + res = &ccb->ataio.res; *error = res->error; *status = res->status; @@ -5873,7 +5811,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, *lba = (res->lba_high << 16) | (res->lba_mid << 8) | (res->lba_low); - if (res->flags & CAM_ATAIO_48BIT) { + if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) { *count |= (res->sector_count_exp << 8); *lba |= ((uint64_t)res->lba_low_exp << 24) | ((uint64_t)res->lba_mid_exp << 32) | @@ -5884,11 +5822,9 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, break; } default: - retval = 1; - break; + return (1); } -bailout: - return (retval); + return (0); } static void @@ -6486,7 +6422,7 @@ scsiformat(struct cam_device *device, int argc, char * if (reportonly) goto doreport; - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -6727,66 +6663,78 @@ scsiformat_bailout: } static int -sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet, + camcontrol_devtype devtype) { - struct ata_res *res; int retval; - cam_status status; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; u_int val, perc; do { - retval = ata_do_cmd(device, - ccb, - /*retries*/1, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SANITIZE, - /*features*/0x00, /* SANITIZE STATUS EXT */ - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/10000, - /*is48bit*/1); - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + retval = build_ata_cmd(ccb, + /*retries*/ 0, + /*flags*/ CAM_DIR_NONE, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*protocol*/ AP_PROTO_NON_DATA, + /*ata_flags*/ AP_FLAG_CHK_COND, + /*features*/ 0x00, /* SANITIZE STATUS EXT */ + /*sector_count*/ 0, + /*lba*/ 0, + /*command*/ ATA_SANITIZE, + /*auxiliary*/ 0, + /*data_ptr*/ NULL, + /*dxfer_len*/ 0, + /*cdb_storage*/ NULL, + /*cdb_storage_len*/ 0, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 10000, + /*is48bit*/ 1, + /*devtype*/ devtype); + if (retval != 0) { + warnx("%s: build_ata_cmd() failed, likely " + "programmer error", __func__); return (1); } - status = ccb->ccb_h.status & CAM_STATUS_MASK; - if (status == CAM_REQ_CMP) { - res = &ccb->ataio.res; - if (res->sector_count_exp & 0x40) { - if (quiet == 0) { - val = (res->lba_mid << 8) + res->lba_low; - perc = 10000 * val; - fprintf(stdout, - "Sanitizing: %u.%02u%% (%d/%d)\r", - (perc / (0x10000 * 100)), - ((perc / 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } - sleep(1); - } else if ((res->sector_count_exp & 0x80) == 0) { - warnx("Sanitize complete with an error. "); - return (1); - } else - break; + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + retval = cam_send_ccb(device, ccb); + if (retval != 0) { + warn("error sending SANITIZE STATUS EXT command"); + return (1); + } - } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + retval = get_ata_status(device, ccb, &error, &count, &lba, + &ata_device, &status); + if (retval != 0) { + warnx("Can't get SANITIZE STATUS EXT status, " + "sanitize may still run."); + return (retval); + } + if (status & ATA_STATUS_ERROR) { + warnx("SANITIZE STATUS EXT failed, " + "sanitize may still run."); return (1); } + if (count & 0x4000) { + if (quiet == 0) { + val = lba & 0xffff; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((count & 0x8000) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; } while (1); return (0); } @@ -7066,7 +7014,7 @@ sanitize(struct cam_device *device, int argc, char **a } } - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -7194,7 +7142,7 @@ sanitize(struct cam_device *device, int argc, char **a retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_SANITIZE, /*features*/feature, @@ -7251,7 +7199,7 @@ doreport: if (dt == CC_DT_SCSI) { error = sanitize_wait_scsi(device, ccb, task_attr, quiet); } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { - error = sanitize_wait_ata(device, ccb, quiet); + error = sanitize_wait_ata(device, ccb, quiet, dt); } else error = 1; if (error == 0 && quiet == 0) @@ -9223,56 +9171,63 @@ bailout: static int atapm_proc_resp(struct cam_device *device, union ccb *ccb) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); - } + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + warnx("Can't get ATA command status"); + return (retval); + } - return (1); - } + if (status & ATA_STATUS_ERROR) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native check power data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x01: + printf("Standby_y mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0x81: + printf("Idle_a mode\n"); + break; + case 0x82: + printf("Idle_b mode\n"); + break; + case 0x83: + printf("Idle_c mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", count); + break; + } - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - - printf("%s%d: ", device->device_name, device->dev_unit_num); - switch (res->sector_count) { - case 0x00: - printf("Standby mode\n"); - break; - case 0x40: - printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); - break; - case 0x41: - printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); - break; - case 0x80: - printf("Idle mode\n"); - break; - case 0xff: - printf("Active or Idle mode\n"); - break; - default: - printf("Unknown mode 0x%02x\n", res->sector_count); - break; - } - - return (0); + return (0); } static int From owner-svn-src-all@freebsd.org Fri Sep 13 15:17:31 2019 Return-Path: Delivered-To: svn-src-all@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 2615FF3F8D; Fri, 13 Sep 2019 15:17:31 +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 46VK4q0yYNz3Hq4; Fri, 13 Sep 2019 15:17:31 +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 0431790A3; Fri, 13 Sep 2019 15:17:31 +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 x8DFHUOc045461; Fri, 13 Sep 2019 15:17:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFHUYC045460; Fri, 13 Sep 2019 15:17:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131517.x8DFHUYC045460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352291 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 352291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:17:31 -0000 Author: mav Date: Fri Sep 13 15:17:30 2019 New Revision: 352291 URL: https://svnweb.freebsd.org/changeset/base/352291 Log: MFC r352082, r352103: Fix number of problems found while testing on SAT devices. - Remove incomplete and dangerous ata_res decoding from ata_do_cmd(). Instead switch all functions that need the result to use get_ata_status(), doing the same, but more careful, also reducing code duplication. - Made get_ata_status() to also decode fixed format sense. In many cases it is still not enough to make it useful, since it can only report results of 28-bit command, but it is slightly better then nothing. - Organize error reporting in ata_do_cmd(), so that if caller specified AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones). - Make HPA/AMA errors not fatal for `identify` subcommand. - Fix reprobe() not being called on HPA/AMA when in quiet mode. - Remove not very useful messages from `format` and `sanitize` commands with -y flag. Once they started, they often can't be stopped any way. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:15:58 2019 (r352290) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:17:30 2019 (r352291) @@ -1603,7 +1603,7 @@ atacapprint(struct ata_params *parm) } static int -scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb, int quiet) +scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb) { struct ata_pass_16 *ata_pass_16; struct ata_cmd ata_cmd; @@ -1626,24 +1626,21 @@ scsi_cam_pass_16_send(struct cam_device *device, union ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s via pass_16", - ata_op_string(&ata_cmd)); - } + warn("error sending ATA %s via pass_16", ata_op_string(&ata_cmd)); return (1); } + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ if (!(ata_pass_16->flags & AP_FLAG_CHK_COND) && (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s via pass_16 failed", - ata_op_string(&ata_cmd)); - } + warnx("ATA %s via pass_16 failed", ata_op_string(&ata_cmd)); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1652,7 +1649,7 @@ scsi_cam_pass_16_send(struct cam_device *device, union static int -ata_cam_send(struct cam_device *device, union ccb *ccb, int quiet) +ata_cam_send(struct cam_device *device, union ccb *ccb) { if (arglist & CAM_ARG_VERBOSE) { warnx("sending ATA %s with timeout of %u msecs", @@ -1667,24 +1664,21 @@ ata_cam_send(struct cam_device *device, union ccb *ccb ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (cam_send_ccb(device, ccb) < 0) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warn("error sending ATA %s", - ata_op_string(&(ccb->ataio.cmd))); - } + warn("error sending ATA %s", ata_op_string(&(ccb->ataio.cmd))); return (1); } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (quiet != 1 || arglist & CAM_ARG_VERBOSE) { - warnx("ATA %s failed: %d", - ata_op_string(&(ccb->ataio.cmd)), quiet); - } - + /* + * Consider any non-CAM_REQ_CMP status as error and report it here, + * unless caller set AP_FLAG_CHK_COND, in which case it is reponsible. + */ + if (!(ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) && + (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + warnx("ATA %s failed", ata_op_string(&(ccb->ataio.cmd))); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); } - return (1); } @@ -1696,7 +1690,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, u_int8_t tag_action, u_int8_t command, u_int16_t features, u_int64_t lba, u_int16_t sector_count, u_int8_t *data_ptr, - u_int16_t dxfer_len, int timeout, int quiet) + u_int16_t dxfer_len, int timeout) { if (data_ptr != NULL) { if (flags & CAM_DIR_OUT) @@ -1726,7 +1720,7 @@ ata_do_pass_16(struct cam_device *device, union ccb *c /*sense_len*/SSD_FULL_SIZE, timeout); - return scsi_cam_pass_16_send(device, ccb, quiet); + return scsi_cam_pass_16_send(device, ccb); } static int @@ -1762,50 +1756,10 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, return (1); if (retval == 1) { - int error; - - /* Try using SCSI Passthrough */ - error = ata_do_pass_16(device, ccb, retries, flags, protocol, + return (ata_do_pass_16(device, ccb, retries, flags, protocol, ata_flags, tag_action, command, features, lba, sector_count, data_ptr, dxfer_len, - timeout, 0); - - if (ata_flags & AP_FLAG_CHK_COND) { - /* Decode ata_res from sense data */ - struct ata_res_pass16 *res_pass16; - struct ata_res *res; - u_int i; - u_int16_t *ptr; - - /* sense_data is 4 byte aligned */ - ptr = (uint16_t*)(uintptr_t)&ccb->csio.sense_data; - for (i = 0; i < sizeof(*res_pass16) / 2; i++) - ptr[i] = le16toh(ptr[i]); - - /* sense_data is 4 byte aligned */ - res_pass16 = (struct ata_res_pass16 *)(uintptr_t) - &ccb->csio.sense_data; - res = &ccb->ataio.res; - res->flags = res_pass16->flags; - res->status = res_pass16->status; - res->error = res_pass16->error; - res->lba_low = res_pass16->lba_low; - res->lba_mid = res_pass16->lba_mid; - res->lba_high = res_pass16->lba_high; - res->device = res_pass16->device; - res->lba_low_exp = res_pass16->lba_low_exp; - res->lba_mid_exp = res_pass16->lba_mid_exp; - res->lba_high_exp = res_pass16->lba_high_exp; - res->sector_count = res_pass16->sector_count; - res->sector_count_exp = res_pass16->sector_count_exp; - ccb->ccb_h.status &= ~CAM_STATUS_MASK; - if (res->status & ATA_STATUS_ERROR) - ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; - else - ccb->ccb_h.status |= CAM_REQ_CMP; - } - - return (error); + timeout)); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); @@ -1826,7 +1780,7 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, if (ata_flags & AP_FLAG_CHK_COND) ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; - return ata_cam_send(device, ccb, 0); + return ata_cam_send(device, ccb); } static void @@ -1846,52 +1800,43 @@ dump_data(uint16_t *ptr, uint32_t len) } static int -atahpa_proc_resp(struct cam_device *device, union ccb *ccb, - int is48bit, u_int64_t *hpasize) +atahpa_proc_resp(struct cam_device *device, union ccb *ccb, u_int64_t *hpasize) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); } + warnx("Can't get ATA command status"); + return (retval); + } - if (res->error & ATA_ERROR_ID_NOT_FOUND) { + if (status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + + if (error & ATA_ERROR_ID_NOT_FOUND) { warnx("Max address has already been set since " "last power-on or hardware reset"); - } + } else if (hpasize == NULL) + warnx("Command failed with ATA error"); return (1); } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native max data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); - - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - if (hpasize != NULL) { - if (is48bit) { - *hpasize = (((u_int64_t)((res->lba_high_exp << 16) | - (res->lba_mid_exp << 8) | res->lba_low_exp) << 24) | - ((res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low)) + 1; - } else { - *hpasize = (((res->device & 0x0f) << 24) | - (res->lba_high << 16) | (res->lba_mid << 8) | - res->lba_low) + 1; - } + if (retval == 2 || retval == 6) + return (1); + *hpasize = lba; } return (0); @@ -1935,7 +1880,7 @@ ata_read_native_max(struct cam_device *device, int ret if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, hpasize); + return atahpa_proc_resp(device, ccb, hpasize); } static int @@ -1979,7 +1924,7 @@ atahpa_set_max(struct cam_device *device, int retry_co if (error) return (error); - return atahpa_proc_resp(device, ccb, is48bit, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int @@ -1987,20 +1932,19 @@ atahpa_password(struct cam_device *device, int retry_c u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_SET_PWD, @@ -2009,31 +1953,25 @@ atahpa_password(struct cam_device *device, int retry_c /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_LOCK, @@ -2042,12 +1980,7 @@ atahpa_lock(struct cam_device *device, int retry_count /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2055,20 +1988,19 @@ atahpa_unlock(struct cam_device *device, int retry_cou u_int32_t timeout, union ccb *ccb, int is48bit, struct ata_set_max_pwd *pwd) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_PIO_OUT; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_OUT, /*protocol*/protocol, /*ata_flags*/AP_FLAG_BYT_BLOK_BLOCKS | - AP_FLAG_TLEN_SECT_CNT | AP_FLAG_CHK_COND, + AP_FLAG_TLEN_SECT_CNT, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_UNLOCK, @@ -2077,31 +2009,25 @@ atahpa_unlock(struct cam_device *device, int retry_cou /*data_ptr*/(u_int8_t*)pwd, /*dxfer_len*/sizeof(*pwd), timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int atahpa_freeze_lock(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb, int is48bit) { - int error; u_int cmd; u_int8_t protocol; protocol = AP_PROTO_NON_DATA; cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/protocol, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/ATA_HPA_FEAT_FREEZE, @@ -2110,12 +2036,7 @@ atahpa_freeze_lock(struct cam_device *device, int retr /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 1000, - is48bit); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, is48bit, NULL); + is48bit)); } static int @@ -2144,7 +2065,7 @@ ata_get_native_max(struct cam_device *device, int retr if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); + return atahpa_proc_resp(device, ccb, nativesize); } static int @@ -2176,21 +2097,20 @@ ataama_set(struct cam_device *device, int retry_count, if (error) return (error); - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + return atahpa_proc_resp(device, ccb, NULL); } static int ataama_freeze(struct cam_device *device, int retry_count, u_int32_t timeout, union ccb *ccb) { - int error; - error = ata_do_cmd(device, + return (ata_do_cmd(device, ccb, retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_AMAX_ADDR, /*features*/ATA_AMAX_ADDR_FREEZE, @@ -2199,12 +2119,7 @@ ataama_freeze(struct cam_device *device, int retry_cou /*data_ptr*/NULL, /*dxfer_len*/0, timeout ? timeout : 30 * 1000, - /*force48bit*/1); - - if (error) - return (error); - - return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); + /*force48bit*/1)); } int @@ -2318,7 +2233,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize, nativesize; + u_int64_t hpasize = 0, nativesize = 0; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2337,22 +2252,12 @@ ataidentify(struct cam_device *device, int retry_count } if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { - if (ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - hpasize = 0; + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); } if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { - if (ata_get_native_max(device, retry_count, timeout, ccb, - &nativesize) != 0) { - cam_freeccb(ccb); - return (1); - } - } else { - nativesize = 0; + ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); } printf("%s%d: ", device->device_name, device->dev_unit_num); @@ -2843,10 +2748,11 @@ atahpa(struct cam_device *device, int retry_count, int } if (action == ATA_HPA_ACTION_PRINT) { - error = ata_read_native_max(device, retry_count, timeout, ccb, - ident_buf, &hpasize); - if (error == 0) - atahpa_print(ident_buf, hpasize, 1); + hpasize = 0; + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) + ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); + atahpa_print(ident_buf, hpasize, 1); cam_freeccb(ccb); free(ident_buf); @@ -2889,12 +2795,14 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, - &ident_buf); - atahpa_print(ident_buf, hpasize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + atahpa_print(ident_buf, hpasize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -3010,10 +2918,11 @@ ataama(struct cam_device *device, int retry_count, int } if (action == ATA_AMA_ACTION_PRINT) { - error = ata_get_native_max(device, retry_count, timeout, ccb, + nativesize = 0; + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) + ata_get_native_max(device, retry_count, timeout, ccb, &nativesize); - if (error == 0) - ataama_print(ident_buf, nativesize, 1); + ataama_print(ident_buf, nativesize, 1); cam_freeccb(ccb); free(ident_buf); @@ -3034,11 +2943,14 @@ ataama(struct cam_device *device, int retry_count, int if (error == 0) { error = ataama_set(device, retry_count, timeout, ccb, maxsize); - if (error == 0 && quiet == 0) { - /* redo identify to get new lba values */ - error = ata_do_identify(device, retry_count, - timeout, ccb, &ident_buf); - ataama_print(ident_buf, nativesize, 1); + if (error == 0) { + if (quiet == 0) { + /* redo identify to get new values */ + error = ata_do_identify(device, + retry_count, timeout, ccb, + &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } /* Hint CAM to reprobe the device. */ reprobe(device); } @@ -5552,16 +5464,21 @@ build_ata_cmd(union ccb *ccb, uint32_t retry_count, ui return (retval); } +/* + * Returns: 0 -- success, 1 -- error, 2 -- lba truncated, + * 4 -- count truncated, 6 -- lba and count truncated. + */ int get_ata_status(struct cam_device *dev, union ccb *ccb, uint8_t *error, uint16_t *count, uint64_t *lba, uint8_t *device, uint8_t *status) { - int retval = 0; + int retval; switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { uint8_t opcode; int error_code = 0, sense_key = 0, asc = 0, ascq = 0; + u_int sense_len; /* * In this case, we have SCSI ATA PASS-THROUGH command, 12 @@ -5573,20 +5490,17 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, opcode = ccb->csio.cdb_io.cdb_bytes[0]; if ((opcode != ATA_PASS_12) && (opcode != ATA_PASS_16)) { - retval = 1; warnx("%s: unsupported opcode %02x", __func__, opcode); - goto bailout; + return (1); } retval = scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq); /* Note: the _ccb() variant returns 0 for an error */ - if (retval == 0) { - retval = 1; - goto bailout; - } else - retval = 0; + if (retval == 0) + return (1); + sense_len = ccb->csio.sense_len - ccb->csio.sense_resid; switch (error_code) { case SSD_DESC_CURRENT_ERROR: case SSD_DESC_DEFERRED_ERROR: { @@ -5597,13 +5511,12 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, sense = (struct scsi_sense_data_desc *) &ccb->csio.sense_data; - desc_ptr = scsi_find_desc(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, SSD_DESC_ATA); + desc_ptr = scsi_find_desc(sense, sense_len, + SSD_DESC_ATA); if (desc_ptr == NULL) { cam_error_print(dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; - goto bailout; + return (1); } desc = (struct scsi_sense_ata_ret_desc *)desc_ptr; @@ -5635,22 +5548,47 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, } case SSD_CURRENT_ERROR: case SSD_DEFERRED_ERROR: { -#if 0 - struct scsi_sense_data_fixed *sense; -#endif + uint64_t val; + /* - * XXX KDM need to support fixed sense data. + * In my understanding of SAT-5 specification, saying: + * "without interpreting the contents of the STATUS", + * this should not happen if CK_COND was set, but it + * does at least for some devices, so try to revert. */ - warnx("%s: Fixed sense data not supported yet", - __func__); - retval = 1; - goto bailout; - break; /*NOTREACHED*/ + if ((sense_key == SSD_KEY_ABORTED_COMMAND) && + (asc == 0) && (ascq == 0)) { + *status = ATA_STATUS_ERROR; + *error = ATA_ERROR_ABORT; + *device = 0; + *count = 0; + *lba = 0; + return (0); + } + + if ((sense_key != SSD_KEY_RECOVERED_ERROR) || + (asc != 0x00) || (ascq != 0x1d)) + return (1); + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_INFO, &val, NULL); + *error = (val >> 24) & 0xff; + *status = (val >> 16) & 0xff; + *device = (val >> 8) & 0xff; + *count = val & 0xff; + + val = 0; + scsi_get_sense_info(&ccb->csio.sense_data, sense_len, + SSD_DESC_COMMAND, &val, NULL); + *lba = ((val >> 16) & 0xff) | (val & 0xff00) | + ((val & 0xff) << 16); + + /* Report UPPER NONZERO bits as errors 2, 4 and 6. */ + return ((val >> 28) & 0x06); } default: - retval = 1; - goto bailout; - break; + return (1); } break; @@ -5658,11 +5596,11 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, case XPT_ATA_IO: { struct ata_res *res; - /* - * In this case, we have an ATA command, and we need to - * fill in the requested values from the result register - * set. - */ + /* Only some statuses return ATA result register set. */ + if (cam_ccb_status(ccb) != CAM_REQ_CMP && + cam_ccb_status(ccb) != CAM_ATA_STATUS_ERROR) + return (1); + res = &ccb->ataio.res; *error = res->error; *status = res->status; @@ -5671,7 +5609,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, *lba = (res->lba_high << 16) | (res->lba_mid << 8) | (res->lba_low); - if (res->flags & CAM_ATAIO_48BIT) { + if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) { *count |= (res->sector_count_exp << 8); *lba |= ((uint64_t)res->lba_low_exp << 24) | ((uint64_t)res->lba_mid_exp << 32) | @@ -5682,11 +5620,9 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, break; } default: - retval = 1; - break; + return (1); } -bailout: - return (retval); + return (0); } static void @@ -6284,7 +6220,7 @@ scsiformat(struct cam_device *device, int argc, char * if (reportonly) goto doreport; - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -6525,66 +6461,78 @@ scsiformat_bailout: } static int -sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet, + camcontrol_devtype devtype) { - struct ata_res *res; int retval; - cam_status status; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; u_int val, perc; do { - retval = ata_do_cmd(device, - ccb, - /*retries*/1, - /*flags*/CAM_DIR_NONE, - /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, - /*tag_action*/MSG_SIMPLE_Q_TAG, - /*command*/ATA_SANITIZE, - /*features*/0x00, /* SANITIZE STATUS EXT */ - /*lba*/0, - /*sector_count*/0, - /*data_ptr*/NULL, - /*dxfer_len*/0, - /*timeout*/10000, - /*is48bit*/1); - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } + retval = build_ata_cmd(ccb, + /*retries*/ 0, + /*flags*/ CAM_DIR_NONE, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*protocol*/ AP_PROTO_NON_DATA, + /*ata_flags*/ AP_FLAG_CHK_COND, + /*features*/ 0x00, /* SANITIZE STATUS EXT */ + /*sector_count*/ 0, + /*lba*/ 0, + /*command*/ ATA_SANITIZE, + /*auxiliary*/ 0, + /*data_ptr*/ NULL, + /*dxfer_len*/ 0, + /*cdb_storage*/ NULL, + /*cdb_storage_len*/ 0, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 10000, + /*is48bit*/ 1, + /*devtype*/ devtype); + if (retval != 0) { + warnx("%s: build_ata_cmd() failed, likely " + "programmer error", __func__); return (1); } - status = ccb->ccb_h.status & CAM_STATUS_MASK; - if (status == CAM_REQ_CMP) { - res = &ccb->ataio.res; - if (res->sector_count_exp & 0x40) { - if (quiet == 0) { - val = (res->lba_mid << 8) + res->lba_low; - perc = 10000 * val; - fprintf(stdout, - "Sanitizing: %u.%02u%% (%d/%d)\r", - (perc / (0x10000 * 100)), - ((perc / 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } - sleep(1); - } else if ((res->sector_count_exp & 0x80) == 0) { - warnx("Sanitize complete with an error. "); - return (1); - } else - break; + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + retval = cam_send_ccb(device, ccb); + if (retval != 0) { + warn("error sending SANITIZE STATUS EXT command"); + return (1); + } - } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + retval = get_ata_status(device, ccb, &error, &count, &lba, + &ata_device, &status); + if (retval != 0) { + warnx("Can't get SANITIZE STATUS EXT status, " + "sanitize may still run."); + return (retval); + } + if (status & ATA_STATUS_ERROR) { + warnx("SANITIZE STATUS EXT failed, " + "sanitize may still run."); return (1); } + if (count & 0x4000) { + if (quiet == 0) { + val = lba & 0xffff; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((count & 0x8000) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; } while (1); return (0); } @@ -6864,7 +6812,7 @@ sanitize(struct cam_device *device, int argc, char **a } } - if (quiet == 0) { + if (quiet == 0 && ycount == 0) { fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); @@ -6992,7 +6940,7 @@ sanitize(struct cam_device *device, int argc, char **a retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, - /*ata_flags*/AP_FLAG_CHK_COND, + /*ata_flags*/0, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/ATA_SANITIZE, /*features*/feature, @@ -7049,7 +6997,7 @@ doreport: if (dt == CC_DT_SCSI) { error = sanitize_wait_scsi(device, ccb, task_attr, quiet); } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { - error = sanitize_wait_ata(device, ccb, quiet); + error = sanitize_wait_ata(device, ccb, quiet, dt); } else error = 1; if (error == 0 && quiet == 0) @@ -8737,56 +8685,63 @@ bailout: static int atapm_proc_resp(struct cam_device *device, union ccb *ccb) { - struct ata_res *res; + uint8_t error = 0, ata_device = 0, status = 0; + uint16_t count = 0; + uint64_t lba = 0; + int retval; - res = &ccb->ataio.res; - if (res->status & ATA_STATUS_ERROR) { - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - printf("error = 0x%02x, sector_count = 0x%04x, " - "device = 0x%02x, status = 0x%02x\n", - res->error, res->sector_count, - res->device, res->status); - } + retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device, + &status); + if (retval == 1) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + warnx("Can't get ATA command status"); + return (retval); + } - return (1); - } + if (status & ATA_STATUS_ERROR) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw native check power data:\n", - device->device_name, device->dev_unit_num); - /* res is 4 byte aligned */ - dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x01: + printf("Standby_y mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0x81: + printf("Idle_a mode\n"); + break; + case 0x82: + printf("Idle_b mode\n"); + break; + case 0x83: + printf("Idle_c mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", count); + break; + } - printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " - "status = 0x%02x\n", res->error, res->sector_count, - res->device, res->status); - } - - printf("%s%d: ", device->device_name, device->dev_unit_num); - switch (res->sector_count) { - case 0x00: - printf("Standby mode\n"); - break; - case 0x40: - printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); - break; - case 0x41: - printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); - break; - case 0x80: - printf("Idle mode\n"); - break; - case 0xff: - printf("Active or Idle mode\n"); - break; - default: - printf("Unknown mode 0x%02x\n", res->sector_count); - break; - } - - return (0); + return (0); } static int From owner-svn-src-all@freebsd.org Fri Sep 13 15:18:29 2019 Return-Path: Delivered-To: svn-src-all@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 744E7F405F; Fri, 13 Sep 2019 15:18:29 +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 46VK5x2VKcz3J1k; Fri, 13 Sep 2019 15:18:29 +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 3A4D290A4; Fri, 13 Sep 2019 15:18:29 +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 x8DFITso045579; Fri, 13 Sep 2019 15:18:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFIT28045578; Fri, 13 Sep 2019 15:18:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131518.x8DFIT28045578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:18:29 +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: r352292 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 352292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:18:29 -0000 Author: mav Date: Fri Sep 13 15:18:28 2019 New Revision: 352292 URL: https://svnweb.freebsd.org/changeset/base/352292 Log: MFC r352111: Initialize page/subpage in case of `modepage -d`. Previously without -m parameter it worked mostly by concodence. While there, make page/subpage values validation more strict. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:17:30 2019 (r352291) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:18:28 2019 (r352292) @@ -4574,7 +4574,7 @@ modepage(struct cam_device *device, int argc, char **a int task_attr, int retry_count, int timeout) { char *str_subpage; - int c, page = -1, subpage = -1, pc = 0, llbaa = 0; + int c, page = -1, subpage = 0, pc = 0, llbaa = 0; int binary = 0, cdb_len = 10, dbd = 0, desc = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { @@ -4600,11 +4600,9 @@ modepage(struct cam_device *device, int argc, char **a page = strtol(optarg, NULL, 0); if (str_subpage) subpage = strtol(str_subpage, NULL, 0); - else - subpage = 0; - if (page < 0) + if (page < 0 || page > 0x3f) errx(1, "invalid mode page %d", page); - if (subpage < 0) + if (subpage < 0 || subpage > 0xff) errx(1, "invalid mode subpage %d", subpage); break; case 'D': @@ -4623,7 +4621,10 @@ modepage(struct cam_device *device, int argc, char **a } } - if (page == -1 && desc == 0 && list == 0) + if (desc && page == -1) + page = SMS_ALL_PAGES_PAGE; + + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); if (dbd && desc) From owner-svn-src-all@freebsd.org Fri Sep 13 15:18:46 2019 Return-Path: Delivered-To: svn-src-all@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 67DEDF40FA; Fri, 13 Sep 2019 15:18:46 +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 46VK6G29fBz3J8J; Fri, 13 Sep 2019 15:18:46 +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 2F23890A6; Fri, 13 Sep 2019 15:18:46 +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 x8DFIkOF045654; Fri, 13 Sep 2019 15:18:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFIkp1045653; Fri, 13 Sep 2019 15:18:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131518.x8DFIkp1045653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352293 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 352293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:18:46 -0000 Author: mav Date: Fri Sep 13 15:18:45 2019 New Revision: 352293 URL: https://svnweb.freebsd.org/changeset/base/352293 Log: MFC r352111: Initialize page/subpage in case of `modepage -d`. Previously without -m parameter it worked mostly by concodence. While there, make page/subpage values validation more strict. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:18:28 2019 (r352292) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:18:45 2019 (r352293) @@ -4393,7 +4393,7 @@ modepage(struct cam_device *device, int argc, char **a int task_attr, int retry_count, int timeout) { char *str_subpage; - int c, page = -1, subpage = -1, pc = 0, llbaa = 0; + int c, page = -1, subpage = 0, pc = 0, llbaa = 0; int binary = 0, cdb_len = 10, dbd = 0, desc = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { @@ -4419,11 +4419,9 @@ modepage(struct cam_device *device, int argc, char **a page = strtol(optarg, NULL, 0); if (str_subpage) subpage = strtol(str_subpage, NULL, 0); - else - subpage = 0; - if (page < 0) + if (page < 0 || page > 0x3f) errx(1, "invalid mode page %d", page); - if (subpage < 0) + if (subpage < 0 || subpage > 0xff) errx(1, "invalid mode subpage %d", subpage); break; case 'D': @@ -4442,7 +4440,10 @@ modepage(struct cam_device *device, int argc, char **a } } - if (page == -1 && desc == 0 && list == 0) + if (desc && page == -1) + page = SMS_ALL_PAGES_PAGE; + + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); if (dbd && desc) From owner-svn-src-all@freebsd.org Fri Sep 13 15:19:51 2019 Return-Path: Delivered-To: svn-src-all@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 24E16F41E0; Fri, 13 Sep 2019 15:19:51 +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 46VK7V7408z3JJm; Fri, 13 Sep 2019 15:19:50 +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 D758590D0; Fri, 13 Sep 2019 15:19:50 +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 x8DFJobb045778; Fri, 13 Sep 2019 15:19:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFJokt045777; Fri, 13 Sep 2019 15:19:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131519.x8DFJokt045777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:19:50 +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: r352294 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 352294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:19:51 -0000 Author: mav Date: Fri Sep 13 15:19:50 2019 New Revision: 352294 URL: https://svnweb.freebsd.org/changeset/base/352294 Log: MFC r352200: Remove struct ata_res_pass16, unneeded after r352082. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:18:45 2019 (r352293) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:19:50 2019 (r352294) @@ -156,22 +156,6 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC -struct ata_res_pass16 { - u_int16_t reserved[5]; - u_int8_t flags; - u_int8_t error; - u_int8_t sector_count_exp; - u_int8_t sector_count; - u_int8_t lba_low_exp; - u_int8_t lba_low; - u_int8_t lba_mid_exp; - u_int8_t lba_mid; - u_int8_t lba_high_exp; - u_int8_t lba_high; - u_int8_t device; - u_int8_t status; -}; - struct ata_set_max_pwd { u_int16_t reserved1; From owner-svn-src-all@freebsd.org Fri Sep 13 15:20:30 2019 Return-Path: Delivered-To: svn-src-all@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 D3612F4281; Fri, 13 Sep 2019 15:20: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 46VK8G5FdLz3JRR; Fri, 13 Sep 2019 15:20: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 95EC690D4; Fri, 13 Sep 2019 15:20: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 x8DFKUnI045904; Fri, 13 Sep 2019 15:20:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFKUe4045903; Fri, 13 Sep 2019 15:20:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131520.x8DFKUe4045903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352295 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 352295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:20:30 -0000 Author: mav Date: Fri Sep 13 15:20:30 2019 New Revision: 352295 URL: https://svnweb.freebsd.org/changeset/base/352295 Log: MFC r352200: Remove struct ata_res_pass16, unneeded after r352082. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:19:50 2019 (r352294) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:20:30 2019 (r352295) @@ -151,22 +151,6 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC -struct ata_res_pass16 { - u_int16_t reserved[5]; - u_int8_t flags; - u_int8_t error; - u_int8_t sector_count_exp; - u_int8_t sector_count; - u_int8_t lba_low_exp; - u_int8_t lba_low; - u_int8_t lba_mid_exp; - u_int8_t lba_mid; - u_int8_t lba_high_exp; - u_int8_t lba_high; - u_int8_t device; - u_int8_t status; -}; - struct ata_set_max_pwd { u_int16_t reserved1; From owner-svn-src-all@freebsd.org Fri Sep 13 15:21:19 2019 Return-Path: Delivered-To: svn-src-all@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 88688F443D; Fri, 13 Sep 2019 15:21:19 +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 46VK9C2lY4z3JjK; Fri, 13 Sep 2019 15:21:19 +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 41CD49229; Fri, 13 Sep 2019 15:21:19 +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 x8DFLJ69046705; Fri, 13 Sep 2019 15:21:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFLJ7W046704; Fri, 13 Sep 2019 15:21:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131521.x8DFLJ7W046704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:21: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: r352296 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 352296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:21:19 -0000 Author: mav Date: Fri Sep 13 15:21:18 2019 New Revision: 352296 URL: https://svnweb.freebsd.org/changeset/base/352296 Log: MFC r352257: Report Trusted Computing feature set support. It practically means the device is SED. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:20:30 2019 (r352295) +++ stable/12/sbin/camcontrol/camcontrol.c Fri Sep 13 15:21:18 2019 (r352296) @@ -1736,6 +1736,9 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Trusted Computing %s\n", + ((parm->tcg & 0xc000) == 0x4000) && (parm->tcg & ATA_SUPPORT_TCG) ? + "yes" : "no"); printf("encrypts all user data %s\n", parm->support3 & ATA_ENCRYPTS_ALL_USER_DATA ? "yes" : "no"); printf("Sanitize "); From owner-svn-src-all@freebsd.org Fri Sep 13 15:21:36 2019 Return-Path: Delivered-To: svn-src-all@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 ED59AF44B5; Fri, 13 Sep 2019 15:21:36 +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 46VK9X61t4z3JrM; Fri, 13 Sep 2019 15:21:36 +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 B21809244; Fri, 13 Sep 2019 15:21:36 +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 x8DFLaJF047492; Fri, 13 Sep 2019 15:21:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFLaxF047491; Fri, 13 Sep 2019 15:21:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131521.x8DFLaxF047491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352297 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 352297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:21:37 -0000 Author: mav Date: Fri Sep 13 15:21:36 2019 New Revision: 352297 URL: https://svnweb.freebsd.org/changeset/base/352297 Log: MFC r352257: Report Trusted Computing feature set support. It practically means the device is SED. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:21:18 2019 (r352296) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Sep 13 15:21:36 2019 (r352297) @@ -1569,6 +1569,9 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Trusted Computing %s\n", + ((parm->tcg & 0xc000) == 0x4000) && (parm->tcg & ATA_SUPPORT_TCG) ? + "yes" : "no"); printf("encrypts all user data %s\n", parm->support3 & ATA_ENCRYPTS_ALL_USER_DATA ? "yes" : "no"); printf("Sanitize "); From owner-svn-src-all@freebsd.org Fri Sep 13 15:48:12 2019 Return-Path: Delivered-To: svn-src-all@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 97E6BF4DFC; Fri, 13 Sep 2019 15:48:12 +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 46VKmD3Zc8z3LGb; Fri, 13 Sep 2019 15:48:12 +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 41224961C; Fri, 13 Sep 2019 15:48:12 +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 x8DFmCf6063956; Fri, 13 Sep 2019 15:48:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFmBWH063954; Fri, 13 Sep 2019 15:48:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131548.x8DFmBWH063954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:48:11 +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: r352298 - in stable/12/sys/cam: . scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: . scsi X-SVN-Commit-Revision: 352298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:48:12 -0000 Author: mav Date: Fri Sep 13 15:48:11 2019 New Revision: 352298 URL: https://svnweb.freebsd.org/changeset/base/352298 Log: MFC r352201: Fix assumptions of only one device per SES slot. It is typical to have one, but no longer true for multi-actuator HDDs with separate LUN for each actuator. Modified: stable/12/sys/cam/cam_periph.c stable/12/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_periph.c ============================================================================== --- stable/12/sys/cam/cam_periph.c Fri Sep 13 15:21:36 2019 (r352297) +++ stable/12/sys/cam/cam_periph.c Fri Sep 13 15:48:11 2019 (r352298) @@ -402,7 +402,9 @@ retry: } xpt_unlock_buses(); sbuf_finish(&local_sb); - sbuf_cpy(sb, sbuf_data(&local_sb)); + if (sbuf_len(sb) != 0) + sbuf_cat(sb, ","); + sbuf_cat(sb, sbuf_data(&local_sb)); sbuf_delete(&local_sb); return (count); } Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_enc_ses.c Fri Sep 13 15:21:36 2019 (r352297) +++ stable/12/sys/cam/scsi/scsi_enc_ses.c Fri Sep 13 15:48:11 2019 (r352298) @@ -883,6 +883,7 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele struct device_match_result *device_match; struct device_match_pattern *device_pattern; ses_path_iter_args_t *args; + struct cam_path *path; args = (ses_path_iter_args_t *)arg; match_pattern.type = DEV_MATCH_DEVICE; @@ -908,23 +909,26 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele cdm.match_buf_len = sizeof(match_result); cdm.matches = &match_result; - xpt_action((union ccb *)&cdm); - xpt_free_path(cdm.ccb_h.path); + do { + xpt_action((union ccb *)&cdm); - if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP - || (cdm.status != CAM_DEV_MATCH_LAST - && cdm.status != CAM_DEV_MATCH_MORE) - || cdm.num_matches == 0) - return; + if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP || + (cdm.status != CAM_DEV_MATCH_LAST && + cdm.status != CAM_DEV_MATCH_MORE) || + cdm.num_matches == 0) + break; - device_match = &match_result.result.device_result; - if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, - device_match->path_id, - device_match->target_id, - device_match->target_lun) != CAM_REQ_CMP) - return; + device_match = &match_result.result.device_result; + if (xpt_create_path(&path, /*periph*/NULL, + device_match->path_id, + device_match->target_id, + device_match->target_lun) == CAM_REQ_CMP) { - args->callback(enc, elem, cdm.ccb_h.path, args->callback_arg); + args->callback(enc, elem, path, args->callback_arg); + + xpt_free_path(path); + } + } while (cdm.status == CAM_DEV_MATCH_MORE); xpt_free_path(cdm.ccb_h.path); } From owner-svn-src-all@freebsd.org Fri Sep 13 15:49:03 2019 Return-Path: Delivered-To: svn-src-all@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 65EAAF4E97; Fri, 13 Sep 2019 15:49:03 +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 46VKnC23P1z3LP7; Fri, 13 Sep 2019 15:49:03 +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 0ACFA961D; Fri, 13 Sep 2019 15:49:03 +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 x8DFn27o064058; Fri, 13 Sep 2019 15:49:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFn2sD064056; Fri, 13 Sep 2019 15:49:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909131549.x8DFn2sD064056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Sep 2019 15:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352299 - in stable/11/sys/cam: . scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/cam: . scsi X-SVN-Commit-Revision: 352299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:49:03 -0000 Author: mav Date: Fri Sep 13 15:49:02 2019 New Revision: 352299 URL: https://svnweb.freebsd.org/changeset/base/352299 Log: MFC r352201: Fix assumptions of only one device per SES slot. It is typical to have one, but no longer true for multi-actuator HDDs with separate LUN for each actuator. Modified: stable/11/sys/cam/cam_periph.c stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_periph.c ============================================================================== --- stable/11/sys/cam/cam_periph.c Fri Sep 13 15:48:11 2019 (r352298) +++ stable/11/sys/cam/cam_periph.c Fri Sep 13 15:49:02 2019 (r352299) @@ -399,7 +399,9 @@ retry: } xpt_unlock_buses(); sbuf_finish(&local_sb); - sbuf_cpy(sb, sbuf_data(&local_sb)); + if (sbuf_len(sb) != 0) + sbuf_cat(sb, ","); + sbuf_cat(sb, sbuf_data(&local_sb)); sbuf_delete(&local_sb); return (count); } Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Fri Sep 13 15:48:11 2019 (r352298) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Fri Sep 13 15:49:02 2019 (r352299) @@ -881,6 +881,7 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele struct device_match_result *device_match; struct device_match_pattern *device_pattern; ses_path_iter_args_t *args; + struct cam_path *path; args = (ses_path_iter_args_t *)arg; match_pattern.type = DEV_MATCH_DEVICE; @@ -906,23 +907,26 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_ele cdm.match_buf_len = sizeof(match_result); cdm.matches = &match_result; - xpt_action((union ccb *)&cdm); - xpt_free_path(cdm.ccb_h.path); + do { + xpt_action((union ccb *)&cdm); - if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP - || (cdm.status != CAM_DEV_MATCH_LAST - && cdm.status != CAM_DEV_MATCH_MORE) - || cdm.num_matches == 0) - return; + if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP || + (cdm.status != CAM_DEV_MATCH_LAST && + cdm.status != CAM_DEV_MATCH_MORE) || + cdm.num_matches == 0) + break; - device_match = &match_result.result.device_result; - if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, - device_match->path_id, - device_match->target_id, - device_match->target_lun) != CAM_REQ_CMP) - return; + device_match = &match_result.result.device_result; + if (xpt_create_path(&path, /*periph*/NULL, + device_match->path_id, + device_match->target_id, + device_match->target_lun) == CAM_REQ_CMP) { - args->callback(enc, elem, cdm.ccb_h.path, args->callback_arg); + args->callback(enc, elem, path, args->callback_arg); + + xpt_free_path(path); + } + } while (cdm.status == CAM_DEV_MATCH_MORE); xpt_free_path(cdm.ccb_h.path); } From owner-svn-src-all@freebsd.org Fri Sep 13 15:49:05 2019 Return-Path: Delivered-To: svn-src-all@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 8C6BAF4EC9; Fri, 13 Sep 2019 15:49:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VKnF37XHz3LQ1; Fri, 13 Sep 2019 15:49:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 505F7961E; Fri, 13 Sep 2019 15:49:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DFn5w5064110; Fri, 13 Sep 2019 15:49:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFn5di064109; Fri, 13 Sep 2019 15:49:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909131549.x8DFn5di064109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Sep 2019 15:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352300 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:49:05 -0000 Author: mjg Date: Fri Sep 13 15:49:04 2019 New Revision: 352300 URL: https://svnweb.freebsd.org/changeset/base/352300 Log: vfs: release usecount using fetchadd 1. If we release the last usecount we take ownership of the hold count, which means the vnode will remain allocated until we vdrop it. 2. If someone else vrefs they will find no usecount and will proceed to add their own hold count. 3. No code has a problem with v_usecount transitioning to 0 without the interlock These facts combined mean we can fetchadd instead of having a cmpset loop. Reviewed by: kib (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21528 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Sep 13 15:49:02 2019 (r352299) +++ head/sys/kern/vfs_subr.c Fri Sep 13 15:49:04 2019 (r352300) @@ -2667,12 +2667,13 @@ v_decr_devcount(struct vnode *vp) * see doomed vnodes. If inactive processing was delayed in * vput try to do it here. * - * Notes on lockless counter manipulation: - * _vhold, vputx and other routines make various decisions based - * on either holdcnt or usecount being 0. As long as either counter - * is not transitioning 0->1 nor 1->0, the manipulation can be done - * with atomic operations. Otherwise the interlock is taken covering - * both the atomic and additional actions. + * Both holdcnt and usecount can be manipulated using atomics without holding + * any locks except in these cases which require the vnode interlock: + * holdcnt: 1->0 and 0->1 + * usecount: 0->1 + * + * usecount is permitted to transition 1->0 without the interlock because + * vnode is kept live by holdcnt. */ static enum vgetstate _vget_prep(struct vnode *vp, bool interlock) @@ -2784,6 +2785,29 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat * Upgrade our holdcnt to a usecount. */ VI_LOCK(vp); + /* + * See the previous section. By the time we get here we may find + * ourselves in the same spot. + */ + if (vp->v_type != VCHR) { + if (refcount_acquire_if_not_zero(&vp->v_usecount)) { +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_holdcnt, -1) - 1; + VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); +#else + refcount_release(&vp->v_holdcnt); +#endif + VNODE_REFCOUNT_FENCE_ACQ(); + VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, + ("%s: vnode with usecount and VI_OWEINACT set", + __func__)); + VI_UNLOCK(vp); + return (0); + } + } else { + if (vp->v_usecount > 0) + refcount_release(&vp->v_holdcnt); + } if ((vp->v_iflag & VI_OWEINACT) == 0) { oweinact = 0; } else { @@ -2791,8 +2815,6 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat vp->v_iflag &= ~VI_OWEINACT; VNODE_REFCOUNT_FENCE_REL(); } - if (vp->v_usecount > 0) - refcount_release(&vp->v_holdcnt); v_incr_devcount(vp); refcount_acquire(&vp->v_usecount); if (oweinact && VOP_ISLOCKED(vp) == LK_EXCLUSIVE && @@ -2832,6 +2854,15 @@ vrefl(struct vnode *vp) ASSERT_VI_LOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if (vp->v_type != VCHR && + refcount_acquire_if_not_zero(&vp->v_usecount)) { + VNODE_REFCOUNT_FENCE_ACQ(); + VNASSERT(vp->v_holdcnt > 0, vp, + ("%s: active vnode not held", __func__)); + VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, + ("%s: vnode with usecount and VI_OWEINACT set", __func__)); + return; + } if (vp->v_usecount == 0) vholdl(vp); if ((vp->v_iflag & VI_OWEINACT) != 0) { @@ -2917,21 +2948,35 @@ vputx(struct vnode *vp, int func) if (func == VPUTX_VPUT) VOP_UNLOCK(vp, 0); - if (vp->v_type != VCHR && - refcount_release_if_not_last(&vp->v_usecount)) - return; - - VI_LOCK(vp); - /* * We want to hold the vnode until the inactive finishes to * prevent vgone() races. We drop the use count here and the * hold count below when we're done. */ - v_decr_devcount(vp); - if (!refcount_release(&vp->v_usecount)) { - VI_UNLOCK(vp); - return; + if (vp->v_type != VCHR) { + /* + * If we release the last usecount we take ownership of the hold + * count which provides liveness of the vnode, in which case we + * have to vdrop. + */ + if (!refcount_release(&vp->v_usecount)) + return; + VI_LOCK(vp); + /* + * By the time we got here someone else might have transitioned + * the count back to > 0. + */ + if (vp->v_usecount > 0) { + vdropl(vp); + return; + } + } else { + VI_LOCK(vp); + v_decr_devcount(vp); + if (!refcount_release(&vp->v_usecount)) { + VI_UNLOCK(vp); + return; + } } if (vp->v_iflag & VI_DOINGINACT) { vdropl(vp); From owner-svn-src-all@freebsd.org Fri Sep 13 15:56:35 2019 Return-Path: Delivered-To: svn-src-all@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 1ADF2F51A3; Fri, 13 Sep 2019 15:56:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VKxt6xHsz3Ltm; Fri, 13 Sep 2019 15:56:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D14CC97DC; Fri, 13 Sep 2019 15:56:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DFuY82069963; Fri, 13 Sep 2019 15:56:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DFuXsu069956; Fri, 13 Sep 2019 15:56:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201909131556.x8DFuXsu069956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Sep 2019 15:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352301 - in head/sys: conf dev/psci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/psci X-SVN-Commit-Revision: 352301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 15:56:35 -0000 Author: br Date: Fri Sep 13 15:56:33 2019 New Revision: 352301 URL: https://svnweb.freebsd.org/changeset/base/352301 Log: Add generic arm/arm64 secure-monitor SMCCC interface and switch PSCI code to use it. This interface will also be used by Intel Stratix 10 platform. This was not tested on arm due to lack of PSCI-enabled arm hardware lying around. Reviewed by: andrew Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21439 Added: head/sys/dev/psci/smccc_arm.S (contents, props changed) head/sys/dev/psci/smccc_arm64.S (contents, props changed) Deleted: head/sys/dev/psci/psci_arm.S head/sys/dev/psci/psci_arm64.S Modified: head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h head/sys/dev/psci/smccc.h Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Fri Sep 13 15:49:04 2019 (r352300) +++ head/sys/conf/files.arm Fri Sep 13 15:56:33 2019 (r352301) @@ -114,7 +114,7 @@ dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci_host_generic pci dev/pci/pci_host_generic_fdt.c optional pci_host_generic pci fdt dev/psci/psci.c optional psci -dev/psci/psci_arm.S optional psci +dev/psci/smccc_arm.S optional psci dev/syscons/scgfbrndr.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Sep 13 15:49:04 2019 (r352300) +++ head/sys/conf/files.arm64 Fri Sep 13 15:56:33 2019 (r352301) @@ -233,7 +233,7 @@ dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_acpi.c optional pci acpi dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c standard -dev/psci/psci_arm64.S standard +dev/psci/smccc_arm64.S standard dev/psci/smccc.c standard dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt dev/uart/uart_cpu_arm64.c optional uart Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Fri Sep 13 15:49:04 2019 (r352300) +++ head/sys/dev/psci/psci.c Fri Sep 13 15:56:33 2019 (r352301) @@ -128,7 +128,9 @@ static int psci_attach(device_t, psci_initfn_t, int); static void psci_shutdown(void *, int); static int psci_find_callfn(psci_callfn_t *); -static int psci_def_callfn(register_t, register_t, register_t, register_t); +static int psci_def_callfn(register_t, register_t, register_t, register_t, + register_t, register_t, register_t, register_t, + struct arm_smccc_res *res); psci_callfn_t psci_callfn = psci_def_callfn; @@ -149,7 +151,10 @@ SYSINIT(psci_start, SI_SUB_CPU, SI_ORDER_FIRST, psci_i static int psci_def_callfn(register_t a __unused, register_t b __unused, - register_t c __unused, register_t d __unused) + register_t c __unused, register_t d __unused, + register_t e __unused, register_t f __unused, + register_t g __unused, register_t h __unused, + struct arm_smccc_res *res __unused) { panic("No PSCI/SMCCC call function set"); @@ -186,9 +191,9 @@ psci_fdt_get_callfn(phandle_t node) if ((OF_getprop(node, "method", method, sizeof(method))) > 0) { if (strcmp(method, "hvc") == 0) - return (psci_hvc_despatch); + return (arm_smccc_hvc); else if (strcmp(method, "smc") == 0) - return (psci_smc_despatch); + return (arm_smccc_smc); else printf("psci: PSCI conduit \"%s\" invalid\n", method); } else @@ -282,9 +287,9 @@ psci_acpi_get_callfn(int flags) if ((flags & ACPI_FADT_PSCI_COMPLIANT) != 0) { if ((flags & ACPI_FADT_PSCI_USE_HVC) != 0) - return (psci_hvc_despatch); + return (arm_smccc_hvc); else - return (psci_smc_despatch); + return (arm_smccc_smc); } else { printf("psci: PSCI conduit not supplied in the device tree\n"); } Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Fri Sep 13 15:49:04 2019 (r352300) +++ head/sys/dev/psci/psci.h Fri Sep 13 15:56:33 2019 (r352301) @@ -30,9 +30,12 @@ #define _MACHINE_PSCI_H_ #include +#include typedef int (*psci_initfn_t)(device_t dev, int default_version); -typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); +typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, + register_t, register_t, register_t, register_t, + struct arm_smccc_res *res); extern int psci_present; @@ -47,12 +50,8 @@ static inline int psci_call(register_t a, register_t b, register_t c, register_t d) { - return (psci_callfn(a, b, c, d)); + return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL)); } -/* One of these handlers will be selected during the boot */ -int psci_hvc_despatch(register_t, register_t, register_t, register_t); -int psci_smc_despatch(register_t, register_t, register_t, register_t); - /* * PSCI return codes. Modified: head/sys/dev/psci/smccc.h ============================================================================== --- head/sys/dev/psci/smccc.h Fri Sep 13 15:49:04 2019 (r352300) +++ head/sys/dev/psci/smccc.h Fri Sep 13 15:56:33 2019 (r352301) @@ -49,6 +49,21 @@ #define SMCCC_32BIT_CALL 0 #define SMCCC_64BIT_CALL 1 +#define SMCCC_ARM_ARCH_CALLS 0 +#define SMCCC_CPU_SERVICE_CALLS 1 +#define SMCCC_SIP_SERVICE_CALLS 2 +#define SMCCC_OEM_SERVICE_CALLS 3 +#define SMCCC_STD_SECURE_SERVICE_CALLS 4 +#define SMCCC_STD_HYP_SERVICE_CALLS 5 +#define SMCCC_VENDOR_HYP_SERVICE_CALLS 6 + +struct arm_smccc_res { + register_t a0; + register_t a1; + register_t a2; + register_t a3; +}; + /* * Arm Architecture Calls. * These are documented in the document ARM DEN 0070A. @@ -71,5 +86,9 @@ int32_t smccc_arch_features(uint32_t); int smccc_arch_workaround_1(void); int smccc_arch_workaround_2(int); +int arm_smccc_smc(register_t, register_t, register_t, register_t, register_t, + register_t, register_t, register_t, struct arm_smccc_res *res); +int arm_smccc_hvc(register_t, register_t, register_t, register_t, register_t, + register_t, register_t, register_t, struct arm_smccc_res *res); #endif /* _PSCI_SMCCC_H_ */ Added: head/sys/dev/psci/smccc_arm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/smccc_arm.S Fri Sep 13 15:56:33 2019 (r352301) @@ -0,0 +1,74 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * Copyright (c) 2015 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +.arch_extension sec /* For smc */ +.arch_extension virt /* For hvc */ + +/* + * int arm_smccc_hvc(register_t, register_t, register_t, register_t, + * register_t, register_t, register_t, register_t, + * struct arm_smccc_res *res) + */ +ENTRY(arm_smccc_hvc) + mov r12, sp + push {r4-r7} + ldm r12, {r4-r7} + hvc #0 + pop {r4-r7} + ldr r12, [sp, #(4 * 4)] + cmp r12, #0 + beq 1f + stm r12, {r0-r3} +1: bx lr +END(arm_smccc_hvc) + +/* + * int arm_smccc_smc(register_t, register_t, register_t, register_t, + * register_t, register_t, register_t, register_t, + * struct arm_smccc_res *res) + */ +ENTRY(arm_smccc_smc) + mov r12, sp + push {r4-r7} + ldm r12, {r4-r7} + smc #0 + pop {r4-r7} + ldr r12, [sp, #(4 * 4)] + cmp r12, #0 + beq 1f + stm r12, {r0-r3} +1: bx lr +END(arm_smccc_smc) Added: head/sys/dev/psci/smccc_arm64.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/smccc_arm64.S Fri Sep 13 15:56:33 2019 (r352301) @@ -0,0 +1,62 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * int arm_smccc_hvc(register_t, register_t, register_t, register_t, + * register_t, register_t, register_t, register_t, + * struct arm_smccc_res *res) + */ +ENTRY(arm_smccc_hvc) + hvc #0 + ldr x4, [sp] + cbz x4, 1f + stp x0, x1, [x4, #16 * 0] + stp x2, x3, [x4, #16 * 1] +1: ret +END(arm_smccc_hvc) + +/* + * int arm_smccc_smc(register_t, register_t, register_t, register_t, + * register_t, register_t, register_t, register_t, + * struct arm_smccc_res *res) + */ +ENTRY(arm_smccc_smc) + smc #0 + ldr x4, [sp] + cbz x4, 1f + stp x0, x1, [x4, #16 * 0] + stp x2, x3, [x4, #16 * 1] +1: ret +END(arm_smccc_smc) From owner-svn-src-all@freebsd.org Fri Sep 13 16:50:59 2019 Return-Path: Delivered-To: svn-src-all@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 38741F5FA9; Fri, 13 Sep 2019 16:50:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VM8g16zkz3P3s; Fri, 13 Sep 2019 16:50:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E625BA12D; Fri, 13 Sep 2019 16:50:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DGowI9002454; Fri, 13 Sep 2019 16:50:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DGovo1002446; Fri, 13 Sep 2019 16:50:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201909131650.x8DGovo1002446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Sep 2019 16:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352302 - in head/sys: arm64/conf arm64/intel conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/intel conf X-SVN-Commit-Revision: 352302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 16:50:59 -0000 Author: br Date: Fri Sep 13 16:50:57 2019 New Revision: 352302 URL: https://svnweb.freebsd.org/changeset/base/352302 Log: Add support for Intel Stratix 10 platform. Intel Stratix 10 SoC includes a quad-core arm64 cluster and FPGA fabric. This adds support for reconfiguring FPGA. Accessing FPGA core of this SoC require the level of privilege EL3, while kernel runs in EL1 (lower) level of privilege. This provides an Intel service layer interface that uses SMCCC to pass queries to the secure-monitor (EL3). Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21454 Added: head/sys/arm64/intel/ head/sys/arm64/intel/firmware.c (contents, props changed) head/sys/arm64/intel/intel-smc.h (contents, props changed) head/sys/arm64/intel/stratix10-soc-fpga-mgr.c (contents, props changed) head/sys/arm64/intel/stratix10-svc.c (contents, props changed) head/sys/arm64/intel/stratix10-svc.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Sep 13 15:56:33 2019 (r352301) +++ head/sys/arm64/conf/GENERIC Fri Sep 13 16:50:57 2019 (r352302) @@ -110,6 +110,7 @@ options SOC_ALLWINNER_A64 options SOC_ALLWINNER_H5 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 +options SOC_INTEL_STRATIX10 options SOC_BRCM_BCM2837 options SOC_MARVELL_8K options SOC_ROCKCHIP_RK3328 Added: head/sys/arm64/intel/firmware.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/intel/firmware.c Fri Sep 13 16:50:57 2019 (r352302) @@ -0,0 +1,122 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +struct firmware_softc { + struct simplebus_softc simplebus_sc; + device_t dev; +}; + +static int +firmware_probe(device_t dev) +{ + phandle_t node; + + node = ofw_bus_get_node(dev); + + /* + * The firmware node has no property compatible. + * Look for a known child. + */ + if (!fdt_depth_search_compatible(node, "intel,stratix10-svc", 0)) + return (ENXIO); + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + device_set_desc(dev, "Firmware node"); + + return (BUS_PROBE_DEFAULT); +} + +static int +firmware_attach(device_t dev) +{ + struct firmware_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(dev); + if (node == -1) + return (ENXIO); + + simplebus_init(dev, node); + + /* + * Allow devices to identify. + */ + bus_generic_probe(dev); + + /* + * Now walk the OFW tree and attach top-level devices. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) + simplebus_add_device(dev, node, 0, NULL, -1, NULL); + + return (bus_generic_attach(dev)); +} + +static int +firmware_detach(device_t dev) +{ + + return (0); +} + +static device_method_t firmware_methods[] = { + DEVMETHOD(device_probe, firmware_probe), + DEVMETHOD(device_attach, firmware_attach), + DEVMETHOD(device_detach, firmware_detach), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(firmware, firmware_driver, firmware_methods, + sizeof(struct firmware_softc), simplebus_driver); + +static devclass_t firmware_devclass; + +EARLY_DRIVER_MODULE(firmware, simplebus, firmware_driver, firmware_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(firmware, 1); Added: head/sys/arm64/intel/intel-smc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/intel/intel-smc.h Fri Sep 13 16:50:57 2019 (r352302) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARM64_INTEL_INTEL_SMC_H_ +#define _ARM64_INTEL_INTEL_SMC_H_ + +#include + +/* + * Intel SiP return values. + */ +#define INTEL_SIP_SMC_STATUS_OK 0 +#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY 1 +#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 2 +#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 4 +#define INTEL_SIP_SMC_REG_ERROR 5 +#define INTEL_SIP_SMC_RSU_ERROR 7 + +/* + * Intel SiP calls. + */ +#define INTEL_SIP_SMC_STD_CALL(func) \ + SMCCC_FUNC_ID(SMCCC_YIELDING_CALL, SMCCC_64BIT_CALL, \ + SMCCC_SIP_SERVICE_CALLS, (func)) +#define INTEL_SIP_SMC_FAST_CALL(func) \ + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, \ + SMCCC_SIP_SERVICE_CALLS, (func)) + +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1 +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE 2 +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE 3 +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4 +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM 5 +#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6 +#define INTEL_SIP_SMC_FUNCID_REG_READ 7 +#define INTEL_SIP_SMC_FUNCID_REG_WRITE 8 +#define INTEL_SIP_SMC_FUNCID_REG_UPDATE 9 +#define INTEL_SIP_SMC_FUNCID_RSU_STATUS 11 +#define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12 + +#define INTEL_SIP_SMC_FPGA_CONFIG_START \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START) +#define INTEL_SIP_SMC_FPGA_CONFIG_WRITE \ + INTEL_SIP_SMC_STD_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE) +#define INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) +#define INTEL_SIP_SMC_FPGA_CONFIG_ISDONE \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE) +#define INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM) +#define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK) +#define INTEL_SIP_SMC_REG_READ \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_REG_READ) +#define INTEL_SIP_SMC_REG_WRITE \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_REG_WRITE) +#define INTEL_SIP_SMC_REG_UPDATE \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_REG_UPDATE) +#define INTEL_SIP_SMC_RSU_STATUS \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_RSU_STATUS) +#define INTEL_SIP_SMC_RSU_UPDATE \ + INTEL_SIP_SMC_FAST_CALL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE) + +typedef int (*intel_smc_callfn_t)(register_t, register_t, register_t, + register_t, register_t, register_t, register_t, register_t, + struct arm_smccc_res *res); + +#endif /* _ARM64_INTEL_INTEL_SMC_H_ */ Added: head/sys/arm64/intel/stratix10-soc-fpga-mgr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/intel/stratix10-soc-fpga-mgr.c Fri Sep 13 16:50:57 2019 (r352302) @@ -0,0 +1,290 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Intel Stratix 10 FPGA Manager. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#define SVC_BUF_SIZE (2 * 1024 * 1024) + +struct fpgamgr_s10_softc { + struct cdev *mgr_cdev; + struct cdev *mgr_cdev_partial; + device_t dev; + device_t s10_svc_dev; + struct s10_svc_mem mem; + struct sx sx; + int opened; +}; + +static int +fpga_open(struct cdev *dev, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + struct fpgamgr_s10_softc *sc; + struct s10_svc_msg msg; + int ret; + int err; + + sc = dev->si_drv1; + + sx_xlock(&sc->sx); + if (sc->opened) { + sx_xunlock(&sc->sx); + return (EBUSY); + } + + err = s10_svc_allocate_memory(sc->s10_svc_dev, + &sc->mem, SVC_BUF_SIZE); + if (err != 0) { + sx_xunlock(&sc->sx); + return (ENXIO); + } + + bzero(&msg, sizeof(struct s10_svc_msg)); + msg.command = COMMAND_RECONFIG; + if (dev == sc->mgr_cdev_partial) + msg.flags |= COMMAND_RECONFIG_FLAG_PARTIAL; + ret = s10_svc_send(sc->s10_svc_dev, &msg); + if (ret != 0) { + sx_xunlock(&sc->sx); + return (ENXIO); + } + + sc->opened = 1; + sx_xunlock(&sc->sx); + + return (0); +} + +static int +fpga_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct fpgamgr_s10_softc *sc; + vm_offset_t addr; + int amnt; + + sc = dev->si_drv1; + + sx_xlock(&sc->sx); + if (sc->opened == 0) { + /* Device closed. */ + sx_xunlock(&sc->sx); + return (ENXIO); + } + + while (uio->uio_resid > 0) { + addr = sc->mem.vaddr + sc->mem.fill; + if (sc->mem.fill >= SVC_BUF_SIZE) + return (ENOMEM); + amnt = MIN(uio->uio_resid, (SVC_BUF_SIZE - sc->mem.fill)); + uiomove((void *)addr, amnt, uio); + sc->mem.fill += amnt; + } + + sx_xunlock(&sc->sx); + + return (0); +} + +static int +fpga_close(struct cdev *dev, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + struct fpgamgr_s10_softc *sc; + struct s10_svc_msg msg; + int ret; + + sc = dev->si_drv1; + + sx_xlock(&sc->sx); + if (sc->opened == 0) { + /* Device closed. */ + sx_xunlock(&sc->sx); + return (ENXIO); + } + + /* Submit bitstream */ + bzero(&msg, sizeof(struct s10_svc_msg)); + msg.command = COMMAND_RECONFIG_DATA_SUBMIT; + msg.payload = (void *)sc->mem.paddr; + msg.payload_length = sc->mem.fill; + ret = s10_svc_send(sc->s10_svc_dev, &msg); + if (ret != 0) { + device_printf(sc->dev, "Failed to submit data\n"); + s10_svc_free_memory(sc->s10_svc_dev, &sc->mem); + sc->opened = 0; + sx_xunlock(&sc->sx); + return (0); + } + + /* Claim memory buffer back */ + bzero(&msg, sizeof(struct s10_svc_msg)); + msg.command = COMMAND_RECONFIG_DATA_CLAIM; + s10_svc_send(sc->s10_svc_dev, &msg); + + s10_svc_free_memory(sc->s10_svc_dev, &sc->mem); + sc->opened = 0; + sx_xunlock(&sc->sx); + + return (0); +} + +static int +fpga_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + + return (0); +} + +static struct cdevsw fpga_cdevsw = { + .d_version = D_VERSION, + .d_open = fpga_open, + .d_close = fpga_close, + .d_write = fpga_write, + .d_ioctl = fpga_ioctl, + .d_name = "FPGA Manager", +}; + +static int +fpgamgr_s10_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "intel,stratix10-soc-fpga-mgr")) + return (ENXIO); + + device_set_desc(dev, "Stratix 10 SOC FPGA Manager"); + + return (BUS_PROBE_DEFAULT); +} + +static int +fpgamgr_s10_attach(device_t dev) +{ + struct fpgamgr_s10_softc *sc; + devclass_t dc; + + sc = device_get_softc(dev); + sc->dev = dev; + + dc = devclass_find("s10_svc"); + if (dc == NULL) + return (ENXIO); + + sc->s10_svc_dev = devclass_get_device(dc, 0); + if (sc->s10_svc_dev == NULL) + return (ENXIO); + + sc->mgr_cdev = make_dev(&fpga_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "fpga%d", device_get_unit(sc->dev)); + if (sc->mgr_cdev == NULL) { + device_printf(dev, "Failed to create character device.\n"); + return (ENXIO); + } + + sc->mgr_cdev_partial = make_dev(&fpga_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "fpga_partial%d", device_get_unit(sc->dev)); + if (sc->mgr_cdev_partial == NULL) { + device_printf(dev, "Failed to create character device.\n"); + return (ENXIO); + } + + sx_init(&sc->sx, "s10 fpga"); + + sc->mgr_cdev->si_drv1 = sc; + sc->mgr_cdev_partial->si_drv1 = sc; + + return (0); +} + +static int +fpgamgr_s10_detach(device_t dev) +{ + struct fpgamgr_s10_softc *sc; + + sc = device_get_softc(dev); + + destroy_dev(sc->mgr_cdev); + destroy_dev(sc->mgr_cdev_partial); + + sx_destroy(&sc->sx); + + return (0); +} + +static device_method_t fpgamgr_s10_methods[] = { + DEVMETHOD(device_probe, fpgamgr_s10_probe), + DEVMETHOD(device_attach, fpgamgr_s10_attach), + DEVMETHOD(device_detach, fpgamgr_s10_detach), + { 0, 0 } +}; + +static driver_t fpgamgr_s10_driver = { + "fpgamgr_s10", + fpgamgr_s10_methods, + sizeof(struct fpgamgr_s10_softc), +}; + +static devclass_t fpgamgr_s10_devclass; + +DRIVER_MODULE(fpgamgr_s10, simplebus, fpgamgr_s10_driver, + fpgamgr_s10_devclass, 0, 0); Added: head/sys/arm64/intel/stratix10-svc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/intel/stratix10-svc.c Fri Sep 13 16:50:57 2019 (r352302) @@ -0,0 +1,271 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Intel Stratix 10 Service Layer + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct s10_svc_softc { + device_t dev; + vmem_t *vmem; + intel_smc_callfn_t callfn; +}; + +static int +s10_data_claim(struct s10_svc_softc *sc) +{ + struct arm_smccc_res res; + register_t a0, a1, a2; + int ret; + + ret = 0; + + while (1) { + a0 = INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE; + a1 = 0; + a2 = 0; + + ret = sc->callfn(a0, a1, a2, 0, 0, 0, 0, 0, &res); + if (ret == INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY) + continue; + + break; + } + + return (ret); +} + +int +s10_svc_send(device_t dev, struct s10_svc_msg *msg) +{ + struct s10_svc_softc *sc; + struct arm_smccc_res res; + register_t a0, a1, a2; + int ret; + + sc = device_get_softc(dev); + + a0 = 0; + a1 = 0; + a2 = 0; + + switch (msg->command) { + case COMMAND_RECONFIG: + a0 = INTEL_SIP_SMC_FPGA_CONFIG_START; + a1 = msg->flags; + break; + case COMMAND_RECONFIG_DATA_SUBMIT: + a0 = INTEL_SIP_SMC_FPGA_CONFIG_WRITE; + a1 = (uint64_t)msg->payload; + a2 = (uint64_t)msg->payload_length; + break; + case COMMAND_RECONFIG_DATA_CLAIM: + ret = s10_data_claim(sc); + return (ret); + default: + return (-1); + } + + ret = sc->callfn(a0, a1, a2, 0, 0, 0, 0, 0, &res); + + return (ret); +} + +int +s10_svc_allocate_memory(device_t dev, struct s10_svc_mem *mem, int size) +{ + struct s10_svc_softc *sc; + + sc = device_get_softc(dev); + + if (size <= 0) + return (EINVAL); + + if (vmem_alloc(sc->vmem, size, + M_FIRSTFIT | M_NOWAIT, &mem->paddr)) { + device_printf(dev, "Can't allocate memory\n"); + return (ENOMEM); + } + + mem->size = size; + mem->fill = 0; + mem->vaddr = (vm_offset_t)pmap_mapdev(mem->paddr, mem->size); + + return (0); +} + +void +s10_svc_free_memory(device_t dev, struct s10_svc_mem *mem) +{ + struct s10_svc_softc *sc; + + sc = device_get_softc(dev); + + vmem_free(sc->vmem, mem->paddr, mem->size); +} + +static int +s10_get_memory(struct s10_svc_softc *sc) +{ + struct arm_smccc_res res; + vmem_addr_t addr; + vmem_size_t size; + vmem_t *vmem; + + sc->callfn(INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM, + 0, 0, 0, 0, 0, 0, 0, &res); + if (res.a0 != INTEL_SIP_SMC_STATUS_OK) + return (ENXIO); + + vmem = vmem_create("stratix10 vmem", 0, 0, PAGE_SIZE, + PAGE_SIZE, M_BESTFIT | M_WAITOK); + if (vmem == NULL) + return (ENXIO); + + addr = res.a1; + size = res.a2; + + device_printf(sc->dev, "Shared memory address 0x%lx size 0x%lx\n", + addr, size); + + vmem_add(vmem, addr, size, 0); + + sc->vmem = vmem; + + return (0); +} + +static intel_smc_callfn_t +s10_svc_get_callfn(struct s10_svc_softc *sc, phandle_t node) +{ + char method[16]; + + if ((OF_getprop(node, "method", method, sizeof(method))) > 0) { + if (strcmp(method, "hvc") == 0) + return (arm_smccc_hvc); + else if (strcmp(method, "smc") == 0) + return (arm_smccc_smc); + else + device_printf(sc->dev, + "Invalid method \"%s\"\n", method); + } else + device_printf(sc->dev, "SMC method not provided\n"); + + return (NULL); +} + +static int +s10_svc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "intel,stratix10-svc")) + return (ENXIO); + + device_set_desc(dev, "Stratix 10 SVC"); + + return (BUS_PROBE_DEFAULT); +} + +static int +s10_svc_attach(device_t dev) +{ + struct s10_svc_softc *sc; + phandle_t node; + + node = ofw_bus_get_node(dev); + + sc = device_get_softc(dev); + sc->dev = dev; + + if (device_get_unit(dev) != 0) + return (ENXIO); + + sc->callfn = s10_svc_get_callfn(sc, node); + if (sc->callfn == NULL) + return (ENXIO); + + if (s10_get_memory(sc) != 0) + return (ENXIO); + + return (0); +} + +static device_method_t s10_svc_methods[] = { + DEVMETHOD(device_probe, s10_svc_probe), + DEVMETHOD(device_attach, s10_svc_attach), + { 0, 0 } +}; + +static driver_t s10_svc_driver = { + "s10_svc", + s10_svc_methods, + sizeof(struct s10_svc_softc), +}; + +static devclass_t s10_svc_devclass; + +EARLY_DRIVER_MODULE(s10_svc, firmware, s10_svc_driver, + s10_svc_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Added: head/sys/arm64/intel/stratix10-svc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/intel/stratix10-svc.h Fri Sep 13 16:50:57 2019 (r352302) @@ -0,0 +1,60 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARM64_INTEL_STRATIX10_SVC_H_ +#define _ARM64_INTEL_STRATIX10_SVC_H_ + +struct s10_svc_msg { + int command; +#define COMMAND_RECONFIG (1 << 0) +#define COMMAND_RECONFIG_DATA_SUBMIT (1 << 1) +#define COMMAND_RECONFIG_DATA_CLAIM (1 << 2) + int flags; +#define COMMAND_RECONFIG_FLAG_PARTIAL (1 << 0) + void *payload; + int payload_length; +}; + +struct s10_svc_mem { + vm_offset_t paddr; + vm_offset_t vaddr; + int size; + int fill; +}; + +int s10_svc_send(device_t dev, struct s10_svc_msg *msg); +int s10_svc_allocate_memory(device_t dev, struct s10_svc_mem *mem, int size); +void s10_svc_free_memory(device_t dev, struct s10_svc_mem *mem); + +#endif /* !_ARM64_INTEL_STRATIX10_SVC_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Sep 13 15:56:33 2019 (r352301) +++ head/sys/conf/files.arm64 Fri Sep 13 16:50:57 2019 (r352302) @@ -174,6 +174,9 @@ arm64/coresight/coresight-dynamic-replicator.c standar arm64/coresight/coresight-etm4x.c standard arm64/coresight/coresight-funnel.c standard arm64/coresight/coresight-tmc.c standard +arm64/intel/firmware.c optional soc_intel_stratix10 +arm64/intel/stratix10-soc-fpga-mgr.c optional soc_intel_stratix10 +arm64/intel/stratix10-svc.c optional soc_intel_stratix10 arm64/qualcomm/qcom_gcc.c optional qcom_gcc fdt contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Fri Sep 13 15:56:33 2019 (r352301) +++ head/sys/conf/options.arm64 Fri Sep 13 16:50:57 2019 (r352302) @@ -19,6 +19,7 @@ SOC_ALLWINNER_H5 opt_soc.h SOC_BRCM_BCM2837 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h +SOC_INTEL_STRATIX10 opt_soc.h SOC_MARVELL_8K opt_soc.h SOC_ROCKCHIP_RK3328 opt_soc.h SOC_ROCKCHIP_RK3399 opt_soc.h From owner-svn-src-all@freebsd.org Fri Sep 13 20:17:15 2019 Return-Path: Delivered-To: svn-src-all@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 1E125D2294; Fri, 13 Sep 2019 20:17:15 +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 46VRkf74H3z44cj; Fri, 13 Sep 2019 20:17:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3062CAD3; Fri, 13 Sep 2019 20:17:14 +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 x8DKHEW5024849; Fri, 13 Sep 2019 20:17:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DKHEJi024848; Fri, 13 Sep 2019 20:17:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909132017.x8DKHEJi024848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Sep 2019 20:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352303 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 20:17:15 -0000 Author: kib Date: Fri Sep 13 20:17:14 2019 New Revision: 352303 URL: https://svnweb.freebsd.org/changeset/base/352303 Log: riscv trap_pfault: remove unneeded hold of the process around vm_fault() call. This is re-appearance of the nop code removed from other arches in r287625. Reviewed by: alc (as part of the larger patch), markj Sponsored by: The FreeBSD Foundation MFC after: 1 week DIfferential revision: https://reviews.freebsd.org/D21645 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Fri Sep 13 16:50:57 2019 (r352302) +++ head/sys/riscv/riscv/trap.c Fri Sep 13 20:17:14 2019 (r352303) @@ -217,29 +217,7 @@ data_abort(struct trapframe *frame, int usermode) if (pmap_fault_fixup(map->pmap, va, ftype)) goto done; - if (map != kernel_map) { - /* - * Keep swapout from messing with us during this - * critical time. - */ - PROC_LOCK(p); - ++p->p_lock; - PROC_UNLOCK(p); - - /* Fault in the user page: */ - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); - - PROC_LOCK(p); - --p->p_lock; - PROC_UNLOCK(p); - } else { - /* - * Don't have to worry about process locking or stacks in the - * kernel. - */ - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); - } - + error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); if (error != KERN_SUCCESS) { if (usermode) { sig = SIGSEGV; From owner-svn-src-all@freebsd.org Fri Sep 13 20:20:06 2019 Return-Path: Delivered-To: svn-src-all@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 DD9D0D23A1; Fri, 13 Sep 2019 20:20:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VRny5ZFkz44n7; Fri, 13 Sep 2019 20:20:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2ADECAEF; Fri, 13 Sep 2019 20:20:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DKK6oA025068; Fri, 13 Sep 2019 20:20:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DKK62j025066; Fri, 13 Sep 2019 20:20:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909132020.x8DKK62j025066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 13 Sep 2019 20:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: . usr.sbin/ntp usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 352304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 20:20:06 -0000 Author: cy Date: Fri Sep 13 20:20:05 2019 New Revision: 352304 URL: https://svnweb.freebsd.org/changeset/base/352304 Log: No longer mlock() ntpd pages by default in memory thus allowing its pages to page as necessary. To restore historic BSD behaviour add the following to ntp.conf: rlimit memlock 32 Discussed on: freebsd-current@ between Sept 6-9, 2019 Reported by: Users using ASLR with stack gap != 0 Reviewed by: ian, kib, rgrimes (all previous versions) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21581 Modified: head/UPDATING head/usr.sbin/ntp/config.h head/usr.sbin/ntp/ntpd/ntp.conf Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Sep 13 20:17:14 2019 (r352303) +++ head/UPDATING Fri Sep 13 20:20:05 2019 (r352304) @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190913: + ntpd no longer by default locks its pages in memory, allowing them + to be paged out by the kernel. Use rlimit memlock to restore + historic BSD behaviour. For example, add "rlimit memlock 32" + to ntp.conf to lock up to 32 MB of ntpd address space in memory. + 20190823: Several of ping6's options have been renamed for better consistency with ping. If you use any of -ARWXaghmrtwx, you must update your Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Fri Sep 13 20:17:14 2019 (r352303) +++ head/usr.sbin/ntp/config.h Fri Sep 13 20:20:05 2019 (r352304) @@ -287,7 +287,7 @@ #define DEFAULT_HZ 100 /* Default number of megabytes for RLIMIT_MEMLOCK */ -#define DFLT_RLIMIT_MEMLOCK 32 +#define DFLT_RLIMIT_MEMLOCK -1 /* Default number of 4k pages for RLIMIT_STACK */ #define DFLT_RLIMIT_STACK 50 Modified: head/usr.sbin/ntp/ntpd/ntp.conf ============================================================================== --- head/usr.sbin/ntp/ntpd/ntp.conf Fri Sep 13 20:17:14 2019 (r352303) +++ head/usr.sbin/ntp/ntpd/ntp.conf Fri Sep 13 20:20:05 2019 (r352304) @@ -102,3 +102,11 @@ restrict ::1 # Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" + +# Specify the number of megabytes of memory that should be allocated and +# locked. -1 (default) means "do not lock the process into memory". +# 0 means "lock whatever memory the process wants into memory". Any other +# number means to lock up to that number of megabytes into memory. +# 0 may result in a segfault when ASLR with stack gap randomization +# is enabled. +#rlimit memlock 32 From owner-svn-src-all@freebsd.org Fri Sep 13 20:22:00 2019 Return-Path: Delivered-To: svn-src-all@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 48A02D2495; Fri, 13 Sep 2019 20:22:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VRr815Zbz457Z; Fri, 13 Sep 2019 20:22:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08AF3CC89; Fri, 13 Sep 2019 20:22:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DKLxPH030296; Fri, 13 Sep 2019 20:21:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DKLxrt030295; Fri, 13 Sep 2019 20:21:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909132021.x8DKLxrt030295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 13 Sep 2019 20:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352305 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 20:22:00 -0000 Author: cy Date: Fri Sep 13 20:21:59 2019 New Revision: 352305 URL: https://svnweb.freebsd.org/changeset/base/352305 Log: Add RELNOTES comment for r352304 discussing removing default mlock() for ntpd. Differential Revision: https://reviews.freebsd.org/D21581 Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Fri Sep 13 20:20:05 2019 (r352304) +++ head/RELNOTES Fri Sep 13 20:21:59 2019 (r352305) @@ -10,6 +10,10 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r352304: + ntpd is no longer by default locked in memory. rlimit memlock 32 + or rlimit memlock 0 can be used to restore this behaviour. + r351522: Add kernel-side support for in-kernel Transport Layer Security (KTLS). KTLS permits using sendfile(2) over sockets using From owner-svn-src-all@freebsd.org Fri Sep 13 20:36:10 2019 Return-Path: Delivered-To: svn-src-all@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 1D059D2A57; Fri, 13 Sep 2019 20:36:10 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VS8S1pL7z45sZ; Fri, 13 Sep 2019 20:36:07 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 220c47df; Fri, 13 Sep 2019 16:33:54 -0400 (EDT) Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id a3d46620 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Fri, 13 Sep 2019 16:33:42 -0400 (EDT) Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909130650.x8D6o2fb037276@repo.freebsd.org> From: Charlie Li Autocrypt: addr=ml+freebsd@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw== Organization: FreeBSD mailing lists Message-ID: <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> Date: Fri, 13 Sep 2019 16:33:15 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201909130650.x8D6o2fb037276@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T3iMzCjUadTz6AS8VbqlUWsykLa71w3Q2" X-Rspamd-Queue-Id: 46VS8S1pL7z45sZ X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[vishwin.info:s=fuccboi12]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.66)[ip: (-9.91), ipnet: 46.101.80.0/20(-4.96), asn: 14061(1.62), country: US(-0.05)]; DKIM_TRACE(0.00)[vishwin.info:+]; DMARC_POLICY_ALLOW(-0.50)[vishwin.info,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; TAGGED_FROM(0.00)[freebsd]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 20:36:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --T3iMzCjUadTz6AS8VbqlUWsykLa71w3Q2 Content-Type: multipart/mixed; boundary="YDnxR0dO5qBLDGmHiI2S3ZODSkucUIqLj" --YDnxR0dO5qBLDGmHiI2S3ZODSkucUIqLj Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Baptiste Daroussin wrote: > Author: bapt > Date: Fri Sep 13 06:50:02 2019 > New Revision: 352275 > URL: https://svnweb.freebsd.org/changeset/base/352275 >=20 > Log: > Update libedit to a snapshot from 2019-09-10 > Reviewed by: Yuichiro Naito > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D21584 >=20 I posted in phab but repeating here, this breaks the build on (at least) aarch64: --- terminal.o --- /usr/src/contrib/libedit/terminal.c:569:41: error: comparison of integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka 'unsigned int') [-Werror,-Wsign-compare] el->el_cursor.v][where & 0370] !=3D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~ ^ /usr/src/contrib/libedit/terminal.c:659:28: error: comparison of integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka 'unsigned int') [-Werror,-Wsign-compare] [el->el_cursor.h] =3D=3D MB_FILL_CHAR) ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ 2 errors generated. *** [terminal.o] Error code 1 --=20 Charlie Li =E2=80=A6nope, still don't have an exit line. (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --YDnxR0dO5qBLDGmHiI2S3ZODSkucUIqLj-- --T3iMzCjUadTz6AS8VbqlUWsykLa71w3Q2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAl17/RMACgkQjnB43vID q2xLvg/+MeYyPTUDxqwK8BID1M5NCFx38at/jWMbIjbvBT0ywcoJxvZa/XQr3zof ZBxtLUAmsd1M35SrYxpNjjjz9D2TUwbE6Ba/Jr3NuplGf3uV/1DHA2v2ZSw1j1w1 Lk+Hx94GMXs1SYhqhxyXQvv3Syq9rkkRIBAJSi+9LmCMHyz2LchPGI4zGw+7dON/ A9uz/lfA0K+nt3E02kifc7wOxQwfzAk5dJUJt3S9d9nrJzDiiZjtCbq92Nb7nqiG UURv3XufECmeyy2GObdJDZz6A3SpznZVNISNsql2FecAaFabA7dhCipvzgVPN8rM Fh4fHzCjSzVLm6A88QHnxrqjqnfV0kiZ00Jao0xVJDE250OaS/qSW1K5+WMHS2+C 6yko2bZU4wF8ETWTop3+EFr3u71ZMuvPFUGBSMYtW6sfyYxWMTC7kdF3J2UCh4fI 21yD/mGjuA6I9X9xMTayGkzq/0IYCHa646xcQYjQZd70WYJL696LGR1qCxjDTHGA T8c7GtciCoMRmBcwxaEC5DQqQG/q866CWWkWuxKM+e37e2jJBIvFhf4c5TWpVKDe 4jHAzEzhsiO6lDnzzOAL2doHObqd/9Sjj/fYTACgjMhamJXQvFAlxrRoB6ymKhNo 3Yni5PdM1ocusVx9XcqQADeFnNmz+bnqMLma0+daGY4TWKqlpTI= =WNTh -----END PGP SIGNATURE----- --T3iMzCjUadTz6AS8VbqlUWsykLa71w3Q2-- From owner-svn-src-all@freebsd.org Fri Sep 13 21:00:20 2019 Return-Path: Delivered-To: svn-src-all@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 80532D31E0; Fri, 13 Sep 2019 21:00:20 +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 46VShN2nGtz47Fb; Fri, 13 Sep 2019 21:00:20 +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 3E2C5D24F; Fri, 13 Sep 2019 21:00:20 +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 x8DL0KEi049605; Fri, 13 Sep 2019 21:00:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DL0Kid049604; Fri, 13 Sep 2019 21:00:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909132100.x8DL0Kid049604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 13 Sep 2019 21:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352306 - head/contrib/libcxxrt X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libcxxrt X-SVN-Commit-Revision: 352306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 21:00:20 -0000 Author: dim Date: Fri Sep 13 21:00:19 2019 New Revision: 352306 URL: https://svnweb.freebsd.org/changeset/base/352306 Log: Include in unwind-arm.h, since it uses uint32_t and uint64_t in various declarations. Otherwise, depending on how unwind-arm.h is included from other source files, the compiler may complain that uint32_t and uint64_t are unknown types. MFC after: 3 days Modified: head/contrib/libcxxrt/unwind-arm.h Modified: head/contrib/libcxxrt/unwind-arm.h ============================================================================== --- head/contrib/libcxxrt/unwind-arm.h Fri Sep 13 20:21:59 2019 (r352305) +++ head/contrib/libcxxrt/unwind-arm.h Fri Sep 13 21:00:19 2019 (r352306) @@ -20,6 +20,9 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/* For uint32_t and uint64_t */ +#include + /** * ARM-specific unwind definitions. These are taken from the ARM EHABI * specification. From owner-svn-src-all@freebsd.org Fri Sep 13 21:20:25 2019 Return-Path: Delivered-To: svn-src-all@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 BC789D3845; Fri, 13 Sep 2019 21:20:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VT7Y4ZB8z486j; Fri, 13 Sep 2019 21:20:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D288D5D8; Fri, 13 Sep 2019 21:20:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DLKPNa061336; Fri, 13 Sep 2019 21:20:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DLKOmh061333; Fri, 13 Sep 2019 21:20:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909132120.x8DLKOmh061333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 13 Sep 2019 21:20: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: r352309 - in stable/12/sys: arm/mv dev/extres/syscon dev/fdt X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/mv dev/extres/syscon dev/fdt X-SVN-Commit-Revision: 352309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 21:20:25 -0000 Author: manu Date: Fri Sep 13 21:20:24 2019 New Revision: 352309 URL: https://svnweb.freebsd.org/changeset/base/352309 Log: MFC r351184, r351189, r351217 r351184: Add method for getting of syscon handle from parent device. If simple multifuction device also provides syscon interface, its childern should be able to consume it. Due to this: - declare coresponding method in syscon interface - implement it in simple multifunction device driver r351189: Fix bug introduced by r351184. We should check the returned handle, not the pointer to it. Noticed by: ian X-MFC with: r351184 r351217: arm64: a37x0_gpio: Use syscon instead of MMIO region The fdt node for this driver is a simple-mfd and syscon compatible one meaning that simplemfd will be the driver attached for it. The gpio driver is attached to the 'gpio' subnode so use syscon_get_handle_default to obtain the handle of the syscon from the parent device and use this to read/write to the memory region. Modified: stable/12/sys/arm/mv/a37x0_gpio.c stable/12/sys/dev/extres/syscon/syscon.c stable/12/sys/dev/extres/syscon/syscon_if.m stable/12/sys/dev/fdt/simple_mfd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/mv/a37x0_gpio.c ============================================================================== --- stable/12/sys/arm/mv/a37x0_gpio.c Fri Sep 13 21:15:01 2019 (r352308) +++ stable/12/sys/arm/mv/a37x0_gpio.c Fri Sep 13 21:20:24 2019 (r352309) @@ -46,21 +46,14 @@ __FBSDID("$FreeBSD$"); #include #include "gpio_if.h" +#include "syscon_if.h" -static struct resource_spec a37x0_gpio_res_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Pinctl / GPIO */ - { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* Interrupts control */ - { -1, 0, 0 } -}; - struct a37x0_gpio_softc { - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; device_t sc_busdev; int sc_type; uint32_t sc_max_pins; uint32_t sc_npins; - struct resource *sc_mem_res[nitems(a37x0_gpio_res_spec) - 1]; + struct syscon *syscon; }; /* Memory regions. */ @@ -72,9 +65,9 @@ struct a37x0_gpio_softc { #define A37X0_SB_GPIO 2 #define A37X0_GPIO_WRITE(_sc, _off, _val) \ - bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off), (_val)) + SYSCON_WRITE_4((_sc)->syscon, (_off), (_val)) #define A37X0_GPIO_READ(_sc, _off) \ - bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off)) + SYSCON_READ_4((_sc)->syscon, (_off)) #define A37X0_GPIO_BIT(_p) (1U << ((_p) % 32)) #define A37X0_GPIO_OUT_EN(_p) (0x0 + ((_p) / 32) * 4) @@ -280,6 +273,12 @@ a37x0_gpio_attach(device_t dev) sc = device_get_softc(dev); + err = syscon_get_handle_default(dev, &sc->syscon); + if (err != 0) { + device_printf(dev, "Cannot get syscon handle from parent\n"); + return (ENXIO); + } + /* Read and verify the "gpio-ranges" property. */ ncells = OF_getencprop_alloc(ofw_bus_get_node(dev), "gpio-ranges", (void **)&ranges); @@ -295,14 +294,6 @@ a37x0_gpio_attach(device_t dev) /* Check the number of pins in the DTS vs HW capabilities. */ if (sc->sc_npins > sc->sc_max_pins) return (ENXIO); - - err = bus_alloc_resources(dev, a37x0_gpio_res_spec, sc->sc_mem_res); - if (err != 0) { - device_printf(dev, "cannot allocate memory window\n"); - return (ENXIO); - } - sc->sc_bst = rman_get_bustag(sc->sc_mem_res[A37X0_GPIO]); - sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res[A37X0_GPIO]); sc->sc_busdev = gpiobus_attach_bus(dev); if (sc->sc_busdev == NULL) Modified: stable/12/sys/dev/extres/syscon/syscon.c ============================================================================== --- stable/12/sys/dev/extres/syscon/syscon.c Fri Sep 13 21:15:01 2019 (r352308) +++ stable/12/sys/dev/extres/syscon/syscon.c Fri Sep 13 21:20:24 2019 (r352309) @@ -254,3 +254,14 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cn return (0); } #endif + +int +syscon_get_handle_default(device_t dev, struct syscon **syscon) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (ENODEV); + return (SYSCON_GET_HANDLE(parent, syscon)); +} Modified: stable/12/sys/dev/extres/syscon/syscon_if.m ============================================================================== --- stable/12/sys/dev/extres/syscon/syscon_if.m Fri Sep 13 21:15:01 2019 (r352308) +++ stable/12/sys/dev/extres/syscon/syscon_if.m Fri Sep 13 21:20:24 2019 (r352309) @@ -32,6 +32,7 @@ INTERFACE syscon; HEADER { struct syscon; + int syscon_get_handle_default(device_t dev, struct syscon **syscon); } METHOD int init { @@ -62,3 +63,11 @@ METHOD int modify_4 { uint32_t clear_bits; uint32_t set_bits; }; + +/** + * Get syscon handle from parent driver + */ +METHOD int get_handle { + device_t dev; + struct syscon **syscon; +} DEFAULT syscon_get_handle_default; Modified: stable/12/sys/dev/fdt/simple_mfd.c ============================================================================== --- stable/12/sys/dev/fdt/simple_mfd.c Fri Sep 13 21:15:01 2019 (r352308) +++ stable/12/sys/dev/fdt/simple_mfd.c Fri Sep 13 21:20:24 2019 (r352309) @@ -49,14 +49,16 @@ __FBSDID("$FreeBSD$"); device_t simple_mfd_add_device(device_t dev, phandle_t node, u_int order, const char *name, int unit, struct simplebus_devinfo *di); -struct simplebus_devinfo *simple_mfd_setup_dinfo(device_t dev, phandle_t node, struct simplebus_devinfo *di); +struct simplebus_devinfo *simple_mfd_setup_dinfo(device_t dev, phandle_t node, + struct simplebus_devinfo *di); #include "syscon_if.h" #include MALLOC_DECLARE(M_SYSCON); -static uint32_t simple_mfd_syscon_read_4(struct syscon *syscon, bus_size_t offset); +static uint32_t simple_mfd_syscon_read_4(struct syscon *syscon, + bus_size_t offset); static int simple_mfd_syscon_write_4(struct syscon *syscon, bus_size_t offset, uint32_t val); static int simple_mfd_syscon_modify_4(struct syscon *syscon, bus_size_t offset, @@ -125,7 +127,18 @@ simple_mfd_syscon_modify_4(struct syscon *syscon, bus_ SYSCON_UNLOCK(sc); return (0); } +static int +simple_mfd_syscon_get_handle(device_t dev, struct syscon **syscon) +{ + struct simple_mfd_softc *sc; + sc = device_get_softc(dev); + *syscon = sc->syscon; + if (*syscon == NULL) + return (ENODEV); + return (0); +} + static int simple_mfd_probe(device_t dev) { @@ -278,6 +291,8 @@ simple_mfd_add_device(device_t dev, phandle_t node, u_ } static device_method_t simple_mfd_methods[] = { + /* syscon interface */ + DEVMETHOD(syscon_get_handle, simple_mfd_syscon_get_handle), /* Device interface */ DEVMETHOD(device_probe, simple_mfd_probe), DEVMETHOD(device_attach, simple_mfd_attach), From owner-svn-src-all@freebsd.org Fri Sep 13 21:28:09 2019 Return-Path: Delivered-To: svn-src-all@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 9D18FD4249; Fri, 13 Sep 2019 21:28:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VTJT3ClCz48tK; Fri, 13 Sep 2019 21:28:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 346CFD793; Fri, 13 Sep 2019 21:28:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DLS935067525; Fri, 13 Sep 2019 21:28:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DLS9Zp067524; Fri, 13 Sep 2019 21:28:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909132128.x8DLS9Zp067524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 13 Sep 2019 21:28: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: r352310 - stable/12/sys/arm/ti X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/arm/ti X-SVN-Commit-Revision: 352310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 21:28:09 -0000 Author: manu Date: Fri Sep 13 21:28:08 2019 New Revision: 352310 URL: https://svnweb.freebsd.org/changeset/base/352310 Log: MFC r351218: ti: sdhci: Correct voltage caps ti,dual-volt property say that the eMMC support 1.8V and 3.3V not 3.0V Use the correct caps for the mmc stack. Note that the MMCHS_SD_CAPA register can only be written once after bootup so if one is using a u-boot compiled with eMMC support (this is the default) this code is a no-op but just in case someone have u-boot compiled without eMMC support this make eMMC works when the kernel is booted. Modified: stable/12/sys/arm/ti/ti_sdhci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/12/sys/arm/ti/ti_sdhci.c Fri Sep 13 21:20:24 2019 (r352309) +++ stable/12/sys/arm/ti/ti_sdhci.c Fri Sep 13 21:28:08 2019 (r352310) @@ -482,15 +482,14 @@ ti_sdhci_hw_init(device_t dev) * The attach() routine has examined fdt data and set flags in * slot.host.caps to reflect what voltages we can handle. Set those * values in the CAPA register. The manual says that these values can - * only be set once, "before initialization" whatever that means, and - * that they survive a reset. So maybe doing this will be a no-op if - * u-boot has already initialized the hardware. + * only be set once, and that they survive a reset so unless u-boot didn't + * set this register this code is a no-op. */ regval = ti_mmchs_read_4(sc, MMCHS_SD_CAPA); if (sc->slot.host.caps & MMC_OCR_LOW_VOLTAGE) regval |= MMCHS_SD_CAPA_VS18; - if (sc->slot.host.caps & (MMC_OCR_290_300 | MMC_OCR_300_310)) - regval |= MMCHS_SD_CAPA_VS30; + if (sc->slot.host.caps & (MMC_OCR_320_330 | MMC_OCR_330_340)) + regval |= MMCHS_SD_CAPA_VS33; ti_mmchs_write_4(sc, MMCHS_SD_CAPA, regval); /* Set initial host configuration (1-bit, std speed, pwr off). */ @@ -524,17 +523,20 @@ ti_sdhci_attach(device_t dev) } /* - * The hardware can inherently do dual-voltage (1p8v, 3p0v) on the first + * The hardware can inherently do dual-voltage (1p8v, 3p3v) on the first * device, and only 1p8v on other devices unless an external transceiver * is used. The only way we could know about a transceiver is fdt data. * Note that we have to do this before calling ti_sdhci_hw_init() so * that it can set the right values in the CAPA register, which can only * be done once and never reset. */ - sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE; - if (sc->mmchs_clk_id == MMC1_CLK || OF_hasprop(node, "ti,dual-volt")) { - sc->slot.host.caps |= MMC_OCR_290_300 | MMC_OCR_300_310; - } + if (OF_hasprop(node, "ti,dual-volt")) { + sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE | MMC_OCR_320_330 | MMC_OCR_330_340; + } else if (OF_hasprop(node, "no-1-8-v")) { + sc->slot.host.caps |= MMC_OCR_320_330 | MMC_OCR_330_340; + } else + sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE; + /* * Set the offset from the device's memory start to the MMCHS registers. From owner-svn-src-all@freebsd.org Fri Sep 13 22:36:05 2019 Return-Path: Delivered-To: svn-src-all@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 3F71DD5720; Fri, 13 Sep 2019 22:36:05 +0000 (UTC) (envelope-from glebius@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 46VVps0zt8z4Clm; Fri, 13 Sep 2019 22:36:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04CD5E472; Fri, 13 Sep 2019 22:36:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DMa4Xh008664; Fri, 13 Sep 2019 22:36:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DMa41h008663; Fri, 13 Sep 2019 22:36:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909132236.x8DMa41h008663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Sep 2019 22:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352311 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 352311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 22:36:05 -0000 Author: glebius Date: Fri Sep 13 22:36:04 2019 New Revision: 352311 URL: https://svnweb.freebsd.org/changeset/base/352311 Log: Drivers may pass runt packets to filter. This is okay. Reviewed by: gallatin Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Sep 13 21:28:08 2019 (r352310) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Sep 13 22:36:04 2019 (r352311) @@ -1448,7 +1448,10 @@ ipfw_chk(struct ip_fw_args *args) do { \ int x = (_len) + T + EHLEN; \ if (mem) { \ - MPASS(pktlen >= x); \ + if (__predict_false(pktlen < x)) { \ + unlock; \ + goto pullup_failed; \ + } \ p = (char *)args->mem + (_len) + EHLEN; \ } else { \ if (__predict_false((m)->m_len < x)) { \ From owner-svn-src-all@freebsd.org Fri Sep 13 23:03:57 2019 Return-Path: Delivered-To: svn-src-all@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 E7207D5EB4; Fri, 13 Sep 2019 23:03:57 +0000 (UTC) (envelope-from chs@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 46VWR15hb4z4DmF; Fri, 13 Sep 2019 23:03:57 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A6A20E9CE; Fri, 13 Sep 2019 23:03:57 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8DN3v7Q026377; Fri, 13 Sep 2019 23:03:57 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8DN3uw3026373; Fri, 13 Sep 2019 23:03:56 GMT (envelope-from chs@FreeBSD.org) Message-Id: <201909132303.x8DN3uw3026373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Fri, 13 Sep 2019 23:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352312 - in head: lib/geom/nop sys/geom/nop X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: in head: lib/geom/nop sys/geom/nop X-SVN-Commit-Revision: 352312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 23:03:58 -0000 Author: chs Date: Fri Sep 13 23:03:56 2019 New Revision: 352312 URL: https://svnweb.freebsd.org/changeset/base/352312 Log: Add a "count_until_fail" option to gnop, which says to start failing I/O requests after the given number have been allowed though. Approved by: imp (mentor) Reviewed by: rpokala kib 0mp mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21593 Modified: head/lib/geom/nop/geom_nop.c head/lib/geom/nop/gnop.8 head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h Modified: head/lib/geom/nop/geom_nop.c ============================================================================== --- head/lib/geom/nop/geom_nop.c Fri Sep 13 22:36:04 2019 (r352311) +++ head/lib/geom/nop/geom_nop.c Fri Sep 13 23:03:56 2019 (r352312) @@ -43,6 +43,7 @@ uint32_t version = G_NOP_VERSION; struct g_command class_commands[] = { { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { + { 'c', "count_until_fail", "-1", G_TYPE_NUMBER }, { 'd', "delaymsec", "-1", G_TYPE_NUMBER }, { 'e', "error", "-1", G_TYPE_NUMBER }, { 'o', "offset", "0", G_TYPE_NUMBER }, @@ -57,12 +58,14 @@ struct g_command class_commands[] = { { 'z', "physpath", G_NOP_PHYSPATH_PASSTHROUGH, G_TYPE_STRING }, G_OPT_SENTINEL }, - "[-v] [-d delaymsec] [-e error] [-o offset] [-p stripesize] " - "[-P stripeoffset] [-q rdelayprob] [-r rfailprob] [-s size] " - "[-S secsize] [-w wfailprob] [-x wdelayprob] [-z physpath] dev ..." + "[-v] [-c count_until_fail] [-d delaymsec] [-e error] [-o offset] " + "[-p stripesize] [-P stripeoffset] [-q rdelayprob] [-r rfailprob] " + "[-s size] [-S secsize] [-w wfailprob] [-x wdelayprob] " + "[-z physpath] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { + { 'c', "count_until_fail", "-1", G_TYPE_NUMBER }, { 'd', "delaymsec", "-1", G_TYPE_NUMBER }, { 'e', "error", "-1", G_TYPE_NUMBER }, { 'q', "rdelayprob", "-1", G_TYPE_NUMBER }, @@ -71,8 +74,9 @@ struct g_command class_commands[] = { { 'x', "wdelayprob", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-v] [-d delaymsec] [-e error] [-q rdelayprob] [-r rfailprob] " - "[-w wfailprob] [-x wdelayprob] prov ..." + "[-v] [-c count_until_fail] [-d delaymsec] [-e error] " + "[-q rdelayprob] [-r rfailprob] [-w wfailprob] [-x wdelayprob] " + "prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { Modified: head/lib/geom/nop/gnop.8 ============================================================================== --- head/lib/geom/nop/gnop.8 Fri Sep 13 22:36:04 2019 (r352311) +++ head/lib/geom/nop/gnop.8 Fri Sep 13 23:03:56 2019 (r352312) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2019 +.Dd September 13, 2019 .Dt GNOP 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm create .Op Fl v +.Op Fl c Ar count_until_fail .Op Fl d Ar delaymsec .Op Fl e Ar error .Op Fl o Ar offset @@ -50,6 +51,7 @@ .Nm .Cm configure .Op Fl v +.Op Fl c Ar count_until_fail .Op Fl d Ar delaymsec .Op Fl e Ar error .Op Fl q Ar rdelayprob @@ -118,7 +120,10 @@ See .El .Pp Additional options: -.Bl -tag -width ".Fl r Ar rfailprob" +.Bl -tag -width "-c count_until_fail" +.It Fl c Ar count_until_fail +Specifies the number of I/O requests to allow before setting the read and write +failure probabilities to 100%. .It Fl d Ar delaymsec Specifies the delay of the requests in milliseconds. Note that requests will be delayed before they are sent to the backing device. Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Fri Sep 13 22:36:04 2019 (r352311) +++ head/sys/geom/nop/g_nop.c Fri Sep 13 23:03:56 2019 (r352312) @@ -195,6 +195,10 @@ g_nop_start(struct bio *bp) G_NOP_LOGREQ(bp, "Request received."); mtx_lock(&sc->sc_lock); + if (sc->sc_count_until_fail != 0 && --sc->sc_count_until_fail == 0) { + sc->sc_rfailprob = 100; + sc->sc_wfailprob = 100; + } switch (bp->bio_cmd) { case BIO_READ: sc->sc_reads++; @@ -308,9 +312,10 @@ g_nop_access(struct g_provider *pp, int dr, int dw, in static int g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, - int ioerror, u_int rfailprob, u_int wfailprob, u_int delaymsec, u_int rdelayprob, - u_int wdelayprob, off_t offset, off_t size, u_int secsize, off_t stripesize, - off_t stripeoffset, const char *physpath) + int ioerror, u_int count_until_fail, u_int rfailprob, u_int wfailprob, + u_int delaymsec, u_int rdelayprob, u_int wdelayprob, off_t offset, + off_t size, u_int secsize, off_t stripesize, off_t stripeoffset, + const char *physpath) { struct g_nop_softc *sc; struct g_geom *gp; @@ -386,6 +391,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, } else sc->sc_physpath = NULL; sc->sc_error = ioerror; + sc->sc_count_until_fail = count_until_fail; sc->sc_rfailprob = rfailprob; sc->sc_wfailprob = wfailprob; sc->sc_delaymsec = delaymsec; @@ -491,8 +497,9 @@ static void g_nop_ctl_create(struct gctl_req *req, struct g_class *mp) { struct g_provider *pp; - intmax_t *error, *rfailprob, *wfailprob, *offset, *secsize, *size, - *stripesize, *stripeoffset, *delaymsec, *rdelayprob, *wdelayprob; + intmax_t *error, *rfailprob, *wfailprob, *count_until_fail, *offset, + *secsize, *size, *stripesize, *stripeoffset, *delaymsec, + *rdelayprob, *wdelayprob; const char *name, *physpath; char param[16]; int i, *nargs; @@ -558,6 +565,16 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class gctl_error(req, "Invalid '%s' argument", "wdelayprob"); return; } + count_until_fail = gctl_get_paraml(req, "count_until_fail", + sizeof(*count_until_fail)); + if (count_until_fail == NULL) { + gctl_error(req, "No '%s' argument", "count_until_fail"); + return; + } + if (*count_until_fail < -1) { + gctl_error(req, "Invalid '%s' argument", "count_until_fail"); + return; + } offset = gctl_get_paraml(req, "offset", sizeof(*offset)); if (offset == NULL) { gctl_error(req, "No '%s' argument", "offset"); @@ -622,6 +639,7 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class } if (g_nop_create(req, mp, pp, *error == -1 ? EIO : (int)*error, + *count_until_fail == -1 ? 0 : (u_int)*count_until_fail, *rfailprob == -1 ? 0 : (u_int)*rfailprob, *wfailprob == -1 ? 0 : (u_int)*wfailprob, *delaymsec == -1 ? 1 : (u_int)*delaymsec, @@ -640,7 +658,8 @@ g_nop_ctl_configure(struct gctl_req *req, struct g_cla { struct g_nop_softc *sc; struct g_provider *pp; - intmax_t *delaymsec, *error, *rdelayprob, *rfailprob, *wdelayprob, *wfailprob; + intmax_t *delaymsec, *error, *rdelayprob, *rfailprob, *wdelayprob, + *wfailprob, *count_until_fail; const char *name; char param[16]; int i, *nargs; @@ -661,6 +680,12 @@ g_nop_ctl_configure(struct gctl_req *req, struct g_cla gctl_error(req, "No '%s' argument", "error"); return; } + count_until_fail = gctl_get_paraml(req, "count_until_fail", + sizeof(*count_until_fail)); + if (count_until_fail == NULL) { + gctl_error(req, "No '%s' argument", "count_until_fail"); + return; + } rfailprob = gctl_get_paraml(req, "rfailprob", sizeof(*rfailprob)); if (rfailprob == NULL) { gctl_error(req, "No '%s' argument", "rfailprob"); @@ -736,6 +761,8 @@ g_nop_ctl_configure(struct gctl_req *req, struct g_cla sc->sc_wdelayprob = (u_int)*wdelayprob; if (*delaymsec != -1) sc->sc_delaymsec = (u_int)*delaymsec; + if (*count_until_fail != -1) + sc->sc_count_until_fail = (u_int)*count_until_fail; } } @@ -904,6 +931,8 @@ g_nop_dumpconf(struct sbuf *sb, const char *indent, st sbuf_printf(sb, "%s%u\n", indent, sc->sc_wdelayprob); sbuf_printf(sb, "%s%d\n", indent, sc->sc_delaymsec); + sbuf_printf(sb, "%s%u\n", indent, + sc->sc_count_until_fail); sbuf_printf(sb, "%s%d\n", indent, sc->sc_error); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_reads); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_writes); Modified: head/sys/geom/nop/g_nop.h ============================================================================== --- head/sys/geom/nop/g_nop.h Fri Sep 13 22:36:04 2019 (r352311) +++ head/sys/geom/nop/g_nop.h Fri Sep 13 23:03:56 2019 (r352312) @@ -62,6 +62,7 @@ struct g_nop_softc { u_int sc_delaymsec; u_int sc_rdelayprob; u_int sc_wdelayprob; + u_int sc_count_until_fail; uintmax_t sc_reads; uintmax_t sc_writes; uintmax_t sc_deletes; From owner-svn-src-all@freebsd.org Sat Sep 14 03:30:36 2019 Return-Path: Delivered-To: svn-src-all@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 258E9DCE22; Sat, 14 Sep 2019 03:30:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VdLh0Bgsz4QwS; Sat, 14 Sep 2019 03:30:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF23019A67; Sat, 14 Sep 2019 03:30:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8E3UZcd081444; Sat, 14 Sep 2019 03:30:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8E3UY7q081438; Sat, 14 Sep 2019 03:30:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909140330.x8E3UY7q081438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 14 Sep 2019 03:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352313 - in head/sys: conf modules modules/opal_nvram powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf modules modules/opal_nvram powerpc/powernv X-SVN-Commit-Revision: 352313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 03:30:36 -0000 Author: jhibbits Date: Sat Sep 14 03:30:34 2019 New Revision: 352313 URL: https://svnweb.freebsd.org/changeset/base/352313 Log: powerpc64/powernv: Add opal NVRAM driver for PowerNV systems Add a very basic NVRAM driver for OPAL which can be used by the IBM powerpc-utils nvram utility, not to be confused with the base nvram utility, which only operates on powermac_nvram. The IBM utility handles all partitions itself, treating the nvram device as a plain store. An alternative would be to manage partitions in the kernel, and augment the base nvram utility to deal with different backing stores, but that complicates the driver significantly. Instead, present the same interface IBM's utlity expects, and we get the usage for free. Tested by: bdragon Added: head/sys/modules/opal_nvram/ head/sys/modules/opal_nvram/Makefile (contents, props changed) head/sys/powerpc/powernv/opal_nvram.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/modules/Makefile head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_hmi.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Sep 13 23:03:56 2019 (r352312) +++ head/sys/conf/files.powerpc Sat Sep 14 03:30:34 2019 (r352313) @@ -192,6 +192,7 @@ powerpc/powernv/opal_flash.c optional powernv opalflas powerpc/powernv/opal_hmi.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv +powerpc/powernv/opal_nvram.c optional powernv nvram powerpc/powernv/opal_pci.c optional powernv pci powerpc/powernv/opal_sensor.c optional powernv powerpc/powernv/opalcall.S optional powernv Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Sep 13 23:03:56 2019 (r352312) +++ head/sys/modules/Makefile Sat Sep 14 03:30:34 2019 (r352313) @@ -762,10 +762,11 @@ _wi= wi .if ${MACHINE_ARCH} == "powerpc64" _ipmi= ipmi +_nvram= opal_nvram .endif .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" # Don't build powermac_nvram for powerpcspe, it's never supported. -_nvram= powermac_nvram +_nvram+= powermac_nvram .endif .if ${MACHINE_CPUARCH} == "sparc64" Added: head/sys/modules/opal_nvram/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/opal_nvram/Makefile Sat Sep 14 03:30:34 2019 (r352313) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/powerpc/powernv + +KMOD= opal_nvram +SRCS= opal_nvram.c +SRCS+= bus_if.h device_if.h +SRCS+= ofw_bus_if.h + +.include Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Fri Sep 13 23:03:56 2019 (r352312) +++ head/sys/powerpc/powernv/opal.h Sat Sep 14 03:30:34 2019 (r352313) @@ -45,6 +45,8 @@ int opal_call(uint64_t token, ...); #define OPAL_RTC_WRITE 4 #define OPAL_CEC_POWER_DOWN 5 #define OPAL_CEC_REBOOT 6 +#define OPAL_READ_NVRAM 7 +#define OPAL_WRITE_NVRAM 8 #define OPAL_HANDLE_INTERRUPT 9 #define OPAL_POLL_EVENTS 10 #define OPAL_PCI_CONFIG_READ_BYTE 13 Modified: head/sys/powerpc/powernv/opal_hmi.c ============================================================================== --- head/sys/powerpc/powernv/opal_hmi.c Fri Sep 13 23:03:56 2019 (r352312) +++ head/sys/powerpc/powernv/opal_hmi.c Sat Sep 14 03:30:34 2019 (r352313) @@ -82,16 +82,34 @@ opal_hmi_event_handler(void *unused, struct opal_msg * } static int +opal_hmi_handler2(struct trapframe *frame) +{ + uint64_t flags; + int err; + + flags = 0; + err = opal_call(OPAL_HANDLE_HMI2, vtophys(&flags)); + + if (flags & OPAL_HMI_FLAGS_TOD_TB_FAIL) + panic("TOD/TB recovery failure"); + + if (err == OPAL_SUCCESS) + return (0); + + printf("HMI handler failed! OPAL error code: %d\n", err); + + return (-1); +} + +static int opal_hmi_handler(struct trapframe *frame) { int err; err = opal_call(OPAL_HANDLE_HMI); - if (err == OPAL_SUCCESS) { - mtspr(SPR_HMER, 0); + if (err == OPAL_SUCCESS) return (0); - } printf("HMI handler failed! OPAL error code: %d\n", err); @@ -105,7 +123,9 @@ opal_setup_hmi(void *data) if (opal_check() != 0) return; - if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) + if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI2) == OPAL_TOKEN_PRESENT) + hmi_handler = opal_hmi_handler2; + else if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) hmi_handler = opal_hmi_handler; else { printf("Warning: No OPAL HMI handler found.\n"); Added: head/sys/powerpc/powernv/opal_nvram.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_nvram.c Sat Sep 14 03:30:34 2019 (r352313) @@ -0,0 +1,276 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Justin Hibbits + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "opal.h" + +#include + +#include +#include + +#define NVRAM_BUFSIZE (65536) /* 64k blocks */ + +struct opal_nvram_softc { + device_t sc_dev; + uint32_t sc_size; + uint8_t *sc_buf; + vm_paddr_t sc_buf_phys; + + struct cdev *sc_cdev; + int sc_isopen; +}; + +/* + * Device interface. + */ +static int opal_nvram_probe(device_t); +static int opal_nvram_attach(device_t); +static int opal_nvram_detach(device_t); + +/* + * Driver methods. + */ +static device_method_t opal_nvram_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opal_nvram_probe), + DEVMETHOD(device_attach, opal_nvram_attach), + DEVMETHOD(device_detach, opal_nvram_detach), + + { 0, 0 } +}; + +static driver_t opal_nvram_driver = { + "opal_nvram", + opal_nvram_methods, + sizeof(struct opal_nvram_softc) +}; + +static devclass_t opal_nvram_devclass; + +DRIVER_MODULE(opal_nvram, opal, opal_nvram_driver, opal_nvram_devclass, 0, 0); + +/* + * Cdev methods. + */ + +static d_open_t opal_nvram_open; +static d_close_t opal_nvram_close; +static d_read_t opal_nvram_read; +static d_write_t opal_nvram_write; +static d_ioctl_t opal_nvram_ioctl; + +static struct cdevsw opal_nvram_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, + .d_open = opal_nvram_open, + .d_close = opal_nvram_close, + .d_read = opal_nvram_read, + .d_write = opal_nvram_write, + .d_ioctl = opal_nvram_ioctl, + .d_name = "nvram", +}; + +static int +opal_nvram_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ibm,opal-nvram")) + return (ENXIO); + + device_set_desc(dev, "OPAL NVRAM"); + return (BUS_PROBE_DEFAULT); +} + +static int +opal_nvram_attach(device_t dev) +{ + struct opal_nvram_softc *sc; + phandle_t node; + int err; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + + sc->sc_dev = dev; + + err = OF_getencprop(node, "#bytes", &sc->sc_size, + sizeof(sc->sc_size)); + + if (err < 0) + return (ENXIO); + + sc->sc_buf = contigmalloc(NVRAM_BUFSIZE, M_DEVBUF, M_WAITOK, + 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + if (sc->sc_buf == NULL) { + device_printf(dev, "No memory for buffer.\n"); + return (ENXIO); + } + sc->sc_buf_phys = pmap_kextract((vm_offset_t)sc->sc_buf); + sc->sc_cdev = make_dev(&opal_nvram_cdevsw, 0, 0, 0, 0600, + "nvram"); + sc->sc_cdev->si_drv1 = sc; + + return (0); +} + +static int +opal_nvram_detach(device_t dev) +{ + struct opal_nvram_softc *sc; + + sc = device_get_softc(dev); + + if (sc->sc_cdev != NULL) + destroy_dev(sc->sc_cdev); + if (sc->sc_buf != NULL) + contigfree(sc->sc_buf, NVRAM_BUFSIZE, M_DEVBUF); + + return (0); +} + +static int +opal_nvram_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct opal_nvram_softc *sc = dev->si_drv1; + + if (sc->sc_isopen) + return EBUSY; + sc->sc_isopen = 1; + return (0); +} + +static int +opal_nvram_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + struct opal_nvram_softc *sc = dev->si_drv1; + + sc->sc_isopen = 0; + return (0); +} + +static int +opal_nvram_read(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct opal_nvram_softc *sc = dev->si_drv1; + int rv, amnt; + + rv = 0; + while (uio->uio_resid > 0) { + amnt = MIN(uio->uio_resid, sc->sc_size - uio->uio_offset); + amnt = MIN(amnt, NVRAM_BUFSIZE); + if (amnt == 0) + break; + + rv = opal_call(OPAL_READ_NVRAM, sc->sc_buf_phys, + amnt, uio->uio_offset); + if (rv != OPAL_SUCCESS) { + switch (rv) { + case OPAL_HARDWARE: + rv = EIO; + break; + case OPAL_PARAMETER: + rv = EINVAL; + break; + } + break; + } + rv = uiomove(sc->sc_buf, amnt, uio); + if (rv != 0) + break; + } + return (rv); +} + +static int +opal_nvram_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + off_t offset; + int rv, amnt; + struct opal_nvram_softc *sc = dev->si_drv1; + + rv = 0; + while (uio->uio_resid > 0) { + amnt = MIN(uio->uio_resid, sc->sc_size - uio->uio_offset); + amnt = MIN(amnt, NVRAM_BUFSIZE); + if (amnt == 0) { + rv = ENOSPC; + break; + } + offset = uio->uio_offset; + rv = uiomove(sc->sc_buf, amnt, uio); + if (rv != 0) + break; + rv = opal_call(OPAL_WRITE_NVRAM, sc->sc_buf_phys, amnt, + offset); + if (rv != OPAL_SUCCESS) { + switch (rv) { + case OPAL_HARDWARE: + rv = EIO; + break; + case OPAL_PARAMETER: + rv = EINVAL; + break; + } + break; + } + } + return (rv); +} + +static int +opal_nvram_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct opal_nvram_softc *sc = dev->si_drv1; + + switch (cmd) { + case DIOCGMEDIASIZE: + *(off_t *)data = sc->sc_size; + return (0); + } + return (EINVAL); +} From owner-svn-src-all@freebsd.org Sat Sep 14 03:38:19 2019 Return-Path: Delivered-To: svn-src-all@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 C2EF5DD0C3; Sat, 14 Sep 2019 03:38:19 +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 46VdWb4XP5z4RJy; Sat, 14 Sep 2019 03:38:19 +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 800EA19C36; Sat, 14 Sep 2019 03:38: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 x8E3cJUs087260; Sat, 14 Sep 2019 03:38:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8E3cJpc087258; Sat, 14 Sep 2019 03:38:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909140338.x8E3cJpc087258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Sep 2019 03:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352314 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 352314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 03:38:19 -0000 Author: kevans Date: Sat Sep 14 03:38:18 2019 New Revision: 352314 URL: https://svnweb.freebsd.org/changeset/base/352314 Log: lualoader: Add reload-conf loader command This command will trigger a reload of the configuration from disk. This is useful if you've changed currdev from recovery media to local disk as much as I have over the past ~2 hours and are tired of the extra keystrokes. This is really just a glorified shortcut, but reload-conf is likely easier to remember for other people and does save some keystrokes when reloading the configuration. It is also resilient to the underlying config method changing interface, but this is unlikely to happen. MFC after: 1 week Modified: head/stand/lua/cli.lua head/stand/lua/cli.lua.8 Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Sat Sep 14 03:30:34 2019 (r352313) +++ head/stand/lua/cli.lua Sat Sep 14 03:38:18 2019 (r352314) @@ -125,6 +125,10 @@ cli['boot-conf'] = function(...) core.autoboot(argstr) end +cli['reload-conf'] = function(...) + config.reload() +end + -- Used for splitting cli varargs into cmd_name and the rest of argv function cli.arguments(...) local argv = {...} Modified: head/stand/lua/cli.lua.8 ============================================================================== --- head/stand/lua/cli.lua.8 Sat Sep 14 03:30:34 2019 (r352313) +++ head/stand/lua/cli.lua.8 Sat Sep 14 03:38:18 2019 (r352314) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2018 +.Dd September 13, 2019 .Dt CLI.LUA 8 .Os .Sh NAME @@ -82,14 +82,27 @@ As of present, the module by default provides commands for .Ic autoboot , .Ic boot , +.Ic boot-conf , and -.Ic boot-conf. -In all three cases, the +.Ic reload-conf . +.Pp +For +.Ic autoboot , +.Ic boot , +and +.Ic boot-conf , +the .Xr core.lua 8 module will load all ELF modules as-needed before executing the equivalent built-in loader commands. All non-kernel arguments to these commands are passed in the same order to the loader command. +.Pp +The +.Ic reload-conf +command will reload the configuration from disk. +This is useful if you have manually changed currdev and would like to easily +reload the configuration from the new device. .Ss Exported Functions The following functions are exported from .Nm : From owner-svn-src-all@freebsd.org Sat Sep 14 04:05:50 2019 Return-Path: Delivered-To: svn-src-all@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 99ABFDD96D; Sat, 14 Sep 2019 04:05:50 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Vf7K518Qz4SLJ; Sat, 14 Sep 2019 04:05:49 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-f177.google.com with SMTP id h2so22415812ljk.1; Fri, 13 Sep 2019 21:05:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gHC9NWXihSFgQOzD0HVM7pSND1ObYCGr3nuq9rSyWr8=; b=KIlPKOpxw2zzo0LI9AkOJZhQmkT6skfxFIJXBg0I263gp0ZHjuwcw/yZGVrTEOUZEu n0sllpkUFjbpKDDeegmquzPuZ5xWn0jrnSK2bljEqNGoJscjTGzGHJldTvggg24OO+1n mcU2mZ4oQnyhG008JhJWc8F++fqCzZbDe/v26DVCcrKYBojA7PGAyg0P7SNd5QZrubIS 1AFeh1lNdu64dnTsNfZVCKZRBfbzpH3CShkEsL+l6bWWMG45DIRvN94RcT+Ph6EP3tCn +0K0n3nU3eQmEwtrzxpiXsTixMthrMpY+bKTQwCYZGYTUGuhVT3icJvX5qSV5fyxX+2P 4hoA== X-Gm-Message-State: APjAAAVDiCX2f+aWNc8kugtOKSb3A9fZnevh96P81zoaUQ25NzanuJV9 Pd8Hmm2McH3mC/flZzpQ9HKRnR1fkBJD1GXWK8q+tg== X-Google-Smtp-Source: APXvYqxAh1fE1Yd5a/EOSKf2FmYB6y8N/Z781hrAkBDX4nZYcs3pP4JhpdTwDvJPDGplMypumgo4WSGXpj43verB5Xw= X-Received: by 2002:a2e:860c:: with SMTP id a12mr31333076lji.116.1568433947056; Fri, 13 Sep 2019 21:05:47 -0700 (PDT) MIME-Version: 1.0 References: <201909140330.x8E3UY7q081438@repo.freebsd.org> In-Reply-To: <201909140330.x8E3UY7q081438@repo.freebsd.org> From: Justin Hibbits Date: Fri, 13 Sep 2019 23:05:37 -0500 Message-ID: Subject: Re: svn commit: r352313 - in head/sys: conf modules modules/opal_nvram powerpc/powernv To: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46Vf7K518Qz4SLJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-3.22 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.22)[ip: (-0.49), ipnet: 209.85.128.0/17(-3.32), asn: 15169(-2.24), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[177.208.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[177.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 04:05:50 -0000 On Fri, Sep 13, 2019, 22:30 Justin Hibbits wrote: > Author: jhibbits > Date: Sat Sep 14 03:30:34 2019 > New Revision: 352313 > URL: https://svnweb.freebsd.org/changeset/base/352313 > > Log: > powerpc64/powernv: Add opal NVRAM driver for PowerNV systems > > Add a very basic NVRAM driver for OPAL which can be used by the IBM > powerpc-utils nvram utility, not to be confused with the base nvram > utility, > which only operates on powermac_nvram. > > The IBM utility handles all partitions itself, treating the nvram device > as > a plain store. > > An alternative would be to manage partitions in the kernel, and augment > the > base nvram utility to deal with different backing stores, but that > complicates the driver significantly. Instead, present the same > interface > IBM's utlity expects, and we get the usage for free. > > Tested by: bdragon > Differential revision: https://reviews.freebsd.org/D21631 > From owner-svn-src-all@freebsd.org Sat Sep 14 04:11:05 2019 Return-Path: Delivered-To: svn-src-all@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 9DCAEDDB94; Sat, 14 Sep 2019 04:11:05 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VfFN1YCwz4SZ9; Sat, 14 Sep 2019 04:11:03 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x8E4Alv8073700 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 14 Sep 2019 14:10:53 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x8E4Afha009643 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Sep 2019 14:10:41 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x8E4AfIo009642; Sat, 14 Sep 2019 14:10:41 +1000 (AEST) (envelope-from peter) Date: Sat, 14 Sep 2019 14:10:41 +1000 From: Peter Jeremy To: Baptiste Daroussin Cc: Charlie Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline Message-ID: <20190914041041.GA97181@server.rulingia.com> References: <201909130650.x8D6o2fb037276@repo.freebsd.org> <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46VfFN1YCwz4SZ9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-4.07 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; IP_SCORE(-1.17)[ipnet: 2001:19f0:5800::/38(-4.94), asn: 20473(-0.88), country: US(-0.05)]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[rulingia.com]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 04:11:05 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Sep-13 16:33:15 -0400, Charlie Li wrote: >Baptiste Daroussin wrote: >> Author: bapt >> Date: Fri Sep 13 06:50:02 2019 >> New Revision: 352275 >> URL: https://svnweb.freebsd.org/changeset/base/352275 >>=20 >> Log: >> Update libedit to a snapshot from 2019-09-10 >> Reviewed by: Yuichiro Naito >> MFC after: 3 weeks >> Differential Revision: https://reviews.freebsd.org/D21584 >>=20 >I posted in phab but repeating here, this breaks the build on (at least) >aarch64: It breaks the build on arm and arm64 only. wint_t is int on all platforms: sys/sys/_types.h: typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ but wchar_t varies between unsigned and signed: $ grep '__wchar_t' sys/*/include/_types.h=20 sys/arm/include/_types.h:typedef unsigned int ___wchar_t; sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; sys/mips/include/_types.h:typedef int ___wchar_t; sys/powerpc/include/_types.h:typedef int ___wchar_t; sys/riscv/include/_types.h:typedef int ___wchar_t; sys/sparc64/include/_types.h:typedef int ___wchar_t; sys/x86/include/_types.h:typedef int ___wchar_t; Looking back into history, it looks like the "unsigned" is part of the ARM EABI. --=20 Peter Jeremy --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl18aDxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzR7QQ//bWl+20ZdrNeDeUay1ykf8r84EmNckAIy4TEsZ8gmv6I3QuUDMwCOr8fC 132d4sFAxysXGpIln713DzZa5VCA42J2ahVjsj8LvCp/76CCsLXtcABCC5RRVoUC +akjl+ya35HvtWJyhXD3f5Vn94ULh4vqWjceb6Uqq22/ZiEJ1FA9tLAE7J/luqyK qW1o5Eomw4HJ3GkUIkpCXJq2ECTByEq3AeLo79xox75L5pwEGbFHuy00WS1KfzlC iwEB7Zo72k6ts6VQeUmnHdsTCTpqx3zwHL8oxQ11kLWZf3qn/eZdvW6ZU/BXoYCu VFOfPzmoV0/51VCukNwETNiqI9o9f7i13UZmH8CEN109UTfLPlo/OYKWO3qmnzE4 CdwEB3HOeqnmUjws/JyVKcUNORh3Dn3mvKxRcKyJkiv7LvQuksPxBD+gXjj6F26u HTsg3tgXdAjB9AlIhSgTslMDc+W7AMPi5DyGQyB+WwTDe3h3MDmuZ6ubkT2d0a4S HGHNq4YwI40OX3DvcYdx/O8fvWRrAJUvpLLqdieUK2Ajb5PTHA1aWarzfkMGkqpM i18o0DfsUgYxTCSb2Y6lG8bEV0LTf78Is8G74AH8G6bsuQVCcseE6otXqyTXVKS2 qyE6FFeSClXsamDODLdJgRHi3jxIMWD/wTdDqqrTg2d/6lCykjA= =k6ZD -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-all@freebsd.org Sat Sep 14 04:25:38 2019 Return-Path: Delivered-To: svn-src-all@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 078DCDE28B for ; Sat, 14 Sep 2019 04:25:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VfZ91nLvz4Tbf for ; Sat, 14 Sep 2019 04:25:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id x4so4761295qtq.8 for ; Fri, 13 Sep 2019 21:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dzlgQ2TTJqzIl4I/hvGx7yZhX/pLQbPRHkztsVs4NPI=; b=zwnlNGF86UXyY8j5pXlRnt+o75KwaovcNiYRBbiJvmgA2Zh18M7ZS0v5M6VhG77Ooz eFTQRh4Q9/rFEFKJPGrC/UEzI19ibREA3hexgHUXe1r14DT0TTi+mknsd9MeH4fhdkH4 fscBnshMriOyDN015s4Uz/T5XmqIr0JT1dhfNGTDQoLy0JCx3t58LVAl5zotvWacW0b5 TnqHmR7sFD95jWDU4Ld6HU1jfJ4RvGmrhWXwjTfeHMgqjvmiXlD9BEtbw6QQrTdRO+Tf J+58GOGtCtuljIGWyeHfGMt2i53U+BsOMh8AM2hzNIwjT/MEpINcbN9tric6BJeQFzuM b8eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dzlgQ2TTJqzIl4I/hvGx7yZhX/pLQbPRHkztsVs4NPI=; b=ITK9ZdJi64ID5bUw7/V2nfl4zVRxmDebAD9lK8o16g+zewJoMvgx1cdImdzyYGtrBV SVuc4QLI0tlfUpszBhgkQ7xfWEhiVvIszxSc4mQF5iqJiadMoF28glFYYJ3X6JWKl5x2 FzQjwY3FvjoI2gJFHl7y5nSrlkLVw4yFxH15pmgjjrrH1M3wpqrF1otDd4VP7Jayh+6k RR2imKPl7u9RUy4hUulP0znrVFou1oUrp47HSc0sqy2UpWEZQ7Ik575usIQvEZ4qH6HW NuUYyIsleKeAkHjwsDZGUQPkI5FAKoZh7y1RLHitO7UONILzLZ79uv8ZdvFR23wrDLfa o1NQ== X-Gm-Message-State: APjAAAUGP0PDftztG9Np8DPwjCp3FGe/Un4r4Gco9CKV/D6DCmdU48EI KItrWnb7+czaFq9E37prMLkAXl+eMexnl2Az6aem1Q== X-Google-Smtp-Source: APXvYqxw3cJupsv8yQaG1nndLr6ta2gkv7RiJAmxpndjF1ygUc5iD2Z9cZLpnSjCNklvbd1fYcyJrf4Yll+BypbXHSw= X-Received: by 2002:ac8:1208:: with SMTP id x8mr6112428qti.32.1568435135586; Fri, 13 Sep 2019 21:25:35 -0700 (PDT) MIME-Version: 1.0 References: <201909130650.x8D6o2fb037276@repo.freebsd.org> <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> <20190914041041.GA97181@server.rulingia.com> In-Reply-To: <20190914041041.GA97181@server.rulingia.com> From: Warner Losh Date: Fri, 13 Sep 2019 22:25:23 -0600 Message-ID: Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline To: Peter Jeremy Cc: Baptiste Daroussin , Charlie Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46VfZ91nLvz4Tbf X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=zwnlNGF8; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82a) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[freebsd]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[a.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.89)[ip: (-9.43), ipnet: 2607:f8b0::/32(-2.70), asn: 15169(-2.24), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 04:25:38 -0000 On Fri, Sep 13, 2019, 10:11 PM Peter Jeremy wrote: > On 2019-Sep-13 16:33:15 -0400, Charlie Li wrote: > >Baptiste Daroussin wrote: > >> Author: bapt > >> Date: Fri Sep 13 06:50:02 2019 > >> New Revision: 352275 > >> URL: https://svnweb.freebsd.org/changeset/base/352275 > >> > >> Log: > >> Update libedit to a snapshot from 2019-09-10 > >> Reviewed by: Yuichiro Naito > >> MFC after: 3 weeks > >> Differential Revision: https://reviews.freebsd.org/D21584 > >> > >I posted in phab but repeating here, this breaks the build on (at least) > >aarch64: > > It breaks the build on arm and arm64 only. > > wint_t is int on all platforms: > sys/sys/_types.h: > typedef int __ct_rune_t; /* arg type for ctype funcs */ > typedef __ct_rune_t __wint_t; /* wint_t (see above) */ > > but wchar_t varies between unsigned and signed: > $ grep '__wchar_t' sys/*/include/_types.h > sys/arm/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; > sys/mips/include/_types.h:typedef int ___wchar_t; > sys/powerpc/include/_types.h:typedef int ___wchar_t; > sys/riscv/include/_types.h:typedef int ___wchar_t; > sys/sparc64/include/_types.h:typedef int ___wchar_t; > sys/x86/include/_types.h:typedef int ___wchar_t; > > Looking back into history, it looks like the "unsigned" is part > of the ARM EABI. > We should confirm that. It is definitely part of the OABI stuff, but EABI was supposed to fix differences like this... Warner > -- > Peter Jeremy > From owner-svn-src-all@freebsd.org Sat Sep 14 08:15:17 2019 Return-Path: Delivered-To: svn-src-all@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 9A878ECC2B; Sat, 14 Sep 2019 08:15:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Vlg93WjWz4gCJ; Sat, 14 Sep 2019 08:15:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2801CF1E; Sat, 14 Sep 2019 08:15:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8E8FH3U051761; Sat, 14 Sep 2019 08:15:17 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8E8FHOc051760; Sat, 14 Sep 2019 08:15:17 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909140815.x8E8FHOc051760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 14 Sep 2019 08:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352315 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 352315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 08:15:17 -0000 Author: lwhsu Date: Sat Sep 14 08:15:16 2019 New Revision: 352315 URL: https://svnweb.freebsd.org/changeset/base/352315 Log: Improve the description of big5(5) - Fix the statement that big5 is a de facto standard of Traditional Chinese text [1] - Add a BUGS section describes the problem of big5 and suggests use utf8 PR: 189095 Submitted by: Brennan Vincent [1] Reviewed by: Ting-Wei Lan MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21622 Modified: head/lib/libc/locale/big5.5 Modified: head/lib/libc/locale/big5.5 ============================================================================== --- head/lib/libc/locale/big5.5 Sat Sep 14 03:38:18 2019 (r352314) +++ head/lib/libc/locale/big5.5 Sat Sep 14 08:15:16 2019 (r352315) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2003 +.Dd September 12, 2019 .Dt BIG5 5 .Os .Sh NAME @@ -37,7 +37,7 @@ encoding for Traditional Chinese text .Qq BIG5 .Sh DESCRIPTION .Dq Big Five -is the de facto standard for encoding Traditional Chinese text. +is a standard for encoding Traditional Chinese text. Each character is represented by either one or two bytes. Characters from the .Tn ASCII @@ -49,3 +49,10 @@ the first in the range 0xA1 - 0xFE, the second in the .Xr euc 5 , .Xr gb18030 5 , .Xr utf8 5 +.Sh BUGS +The range of the second byte overlaps some ASCII characters, including +0x5C (`\\') and 0x7C (`|') which may cause problems in program execution or +display. +Big5 is considered a legacy standard and only preserved for backward +compatibility reason. +New documents and systems are suggested using UTF-8 directly. From owner-svn-src-all@freebsd.org Sat Sep 14 10:36:31 2019 Return-Path: Delivered-To: svn-src-all@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 C5569F017A; Sat, 14 Sep 2019 10:36:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Vpp74qlGz3Jcv; Sat, 14 Sep 2019 10:36:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 3EE5C15E0D; Sat, 14 Sep 2019 10:36:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::19b1:7fa4:cdc6:3be2] (unknown [IPv6:2001:470:7a58:0:19b1:7fa4:cdc6:3be2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 468EC670C8; Sat, 14 Sep 2019 12:36:30 +0200 (CEST) From: Dimitry Andric Message-Id: <2D5BFAF9-7A03-4A2C-B406-19AA8BC8BF5D@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_4B83A316-21D1-46A8-ACB1-444D07C617CC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline Date: Sat, 14 Sep 2019 12:36:24 +0200 In-Reply-To: Cc: Peter Jeremy , Baptiste Daroussin , Charlie Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201909130650.x8D6o2fb037276@repo.freebsd.org> <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> <20190914041041.GA97181@server.rulingia.com> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 10:36:31 -0000 --Apple-Mail=_4B83A316-21D1-46A8-ACB1-444D07C617CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 14 Sep 2019, at 06:25, Warner Losh wrote: >=20 > On Fri, Sep 13, 2019, 10:11 PM Peter Jeremy = wrote: > On 2019-Sep-13 16:33:15 -0400, Charlie Li = wrote: > >Baptiste Daroussin wrote: > >> Author: bapt > >> Date: Fri Sep 13 06:50:02 2019 > >> New Revision: 352275 > >> URL: https://svnweb.freebsd.org/changeset/base/352275 > >> > >> Log: > >> Update libedit to a snapshot from 2019-09-10 > >> Reviewed by: Yuichiro Naito > >> MFC after: 3 weeks > >> Differential Revision: https://reviews.freebsd.org/D21584 > >> > >I posted in phab but repeating here, this breaks the build on (at = least) > >aarch64: >=20 > It breaks the build on arm and arm64 only. >=20 > wint_t is int on all platforms: > sys/sys/_types.h: > typedef int __ct_rune_t; /* arg type for ctype funcs */ > typedef __ct_rune_t __wint_t; /* wint_t (see above) */ >=20 > but wchar_t varies between unsigned and signed: > $ grep '__wchar_t' sys/*/include/_types.h > sys/arm/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; > sys/mips/include/_types.h:typedef int ___wchar_t; > sys/powerpc/include/_types.h:typedef int ___wchar_t; > sys/riscv/include/_types.h:typedef int ___wchar_t; > sys/sparc64/include/_types.h:typedef int ___wchar_t; > sys/x86/include/_types.h:typedef int ___wchar_t; >=20 > Looking back into history, it looks like the "unsigned" is part > of the ARM EABI. >=20 > We should confirm that. It is definitely part of the OABI stuff, but = EABI was supposed to fix differences like this... As far as I know, arm has always been the odd one out, but even then, you should assume anything about the signedness of char. :) In any case, I have put up a fix for review here, which sidesteps that issue: https://reviews.freebsd.org/D21657 -Dimitry --Apple-Mail=_4B83A316-21D1-46A8-ACB1-444D07C617CC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXXzCqAAKCRCwXqMKLiCW ozx9AJ444XH15u1oO1QhjtwQJ3iBDNTdVgCg8Lp0HLCGxH7ZUaGKrFaMfRFJusU= =ix0J -----END PGP SIGNATURE----- --Apple-Mail=_4B83A316-21D1-46A8-ACB1-444D07C617CC-- From owner-svn-src-all@freebsd.org Sat Sep 14 10:39:22 2019 Return-Path: Delivered-To: svn-src-all@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 0DFB7F0239; Sat, 14 Sep 2019 10:39:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VpsP6XfHz3Jlv; Sat, 14 Sep 2019 10:39:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id AAFDE15E0E; Sat, 14 Sep 2019 10:39:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::19b1:7fa4:cdc6:3be2] (unknown [IPv6:2001:470:7a58:0:19b1:7fa4:cdc6:3be2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 851C3670C9; Sat, 14 Sep 2019 12:39:20 +0200 (CEST) From: Dimitry Andric Message-Id: <5683AA01-BF0D-4A67-9B57-925D47FE459D@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_72B25B43-1F43-465A-817D-53E157B7FAAB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline Date: Sat, 14 Sep 2019 12:39:20 +0200 In-Reply-To: <2D5BFAF9-7A03-4A2C-B406-19AA8BC8BF5D@FreeBSD.org> Cc: Peter Jeremy , Baptiste Daroussin , Charlie Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201909130650.x8D6o2fb037276@repo.freebsd.org> <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> <20190914041041.GA97181@server.rulingia.com> <2D5BFAF9-7A03-4A2C-B406-19AA8BC8BF5D@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 10:39:22 -0000 --Apple-Mail=_72B25B43-1F43-465A-817D-53E157B7FAAB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 14 Sep 2019, at 12:36, Dimitry Andric wrote: >=20 > On 14 Sep 2019, at 06:25, Warner Losh wrote: >>=20 >> On Fri, Sep 13, 2019, 10:11 PM Peter Jeremy = wrote: >> On 2019-Sep-13 16:33:15 -0400, Charlie Li = wrote: ... >> Looking back into history, it looks like the "unsigned" is part >> of the ARM EABI. >>=20 >> We should confirm that. It is definitely part of the OABI stuff, but = EABI was supposed to fix differences like this... >=20 > As far as I know, arm has always been the odd one out, but even then, > you should assume anything about the signedness of char. :) Oops, I meant "should NOT assume", there. -Dimitry --Apple-Mail=_72B25B43-1F43-465A-817D-53E157B7FAAB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXXzDWAAKCRCwXqMKLiCW o1PoAJ4zbsiE1gP2y24W5u1cVXjyiwmccwCg/xxpLenKkPmLDD3O8vEAe39omWc= =vqr5 -----END PGP SIGNATURE----- --Apple-Mail=_72B25B43-1F43-465A-817D-53E157B7FAAB-- From owner-svn-src-all@freebsd.org Sat Sep 14 12:40:47 2019 Return-Path: Delivered-To: svn-src-all@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 47810F38BC; Sat, 14 Sep 2019 12:40:47 +0000 (UTC) (envelope-from sg@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 46VsYW1C2dz3QjS; Sat, 14 Sep 2019 12:40:47 +0000 (UTC) (envelope-from sg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0D6A71FD2A; Sat, 14 Sep 2019 12:40:47 +0000 (UTC) (envelope-from sg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ECekPc004933; Sat, 14 Sep 2019 12:40:46 GMT (envelope-from sg@FreeBSD.org) Received: (from sg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ECekpo004932; Sat, 14 Sep 2019 12:40:46 GMT (envelope-from sg@FreeBSD.org) Message-Id: <201909141240.x8ECekpo004932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sg set sender to sg@FreeBSD.org using -f From: Stephen Gregoratto Date: Sat, 14 Sep 2019 12:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352320 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sg X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 352320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 12:40:47 -0000 Author: sg (doc committer) Date: Sat Sep 14 12:40:46 2019 New Revision: 352320 URL: https://svnweb.freebsd.org/changeset/base/352320 Log: Set bcr@ mentor for sg@ Approved by: bcr (mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sat Sep 14 10:56:17 2019 (r352319) +++ head/share/misc/committers-doc.dot Sat Sep 14 12:40:46 2019 (r352320) @@ -88,6 +88,7 @@ remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10 rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] sevan [label="Sevan Janiyan\nsevan@FreeBSD.org\n2016/09/16"] +sg [label="Stephen Gregoratto\nsg@FreeBSD.org\n2016/02/24"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2014/01/15"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] @@ -110,6 +111,7 @@ bcr -> allanjude bcr -> bhd bcr -> sevan bcr -> dexter +bcr -> sg blackend -> ale From owner-svn-src-all@freebsd.org Sat Sep 14 13:25:55 2019 Return-Path: Delivered-To: svn-src-all@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 7D3ADF4984; Sat, 14 Sep 2019 13:25:55 +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 46VtYb2nJfz3y4g; Sat, 14 Sep 2019 13:25:55 +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 3E709205DE; Sat, 14 Sep 2019 13:25:55 +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 x8EDPt3l033584; Sat, 14 Sep 2019 13:25:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDPtOZ033583; Sat, 14 Sep 2019 13:25:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141325.x8EDPtOZ033583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:25:55 +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: r352321 - stable/12/sys/ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/ufs/ufs X-SVN-Commit-Revision: 352321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:25:55 -0000 Author: kib Date: Sat Sep 14 13:25:54 2019 New Revision: 352321 URL: https://svnweb.freebsd.org/changeset/base/352321 Log: MFC r352012: Properly check for writers when fetching quotas for writeable vnodes in UFS quotaon(). Modified: stable/12/sys/ufs/ufs/ufs_quota.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_quota.c Sat Sep 14 12:40:46 2019 (r352320) +++ stable/12/sys/ufs/ufs/ufs_quota.c Sat Sep 14 13:25:54 2019 (r352321) @@ -617,7 +617,7 @@ again: MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto again; } - if (vp->v_type == VNON || vp->v_writecount == 0) { + if (vp->v_type == VNON || vp->v_writecount <= 0) { VOP_UNLOCK(vp, 0); vrele(vp); continue; From owner-svn-src-all@freebsd.org Sat Sep 14 13:27:08 2019 Return-Path: Delivered-To: svn-src-all@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 540E9F4A0D; Sat, 14 Sep 2019 13:27:08 +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 46Vtb01Dvrz3yBw; Sat, 14 Sep 2019 13:27:08 +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 0DE53205DF; Sat, 14 Sep 2019 13:27:08 +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 x8EDR7LD033700; Sat, 14 Sep 2019 13:27:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDR7Sh033699; Sat, 14 Sep 2019 13:27:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141327.x8EDR7Sh033699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:27:07 +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: r352322 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 352322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:27:08 -0000 Author: kib Date: Sat Sep 14 13:27:07 2019 New Revision: 352322 URL: https://svnweb.freebsd.org/changeset/base/352322 Log: MFC r352013: vm_object_coalesce(): avoid extending any nosplit objects, not only that which back tmpfs nodes. Modified: stable/12/sys/vm/vm_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Sat Sep 14 13:25:54 2019 (r352321) +++ stable/12/sys/vm/vm_object.c Sat Sep 14 13:27:07 2019 (r352322) @@ -2093,7 +2093,7 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset VM_OBJECT_WLOCK(prev_object); if ((prev_object->type != OBJT_DEFAULT && prev_object->type != OBJT_SWAP) || - (prev_object->flags & OBJ_TMPFS_NODE) != 0) { + (prev_object->flags & OBJ_NOSPLIT) != 0) { VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } From owner-svn-src-all@freebsd.org Sat Sep 14 13:29:42 2019 Return-Path: Delivered-To: svn-src-all@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 AC692F4C02; Sat, 14 Sep 2019 13:29:42 +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 46Vtdy3y0jz3yQg; Sat, 14 Sep 2019 13:29:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB66205E2; Sat, 14 Sep 2019 13:29:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8EDTgKQ033872; Sat, 14 Sep 2019 13:29:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDTgsV033871; Sat, 14 Sep 2019 13:29:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141329.x8EDTgsV033871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:29:42 +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: r352323 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 352323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:29:42 -0000 Author: kib Date: Sat Sep 14 13:29:41 2019 New Revision: 352323 URL: https://svnweb.freebsd.org/changeset/base/352323 Log: MFC r352014: vm_object_deallocate(): Remove no longer needed code. Modified: stable/12/sys/vm/vm_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Sat Sep 14 13:27:07 2019 (r352322) +++ stable/12/sys/vm/vm_object.c Sat Sep 14 13:29:41 2019 (r352323) @@ -515,7 +515,6 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t temp; - struct vnode *vp; while (object != NULL) { VM_OBJECT_WLOCK(object); @@ -538,25 +537,6 @@ vm_object_deallocate(vm_object_t object) VM_OBJECT_WUNLOCK(object); return; } else if (object->ref_count == 1) { - if (object->type == OBJT_SWAP && - (object->flags & OBJ_TMPFS) != 0) { - vp = object->un_pager.swp.swp_tmpfs; - vhold(vp); - VM_OBJECT_WUNLOCK(object); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - VM_OBJECT_WLOCK(object); - if (object->type == OBJT_DEAD || - object->ref_count != 1) { - VM_OBJECT_WUNLOCK(object); - VOP_UNLOCK(vp, 0); - vdrop(vp); - return; - } - if ((object->flags & OBJ_TMPFS) != 0) - VOP_UNSET_TEXT(vp); - VOP_UNLOCK(vp, 0); - vdrop(vp); - } if (object->shadow_count == 0 && object->handle == NULL && (object->type == OBJT_DEFAULT || From owner-svn-src-all@freebsd.org Sat Sep 14 13:30:23 2019 Return-Path: Delivered-To: svn-src-all@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 8FE93F4D44; Sat, 14 Sep 2019 13:30:23 +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 46Vtfl2QDpz3yZJ; Sat, 14 Sep 2019 13:30:23 +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 2FC8B205E7; Sat, 14 Sep 2019 13:30:23 +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 x8EDUNC5034012; Sat, 14 Sep 2019 13:30:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDUNQ9034011; Sat, 14 Sep 2019 13:30:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909141330.x8EDUNQ9034011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 14 Sep 2019 13:30:23 +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: r352324 - stable/12/sys/dev/sound/pcm X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/sound/pcm X-SVN-Commit-Revision: 352324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:30:23 -0000 Author: hselasky Date: Sat Sep 14 13:30:22 2019 New Revision: 352324 URL: https://svnweb.freebsd.org/changeset/base/352324 Log: MFC r351847: Decrease the default audio playback latency to a maximum of 21.3ms. This significantly improves the audio playback response time. Discussed with: mav@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/sound/pcm/channel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pcm/channel.h ============================================================================== --- stable/12/sys/dev/sound/pcm/channel.h Sat Sep 14 13:29:41 2019 (r352323) +++ stable/12/sys/dev/sound/pcm/channel.h Sat Sep 14 13:30:22 2019 (r352324) @@ -413,7 +413,7 @@ extern int report_soft_matrix; #define CHN_LATENCY_MIN 0 #define CHN_LATENCY_MAX 10 -#define CHN_LATENCY_DEFAULT 5 +#define CHN_LATENCY_DEFAULT 2 /* 21.3ms total buffering */ #define CHN_POLICY_MIN CHN_LATENCY_MIN #define CHN_POLICY_MAX CHN_LATENCY_MAX #define CHN_POLICY_DEFAULT CHN_LATENCY_DEFAULT From owner-svn-src-all@freebsd.org Sat Sep 14 13:30:55 2019 Return-Path: Delivered-To: svn-src-all@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 23D49F4FD4; Sat, 14 Sep 2019 13:30:55 +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 46VtgL5sJkz3ynv; Sat, 14 Sep 2019 13:30:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 909BD205FE; Sat, 14 Sep 2019 13:30:54 +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 x8EDUsi8036333; Sat, 14 Sep 2019 13:30:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDUsgw036332; Sat, 14 Sep 2019 13:30:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141330.x8EDUsgw036332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:30: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: r352325 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:30:55 -0000 Author: kib Date: Sat Sep 14 13:30:53 2019 New Revision: 352325 URL: https://svnweb.freebsd.org/changeset/base/352325 Log: MFC r352015: When loading ELF interpreter, initialize whole nested image_params with zero. Modified: stable/12/sys/kern/imgact_elf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Sat Sep 14 13:30:22 2019 (r352324) +++ stable/12/sys/kern/imgact_elf.c Sat Sep 14 13:30:53 2019 (r352325) @@ -735,7 +735,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ return (ECAPMODE); #endif - tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK); + tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK | M_ZERO); nd = &tempdata->nd; attr = &tempdata->attr; imgp = &tempdata->image_params; @@ -745,10 +745,6 @@ __elfN(load_file)(struct proc *p, const char *file, u_ */ imgp->proc = p; imgp->attr = attr; - imgp->firstpage = NULL; - imgp->image_header = NULL; - imgp->object = NULL; - imgp->execlabel = NULL; NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, file, curthread); From owner-svn-src-all@freebsd.org Sat Sep 14 13:31:08 2019 Return-Path: Delivered-To: svn-src-all@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 70C9BF502E; Sat, 14 Sep 2019 13:31:08 +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 46Vtgc0yv8z3ywX; Sat, 14 Sep 2019 13:31:08 +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 EE60A20613; Sat, 14 Sep 2019 13:31:07 +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 x8EDV7Am036403; Sat, 14 Sep 2019 13:31:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDV7xH036402; Sat, 14 Sep 2019 13:31:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909141331.x8EDV7xH036402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 14 Sep 2019 13:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352326 - stable/11/sys/dev/sound/pcm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/pcm X-SVN-Commit-Revision: 352326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:31:08 -0000 Author: hselasky Date: Sat Sep 14 13:31:07 2019 New Revision: 352326 URL: https://svnweb.freebsd.org/changeset/base/352326 Log: MFC r351847: Decrease the default audio playback latency to a maximum of 21.3ms. This significantly improves the audio playback response time. Discussed with: mav@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/pcm/channel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pcm/channel.h ============================================================================== --- stable/11/sys/dev/sound/pcm/channel.h Sat Sep 14 13:30:53 2019 (r352325) +++ stable/11/sys/dev/sound/pcm/channel.h Sat Sep 14 13:31:07 2019 (r352326) @@ -411,7 +411,7 @@ extern int report_soft_matrix; #define CHN_LATENCY_MIN 0 #define CHN_LATENCY_MAX 10 -#define CHN_LATENCY_DEFAULT 5 +#define CHN_LATENCY_DEFAULT 2 /* 21.3ms total buffering */ #define CHN_POLICY_MIN CHN_LATENCY_MIN #define CHN_POLICY_MAX CHN_LATENCY_MAX #define CHN_POLICY_DEFAULT CHN_LATENCY_DEFAULT From owner-svn-src-all@freebsd.org Sat Sep 14 13:32:14 2019 Return-Path: Delivered-To: svn-src-all@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 4F940F52AA; Sat, 14 Sep 2019 13:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Vtht1Tc0z40JN; Sat, 14 Sep 2019 13:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15BDC20775; Sat, 14 Sep 2019 13:32:14 +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 x8EDWD4c038743; Sat, 14 Sep 2019 13:32:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDWDJo038742; Sat, 14 Sep 2019 13:32:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141332.x8EDWDJo038742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:32:13 +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: r352327 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:32:14 -0000 Author: kib Date: Sat Sep 14 13:32:13 2019 New Revision: 352327 URL: https://svnweb.freebsd.org/changeset/base/352327 Log: MFC r352016: In do_execve(), clear imgp->textset when restarting for interpreter. Modified: stable/12/sys/kern/kern_exec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Sat Sep 14 13:31:07 2019 (r352326) +++ stable/12/sys/kern/kern_exec.c Sat Sep 14 13:32:13 2019 (r352327) @@ -618,7 +618,9 @@ interpret: * The vnode lock is held over this entire period * so nothing should illegitimately be blocked. */ - VOP_UNSET_TEXT_CHECKED(imgp->vp); + MPASS(imgp->textset); + VOP_UNSET_TEXT_CHECKED(newtextvp); + imgp->textset = false; /* free name buffer and old vnode */ if (args->fname != NULL) NDFREE(&nd, NDF_ONLY_PNBUF); From owner-svn-src-all@freebsd.org Sat Sep 14 13:32:55 2019 Return-Path: Delivered-To: svn-src-all@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 5B53DF5345; Sat, 14 Sep 2019 13:32:55 +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 46Vtjg1l5Mz40S4; Sat, 14 Sep 2019 13:32:55 +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 1F17620790; Sat, 14 Sep 2019 13:32:55 +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 x8EDWs81039541; Sat, 14 Sep 2019 13:32:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDWs2T039540; Sat, 14 Sep 2019 13:32:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909141332.x8EDWs2T039540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 14 Sep 2019 13:32: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: r352328 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 352328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:32:55 -0000 Author: hselasky Date: Sat Sep 14 13:32:54 2019 New Revision: 352328 URL: https://svnweb.freebsd.org/changeset/base/352328 Log: MFC r351693: Use DEVICE memory instead of UNCACHEABLE on aarch64 in ioremap() in the LinuxKPI. This fixes system hangs on reading device registers on aarch64. Tested with: Marvell MACCHIATObin (Armada8k) + mlx4en, amdgpu Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D20789 Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/io.h Sat Sep 14 13:32:13 2019 (r352327) +++ stable/12/sys/compat/linuxkpi/common/include/linux/io.h Sat Sep 14 13:32:54 2019 (r352328) @@ -356,16 +356,25 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned lon #define _ioremap_attr(...) NULL #endif +#ifdef VM_MEMATTR_DEVICE #define ioremap_nocache(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap_wt(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#else +#define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) -#define ioremap_wc(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) -#define ioremap_wb(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) #define ioremap_wt(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_THROUGH) #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) +#endif +#define ioremap_wc(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) +#define ioremap_wb(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) void iounmap(void *addr); #define memset_io(a, b, c) memset((a), (b), (c)) From owner-svn-src-all@freebsd.org Sat Sep 14 13:33:37 2019 Return-Path: Delivered-To: svn-src-all@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 48576F53D0; Sat, 14 Sep 2019 13:33:37 +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 46VtkT18xBz40ZW; Sat, 14 Sep 2019 13:33:37 +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 0B4C620792; Sat, 14 Sep 2019 13:33:37 +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 x8EDXaZk039668; Sat, 14 Sep 2019 13:33:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDXaYY039667; Sat, 14 Sep 2019 13:33:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141333.x8EDXaYY039667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:33: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: r352329 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:33:37 -0000 Author: kib Date: Sat Sep 14 13:33:36 2019 New Revision: 352329 URL: https://svnweb.freebsd.org/changeset/base/352329 Log: MFC r352017: In do_execve(), use shared text vnode lock consistently. Modified: stable/12/sys/kern/kern_exec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Sat Sep 14 13:32:54 2019 (r352328) +++ stable/12/sys/kern/kern_exec.c Sat Sep 14 13:33:36 2019 (r352329) @@ -528,7 +528,7 @@ interpret: euip = uifind(attr.va_uid); change_euid(imgp->newcred, euip); } - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (attr.va_mode & S_ISGID) change_egid(imgp->newcred, attr.va_gid); /* @@ -557,7 +557,7 @@ interpret: oldcred->cr_svgid != oldcred->cr_gid) { VOP_UNLOCK(imgp->vp, 0); imgp->newcred = crdup(oldcred); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); change_svuid(imgp->newcred, imgp->newcred->cr_uid); change_svgid(imgp->newcred, imgp->newcred->cr_gid); } @@ -574,7 +574,7 @@ interpret: if (vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0) imgp->execpath = args->fname; - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } /* From owner-svn-src-all@freebsd.org Sat Sep 14 13:33:52 2019 Return-Path: Delivered-To: svn-src-all@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 E3E44F5440; Sat, 14 Sep 2019 13:33:52 +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 46Vtkm49cZz40hf; Sat, 14 Sep 2019 13:33:52 +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 7325620794; Sat, 14 Sep 2019 13:33:52 +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 x8EDXq6f039726; Sat, 14 Sep 2019 13:33:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDXq3n039725; Sat, 14 Sep 2019 13:33:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909141333.x8EDXq3n039725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 14 Sep 2019 13:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352330 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 352330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:33:53 -0000 Author: hselasky Date: Sat Sep 14 13:33:52 2019 New Revision: 352330 URL: https://svnweb.freebsd.org/changeset/base/352330 Log: MFC r351693: Use DEVICE memory instead of UNCACHEABLE on aarch64 in ioremap() in the LinuxKPI. This fixes system hangs on reading device registers on aarch64. Tested with: Marvell MACCHIATObin (Armada8k) + mlx4en, amdgpu Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D20789 Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/io.h Sat Sep 14 13:33:36 2019 (r352329) +++ stable/11/sys/compat/linuxkpi/common/include/linux/io.h Sat Sep 14 13:33:52 2019 (r352330) @@ -356,16 +356,25 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned lon #define _ioremap_attr(...) NULL #endif +#ifdef VM_MEMATTR_DEVICE #define ioremap_nocache(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap_wt(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#else +#define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) -#define ioremap_wc(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) -#define ioremap_wb(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) #define ioremap_wt(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_THROUGH) #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) +#endif +#define ioremap_wc(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) +#define ioremap_wb(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) void iounmap(void *addr); #define memset_io(a, b, c) memset((a), (b), (c)) From owner-svn-src-all@freebsd.org Sat Sep 14 13:35:49 2019 Return-Path: Delivered-To: svn-src-all@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 AD7A9F5512; Sat, 14 Sep 2019 13:35:49 +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 46Vtn149Fvz40r6; Sat, 14 Sep 2019 13:35:49 +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 70CD9207A3; Sat, 14 Sep 2019 13:35:49 +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 x8EDZn3D039880; Sat, 14 Sep 2019 13:35:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EDZnLx039879; Sat, 14 Sep 2019 13:35:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909141335.x8EDZnLx039879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Sep 2019 13:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352331 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 352331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 13:35:49 -0000 Author: kib Date: Sat Sep 14 13:35:48 2019 New Revision: 352331 URL: https://svnweb.freebsd.org/changeset/base/352331 Log: MFC r352013: vm_object_coalesce(): avoid extending any nosplit objects, not only that which back tmpfs nodes. Modified: stable/11/sys/vm/vm_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Sat Sep 14 13:33:52 2019 (r352330) +++ stable/11/sys/vm/vm_object.c Sat Sep 14 13:35:48 2019 (r352331) @@ -2153,7 +2153,7 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset VM_OBJECT_WLOCK(prev_object); if ((prev_object->type != OBJT_DEFAULT && prev_object->type != OBJT_SWAP) || - (prev_object->flags & OBJ_TMPFS_NODE) != 0) { + (prev_object->flags & OBJ_NOSPLIT) != 0) { VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } From owner-svn-src-all@freebsd.org Sat Sep 14 14:26:31 2019 Return-Path: Delivered-To: svn-src-all@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 8A7E0F647A; Sat, 14 Sep 2019 14:26:31 +0000 (UTC) (envelope-from sg@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 46VvvW38Kpz431s; Sat, 14 Sep 2019 14:26:31 +0000 (UTC) (envelope-from sg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4F4BC21107; Sat, 14 Sep 2019 14:26:31 +0000 (UTC) (envelope-from sg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8EEQV3R070179; Sat, 14 Sep 2019 14:26:31 GMT (envelope-from sg@FreeBSD.org) Received: (from sg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EEQVSL070178; Sat, 14 Sep 2019 14:26:31 GMT (envelope-from sg@FreeBSD.org) Message-Id: <201909141426.x8EEQVSL070178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sg set sender to sg@FreeBSD.org using -f From: Stephen Gregoratto Date: Sat, 14 Sep 2019 14:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352332 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sg X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 352332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 14:26:31 -0000 Author: sg (doc committer) Date: Sat Sep 14 14:26:30 2019 New Revision: 352332 URL: https://svnweb.freebsd.org/changeset/base/352332 Log: amend r:352320 Fix date for sg@ Approved by: bcr (mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sat Sep 14 13:35:48 2019 (r352331) +++ head/share/misc/committers-doc.dot Sat Sep 14 14:26:30 2019 (r352332) @@ -88,7 +88,7 @@ remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10 rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] sevan [label="Sevan Janiyan\nsevan@FreeBSD.org\n2016/09/16"] -sg [label="Stephen Gregoratto\nsg@FreeBSD.org\n2016/02/24"] +sg [label="Stephen Gregoratto\nsg@FreeBSD.org\n2019/09/10"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2014/01/15"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] From owner-svn-src-all@freebsd.org Sat Sep 14 15:15:02 2019 Return-Path: Delivered-To: svn-src-all@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 93248F7733 for ; Sat, 14 Sep 2019 15:15:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46VwzV1Fwgz45GR for ; Sat, 14 Sep 2019 15:15:01 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568474100; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=hp4H6aDX0pq3qawk0PYDOtfkwl1rI28jhi5hCKKyR1Wx90gshT0/16WLbhyaBnnmd+br/IW4tF/MK rbtH4KENEqlAZNaqlBnbZV4f5D1ALz9e8HK4D8djF0CKY6k9uXg1I5d3wWwJm+fzsZ0DaAH8HpM0WM KiSgJzMbNpLreJ9hstp7d77mnJA90quhJ+arAM7dY1cCyb1HFkVxHCI+louZkL1xLNpgKYcjwBAviX LosrUrox4VprY2xNDvkmQevDHKIGGz4RFkEHGoUDf3iz3wyA2XL6nVOZJTfikxyyHarRhNaw1azcSU 4EG4Tu8Lq+XUg2Vr/hpWs0tEA6YKR5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=Zb6fyPxGBOwrj+9ODsjNByFB/BK1I138Qe8baNMh95E=; b=T7v6iQjg8j1HLbiTAc1Suxlja4ovcD1DX9F4I8UJM1k+5OPS5Nx69rkYuuxfBGLtLONNXAM/tWR9K 8vVXTaScpavhC9ehEr92aa1FPRsrin0bFMx9lSvhq568zuG+vb9/Rl+v6HS9kWrg7Qn5op/B2L5WpE XqqN7EM3kHANtPHkQNWtjERTlFGe4ZaCS4/HbZBqykGNBbTQMGPrRoR1Y3U2jw4VxJJegfZ0tOmPfR 4+Tv/LYjbwmd6KZNpMqlLO/GvPSmvKCEWbtrrSletieMKNFADiscs6Ukh+zgIjcKdZuzZC/JinvOqO dHtF6l6i69DYcmuwj7DNTojivMMa0pQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=Zb6fyPxGBOwrj+9ODsjNByFB/BK1I138Qe8baNMh95E=; b=s7l0d8h8HqcqPt++bjXLqNufUV7j8W0mdErLisd8wgGabqnp0JfuueIUxZv8O2+inO5x4kHVWalQ1 ZuaFwL1U5G2CRNj4A4d0kbH7luYQBtHRvC+YaYlZy5eBbnRvHU/xXXY8N1mZFZZDsVsWecF8MEotI+ EC8hZpAvoqjfmaIYFhYNXlcVxd/PyOvQLUn8iO2jiyGgZj/24ipy2K/5LCtCRQjx8tvVqzzRYYn66e ZSBdhbFsN6DQFqhkMULnjU9uJoQjPveI1yjh3if84L3AXhEhdLlFanGgxhP1puFFtTipbBC47x4pUc 93tKHKzUuppkkt2J4+/3HoAQJKSSkNA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 692ad101-d702-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 692ad101-d702-11e9-b67d-cdd75d6ce7a8; Sat, 14 Sep 2019 15:14:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8EFEub9086559; Sat, 14 Sep 2019 09:14:56 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1f18e7e147790aa280a4d35f93bf619313745200.camel@freebsd.org> Subject: Re: svn commit: r352275 - in head/lib/libedit: . TEST edit readline From: Ian Lepore To: Warner Losh , Peter Jeremy Cc: Baptiste Daroussin , Charlie Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 14 Sep 2019 09:14:56 -0600 In-Reply-To: References: <201909130650.x8D6o2fb037276@repo.freebsd.org> <6fadeb6b-fe09-f3c7-9bca-b5637bbb4e43@vishwin.info> <20190914041041.GA97181@server.rulingia.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46VwzV1Fwgz45GR X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; TAGGED_RCPT(0.00)[freebsd]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 15:15:02 -0000 On Fri, 2019-09-13 at 22:25 -0600, Warner Losh wrote: > On Fri, Sep 13, 2019, 10:11 PM Peter Jeremy > wrote: > > > On 2019-Sep-13 16:33:15 -0400, Charlie Li > > wrote: > > > Baptiste Daroussin wrote: > > > > Author: bapt > > > > Date: Fri Sep 13 06:50:02 2019 > > > > New Revision: 352275 > > > > URL: https://svnweb.freebsd.org/changeset/base/352275 > > > > > > > > Log: > > > > Update libedit to a snapshot from 2019-09-10 > > > > Reviewed by: Yuichiro Naito > > > > MFC after: 3 weeks > > > > Differential Revision: https://reviews.freebsd.org/D21584 > > > > > > > > > > I posted in phab but repeating here, this breaks the build on (at > > > least) > > > aarch64: > > > > It breaks the build on arm and arm64 only. > > > > wint_t is int on all platforms: > > sys/sys/_types.h: > > typedef int __ct_rune_t; /* arg type for ctype funcs > > */ > > typedef __ct_rune_t __wint_t; /* wint_t (see above) */ > > > > but wchar_t varies between unsigned and signed: > > $ grep '__wchar_t' sys/*/include/_types.h > > sys/arm/include/_types.h:typedef unsigned int ___wchar_t; > > sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; > > sys/mips/include/_types.h:typedef int ___wchar_t; > > sys/powerpc/include/_types.h:typedef int ___wchar_t; > > sys/riscv/include/_types.h:typedef int ___wchar_t; > > sys/sparc64/include/_types.h:typedef int ___wchar_t; > > sys/x86/include/_types.h:typedef int ___wchar_t; > > > > Looking back into history, it looks like the "unsigned" is part > > of the ARM EABI. > > > > We should confirm that. It is definitely part of the OABI stuff, but EABI > was supposed to fix differences like this... > The char type is unsigned by default on arm (it's part of eabi), and also on powerpc and riscv. -- Ian From owner-svn-src-all@freebsd.org Sat Sep 14 18:20:15 2019 Return-Path: Delivered-To: svn-src-all@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 3B7BDFB681; Sat, 14 Sep 2019 18:20:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46W15C0kVcz4GnN; Sat, 14 Sep 2019 18:20:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC2442399B; Sat, 14 Sep 2019 18:20:14 +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 x8EIKEbG007482; Sat, 14 Sep 2019 18:20:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EIKEve007481; Sat, 14 Sep 2019 18:20:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909141820.x8EIKEve007481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Sep 2019 18:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352333 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 352333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 18:20:15 -0000 Author: ian Date: Sat Sep 14 18:20:14 2019 New Revision: 352333 URL: https://svnweb.freebsd.org/changeset/base/352333 Log: Include , required to use spinlocks in this code. Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtpps.c Sat Sep 14 14:26:30 2019 (r352332) +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Sat Sep 14 18:20:14 2019 (r352333) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Sat Sep 14 19:16:08 2019 Return-Path: Delivered-To: svn-src-all@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 B1CD7FCA5B; Sat, 14 Sep 2019 19:16:08 +0000 (UTC) (envelope-from trasz@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 46W2Kh4GHgz4L58; Sat, 14 Sep 2019 19:16:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 75C3D24434; Sat, 14 Sep 2019 19:16:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8EJG8hw043569; Sat, 14 Sep 2019 19:16:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EJG8or043567; Sat, 14 Sep 2019 19:16:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909141916.x8EJG8or043567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Sep 2019 19:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352334 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 352334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 19:16:08 -0000 Author: trasz Date: Sat Sep 14 19:16:07 2019 New Revision: 352334 URL: https://svnweb.freebsd.org/changeset/base/352334 Log: Make pseudofs(9) create directory entries in order, instead of the reverse. This fixes Linux sysctl(8) binary - it assumes the first two directory entries are always "." and "..". There might be other Linux apps affected by this. NB it might be a good idea to rewrite it using queue(3). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21550 Modified: head/sys/fs/pseudofs/pseudofs.c head/sys/fs/pseudofs/pseudofs.h Modified: head/sys/fs/pseudofs/pseudofs.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs.c Sat Sep 14 18:20:14 2019 (r352333) +++ head/sys/fs/pseudofs/pseudofs.c Sat Sep 14 19:16:07 2019 (r352334) @@ -135,10 +135,21 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node pfs_fileno_alloc(pn); pfs_lock(parent); - pn->pn_next = parent->pn_nodes; if ((parent->pn_flags & PFS_PROCDEP) != 0) pn->pn_flags |= PFS_PROCDEP; - parent->pn_nodes = pn; + if (parent->pn_nodes == NULL) { + KASSERT(parent->pn_last_node == NULL, + ("%s(): pn_last_node not NULL", __func__)); + parent->pn_nodes = pn; + parent->pn_last_node = pn; + } else { + KASSERT(parent->pn_last_node != NULL, + ("%s(): pn_last_node is NULL", __func__)); + KASSERT(parent->pn_last_node->pn_next == NULL, + ("%s(): pn_last_node->pn_next not NULL", __func__)); + parent->pn_last_node->pn_next = pn; + parent->pn_last_node = pn; + } pfs_unlock(parent); } @@ -148,7 +159,7 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node static void pfs_detach_node(struct pfs_node *pn) { - struct pfs_node *parent = pn->pn_parent; + struct pfs_node *node, *parent = pn->pn_parent; struct pfs_node **iter; KASSERT(parent != NULL, ("%s(): node has no parent", __func__)); @@ -156,6 +167,16 @@ pfs_detach_node(struct pfs_node *pn) ("%s(): parent has different pn_info", __func__)); pfs_lock(parent); + if (pn == parent->pn_last_node) { + if (pn == pn->pn_nodes) { + parent->pn_last_node = NULL; + } else { + for (node = parent->pn_nodes; + node->pn_next != pn; node = node->pn_next) + continue; + parent->pn_last_node = node; + } + } iter = &parent->pn_nodes; while (*iter != NULL) { if (*iter == pn) { Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Sat Sep 14 18:20:14 2019 (r352333) +++ head/sys/fs/pseudofs/pseudofs.h Sat Sep 14 19:16:07 2019 (r352334) @@ -237,6 +237,7 @@ struct pfs_node { struct pfs_node *pn_parent; /* (o) */ struct pfs_node *pn_nodes; /* (o) */ + struct pfs_node *pn_last_node; /* (o) */ struct pfs_node *pn_next; /* (p) */ }; From owner-svn-src-all@freebsd.org Sat Sep 14 19:23:48 2019 Return-Path: Delivered-To: svn-src-all@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 1ED7DFD065; Sat, 14 Sep 2019 19:23:48 +0000 (UTC) (envelope-from trasz@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 46W2VX0jjpz4M0w; Sat, 14 Sep 2019 19:23:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D708424608; Sat, 14 Sep 2019 19:23:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8EJNlLG049512; Sat, 14 Sep 2019 19:23:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EJNkVx049506; Sat, 14 Sep 2019 19:23:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909141923.x8EJNkVx049506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Sep 2019 19:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352337 - in head: share/man/man3 sys/sys tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man3 sys/sys tests/sys/sys X-SVN-Commit-Revision: 352337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 19:23:48 -0000 Author: trasz Date: Sat Sep 14 19:23:46 2019 New Revision: 352337 URL: https://svnweb.freebsd.org/changeset/base/352337 Log: Introduce arb(3), the Array-based Red-Black Tree macros: similar to the traditional tree(3) RB trees, but using an array (preallocated, linear chunk of memory) to store the tree. This avoids allocation overhead, improves memory locality, and makes it trivially easy to share/transfer/copy the entire tree without the need for marshalling. The downside is that the size is fixed at initialization time; there is no mechanism to resize it. This is one of the dependencies for the new stats(3) framework (https://reviews.freebsd.org/D20477). Reviewed by: bcr (man pages), markj Discussed with: cem MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Obtained from: Netflix Differential Revision: https://reviews.freebsd.org/D20324 Added: head/share/man/man3/arb.3 (contents, props changed) head/sys/sys/arb.h (contents, props changed) head/tests/sys/sys/arb_test.c (contents, props changed) Modified: head/share/man/man3/Makefile head/share/man/man3/queue.3 head/share/man/man3/tree.3 head/tests/sys/sys/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sat Sep 14 19:19:38 2019 (r352336) +++ head/share/man/man3/Makefile Sat Sep 14 19:23:46 2019 (r352337) @@ -3,7 +3,8 @@ .include -MAN= assert.3 \ +MAN= arb.3 \ + assert.3 \ ATOMIC_VAR_INIT.3 \ bitstring.3 \ CMSG_DATA.3 \ @@ -32,6 +33,42 @@ MAN= assert.3 \ timeradd.3 \ tree.3 +MLINKS+= arb.3 ARB8_ENTRY.3 \ + arb.3 ARB16_ENTRY.3 \ + arb.3 ARB32_ENTRY.3 \ + arb.3 ARB8_HEAD.3 \ + arb.3 ARB16_HEAD.3 \ + arb.3 ARB32_HEAD.3 \ + arb.3 ARB_ALLOCSIZE.3 \ + arb.3 ARB_INITIALIZER.3 \ + arb.3 ARB_ROOT.3 \ + arb.3 ARB_EMPTY.3 \ + arb.3 ARB_FULL.3 \ + arb.3 ARB_CURNODES.3 \ + arb.3 ARB_MAXNODES.3 \ + arb.3 ARB_NEXT.3 \ + arb.3 ARB_PREV.3 \ + arb.3 ARB_MIN.3 \ + arb.3 ARB_MAX.3 \ + arb.3 ARB_FIND.3 \ + arb.3 ARB_NFIND.3 \ + arb.3 ARB_LEFT.3 \ + arb.3 ARB_LEFTIDX.3 \ + arb.3 ARB_RIGHT.3 \ + arb.3 ARB_RIGHTIDX.3 \ + arb.3 ARB_PARENT.3 \ + arb.3 ARB_PARENTIDX.3 \ + arb.3 ARB_GETFREE.3 \ + arb.3 ARB_FREEIDX.3 \ + arb.3 ARB_FOREACH.3 \ + arb.3 ARB_FOREACH_FROM.3 \ + arb.3 ARB_FOREACH_SAFE.3 \ + arb.3 ARB_FOREACH_REVERSE.3 \ + arb.3 ARB_FOREACH_REVERSE_FROM.3 \ + arb.3 ARB_FOREACH_REVERSE_SAFE.3 \ + arb.3 ARB_INIT.3 \ + arb.3 ARB_INSERT.3 \ + arb.3 ARB_REMOVE.3 MLINKS= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ Added: head/share/man/man3/arb.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/arb.3 Sat Sep 14 19:23:46 2019 (r352337) @@ -0,0 +1,483 @@ +.\" $OpenBSD: tree.3,v 1.7 2002/06/12 01:09:20 provos Exp $ +.\" +.\" Copyright 2002 Niels Provos +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Niels Provos. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 8, 2019 +.Dt ARB 3 +.Os +.Sh NAME +.Nm ARB_PROTOTYPE , +.Nm ARB_PROTOTYPE_STATIC , +.Nm ARB_PROTOTYPE_INSERT , +.Nm ARB_PROTOTYPE_INSERT_COLOR , +.Nm ARB_PROTOTYPE_REMOVE , +.Nm ARB_PROTOTYPE_REMOVE_COLOR , +.Nm ARB_PROTOTYPE_FIND , +.Nm ARB_PROTOTYPE_NFIND , +.Nm ARB_PROTOTYPE_NEXT , +.Nm ARB_PROTOTYPE_PREV , +.Nm ARB_PROTOTYPE_MINMAX , +.Nm ARB_GENERATE , +.Nm ARB_GENERATE_STATIC , +.Nm ARB_GENERATE_INSERT , +.Nm ARB_GENERATE_INSERT_COLOR , +.Nm ARB_GENERATE_REMOVE , +.Nm ARB_GENERATE_REMOVE_COLOR , +.Nm ARB_GENERATE_FIND , +.Nm ARB_GENERATE_NFIND , +.Nm ARB_GENERATE_NEXT , +.Nm ARB_GENERATE_PREV , +.Nm ARB_GENERATE_MINMAX , +.Nm ARB8_ENTRY , +.Nm ARB16_ENTRY , +.Nm ARB32_ENTRY , +.Nm ARB8_HEAD , +.Nm ARB16_HEAD , +.Nm ARB32_HEAD , +.Nm ARB_ALLOCSIZE , +.Nm ARB_INITIALIZER , +.Nm ARB_ROOT , +.Nm ARB_EMPTY , +.Nm ARB_FULL , +.Nm ARB_CURNODES , +.Nm ARB_MAXNODES , +.Nm ARB_NEXT , +.Nm ARB_PREV , +.Nm ARB_MIN , +.Nm ARB_MAX , +.Nm ARB_FIND , +.Nm ARB_NFIND , +.Nm ARB_LEFT , +.Nm ARB_LEFTIDX , +.Nm ARB_RIGHT , +.Nm ARB_RIGHTIDX , +.Nm ARB_PARENT , +.Nm ARB_PARENTIDX , +.Nm ARB_GETFREE , +.Nm ARB_FREEIDX , +.Nm ARB_FOREACH , +.Nm ARB_FOREACH_FROM , +.Nm ARB_FOREACH_SAFE , +.Nm ARB_FOREACH_REVERSE , +.Nm ARB_FOREACH_REVERSE_FROM , +.Nm ARB_FOREACH_REVERSE_SAFE , +.Nm ARB_INIT , +.Nm ARB_INSERT , +.Nm ARB_REMOVE +.Nd "array-based red-black trees" +.Sh SYNOPSIS +.In sys/arb.h +.Fn ARB_PROTOTYPE NAME TYPE FIELD CMP +.Fn ARB_PROTOTYPE_STATIC NAME TYPE FIELD CMP +.Fn ARB_PROTOTYPE_INSERT NAME TYPE ATTR +.Fn ARB_PROTOTYPE_INSERT_COLOR NAME TYPE ATTR +.Fn ARB_PROTOTYPE_REMOVE NAME TYPE ATTR +.Fn ARB_PROTOTYPE_REMOVE_COLOR NAME TYPE ATTR +.Fn ARB_PROTOTYPE_FIND NAME TYPE ATTR +.Fn ARB_PROTOTYPE_NFIND NAME TYPE ATTR +.Fn ARB_PROTOTYPE_NEXT NAME TYPE ATTR +.Fn ARB_PROTOTYPE_PREV NAME TYPE ATTR +.Fn ARB_PROTOTYPE_MINMAX NAME TYPE ATTR +.Fn ARB_GENERATE NAME TYPE FIELD CMP +.Fn ARB_GENERATE_STATIC NAME TYPE FIELD CMP +.Fn ARB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR +.Fn ARB_GENERATE_INSERT_COLOR NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_REMOVE NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_REMOVE_COLOR NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_FIND NAME TYPE FIELD CMP ATTR +.Fn ARB_GENERATE_NFIND NAME TYPE FIELD CMP ATTR +.Fn ARB_GENERATE_NEXT NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_PREV NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_MINMAX NAME TYPE FIELD ATTR +.Fn ARB<8|16|32>_ENTRY +.Fn ARB<8|16|32>_HEAD HEADNAME TYPE +.Ft "size_t" +.Fn ARB_ALLOCSIZE "ARB_HEAD *head" "int<8|16|32>_t maxnodes" "struct TYPE *elm" +.Fn ARB_INITIALIZER "ARB_HEAD *head" "int<8|16|32>_t maxnodes" +.Ft "struct TYPE *" +.Fn ARB_ROOT "ARB_HEAD *head" +.Ft "bool" +.Fn ARB_EMPTY "ARB_HEAD *head" +.Ft "bool" +.Fn ARB_FULL "ARB_HEAD *head" +.Ft "int<8|16|32>_t" +.Fn ARB_CURNODES "ARB_HEAD *head" +.Ft "int<8|16|32>_t" +.Fn ARB_MAXNODES "ARB_HEAD *head" +.Ft "struct TYPE *" +.Fn ARB_NEXT NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_PREV NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_MIN NAME "ARB_HEAD *head" +.Ft "struct TYPE *" +.Fn ARB_MAX NAME "ARB_HEAD *head" +.Ft "struct TYPE *" +.Fn ARB_FIND NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_NFIND NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_LEFT "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "int<8|16|32>_t" +.Fn ARB_LEFTIDX "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "struct TYPE *" +.Fn ARB_RIGHT "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "int<8|16|32>_t" +.Fn ARB_RIGHTIDX "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "struct TYPE *" +.Fn ARB_PARENT "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "int<8|16|32>_t" +.Fn ARB_PARENTIDX "struct TYPE *elm" "ARB_ENTRY NAME" +.Ft "struct TYPE *" +.Fn ARB_GETFREE "ARB_HEAD *head" "FIELD" +.Ft "int<8|16|32>_t" +.Fn ARB_FREEIDX "ARB_HEAD *head" +.Fn ARB_FOREACH VARNAME NAME "ARB_HEAD *head" +.Fn ARB_FOREACH_FROM "VARNAME" "NAME" "POS_VARNAME" +.Fn ARB_FOREACH_SAFE "VARNAME" "NAME" "ARB_HEAD *head" "TEMP_VARNAME" +.Fn ARB_FOREACH_REVERSE VARNAME NAME "ARB_HEAD *head" +.Fn ARB_FOREACH_REVERSE_FROM "VARNAME" "NAME" "POS_VARNAME" +.Fn ARB_FOREACH_REVERSE_SAFE "VARNAME" "NAME" "ARB_HEAD *head" "TEMP_VARNAME" +.Ft void +.Fn ARB_INIT "struct TYPE *elm" "FIELD" "ARB_HEAD *head" "int<8|16|32>_t maxnodes" +.Ft "struct TYPE *" +.Fn ARB_INSERT NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_REMOVE NAME "ARB_HEAD *head" "struct TYPE *elm" +.Sh DESCRIPTION +These macros define data structures for and array-based red-black trees. +They use a single, continuous chunk of memory, and are useful +e.g., when the tree needs to be transferred between userspace and kernel. +.Pp +In the macro definitions, +.Fa TYPE +is the name tag of a user defined structure that must contain a field of type +.Vt ARB_ENTRY , +named +.Fa ENTRYNAME . +The argument +.Fa HEADNAME +is the name tag of a user defined structure that must be declared +using the +.Fn ARB_HEAD +macro. +The argument +.Fa NAME +has to be a unique name prefix for every tree that is defined. +.Pp +The function prototypes are declared with +.Fn ARB_PROTOTYPE , +or +.Fn ARB_PROTOTYPE_STATIC . +The function bodies are generated with +.Fn ARB_GENERATE , +or +.Fn ARB_GENERATE_STATIC . +See the examples below for further explanation of how these macros are used. +.Pp +A red-black tree is a binary search tree with the node color as an +extra attribute. +It fulfills a set of conditions: +.Bl -enum -offset indent +.It +Every search path from the root to a leaf consists of the same number of +black nodes. +.It +Each red node (except for the root) has a black parent. +.It +Each leaf node is black. +.El +.Pp +Every operation on a red-black tree is bounded as +.Fn O "lg n" . +The maximum height of a red-black tree is +.Fn 2lg "n + 1" . +.Pp +.Fn ARB_* +trees require entries to be allocated as an array, and uses array +indices to link entries together. +The maximum number of +.Fn ARB_* +tree entries is therefore constrained by the minimum of array size and choice of +signed integer data type used to store array indices. +Use +.Fn ARB_ALLOCSIZE +to compute the size of memory chunk to allocate. +.Pp +A red-black tree is headed by a structure defined by the +.Fn ARB_HEAD +macro. +A +structure is declared with either of the following: +.Bd -ragged -offset indent +.Fn ARB<8|16|32>_HEAD HEADNAME TYPE +.Va head ; +.Ed +.Pp +where +.Fa HEADNAME +is the name of the structure to be defined, and struct +.Fa TYPE +is the type of the elements to be inserted into the tree. +.Pp +The +.Fn ARB_HEAD +variant includes a suffix denoting the signed integer data type size +.Pq in bits +used to store array indices. +For example, +.Fn ARB_HEAD8 +creates a red-black tree head strucutre with 8-bit signed array indices capable +of indexing up to 128 entries. +.Pp +The +.Fn ARB_ENTRY +macro declares a structure that allows elements to be connected in the tree. +Similarly to the +.Fn ARB<8|16|32>_HEAD +macro, the +.Fn ARB_ENTRY +variant includes a suffix denoting the signed integer data type size +.Pq in bits +used to store array indices. +Entries should use the same number of bits as the tree head structure they will +be linked into. +.Pp +In order to use the functions that manipulate the tree structure, +their prototypes need to be declared with the +.Fn ARB_PROTOTYPE +or +.Fn ARB_PROTOTYPE_STATIC +macro, +where +.Fa NAME +is a unique identifier for this particular tree. +The +.Fa TYPE +argument is the type of the structure that is being managed +by the tree. +The +.Fa FIELD +argument is the name of the element defined by +.Fn ARB_ENTRY . +Individual prototypes can be declared with +.Fn ARB_PROTOTYPE_INSERT , +.Fn ARB_PROTOTYPE_INSERT_COLOR , +.Fn ARB_PROTOTYPE_REMOVE , +.Fn ARB_PROTOTYPE_REMOVE_COLOR , +.Fn ARB_PROTOTYPE_FIND , +.Fn ARB_PROTOTYPE_NFIND , +.Fn ARB_PROTOTYPE_NEXT , +.Fn ARB_PROTOTYPE_PREV , +and +.Fn ARB_PROTOTYPE_MINMAX +in case not all functions are required. +The individual prototype macros expect +.Fa NAME , +.Fa TYPE , +and +.Fa ATTR +arguments. +The +.Fa ATTR +argument must be empty for global functions or +.Fa static +for static functions. +.Pp +The function bodies are generated with the +.Fn ARB_GENERATE +or +.Fn ARB_GENERATE_STATIC +macro. +These macros take the same arguments as the +.Fn ARB_PROTOTYPE +and +.Fn ARB_PROTOTYPE_STATIC +macros, but should be used only once. +As an alternative individual function bodies are generated with the +.Fn ARB_GENERATE_INSERT , +.Fn ARB_GENERATE_INSERT_COLOR , +.Fn ARB_GENERATE_REMOVE , +.Fn ARB_GENERATE_REMOVE_COLOR , +.Fn ARB_GENERATE_FIND , +.Fn ARB_GENERATE_NFIND , +.Fn ARB_GENERATE_NEXT , +.Fn ARB_GENERATE_PREV , +and +.Fn ARB_GENERATE_MINMAX +macros. +.Pp +Finally, +the +.Fa CMP +argument is the name of a function used to compare tree nodes +with each other. +The function takes two arguments of type +.Vt "struct TYPE *" . +If the first argument is smaller than the second, the function returns a +value smaller than zero. +If they are equal, the function returns zero. +Otherwise, it should return a value greater than zero. +The compare +function defines the order of the tree elements. +.Pp +The +.Fn ARB_INIT +macro initializes the tree referenced by +.Fa head , +with the array length of +.Fa maxnodes . +.Pp +The red-black tree can also be initialized statically by using the +.Fn ARB_INITIALIZER +macro: +.Bd -ragged -offset indent +.Fn ARB<8|16|32>_HEAD HEADNAME TYPE +.Va head += +.Fn ARB_INITIALIZER &head maxnodes ; +.Ed +.Pp +The +.Fn ARB_INSERT +macro inserts the new element +.Fa elm +into the tree. +.Pp +The +.Fn ARB_REMOVE +macro removes the element +.Fa elm +from the tree pointed by +.Fa head . +.Pp +The +.Fn ARB_FIND +and +.Fn ARB_NFIND +macros can be used to find a particular element in the tree. +.Bd -literal -offset indent +struct TYPE find, *res; +find.key = 30; +res = RB_FIND(NAME, head, &find); +.Ed +.Pp +The +.Fn ARB_ROOT , +.Fn ARB_MIN , +.Fn ARB_MAX , +.Fn ARB_NEXT , +and +.Fn ARB_PREV +macros can be used to traverse the tree: +.Pp +.Dl "for (np = RB_MIN(NAME, &head); np != NULL; np = RB_NEXT(NAME, &head, np))" +.Pp +Or, for simplicity, one can use the +.Fn ARB_FOREACH +or +.Fn ARB_FOREACH_REVERSE +macro: +.Bd -ragged -offset indent +.Fn RB_FOREACH np NAME head +.Ed +.Pp +The macros +.Fn ARB_FOREACH_SAFE +and +.Fn ARB_FOREACH_REVERSE_SAFE +traverse the tree referenced by head +in a forward or reverse direction respectively, +assigning each element in turn to np. +However, unlike their unsafe counterparts, +they permit both the removal of np +as well as freeing it from within the loop safely +without interfering with the traversal. +.Pp +Both +.Fn ARB_FOREACH_FROM +and +.Fn ARB_FOREACH_REVERSE_FROM +may be used to continue an interrupted traversal +in a forward or reverse direction respectively. +The head pointer is not required. +The pointer to the node from where to resume the traversal +should be passed as their last argument, +and will be overwritten to provide safe traversal. +.Pp +The +.Fn ARB_EMPTY +macro should be used to check whether a red-black tree is empty. +.Pp +Given that ARB trees have an intrinsic upper bound on the number of entries, +some ARB-specific additional macros are defined. +The +.Fn ARB_FULL +macro returns a boolean indicating whether the current number of tree entries +equals the tree's maximum. +The +.Fn ARB_CURNODES +and +.Fn ARB_MAXNODES +macros return the current and maximum number of entries respectively. +The +.Fn ARB_GETFREE +macro returns a pointer to the next free entry in the array of entries, ready to +be linked into the tree. +The +.Fn ARB_INSERT +returns +.Dv NULL +if the element was inserted in the tree successfully, otherwise they +return a pointer to the element with the colliding key. +.Pp +Accordingly, +.Fn ARB_REMOVE +returns the pointer to the removed element otherwise they return +.Dv NULL +to indicate an error. +.Sh SEE ALSO +.Xr queue 3 , +.Xr tree 3 +.Sh HISTORY +The +.Nm ARB +macros first appeared in +.Fx 13.0 . +.Sh AUTHORS +The +.Nm ARB +macros were implemented by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org , +based on +.Xr tree 3 +macros written by +.An Niels Provos . Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Sat Sep 14 19:19:38 2019 (r352336) +++ head/share/man/man3/queue.3 Sat Sep 14 19:23:46 2019 (r352337) @@ -1329,6 +1329,7 @@ in mode. .El .Sh SEE ALSO +.Xr arb 3 , .Xr tree 3 .Sh HISTORY The Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Sat Sep 14 19:19:38 2019 (r352336) +++ head/share/man/man3/tree.3 Sat Sep 14 19:23:46 2019 (r352337) @@ -674,6 +674,7 @@ return the pointer to the removed element otherwise th .Dv NULL to indicate an error. .Sh SEE ALSO +.Xr arb 3 , .Xr queue 3 .Sh AUTHORS The author of the tree macros is Added: head/sys/sys/arb.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/arb.h Sat Sep 14 19:23:46 2019 (r352337) @@ -0,0 +1,779 @@ +/* $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $ */ +/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ +/* $FreeBSD$ */ + +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2002 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_ARB_H_ +#define _SYS_ARB_H_ + +#include + +/* Array-based red-black trees. */ + +#define ARB_NULLIDX -1 +#define ARB_NULLCOL -1 + +#define ARB_BLACK 0 +#define ARB_RED 1 + +#define ARB_NEGINF -1 +#define ARB_INF 1 + +#define ARB_HEAD(name, type, idxbits) \ +struct name { \ + int##idxbits##_t arb_curnodes; \ + int##idxbits##_t arb_maxnodes; \ + int##idxbits##_t arb_root_idx; \ + int##idxbits##_t arb_free_idx; \ + int##idxbits##_t arb_min_idx; \ + int##idxbits##_t arb_max_idx; \ + struct type arb_nodes[]; \ +} +#define ARB8_HEAD(name, type) ARB_HEAD(name, type, 8) +#define ARB16_HEAD(name, type) ARB_HEAD(name, type, 16) +#define ARB32_HEAD(name, type) ARB_HEAD(name, type, 32) + +#define ARB_ALLOCSIZE(head, maxn, x) \ + (sizeof(*head) + (maxn) * sizeof(*x)) + +#define ARB_INITIALIZER(name, maxn) \ + ((struct name){ 0, maxn, ARB_NULLIDX, ARB_NULLIDX, \ + ARB_NULLIDX, ARB_NULLIDX }) + +#define ARB_INIT(x, field, head, maxn) \ + (head)->arb_curnodes = 0; \ + (head)->arb_maxnodes = (maxn); \ + (head)->arb_root_idx = (head)->arb_free_idx = \ + (head)->arb_min_idx = (head)->arb_max_idx = ARB_NULLIDX; \ + /* The ARB_RETURNFREE() puts all entries on the free list. */ \ + ARB_ARRFOREACH_REVWCOND(x, field, head, \ + ARB_RETURNFREE(head, x, field)) + +#define ARB_ENTRY(idxbits) \ +struct { \ + int##idxbits##_t arbe_parent_idx; \ + int##idxbits##_t arbe_left_idx; \ + int##idxbits##_t arbe_right_idx; \ + int8_t arbe_color; \ +} +#define ARB8_ENTRY() ARB_ENTRY(8) +#define ARB16_ENTRY() ARB_ENTRY(16) +#define ARB32_ENTRY() ARB_ENTRY(32) + +#define ARB_ENTRYINIT(elm, field) do { \ + (elm)->field.arbe_parent_idx = \ + (elm)->field.arbe_left_idx = \ + (elm)->field.arbe_right_idx = ARB_NULLIDX; \ + (elm)->field.arbe_color = ARB_NULLCOL; \ +} while (/*CONSTCOND*/ 0) + +#define ARB_ELMTYPE(head) __typeof(&(head)->arb_nodes[0]) +#define ARB_NODES(head) (head)->arb_nodes +#define ARB_MAXNODES(head) (head)->arb_maxnodes +#define ARB_CURNODES(head) (head)->arb_curnodes +#define ARB_EMPTY(head) ((head)->arb_curnodes == 0) +#define ARB_FULL(head) ((head)->arb_curnodes >= (head)->arb_maxnodes) +#define ARB_CNODE(head, idx) \ + ((((intptr_t)(idx) <= ARB_NULLIDX) || ((idx) >= ARB_MAXNODES(head))) ? \ + NULL : ((const ARB_ELMTYPE(head))(ARB_NODES(head) + (idx)))) +#define ARB_NODE(head, idx) \ + (__DECONST(ARB_ELMTYPE(head), ARB_CNODE(head, idx))) +#define ARB_ROOT(head) ARB_NODE(head, ARB_ROOTIDX(head)) +#define ARB_LEFT(head, elm, field) ARB_NODE(head, ARB_LEFTIDX(elm, field)) +#define ARB_RIGHT(head, elm, field) ARB_NODE(head, ARB_RIGHTIDX(elm, field)) +#define ARB_PARENT(head, elm, field) ARB_NODE(head, ARB_PARENTIDX(elm, field)) +#define ARB_FREEIDX(head) (head)->arb_free_idx +#define ARB_ROOTIDX(head) (head)->arb_root_idx +#define ARB_MINIDX(head) (head)->arb_min_idx +#define ARB_MAXIDX(head) (head)->arb_max_idx +#define ARB_SELFIDX(head, elm) \ + ((elm) ? ((intptr_t)((((const uint8_t *)(elm)) - \ + ((const uint8_t *)ARB_NODES(head))) / sizeof(*(elm)))) : \ + (intptr_t)ARB_NULLIDX) +#define ARB_LEFTIDX(elm, field) (elm)->field.arbe_left_idx +#define ARB_RIGHTIDX(elm, field) (elm)->field.arbe_right_idx +#define ARB_PARENTIDX(elm, field) (elm)->field.arbe_parent_idx +#define ARB_COLOR(elm, field) (elm)->field.arbe_color +#define ARB_PREVFREE(head, elm, field) \ + ARB_NODE(head, ARB_PREVFREEIDX(elm, field)) +#define ARB_PREVFREEIDX(elm, field) ARB_LEFTIDX(elm, field) +#define ARB_NEXTFREE(head, elm, field) \ + ARB_NODE(head, ARB_NEXTFREEIDX(elm, field)) +#define ARB_NEXTFREEIDX(elm, field) ARB_RIGHTIDX(elm, field) +#define ARB_ISFREE(elm, field) (ARB_COLOR(elm, field) == ARB_NULLCOL) + +#define ARB_SET(head, elm, parent, field) do { \ + ARB_PARENTIDX(elm, field) = \ + parent ? ARB_SELFIDX(head, parent) : ARB_NULLIDX; \ + ARB_LEFTIDX(elm, field) = ARB_RIGHTIDX(elm, field) = ARB_NULLIDX; \ + ARB_COLOR(elm, field) = ARB_RED; \ +} while (/*CONSTCOND*/ 0) + +#define ARB_SET_BLACKRED(black, red, field) do { \ + ARB_COLOR(black, field) = ARB_BLACK; \ + ARB_COLOR(red, field) = ARB_RED; \ +} while (/*CONSTCOND*/ 0) + +#ifndef ARB_AUGMENT +#define ARB_AUGMENT(x) do {} while (0) +#endif + +#define ARB_ROTATE_LEFT(head, elm, tmp, field) do { \ + __typeof(ARB_RIGHTIDX(elm, field)) _tmpidx; \ + (tmp) = ARB_RIGHT(head, elm, field); \ + _tmpidx = ARB_RIGHTIDX(elm, field); \ + ARB_RIGHTIDX(elm, field) = ARB_LEFTIDX(tmp, field); \ + if (ARB_RIGHTIDX(elm, field) != ARB_NULLIDX) { \ + ARB_PARENTIDX(ARB_LEFT(head, tmp, field), field) = \ + ARB_SELFIDX(head, elm); \ + } \ + ARB_AUGMENT(elm); \ + ARB_PARENTIDX(tmp, field) = ARB_PARENTIDX(elm, field); \ + if (ARB_PARENTIDX(tmp, field) != ARB_NULLIDX) { \ + if (ARB_SELFIDX(head, elm) == \ + ARB_LEFTIDX(ARB_PARENT(head, elm, field), field)) \ + ARB_LEFTIDX(ARB_PARENT(head, elm, field), \ + field) = _tmpidx; \ + else \ + ARB_RIGHTIDX(ARB_PARENT(head, elm, field), \ + field) = _tmpidx; \ + } else \ + ARB_ROOTIDX(head) = _tmpidx; \ + ARB_LEFTIDX(tmp, field) = ARB_SELFIDX(head, elm); \ + ARB_PARENTIDX(elm, field) = _tmpidx; \ + ARB_AUGMENT(tmp); \ + if (ARB_PARENTIDX(tmp, field) != ARB_NULLIDX) \ + ARB_AUGMENT(ARB_PARENT(head, tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +#define ARB_ROTATE_RIGHT(head, elm, tmp, field) do { \ + __typeof(ARB_LEFTIDX(elm, field)) _tmpidx; \ + (tmp) = ARB_LEFT(head, elm, field); \ + _tmpidx = ARB_LEFTIDX(elm, field); \ + ARB_LEFTIDX(elm, field) = ARB_RIGHTIDX(tmp, field); \ + if (ARB_LEFTIDX(elm, field) != ARB_NULLIDX) { \ + ARB_PARENTIDX(ARB_RIGHT(head, tmp, field), field) = \ + ARB_SELFIDX(head, elm); \ + } \ + ARB_AUGMENT(elm); \ + ARB_PARENTIDX(tmp, field) = ARB_PARENTIDX(elm, field); \ + if (ARB_PARENTIDX(tmp, field) != ARB_NULLIDX) { \ + if (ARB_SELFIDX(head, elm) == \ + ARB_LEFTIDX(ARB_PARENT(head, elm, field), field)) \ + ARB_LEFTIDX(ARB_PARENT(head, elm, field), \ + field) = _tmpidx; \ + else \ + ARB_RIGHTIDX(ARB_PARENT(head, elm, field), \ + field) = _tmpidx; \ + } else \ + ARB_ROOTIDX(head) = _tmpidx; \ + ARB_RIGHTIDX(tmp, field) = ARB_SELFIDX(head, elm); \ + ARB_PARENTIDX(elm, field) = _tmpidx; \ + ARB_AUGMENT(tmp); \ + if (ARB_PARENTIDX(tmp, field) != ARB_NULLIDX) \ + ARB_AUGMENT(ARB_PARENT(head, tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +#define ARB_RETURNFREE(head, elm, field) \ +({ \ + ARB_COLOR(elm, field) = ARB_NULLCOL; \ + ARB_NEXTFREEIDX(elm, field) = ARB_FREEIDX(head); \ + ARB_FREEIDX(head) = ARB_SELFIDX(head, elm); \ + elm; \ +}) + +#define ARB_GETFREEAT(head, field, fidx) \ +({ \ + __typeof(ARB_NODE(head, 0)) _elm, _prevelm; \ + int _idx = fidx; \ + if (ARB_FREEIDX(head) == ARB_NULLIDX && !ARB_FULL(head)) { \ + /* Populate the free list. */ \ + ARB_ARRFOREACH_REVERSE(_elm, field, head) { \ + if (ARB_ISFREE(_elm, field)) \ + ARB_RETURNFREE(head, _elm, field); \ + } \ + } \ + _elm = _prevelm = ARB_NODE(head, ARB_FREEIDX(head)); \ + for (; _idx > 0 && _elm != NULL; _idx--, _prevelm = _elm) \ + _elm = ARB_NODE(head, ARB_NEXTFREEIDX(_elm, field)); \ + if (_elm) { \ + if (fidx == 0) \ + ARB_FREEIDX(head) = \ + ARB_NEXTFREEIDX(_elm, field); \ + else \ + ARB_NEXTFREEIDX(_prevelm, field) = \ + ARB_NEXTFREEIDX(_elm, field); \ + } \ + _elm; \ +}) +#define ARB_GETFREE(head, field) ARB_GETFREEAT(head, field, 0) + +/* Generates prototypes and inline functions */ +#define ARB_PROTOTYPE(name, type, field, cmp) \ + ARB_PROTOTYPE_INTERNAL(name, type, field, cmp,) +#define ARB_PROTOTYPE_STATIC(name, type, field, cmp) \ + ARB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static) +#define ARB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ + ARB_PROTOTYPE_INSERT_COLOR(name, type, attr); \ + ARB_PROTOTYPE_REMOVE_COLOR(name, type, attr); \ + ARB_PROTOTYPE_INSERT(name, type, attr); \ + ARB_PROTOTYPE_REMOVE(name, type, attr); \ + ARB_PROTOTYPE_CFIND(name, type, attr); \ + ARB_PROTOTYPE_FIND(name, type, attr); \ + ARB_PROTOTYPE_NFIND(name, type, attr); \ + ARB_PROTOTYPE_CNEXT(name, type, attr); \ + ARB_PROTOTYPE_NEXT(name, type, attr); \ + ARB_PROTOTYPE_CPREV(name, type, attr); \ + ARB_PROTOTYPE_PREV(name, type, attr); \ + ARB_PROTOTYPE_CMINMAX(name, type, attr); \ + ARB_PROTOTYPE_MINMAX(name, type, attr); \ + ARB_PROTOTYPE_REBALANCE(name, type, attr); +#define ARB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ + attr void name##_ARB_INSERT_COLOR(struct name *, struct type *) +#define ARB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ + attr void name##_ARB_REMOVE_COLOR(struct name *, struct type *, struct type *) +#define ARB_PROTOTYPE_REMOVE(name, type, attr) \ + attr struct type *name##_ARB_REMOVE(struct name *, struct type *) +#define ARB_PROTOTYPE_INSERT(name, type, attr) \ + attr struct type *name##_ARB_INSERT(struct name *, struct type *) +#define ARB_PROTOTYPE_CFIND(name, type, attr) \ + attr const struct type *name##_ARB_CFIND(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_FIND(name, type, attr) \ + attr struct type *name##_ARB_FIND(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_NFIND(name, type, attr) \ + attr struct type *name##_ARB_NFIND(struct name *, struct type *) +#define ARB_PROTOTYPE_CNFIND(name, type, attr) \ + attr const struct type *name##_ARB_CNFIND(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_CNEXT(name, type, attr) \ + attr const struct type *name##_ARB_CNEXT(const struct name *head,\ + const struct type *) +#define ARB_PROTOTYPE_NEXT(name, type, attr) \ + attr struct type *name##_ARB_NEXT(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_CPREV(name, type, attr) \ + attr const struct type *name##_ARB_CPREV(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_PREV(name, type, attr) \ + attr struct type *name##_ARB_PREV(const struct name *, \ + const struct type *) +#define ARB_PROTOTYPE_CMINMAX(name, type, attr) \ + attr const struct type *name##_ARB_CMINMAX(const struct name *, int) +#define ARB_PROTOTYPE_MINMAX(name, type, attr) \ + attr struct type *name##_ARB_MINMAX(const struct name *, int) +#define ARB_PROTOTYPE_REBALANCE(name, type, attr) \ + attr struct type *name##_ARB_REBALANCE(struct name *, struct type *) + +#define ARB_GENERATE(name, type, field, cmp) \ + ARB_GENERATE_INTERNAL(name, type, field, cmp,) +#define ARB_GENERATE_STATIC(name, type, field, cmp) \ + ARB_GENERATE_INTERNAL(name, type, field, cmp, __unused static) +#define ARB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ + ARB_GENERATE_INSERT_COLOR(name, type, field, attr) \ + ARB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ + ARB_GENERATE_INSERT(name, type, field, cmp, attr) \ + ARB_GENERATE_REMOVE(name, type, field, attr) \ + ARB_GENERATE_CFIND(name, type, field, cmp, attr) \ + ARB_GENERATE_FIND(name, type, field, cmp, attr) \ + ARB_GENERATE_CNEXT(name, type, field, attr) \ + ARB_GENERATE_NEXT(name, type, field, attr) \ + ARB_GENERATE_CPREV(name, type, field, attr) \ + ARB_GENERATE_PREV(name, type, field, attr) \ + ARB_GENERATE_CMINMAX(name, type, field, attr) \ + ARB_GENERATE_MINMAX(name, type, field, attr) \ + ARB_GENERATE_REBALANCE(name, type, field, cmp, attr) + +#define ARB_GENERATE_INSERT_COLOR(name, type, field, attr) \ +attr void \ +name##_ARB_INSERT_COLOR(struct name *head, struct type *elm) \ +{ \ + struct type *parent, *gparent, *tmp; \ + while ((parent = ARB_PARENT(head, elm, field)) != NULL && \ + ARB_COLOR(parent, field) == ARB_RED) { \ + gparent = ARB_PARENT(head, parent, field); \ + if (parent == ARB_LEFT(head, gparent, field)) { \ + tmp = ARB_RIGHT(head, gparent, field); \ + if (tmp && ARB_COLOR(tmp, field) == ARB_RED) { \ + ARB_COLOR(tmp, field) = ARB_BLACK; \ + ARB_SET_BLACKRED(parent, gparent, field); \ + elm = gparent; \ + continue; \ + } \ + if (ARB_RIGHT(head, parent, field) == elm) { \ + ARB_ROTATE_LEFT(head, parent, tmp, field); \ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + ARB_SET_BLACKRED(parent, gparent, field); \ + ARB_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = ARB_LEFT(head, gparent, field); \ + if (tmp && ARB_COLOR(tmp, field) == ARB_RED) { \ + ARB_COLOR(tmp, field) = ARB_BLACK; \ + ARB_SET_BLACKRED(parent, gparent, field); \ + elm = gparent; \ + continue; \ + } \ + if (ARB_LEFT(head, parent, field) == elm) { \ + ARB_ROTATE_RIGHT(head, parent, tmp, field); \ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + ARB_SET_BLACKRED(parent, gparent, field); \ + ARB_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + ARB_COLOR(ARB_ROOT(head), field) = ARB_BLACK; \ +} + +#define ARB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ +attr void \ +name##_ARB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ +{ \ + struct type *tmp; \ + while ((elm == NULL || ARB_COLOR(elm, field) == ARB_BLACK) && \ + elm != ARB_ROOT(head)) { \ + if (ARB_LEFT(head, parent, field) == elm) { \ + tmp = ARB_RIGHT(head, parent, field); \ + if (ARB_COLOR(tmp, field) == ARB_RED) { \ + ARB_SET_BLACKRED(tmp, parent, field); \ + ARB_ROTATE_LEFT(head, parent, tmp, field); \ + tmp = ARB_RIGHT(head, parent, field); \ + } \ + if ((ARB_LEFT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_LEFT(head, tmp, field), field) == ARB_BLACK) && \ + (ARB_RIGHT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_RIGHT(head, tmp, field), field) == ARB_BLACK)) { \ + ARB_COLOR(tmp, field) = ARB_RED; \ + elm = parent; \ + parent = ARB_PARENT(head, elm, field); \ + } else { \ + if (ARB_RIGHT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_RIGHT(head, tmp, field), field) == ARB_BLACK) { \ + struct type *oleft; \ + if ((oleft = ARB_LEFT(head, tmp, field)) \ + != NULL) \ + ARB_COLOR(oleft, field) = ARB_BLACK; \ + ARB_COLOR(tmp, field) = ARB_RED; \ + ARB_ROTATE_RIGHT(head, tmp, oleft, field); \ + tmp = ARB_RIGHT(head, parent, field); \ + } \ + ARB_COLOR(tmp, field) = ARB_COLOR(parent, field); \ + ARB_COLOR(parent, field) = ARB_BLACK; \ + if (ARB_RIGHT(head, tmp, field)) \ + ARB_COLOR(ARB_RIGHT(head, tmp, field), field) = ARB_BLACK; \ + ARB_ROTATE_LEFT(head, parent, tmp, field); \ + elm = ARB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = ARB_LEFT(head, parent, field); \ + if (ARB_COLOR(tmp, field) == ARB_RED) { \ + ARB_SET_BLACKRED(tmp, parent, field); \ + ARB_ROTATE_RIGHT(head, parent, tmp, field); \ + tmp = ARB_LEFT(head, parent, field); \ + } \ + if ((ARB_LEFT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_LEFT(head, tmp, field), field) == ARB_BLACK) && \ + (ARB_RIGHT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_RIGHT(head, tmp, field), field) == ARB_BLACK)) { \ + ARB_COLOR(tmp, field) = ARB_RED; \ + elm = parent; \ + parent = ARB_PARENT(head, elm, field); \ + } else { \ + if (ARB_LEFT(head, tmp, field) == NULL || \ + ARB_COLOR(ARB_LEFT(head, tmp, field), field) == ARB_BLACK) { \ + struct type *oright; \ + if ((oright = ARB_RIGHT(head, tmp, field)) \ + != NULL) \ + ARB_COLOR(oright, field) = ARB_BLACK; \ + ARB_COLOR(tmp, field) = ARB_RED; \ + ARB_ROTATE_LEFT(head, tmp, oright, field); \ + tmp = ARB_LEFT(head, parent, field); \ + } \ + ARB_COLOR(tmp, field) = ARB_COLOR(parent, field); \ + ARB_COLOR(parent, field) = ARB_BLACK; \ + if (ARB_LEFT(head, tmp, field)) \ + ARB_COLOR(ARB_LEFT(head, tmp, field), field) = ARB_BLACK; \ + ARB_ROTATE_RIGHT(head, parent, tmp, field); \ + elm = ARB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + ARB_COLOR(elm, field) = ARB_BLACK; \ +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 14 19:33:37 2019 Return-Path: Delivered-To: svn-src-all@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 02B14FD3A8; Sat, 14 Sep 2019 19:33: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 46W2jr6Fmwz4MSg; Sat, 14 Sep 2019 19:33:36 +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 B9DB22480B; Sat, 14 Sep 2019 19:33: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 x8EJXa9V055117; Sat, 14 Sep 2019 19:33:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EJXaP6055116; Sat, 14 Sep 2019 19:33:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909141933.x8EJXaP6055116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Sep 2019 19:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352338 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 352338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 19:33:37 -0000 Author: ian Date: Sat Sep 14 19:33:36 2019 New Revision: 352338 URL: https://svnweb.freebsd.org/changeset/base/352338 Log: Create a mechanism for encoding a system errno into the IIC_Exxxxx space. Errors are communicated between the i2c controller layer and upper layers (iicbus and slave device drivers) using a set of IIC_Exxxxxx constants which effectively define a private number space separate from (and having values that conflict with) the system errno number space. Sometimes it is necessary to report a plain old system error (especially EINTR) from the controller or bus layer and have that value make it back across the syscall interface intact. I initially considered replicating a few "crucial" errno values with similar names and new numbers, e.g., IIC_EINTR, IIC_ERESTART, etc. It seemed like that had the potential to grow over time until many of the errno names were duplicated into the IIC_Exxxxx space. So instead, this defines a mechanism to "encode" an errno into the IIC_Exxxx space by setting the high bit and putting the errno into the lower-order bits; a new errno2iic() function does this. The existing iic2errno() recognizes the encoded values and extracts the original errno out of the encoded value. An interesting wrinkle occurs with the pseudo-error values such as ERESTART -- they aleady have the high bit set, and turning it off would be the wrong thing to do. Instead, iic2errno() recognizes that lots of high bits are on (i.e., it's a negative number near to zero) and just returns that value as-is. Thus, existing drivers continue to work without needing any changes, and there is now a way to return errno values from the lower layers. The first use of that is in iicbus_poll() which does mtx_sleep() with the PCATCH flag, and needs to return the errno from that up the call chain. Differential Revision: https://reviews.freebsd.org/D20975 Modified: head/sys/dev/iicbus/iiconf.c head/sys/dev/iicbus/iiconf.h Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Sat Sep 14 19:23:46 2019 (r352337) +++ head/sys/dev/iicbus/iiconf.c Sat Sep 14 19:33:36 2019 (r352338) @@ -42,6 +42,18 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" /* + * Encode a system errno value into the IIC_Exxxxx space by setting the + * IIC_ERRNO marker bit, so that iic2errno() can turn it back into a plain + * system errno value later. This lets controller- and bus-layer code get + * important system errno values (such as EINTR/ERESTART) back to the caller. + */ +int +errno2iic(int errno) +{ + return ((errno == 0) ? 0 : errno | IIC_ERRNO); +} + +/* * Translate IIC_Exxxxx status values to vaguely-equivelent errno values. */ int @@ -59,7 +71,22 @@ iic2errno(int iic_status) case IIC_ENOTSUPP: return (EOPNOTSUPP); case IIC_ENOADDR: return (EADDRNOTAVAIL); case IIC_ERESOURCE: return (ENOMEM); - default: return (EIO); + default: + /* + * If the high bit is set, that means it's a system errno value + * that was encoded into the IIC_Exxxxxx space by setting the + * IIC_ERRNO marker bit. If lots of high-order bits are set, + * then it's one of the negative pseudo-errors such as ERESTART + * and we return it as-is. Otherwise it's a plain "small + * positive integer" errno, so just remove the IIC_ERRNO marker + * bit. If it's some unknown number without the high bit set, + * there isn't much we can do except call it an I/O error. + */ + if ((iic_status & IIC_ERRNO) == 0) + return (EIO); + if ((iic_status & 0xFFFF0000) != 0) + return (iic_status); + return (iic_status & ~IIC_ERRNO); } } @@ -97,7 +124,7 @@ iicbus_poll(struct iicbus_softc *sc, int how) return (IIC_EBUSBSY); } - return (error); + return (errno2iic(error)); } /* Modified: head/sys/dev/iicbus/iiconf.h ============================================================================== --- head/sys/dev/iicbus/iiconf.h Sat Sep 14 19:23:46 2019 (r352337) +++ head/sys/dev/iicbus/iiconf.h Sat Sep 14 19:33:36 2019 (r352338) @@ -96,12 +96,14 @@ #define IIC_ENOTSUPP 0x8 /* request not supported */ #define IIC_ENOADDR 0x9 /* no address assigned to the interface */ #define IIC_ERESOURCE 0xa /* resources (memory, whatever) unavailable */ +#define IIC_ERRNO __INT_MIN /* marker bit: errno is in low-order bits */ /* * Note that all iicbus functions return IIC_Exxxxx status values, * except iic2errno() (obviously) and iicbus_started() (returns bool). */ extern int iic2errno(int); +extern int errno2iic(int); extern int iicbus_request_bus(device_t, device_t, int); extern int iicbus_release_bus(device_t, device_t); extern device_t iicbus_alloc_bus(device_t); From owner-svn-src-all@freebsd.org Sat Sep 14 20:26:50 2019 Return-Path: Delivered-To: svn-src-all@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 EEEBAFE338; Sat, 14 Sep 2019 20:26:50 +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 46W3vG62GZz4Psx; Sat, 14 Sep 2019 20:26:50 +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 B23BA251B9; Sat, 14 Sep 2019 20:26:50 +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 x8EKQodr085253; Sat, 14 Sep 2019 20:26:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8EKQov2085252; Sat, 14 Sep 2019 20:26:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909142026.x8EKQov2085252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Sep 2019 20:26:50 +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: r352339 - stable/12/sys/dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/dev/iicbus X-SVN-Commit-Revision: 352339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 20:26:51 -0000 Author: ian Date: Sat Sep 14 20:26:50 2019 New Revision: 352339 URL: https://svnweb.freebsd.org/changeset/base/352339 Log: MFC r351885, r351887 r351885: Ensure a measurement is complete before reading the result in ads111x. Also, disable the comparator by default; it's not used for anything. The previous logic would start a measurement, and then pause_sbt() for the averaging time currently configured in the chip. After waiting that long, the code would blindly read the measurement register and return its value. The problem is that the chip's idea of averaging time is based on its internal free-running 1MHz oscillator, which may be running at a wildly different rate than the kernel clock. If the chip's internal timer was running slower than the kernel clock, we'd end up grabbing a stale result from an old measurement. The driver now still uses pause_sbt() to yield the cpu while waiting for the measurement to complete, but after sleeping it checks the chip's status register to ensure the measurement engine is idle. If it's not, the driver uses a retry loop to wait a bit (5% of the original wait time) then check again for completion. r351887: Use a single write of 3 bytes instead of iicdev_writeto() in ads111x. The iicdev_writeto() function basically does scatter-gather IO by filling in a pair of iic_msg structs to write the register address then the data from different locations but with a single bus START/xfer/STOP sequence. It turns out several low-level i2c controller drivers do not honor the IIC_NOSTART flag, so the second piece of the write gets a new START on the bus, and that confuses the ads111x chips which expect a continuous write of 3 bytes to set a register. A proper fix for this is to track down all the misbehaving controllers drivers and fix them. For now this change makes this driver work again. Modified: stable/12/sys/dev/iicbus/ads111x.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/ads111x.c ============================================================================== --- stable/12/sys/dev/iicbus/ads111x.c Sat Sep 14 19:33:36 2019 (r352338) +++ stable/12/sys/dev/iicbus/ads111x.c Sat Sep 14 20:26:50 2019 (r352339) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #define ADS111x_CONF_GAIN_SHIFT 9 /* Programmable gain amp */ #define ADS111x_CONF_MODE_SHIFT 8 /* Operational mode */ #define ADS111x_CONF_RATE_SHIFT 5 /* Sample rate */ +#define ADS111x_CONF_COMP_DISABLE 3 /* Comparator disable */ #define ADS111x_LOTHRESH 2 /* Compare lo threshold (rw) */ @@ -81,7 +82,8 @@ __FBSDID("$FreeBSD$"); * comparator and we'll leave it alone if they do. That allows them connect the * alert pin to something and use the feature without any help from this driver. */ -#define ADS111x_CONF_DEFAULT (1 << ADS111x_CONF_MODE_SHIFT) +#define ADS111x_CONF_DEFAULT \ + ((1 << ADS111x_CONF_MODE_SHIFT) | ADS111x_CONF_COMP_DISABLE) #define ADS111x_CONF_USERMASK 0x001f /* @@ -165,11 +167,21 @@ struct ads111x_softc { static int ads111x_write_2(struct ads111x_softc *sc, int reg, int val) { - uint8_t data[2]; + uint8_t data[3]; + struct iic_msg msgs[1]; + uint8_t slaveaddr; - be16enc(data, val); + slaveaddr = iicbus_get_addr(sc->dev); - return (iic2errno(iicdev_writeto(sc->dev, reg, data, 2, IIC_WAIT))); + data[0] = reg; + be16enc(&data[1], val); + + msgs[0].slave = slaveaddr; + msgs[0].flags = IIC_M_WR; + msgs[0].len = sizeof(data); + msgs[0].buf = data; + + return (iicbus_transfer_excl(sc->dev, msgs, nitems(msgs), IIC_WAIT)); } static int @@ -189,7 +201,7 @@ static int ads111x_sample_voltage(struct ads111x_softc *sc, int channum, int *voltage) { struct ads111x_channel *chan; - int err, cfgword, convword, rate, waitns; + int err, cfgword, convword, rate, retries, waitns; int64_t fsrange; chan = &sc->channels[channum]; @@ -205,7 +217,8 @@ ads111x_sample_voltage(struct ads111x_softc *sc, int c /* * Calculate how long it will take to make the measurement at the - * current sampling rate (round up), and sleep at least that long. + * current sampling rate (round up). The measurement averaging time + * ranges from 300us to 125ms, so we yield the cpu while waiting. */ rate = sc->chipinfo->ratetab[chan->rateidx]; waitns = (1000000000 + rate - 1) / rate; @@ -213,20 +226,27 @@ ads111x_sample_voltage(struct ads111x_softc *sc, int c if (err != 0 && err != EWOULDBLOCK) return (err); -#if 0 /* - * Sanity-check that the measurement is complete. Not enabled by - * default because checking wastes 200-800us just in moving the status - * command and result across the i2c bus, which could double the time it - * takes to get one measurement. Unlike most i2c slaves, this device - * does not auto-increment the register number on reads, so we can't - * read both status and measurement in one operation. + * In theory the measurement should be available now; we waited long + * enough. However, the chip times its averaging intervals using an + * internal 1 MHz oscillator which likely isn't running at the same rate + * as the system clock, so we have to double-check that the measurement + * is complete before reading the result. If it's not ready yet, yield + * the cpu again for 5% of the time we originally calculated. + * + * Unlike most i2c slaves, this device does not auto-increment the + * register number on reads, so we can't read both status and + * measurement in one operation. */ - if ((err = ads111x_read_2(sc, ADS111x_CONF, &cfgword)) != 0) - return (err); - if (!(cfgword & ADS111x_CONF_IDLE)) - return (EIO); -#endif + for (retries = 5; ; --retries) { + if (retries == 0) + return (EWOULDBLOCK); + if ((err = ads111x_read_2(sc, ADS111x_CONF, &cfgword)) != 0) + return (err); + if (cfgword & ADS111x_CONF_IDLE) + break; + pause_sbt("ads111x", nstosbt(waitns / 20), 0, C_PREL(2)); + } /* Retrieve the sample and convert it to microvolts. */ if ((err = ads111x_read_2(sc, ADS111x_CONV, &convword)) != 0) From owner-svn-src-all@freebsd.org Sat Sep 14 21:18:11 2019 Return-Path: Delivered-To: svn-src-all@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 354CEFF8E7; Sat, 14 Sep 2019 21:18:11 +0000 (UTC) (envelope-from bdragon@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 46W52W0LGjz4Vty; Sat, 14 Sep 2019 21:18:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E319625BFB; Sat, 14 Sep 2019 21:18:10 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ELIAxL017410; Sat, 14 Sep 2019 21:18:10 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ELIA4L017409; Sat, 14 Sep 2019 21:18:10 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201909142118.x8ELIA4L017409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sat, 14 Sep 2019 21:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352340 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 352340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 21:18:11 -0000 Author: bdragon Date: Sat Sep 14 21:18:10 2019 New Revision: 352340 URL: https://svnweb.freebsd.org/changeset/base/352340 Log: Fix aux_info corruption in rtld direct execution mode. After the aux vector is moved, it is necessary to re-digest aux_info so the pointers are updated to the new locations. This was causing thread creation to fail on powerpc64 when using direct execution due to a nonsense value being read for aux_info[AT_STACKPROT]. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D21656 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Sep 14 20:26:50 2019 (r352339) +++ head/libexec/rtld-elf/rtld.c Sat Sep 14 21:18:10 2019 (r352340) @@ -499,6 +499,13 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr if (auxp->a_type == AT_NULL) break; } + /* Since the auxiliary vector has moved, redigest it. */ + for (i = 0; i < AT_COUNT; i++) + aux_info[i] = NULL; + for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { + if (auxp->a_type < AT_COUNT) + aux_info[auxp->a_type] = auxp; + } } else { _rtld_error("No binary"); rtld_die(); From owner-svn-src-all@freebsd.org Sat Sep 14 21:49:43 2019 Return-Path: Delivered-To: svn-src-all@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 BFCDED041F; Sat, 14 Sep 2019 21:49:43 +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 46W5kv4j3tz4X9N; Sat, 14 Sep 2019 21:49:43 +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 8195026139; Sat, 14 Sep 2019 21:49:43 +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 x8ELnh0U035301; Sat, 14 Sep 2019 21:49:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ELnhqE035300; Sat, 14 Sep 2019 21:49:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909142149.x8ELnhqE035300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Sep 2019 21:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352341 - head/contrib/libedit X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libedit X-SVN-Commit-Revision: 352341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 21:49:43 -0000 Author: dim Date: Sat Sep 14 21:49:42 2019 New Revision: 352341 URL: https://svnweb.freebsd.org/changeset/base/352341 Log: Fix arm and aarch64 builds of libedit after r352275 On arm and arm64, where chars are unsigned by default, buildworld dies with: --- terminal.o --- /usr/src/contrib/libedit/terminal.c:569:41: error: comparison of integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka 'unsigned int') [-Werror,-Wsign-compare] el->el_cursor.v][where & 0370] != ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ /usr/src/contrib/libedit/terminal.c:659:28: error: comparison of integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka 'unsigned int') [-Werror,-Wsign-compare] [el->el_cursor.h] == MB_FILL_CHAR) ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ Fix this by making MB_FILL_CHAR a wint_t, so no casting is needed. Note that in https://reviews.freebsd.org/D21584 this was also proposed by Yuichiro Naito . Reviewed by: bapt Subscribers: naito.yuichiro_gmail.com, ml_vishwin.info MFC after: 3 weeks X-MFC-With: r352275 Differential Revision: https://reviews.freebsd.org/D21657 Modified: head/contrib/libedit/chartype.h head/contrib/libedit/terminal.c Modified: head/contrib/libedit/chartype.h ============================================================================== --- head/contrib/libedit/chartype.h Sat Sep 14 21:18:10 2019 (r352340) +++ head/contrib/libedit/chartype.h Sat Sep 14 21:49:42 2019 (r352341) @@ -87,7 +87,7 @@ libedit_private size_t ct_enc_width(wchar_t); /* The terminal is thought of in terms of X columns by Y lines. In the cases * where a wide character takes up more than one column, the adjacent * occupied column entries will contain this faux character. */ -#define MB_FILL_CHAR ((wchar_t)-1) +#define MB_FILL_CHAR ((wint_t)-1) /* Visual width of character c, taking into account ^? , \0177 and \U+nnnnn * style visual expansions. */ Modified: head/contrib/libedit/terminal.c ============================================================================== --- head/contrib/libedit/terminal.c Sat Sep 14 21:18:10 2019 (r352340) +++ head/contrib/libedit/terminal.c Sat Sep 14 21:49:42 2019 (r352341) @@ -1224,7 +1224,7 @@ terminal__putc(EditLine *el, wint_t c) { char buf[MB_LEN_MAX +1]; ssize_t i; - if (c == (wint_t)MB_FILL_CHAR) + if (c == MB_FILL_CHAR) return 0; if (c & EL_LITERAL) return fputs(literal_get(el, c), el->el_outfile); From owner-svn-src-all@freebsd.org Sat Sep 14 22:32:18 2019 Return-Path: Delivered-To: svn-src-all@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 D16C4D11F2; Sat, 14 Sep 2019 22:32:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46W6h256D2z4Z2H; Sat, 14 Sep 2019 22:32:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f54.google.com with SMTP id r26so70343904ioh.8; Sat, 14 Sep 2019 15:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=4Kb+DBm3UHgEBQwT/Js8LftCZM5ObwtPaJVQH6O1IIM=; b=pSlmvqnw9GQ5w/AXju6+tdX1YmAdZN9ZJJFj/bxwpP6aH7yR6AXD6zfVMUUKh3+5Qm sttCSLlyMRxtk8MjiHS7JyRNO5jKA4tIgyInUDz0zuQJc6KlnNTV4I7NjayFiNeI5smD yDOCjqxJECFUTvaQ2fP7VHKS/0rawb/06YAXrUI9cJnGi5RpAUaNPTfBazlYazelsQ34 7ONdBxQ4v9Y1YFItne+swOw6wATGczNtf/MvijQ+ynQoA8Y52bhi0V0u85jM/4gCTjkC wdhscOp5mZhYsRYsWywW8ttl43dRI59S7LSM0FEsBTLFmQTOpta0ZJt+vAAqPOI6+2CY SkYw== X-Gm-Message-State: APjAAAXTh/GAtuzkX/eNPZTrcDYznUul00eFVjsBNFmiV+ettNFnOkJE tP2FKdIvQvM12tTareiWyUnYLTXq X-Google-Smtp-Source: APXvYqzN1JHUfzl4RPOEVK0I7+5qNBydgx3b/mMDChq5/VCSdghmGAgLfLeqmi63toH2rgOEaoUaBw== X-Received: by 2002:a02:4807:: with SMTP id p7mr20990661jaa.95.1568500337271; Sat, 14 Sep 2019 15:32:17 -0700 (PDT) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com. [209.85.166.52]) by smtp.gmail.com with ESMTPSA id i24sm24011573ioe.6.2019.09.14.15.32.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Sep 2019 15:32:16 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id k5so45228070iol.5; Sat, 14 Sep 2019 15:32:16 -0700 (PDT) X-Received: by 2002:a5d:9856:: with SMTP id p22mr8262462ios.231.1568500336219; Sat, 14 Sep 2019 15:32:16 -0700 (PDT) MIME-Version: 1.0 References: <201909141923.x8EJNkVx049506@repo.freebsd.org> In-Reply-To: <201909141923.x8EJNkVx049506@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 14 Sep 2019 15:32:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352337 - in head: share/man/man3 sys/sys tests/sys/sys To: Edward Tomasz Napierala Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46W6h256D2z4Z2H X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 22:32:18 -0000 One correction: On Sat, Sep 14, 2019 at 12:23 PM Edward Tomasz Napierala wrote: > > Author: trasz > Date: Sat Sep 14 19:23:46 2019 > New Revision: 352337 > URL: https://svnweb.freebsd.org/changeset/base/352337 > > Log: > Introduce arb(3), the Array-based Red-Black Tree macros: similar > to the traditional tree(3) RB trees, but using an array (preallocated, > linear chunk of memory) to store the tree. > > This avoids allocation overhead, improves memory locality, > and makes it trivially easy to share/transfer/copy the entire tree > without the need for marshalling. The downside is that the size > is fixed at initialization time; there is no mechanism to resize > it. > > This is one of the dependencies for the new stats(3) framework > (https://reviews.freebsd.org/D20477). > > Reviewed by: bcr (man pages), markj > Discussed with: cem This should read: "Objected to by: cem" Thanks, Conrad