From owner-svn-src-head@freebsd.org Sun Feb 17 01:16:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D5714DA5E5; Sun, 17 Feb 2019 01:16:28 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA895759A2; Sun, 17 Feb 2019 01:16:27 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1028EE81; Sun, 17 Feb 2019 01:16:27 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H1GR7D055736; Sun, 17 Feb 2019 01:16:27 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H1GRg5055735; Sun, 17 Feb 2019 01:16:27 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902170116.x1H1GRg5055735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sun, 17 Feb 2019 01:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344219 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA895759A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 01:16:28 -0000 Author: ganbold Date: Sun Feb 17 01:16:27 2019 New Revision: 344219 URL: https://svnweb.freebsd.org/changeset/base/344219 Log: Add sysctl for setting battery charging current. The charging current can be set using steps from 0: 200mA to 13: 2800mA (200mA/step). While there, fix battery charging current related sensor descriptions. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D19212 Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sat Feb 16 23:57:38 2019 (r344218) +++ head/sys/arm/allwinner/axp81x.c Sun Feb 17 01:16:27 2019 (r344219) @@ -120,6 +120,10 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_VOLTCTL_MASK 0x7f #define AXP_POWERBAT 0x32 #define AXP_POWERBAT_SHUTDOWN (1 << 7) +#define AXP_CHARGERCTL1 0x33 +#define AXP_CHARGERCTL1_MIN 0 +#define AXP_CHARGERCTL1_MAX 13 +#define AXP_CHARGERCTL1_CMASK 0xf #define AXP_IRQEN1 0x40 #define AXP_IRQEN1_ACIN_HI (1 << 6) #define AXP_IRQEN1_ACIN_LO (1 << 5) @@ -614,13 +618,13 @@ static const struct axp8xx_sensors axp8xx_common_senso .id = AXP_SENSOR_BATT_CHARGE_CURRENT, .name = "batchargecurrent", .format = "I", - .desc = "Battery Charging Current", + .desc = "Average Battery Charging Current", }, { .id = AXP_SENSOR_BATT_DISCHARGE_CURRENT, .name = "batdischargecurrent", .format = "I", - .desc = "Battery Discharging Current", + .desc = "Average Battery Discharging Current", }, { .id = AXP_SENSOR_BATT_CAPACITY_PERCENT, @@ -890,6 +894,33 @@ axp8xx_shutdown(void *devp, int howto) } static int +axp8xx_sysctl_chargecurrent(SYSCTL_HANDLER_ARGS) +{ + device_t dev = arg1; + uint8_t data; + int val, error; + + error = axp8xx_read(dev, AXP_CHARGERCTL1, &data, 1); + if (error != 0) + return (error); + + if (bootverbose) + device_printf(dev, "Raw CHARGECTL1 val: 0x%0x\n", data); + val = (data & AXP_CHARGERCTL1_CMASK); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) /* error || read request */ + return (error); + + if ((val < AXP_CHARGERCTL1_MIN) || (val > AXP_CHARGERCTL1_MAX)) + return (EINVAL); + + val |= (data & (AXP_CHARGERCTL1_CMASK << 4)); + axp8xx_write(dev, AXP_CHARGERCTL1, val); + + return (0); +} + +static int axp8xx_sysctl(SYSCTL_HANDLER_ARGS) { struct axp8xx_softc *sc; @@ -1482,6 +1513,16 @@ axp8xx_attach(device_t dev) sc->sensors[i].format, sc->sensors[i].desc); } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "batchargecurrentstep", + CTLTYPE_INT | CTLFLAG_RW, + dev, 0, axp8xx_sysctl_chargecurrent, + "I", "Battery Charging Current Step, " + "0: 200mA, 1: 400mA, 2: 600mA, 3: 800mA, " + "4: 1000mA, 5: 1200mA, 6: 1400mA, 7: 1600mA, " + "8: 1800mA, 9: 2000mA, 10: 2200mA, 11: 2400mA, " + "12: 2600mA, 13: 2800mA"); /* Get thresholds */ if (axp8xx_read(dev, AXP_BAT_CAP_WARN, &val, 1) == 0) { From owner-svn-src-head@freebsd.org Sun Feb 17 03:52:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00EE614E1168; Sun, 17 Feb 2019 03:52:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0EA84398; Sun, 17 Feb 2019 03:52:44 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A61218DD1; Sun, 17 Feb 2019 03:52:44 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3qiCA041664; Sun, 17 Feb 2019 03:52:44 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3qiPo041663; Sun, 17 Feb 2019 03:52:44 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902170352.x1H3qiPo041663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 03:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344227 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 344227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B0EA84398 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 03:52:45 -0000 Author: pkelsey Date: Sun Feb 17 03:52:44 2019 New Revision: 344227 URL: https://svnweb.freebsd.org/changeset/base/344227 Log: Remove whole-disk vdev support from zfsboot This is consistent with the removal of whole-disk vdev support from libsa/zfs/zfs.c in r342151, and is part way to having the LBAs read during probe be fully constrained by partition tables when present. Reviewed by: tsoome MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19142 Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Feb 17 03:35:15 2019 (r344226) +++ head/stand/i386/zfsboot/zfsboot.c Sun Feb 17 03:52:44 2019 (r344227) @@ -545,32 +545,19 @@ probe_drive(struct zfsdsk *zdsk) char *sec; unsigned i; - /* - * If we find a vdev on the whole disk, stop here. - */ - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) - return; - #ifdef LOADER_GELI_SUPPORT /* - * Taste the disk, if it is GELI encrypted, decrypt it and check to see if - * it is a usable vdev then. Otherwise dig - * out the partition table and probe each slice/partition - * in turn for a vdev or GELI encrypted vdev. + * Taste the disk, if it is GELI encrypted, decrypt it then dig out the + * partition table and probe each slice/partition in turn for a vdev or + * GELI encrypted vdev. */ elba = drvsize_ext(zdsk); if (elba > 0) { elba--; } zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:"); - if (zdsk->gdev != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) == 0) { - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - return; - } - } - } + if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0)) + geli_passphrase(zdsk->gdev, gelipw); #endif /* LOADER_GELI_SUPPORT */ sec = dmadat->secbuf; From owner-svn-src-head@freebsd.org Sun Feb 17 03:35:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E16114E082C; Sun, 17 Feb 2019 03:35:16 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0F938393B; Sun, 17 Feb 2019 03:35:15 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C215018A53; Sun, 17 Feb 2019 03:35:15 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3ZFbV031622; Sun, 17 Feb 2019 03:35:15 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3ZFPH031621; Sun, 17 Feb 2019 03:35:15 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902170335.x1H3ZFPH031621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 03:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344226 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 344226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0F938393B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 03:35:16 -0000 Author: pkelsey Date: Sun Feb 17 03:35:15 2019 New Revision: 344226 URL: https://svnweb.freebsd.org/changeset/base/344226 Log: Fix memory corruption bug introduced in r325310 The bug occurred when a bounce buffer was used and the requested read size was greater than the size of the bounce buffer. This commit also rewrites the read logic so that it is easier to systematically verify all alignment and size cases. Reviewed by: allanjude, tsoome MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19140 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Feb 17 03:21:42 2019 (r344225) +++ head/stand/libsa/zfs/zfs.c Sun Feb 17 03:35:15 2019 (r344226) @@ -363,51 +363,100 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t offset, void *buf, size_t bytes) { int fd, ret; - size_t res, size, remainder, rb_size, blksz; - unsigned secsz; - off_t off; - char *bouncebuf, *rb_buf; + size_t res, head, tail, total_size, full_sec_size; + unsigned secsz, do_tail_read; + off_t start_sec; + char *outbuf, *bouncebuf; fd = (uintptr_t) priv; + outbuf = (char *) buf; bouncebuf = NULL; ret = ioctl(fd, DIOCGSECTORSIZE, &secsz); if (ret != 0) return (ret); - off = offset / secsz; - remainder = offset % secsz; - if (lseek(fd, off * secsz, SEEK_SET) == -1) - return (errno); + /* + * Handling reads of arbitrary offset and size - multi-sector case + * and single-sector case. + * + * Multi-sector Case + * (do_tail_read = true if tail > 0) + * + * |<----------------------total_size--------------------->| + * | | + * |<--head-->|<--------------bytes------------>|<--tail-->| + * | | | | + * | | |<~full_sec_size~>| | | + * +------------------+ +------------------+ + * | |0101010| . . . |0101011| | + * +------------------+ +------------------+ + * start_sec start_sec + n + * + * + * Single-sector Case + * (do_tail_read = false) + * + * |<------total_size = secsz----->| + * | | + * |<-head->|<---bytes--->|<-tail->| + * +-------------------------------+ + * | |0101010101010| | + * +-------------------------------+ + * start_sec + */ + start_sec = offset / secsz; + head = offset % secsz; + total_size = roundup2(head + bytes, secsz); + tail = total_size - (head + bytes); + do_tail_read = ((tail > 0) && (head + bytes > secsz)); + full_sec_size = total_size; + if (head > 0) + full_sec_size -= secsz; + if (do_tail_read) + full_sec_size -= secsz; - rb_buf = buf; - rb_size = bytes; - size = roundup2(bytes + remainder, secsz); - blksz = size; - if (remainder != 0 || size != bytes) { + /* Return of partial sector data requires a bounce buffer. */ + if ((head > 0) || do_tail_read) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); return (ENOMEM); } - rb_buf = bouncebuf; - blksz = rb_size - remainder; } - while (bytes > 0) { - res = read(fd, rb_buf, rb_size); - if (res != rb_size) { + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) + return (errno); + + /* Partial data return from first sector */ + if (head > 0) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { ret = EIO; goto error; } - if (bytes < blksz) - blksz = bytes; - if (bouncebuf != NULL) - memcpy(buf, rb_buf + remainder, blksz); - buf = (void *)((uintptr_t)buf + blksz); - bytes -= blksz; - remainder = 0; - blksz = rb_size; + memcpy(outbuf, bouncebuf + head, secsz - head); + outbuf += secsz - head; + } + + /* Full data return from read sectors */ + if (full_sec_size > 0) { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; + } + + /* Partial data return from last sector */ + if (do_tail_read) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, secsz - tail); } ret = 0; From owner-svn-src-head@freebsd.org Sun Feb 17 12:17:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EBE14F0DD5; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB7E6C420; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 0439291FB; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) From: Jan Beich To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344021 - head/share/man/man7 References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> Date: Sun, 17 Feb 2019 13:17:40 +0100 In-Reply-To: <201902112046.x1BKkWFJ007744@repo.freebsd.org> (Edward Tomasz Napierala's message of "Mon, 11 Feb 2019 20:46:32 +0000 (UTC)") Message-ID: <36om-fw2j-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 2AB7E6C420 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 12:17:45 -0000 Edward Tomasz Napierala writes: > ... while the > +.Em quarterly .Em looks unnecessary as "the" is enough. /quarterly is a package set (or repository), not an actual name of the branch. - /head -> /latest - /branches/*Q* -> /quarterly - /tags/RELEASE_* -> /release_* > +subdirectory, eg: Did you mean "subdirectory e.g.," ? https://english.stackexchange.com/questions/16172/should-i-always-use-a-comma-after-e-g-or-i-e From owner-svn-src-head@freebsd.org Sun Feb 17 17:47:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E5C14D715B; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14C1E77ABD; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048E721B6C; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HHl8n5074436; Sun, 17 Feb 2019 17:47:08 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HHl8A7074435; Sun, 17 Feb 2019 17:47:08 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902171747.x1HHl8A7074435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 17:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344234 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 344234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14C1E77ABD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 17:47:09 -0000 Author: pkelsey Date: Sun Feb 17 17:47:08 2019 New Revision: 344234 URL: https://svnweb.freebsd.org/changeset/base/344234 Log: It turns out r344226 narrowed the overrun bug but did not eliminate it entirely This commit fixes a remaining output buffer overrun in the single-sector case when there is a non-zero tail. Reviewed by: allanjude, tsoome MFC after: 3 months MFC with: r344226 Differential Revision: https://reviews.freebsd.org/D19220 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Feb 17 16:56:41 2019 (r344233) +++ head/stand/libsa/zfs/zfs.c Sun Feb 17 17:47:08 2019 (r344234) @@ -435,8 +435,8 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void ret = EIO; goto error; } - memcpy(outbuf, bouncebuf + head, secsz - head); - outbuf += secsz - head; + memcpy(outbuf, bouncebuf + head, min(secsz - head, bytes)); + outbuf += min(secsz - head, bytes); } /* Full data return from read sectors */ From owner-svn-src-head@freebsd.org Sun Feb 17 18:26:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5084C14D8A2B; Sun, 17 Feb 2019 18:26:28 +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 E1F1081124; Sun, 17 Feb 2019 18:26:27 +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 C866622250; Sun, 17 Feb 2019 18:26:27 +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 x1HIQRZX095460; Sun, 17 Feb 2019 18:26:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HIQRdg095459; Sun, 17 Feb 2019 18:26:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201902171826.x1HIQRdg095459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 17 Feb 2019 18:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344235 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 344235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1F1081124 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 18:26:28 -0000 Author: oshogbo Date: Sun Feb 17 18:26:27 2019 New Revision: 344235 URL: https://svnweb.freebsd.org/changeset/base/344235 Log: libnv: fix double free In r343986 we introduced a double free. The structure was already freed fixed in the r302966. This problem was introduced because the GitHub version was out of sync with the FreeBSD one. Submitted by: Mindaugas Rasiukevicius MFC with: r343986 Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Sun Feb 17 17:47:08 2019 (r344234) +++ head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:26:27 2019 (r344235) @@ -229,14 +229,6 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); for (i = 0; i < count; i++) { - nvlist_t *nvl; - nvpair_t *nnvp; - - nvl = nvlarray[i]; - nnvp = nvlist_get_array_next_nvpair(nvl); - if (nnvp != NULL) { - nvpair_free_structure(nnvp); - } nvlist_set_array_next(nvl, NULL); nvlist_set_parent(nvl, NULL); } From owner-svn-src-head@freebsd.org Sun Feb 17 18:33:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C2F14D8DDA; Sun, 17 Feb 2019 18:33:36 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC26581768; Sun, 17 Feb 2019 18:33:35 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.254.108]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MKYsh-1gwoxw3MNr-001whd; Sun, 17 Feb 2019 19:33:31 +0100 Date: Sun, 17 Feb 2019 19:32:53 +0100 From: "O. Hartmann" To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344235 - head/sys/contrib/libnv Message-ID: <20190217193320.799424e6@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201902171826.x1HIQRdg095459@repo.freebsd.org> References: <201902171826.x1HIQRdg095459@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:AlET25rEesps1vqHW+j578f+PT8pBTySZt4ngR3fN9Ga6luoStb Xj8wYgNDD4mGnwIxIuDHctZkcW6qetHS1b+KdOcT2GFRgxQMzmcyUKPIDdvQakY943COMIX +gWy6/qtnaz8S+cjXaPHJEGjKCpSQC+MFGlTb0JKqXG2frg92LgPu0pa5AqWnXRkLXmaohO ap5DEeuOOr3f85ix4O+wA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KEwMJzO+92c=:oitOyEJCCjWwpxBImmgtuh Rr1im0zYrByC27jzKIMusSYOGMjFxmp7+NsG8RBWBJ+83/gIImbCisKKin6BjMS+wEVUkGBW6 5bBwo+XTLsYWvPdP1Tmxpo06FXZEArN6dk3KvNteoGgrMHDaFqWiFDSAa6vN1KYCNFerzATSa ARupNaYHUOlF/OkfaNKc8yVjizpJ8L/XmIaIATEQ5zzbhO/RCoat+EC3eTxEibfu35XWNiANe osQWBhKU2aekS0Ch+lIAZtqcrmK+csQDbWSL9Z2/J9ZgiMYMOyEnxsFdqoHhTxICbBt2pq0hG Q0LFaDH+A+7WpT2pw8hkwt2RH2PtygOKscShxmicUZ2FkQbk6TG5N2Tn4SP0s0oUR7yxBZpOn po3F+DNRnKGNhjNLY1rLmYls+gcTKYSgsOG5f9BYhpIHQHTCGT98De73+oJEFn95zHkuZDOhj s+p3FHw1bCWGAq7a0c5bG1HvHaPTtTBp6JwrymfVsMPwa2P5iMOpskjN0kCxXkKVtchqGSeIE uxF1HlJI2uOD23Z2v0tHsXkA7WeCNvozpkVzKzlV6SpHiFxh14+NudGzLIiYJJfb0vV5oX097 bzYBQPNV9/10fFXjPo4O3O2+3FfHJ7qrJC8g1DY0anQV5gSuexpS0EcsP4Vpba4WgdbuGSfqM U0LugkEeyXA0Y5JGfR+rYQCmQfZ25dv5IC0ZaF9XLejsvxTFEUuRFr0fNgLV9LRBton76e5t1 SAiV8XLNhqzjr08tPg2RyRuB5xsnuGNBct7Bj/bvYwEoWu8bhvsSS3xfrTxVVCls7+RM1X2JZ CnKbhTHlVG8r1+VJKEt7MPFwpBqPvqw0jt6vU4RLmKgE39BceeQj9VLCtuEQrN7iGJF1kiOcL vcW2sF30lH0K2SR1VQ047/3+hxwvM8SgX4ZmMe9f0AlLwMLiG2GVPmFr0ngz+s5bS3MQru35y 490AI+tidOQ== X-Rspamd-Queue-Id: DC26581768 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 18:33:36 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFN1 biwgMTcgRmViIDIwMTkgMTg6MjY6MjcgKzAwMDAgKFVUQykNCk1hcml1c3ogWmFib3Jza2kgPG9z aG9nYm9ARnJlZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBvc2hvZ2JvDQo+IERhdGU6 IFN1biBGZWIgMTcgMTg6MjY6MjcgMjAxOQ0KPiBOZXcgUmV2aXNpb246IDM0NDIzNQ0KPiBVUkw6 IGh0dHBzOi8vc3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzM0NDIzNQ0KPiANCj4g TG9nOg0KPiAgIGxpYm52OiBmaXggZG91YmxlIGZyZWUNCj4gICANCj4gICBJbiByMzQzOTg2IHdl IGludHJvZHVjZWQgYSBkb3VibGUgZnJlZS4gVGhlIHN0cnVjdHVyZSB3YXMgYWxyZWFkeQ0KPiAg IGZyZWVkIGZpeGVkIGluIHRoZSByMzAyOTY2LiBUaGlzIHByb2JsZW0gd2FzIGludHJvZHVjZWQN Cj4gICBiZWNhdXNlIHRoZSBHaXRIdWIgdmVyc2lvbiB3YXMgb3V0IG9mIHN5bmMgd2l0aCB0aGUg RnJlZUJTRCBvbmUuDQo+ICAgDQo+ICAgU3VibWl0dGVkIGJ5OglNaW5kYXVnYXMgUmFzaXVrZXZp Y2l1cyA8cm1pbmRAbmV0YnNkLm9yZz4NCj4gICBNRkMgd2l0aDoJcjM0Mzk4Ng0KPiANCj4gTW9k aWZpZWQ6DQo+ICAgaGVhZC9zeXMvY29udHJpYi9saWJudi9udnBhaXIuYw0KPiANCj4gTW9kaWZp ZWQ6IGhlYWQvc3lzL2NvbnRyaWIvbGlibnYvbnZwYWlyLmMNCj4gPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09DQo+IC0tLSBoZWFkL3N5cy9jb250cmliL2xpYm52L252cGFpci5jCVN1biBGZWIgMTcgMTc6 NDc6MDggMjAxOQkocjM0NDIzNCkNCj4gKysrIGhlYWQvc3lzL2NvbnRyaWIvbGlibnYvbnZwYWly LmMJU3VuIEZlYiAxNyAxODoyNjoyNyAyMDE5CShyMzQ0MjM1KQ0KPiBAQCAtMjI5LDE0ICsyMjks NiBAQCBudnBhaXJfcmVtb3ZlX252bGlzdF9hcnJheShudnBhaXJfdCAqbnZwKQ0KPiAgCW52bGFy cmF5ID0gX19ERUNPTlNUKG52bGlzdF90ICoqLA0KPiAgCSAgICBudnBhaXJfZ2V0X252bGlzdF9h cnJheShudnAsICZjb3VudCkpOw0KPiAgCWZvciAoaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7DQo+ IC0JCW52bGlzdF90ICpudmw7DQo+IC0JCW52cGFpcl90ICpubnZwOw0KPiAtDQo+IC0JCW52bCA9 IG52bGFycmF5W2ldOw0KPiAtCQlubnZwID0gbnZsaXN0X2dldF9hcnJheV9uZXh0X252cGFpcihu dmwpOw0KPiAtCQlpZiAobm52cCAhPSBOVUxMKSB7DQo+IC0JCQludnBhaXJfZnJlZV9zdHJ1Y3R1 cmUobm52cCk7DQo+IC0JCX0NCj4gIAkJbnZsaXN0X3NldF9hcnJheV9uZXh0KG52bCwgTlVMTCk7 DQo+ICAJCW52bGlzdF9zZXRfcGFyZW50KG52bCwgTlVMTCk7DQo+ICAJfQ0KPiBfX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhlYWRAZnJl ZWJzZC5vcmcgbWFpbGluZyBsaXN0DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1h bi9saXN0aW5mby9zdm4tc3JjLWhlYWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55IG1haWwg dG8gInN2bi1zcmMtaGVhZC11bnN1YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KDQpUaGlzIGNvbW1p dCBicmVha3MgYnVpbGR3b3JsZDoNClsuLi5dDQoNCm1rZGlyIC1wICIvdXNyL29iai91c3Ivc3Jj L2FtZDY0LmFtZDY0L3RtcC9sZWdhY3kvL3Vzci9pbmNsdWRlL3N5cyINCj09PT4gbGliL2xpYm52 IChvYmosaW5jbHVkZXMsYWxsLGluc3RhbGwpDQpCdWlsZGluZyAvdXNyL29iai91c3Ivc3JjL2Ft ZDY0LmFtZDY0L3RtcC9vYmotdG9vbHMvbGliL2xpYm52L252cGFpci5vDQotIC0tLSBudnBhaXIu byAtLS0NCi91c3Ivc3JjL3N5cy9jb250cmliL2xpYm52L252cGFpci5jOjIzMjoyNTogZXJyb3I6 IHVzZSBvZiB1bmRlY2xhcmVkIGlkZW50aWZpZXIgJ252bCc7IGRpZCB5b3UNCm1lYW4gJ252cCc/ IG52bGlzdF9zZXRfYXJyYXlfbmV4dChudmwsIE5VTEwpOw0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBefn4NCg0KLSAtLSANCk8uIEhhcnRtYW5uDQoNCkljaCB3aWRlcnNw cmVjaGUgZGVyIE51dHp1bmcgb2RlciDDnGJlcm1pdHRsdW5nIG1laW5lciBEYXRlbiBmw7xyDQpX ZXJiZXp3ZWNrZSBvZGVyIGbDvHIgZGllIE1hcmt0LSBvZGVyIE1laW51bmdzZm9yc2NodW5nICjC pyAyOCBBYnMuIDQgQkRTRykuDQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUtLS0tLQ0KDQppSFVF QVJZSUFCMFdJUVN5OElCeEFQRGtxVkJhVEo0NE4xWlpQYmE1UndVQ1hHbW84QUFLQ1JBNE4xWlpQ YmE1DQpSMWRZQVFESmVpM3J4eHRkbGlUSzEza1JUbEdzUHZHK1hNMnhNSlBodkljQmRVK2syQUQ4 RFQzS0NWdU1qZ3VHDQpXUEZWWGVsVmFBd0lFLzA1RWxWTmcxRlJvWEdXOFFzPQ0KPXRyVksNCi0t LS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-head@freebsd.org Sun Feb 17 16:35:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8A3E14F8F0D; Sun, 17 Feb 2019 16:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 834C87492A; Sun, 17 Feb 2019 16:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2651220F6C; Sun, 17 Feb 2019 16:35:20 +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 x1HGZJVK037071; Sun, 17 Feb 2019 16:35:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGZJCh037070; Sun, 17 Feb 2019 16:35:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171635.x1HGZJCh037070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344231 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 834C87492A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 16:35:21 -0000 Author: markj Date: Sun Feb 17 16:35:19 2019 New Revision: 344231 URL: https://svnweb.freebsd.org/changeset/base/344231 Log: Remove a redundant flag variable. Use the object pointer itself to determine whether the object is locked. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19215 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Feb 17 10:01:42 2019 (r344230) +++ head/sys/vm/vm_pageout.c Sun Feb 17 16:35:19 2019 (r344231) @@ -695,10 +695,9 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, vm_page_t m, marker; int act_delta, error, numpagedout, queue, starting_target; int vnodes_skipped; - bool obj_locked, pageout_ok; + bool pageout_ok; mtx = NULL; - obj_locked = false; object = NULL; starting_target = launder; vnodes_skipped = 0; @@ -760,22 +759,16 @@ recheck: } if (object != m->object) { - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } object = m->object; - } - if (!obj_locked) { if (!VM_OBJECT_TRYWLOCK(object)) { mtx_unlock(mtx); /* Depends on type-stability. */ VM_OBJECT_WLOCK(object); - obj_locked = true; mtx_lock(mtx); goto recheck; - } else - obj_locked = true; + } } if (vm_page_busied(m)) @@ -897,17 +890,13 @@ free_page: vnodes_skipped++; } mtx = NULL; - obj_locked = false; + object = NULL; } } - if (mtx != NULL) { + if (mtx != NULL) mtx_unlock(mtx); - mtx = NULL; - } - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } vm_pagequeue_lock(pq); vm_pageout_end_scan(&ss); vm_pagequeue_unlock(pq); @@ -1368,7 +1357,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh vm_object_t object; int act_delta, addl_page_shortage, deficit, page_shortage; int starting_page_shortage; - bool obj_locked; /* * The addl_page_shortage is an estimate of the number of temporarily @@ -1388,7 +1376,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh starting_page_shortage = page_shortage = shortage + deficit; mtx = NULL; - obj_locked = false; object = NULL; vm_batchqueue_init(&rq); @@ -1446,22 +1433,16 @@ recheck: } if (object != m->object) { - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } object = m->object; - } - if (!obj_locked) { if (!VM_OBJECT_TRYWLOCK(object)) { mtx_unlock(mtx); /* Depends on type-stability. */ VM_OBJECT_WLOCK(object); - obj_locked = true; mtx_lock(mtx); goto recheck; - } else - obj_locked = true; + } } if (vm_page_busied(m)) { @@ -1563,14 +1544,10 @@ free_page: reinsert: vm_pageout_reinsert_inactive(&ss, &rq, m); } - if (mtx != NULL) { + if (mtx != NULL) mtx_unlock(mtx); - mtx = NULL; - } - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } vm_pageout_reinsert_inactive(&ss, &rq, NULL); vm_pageout_reinsert_inactive(&ss, &ss.bq, NULL); vm_pagequeue_lock(pq); From owner-svn-src-head@freebsd.org Sun Feb 17 16:05:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63DC014F83BF; Sun, 17 Feb 2019 16:05:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC16F73888; Sun, 17 Feb 2019 16:05:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id y10so7501120plp.0; Sun, 17 Feb 2019 08:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7CP69BX+lw4/DShjv8GftJWJge1trFK6APLCKeU3kRM=; b=PhlwR2uhmX3KTZb4nYKXLX0q7FqTYCfPDsDdhBTuOj8N9F9HzcTtarGS6gbAAUyHlV gmVuFG2guU/9znCyV2WIILjXQob779ZyCB6miZK8zjKS7fORTiPsgKIpRS9tQ4D6QDRc czz/vJPTw3jsJRJwL89K0mpKlVKSj9vJ/Shx3IQUGjtt/XHNoAXBCNTmrDTXI92q7UsA zGBbAc/GRnjHRLUKzza3bu1b96ijbVVDCFH/Zq5ls0w9RdQcxmoDOOk5csngxg+d2XrM 5yXwDDW8Zy9bTkb+6xuLx8WxJKYDu6bhDkWv3YGWbRShqRojatfJh56cokPVgnRAbVCs 6M7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7CP69BX+lw4/DShjv8GftJWJge1trFK6APLCKeU3kRM=; b=Yro7ht/qTLGp7HasIK8Aab5/CrU7ZNZJdlU4d0rI7XTJDxZayaNGmXAGM63iyUoO8n 2exTaJ0Mox13Sk4qvh0hWUSV2voORYnoNDMZvP6rESgD6UE/xpFAtJvnPHjUro0Zsr/Q LjJ5WWUuESEG4xKQrbAssFn5Yhxb3uuiBPG29oRSoL0BGzXX6ZJiiNuwWAeEr5w+0KdK SfD1zx4qKM6XsyxUK1ZoxjkihXlAxdFR/tE+m6Ww8jAh7jBRrTs/NSoTfkc5pnzExlkx TWOOgW4o4i7gfBFQiH7uAEj2AOLxnVsTxoIGIlR3fe5Dnm2MFJRH8DxOjkGY+rUN/RAw xlxw== X-Gm-Message-State: AHQUAuamsiofCnZihwB4YiEBcNcn6/lZspkynaEMRvkWoCNV2caJnJTn HuG8daJJtmmSD7kN9NEBDxvAaeQO X-Google-Smtp-Source: AHgI3IbLt4CX7CrvzxbH9MGISIXQW9DkWFsiV12/zpNgOsDm+HxVNsyy3K/CXMevOJPgl1uxrJfzCA== X-Received: by 2002:a17:902:f091:: with SMTP id go17mr21058027plb.235.1550419512326; Sun, 17 Feb 2019 08:05:12 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q75sm17921180pfa.38.2019.02.17.08.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Feb 2019 08:05:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344021 - head/share/man/man7 From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <36om-fw2j-wny@FreeBSD.org> Date: Sun, 17 Feb 2019 08:05:10 -0800 Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> <36om-fw2j-wny@FreeBSD.org> To: Jan Beich X-Rspamd-Queue-Id: CC16F73888 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.917,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 16:05:14 -0000 > On Feb 17, 2019, at 04:17, Jan Beich wrote: >=20 > Edward Tomasz Napierala writes: >=20 >> ... while the >> +.Em quarterly >=20 > .Em looks unnecessary as "the" is enough. /quarterly is a package set > (or repository), not an actual name of the branch. >=20 > - /head -> /latest > - /branches/*Q* -> /quarterly > - /tags/RELEASE_* -> /release_* >=20 >> +subdirectory, eg: >=20 > Did you mean "subdirectory e.g.," ? >=20 > https://english.stackexchange.com/questions/16172/should-i-always-use-a-co= mma-after-e-g-or-i-e It=E2=80=99s actually =E2=80=9Csubdirectory, e.g.,=E2=80=9D. igor will corre= ct the usage :). Cheers! -Enji= From owner-svn-src-head@freebsd.org Sun Feb 17 16:43:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2D5414D220C; Sun, 17 Feb 2019 16:43:45 +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 4845B74DFB; Sun, 17 Feb 2019 16:43:45 +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 38E1A21115; Sun, 17 Feb 2019 16:43:45 +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 x1HGhjx8042296; Sun, 17 Feb 2019 16:43:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGhjlF042295; Sun, 17 Feb 2019 16:43:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171643.x1HGhjlF042295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344232 - head/sys/amd64/sgx X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/sgx X-SVN-Commit-Revision: 344232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4845B74DFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 16:43:45 -0000 Author: markj Date: Sun Feb 17 16:43:44 2019 New Revision: 344232 URL: https://svnweb.freebsd.org/changeset/base/344232 Log: Fix refcount leaks in the SGX Linux compat ioctl handler. Some argument validation error paths would return without releasing the file reference obtained at the beginning of the function. While here, fix some style bugs and remove trivial debug prints. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19214 Modified: head/sys/amd64/sgx/sgx_linux.c Modified: head/sys/amd64/sgx/sgx_linux.c ============================================================================== --- head/sys/amd64/sgx/sgx_linux.c Sun Feb 17 16:35:19 2019 (r344231) +++ head/sys/amd64/sgx/sgx_linux.c Sun Feb 17 16:43:44 2019 (r344232) @@ -70,30 +70,26 @@ sgx_linux_ioctl(struct thread *td, struct linux_ioctl_ cmd = args->cmd; args->cmd &= ~(LINUX_IOC_IN | LINUX_IOC_OUT); - if (cmd & LINUX_IOC_IN) + if ((cmd & LINUX_IOC_IN) != 0) args->cmd |= IOC_IN; - if (cmd & LINUX_IOC_OUT) + if ((cmd & LINUX_IOC_OUT) != 0) args->cmd |= IOC_OUT; len = IOCPARM_LEN(cmd); if (len > SGX_IOCTL_MAX_DATA_LEN) { - printf("%s: Can't copy data: cmd len is too big %d\n", - __func__, len); - return (EINVAL); + error = EINVAL; + goto out; } - if (cmd & LINUX_IOC_IN) { + if ((cmd & LINUX_IOC_IN) != 0) { error = copyin((void *)args->arg, data, len); - if (error) { - printf("%s: Can't copy data, error %d\n", - __func__, error); - return (EINVAL); - } + if (error != 0) + goto out; } - error = (fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td)); + error = fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td); +out: fdrop(fp, td); - return (error); } From owner-svn-src-head@freebsd.org Sun Feb 17 18:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5800E14D8DA1; Sun, 17 Feb 2019 18:32:20 +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 EBD3681641; Sun, 17 Feb 2019 18:32:19 +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 DD7BB223EB; Sun, 17 Feb 2019 18:32:19 +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 x1HIWJZo000456; Sun, 17 Feb 2019 18:32:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HIWJQW000455; Sun, 17 Feb 2019 18:32:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201902171832.x1HIWJQW000455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 17 Feb 2019 18:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344236 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 344236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBD3681641 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 18:32:20 -0000 Author: oshogbo Date: Sun Feb 17 18:32:19 2019 New Revision: 344236 URL: https://svnweb.freebsd.org/changeset/base/344236 Log: libnv: fix revert Reported by: jenkins Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:26:27 2019 (r344235) +++ head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:32:19 2019 (r344236) @@ -229,8 +229,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); for (i = 0; i < count; i++) { - nvlist_set_array_next(nvl, NULL); - nvlist_set_parent(nvl, NULL); + nvlist_set_array_next(nvlarray[i], NULL); + nvlist_set_parent(nvlarray[i], NULL); } } From owner-svn-src-head@freebsd.org Sun Feb 17 16:56:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5B1114D2A6A; Sun, 17 Feb 2019 16:56:42 +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 74FEC754D8; Sun, 17 Feb 2019 16:56:42 +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 64E4D212BE; Sun, 17 Feb 2019 16:56:42 +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 x1HGugj4047682; Sun, 17 Feb 2019 16:56:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGug58047681; Sun, 17 Feb 2019 16:56:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171656.x1HGug58047681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344233 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74FEC754D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 16:56:43 -0000 Author: markj Date: Sun Feb 17 16:56:41 2019 New Revision: 344233 URL: https://svnweb.freebsd.org/changeset/base/344233 Log: Remove a write-only variable orphaned by r340677. Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sun Feb 17 16:43:44 2019 (r344232) +++ head/sys/kern/sys_pipe.c Sun Feb 17 16:56:41 2019 (r344233) @@ -379,9 +379,7 @@ void pipe_dtor(struct pipe *dpipe) { struct pipe *peer; - ino_t ino; - ino = dpipe->pipe_ino; peer = (dpipe->pipe_state & PIPE_NAMED) != 0 ? dpipe->pipe_peer : NULL; funsetown(&dpipe->pipe_sigio); pipeclose(dpipe); From owner-svn-src-head@freebsd.org Sun Feb 17 23:46:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55CF14E6164; Sun, 17 Feb 2019 23:46:12 +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 53DFE8F2E5; Sun, 17 Feb 2019 23:46:12 +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 451CE258F0; Sun, 17 Feb 2019 23:46:12 +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 x1HNkCA9067352; Sun, 17 Feb 2019 23:46:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNkCSl067351; Sun, 17 Feb 2019 23:46:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172346.x1HNkCSl067351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344240 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53DFE8F2E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 23:46:13 -0000 Author: ian Date: Sun Feb 17 23:46:11 2019 New Revision: 344240 URL: https://svnweb.freebsd.org/changeset/base/344240 Log: Make lsdev -v output line up in neat columns by using a fixed width for the size field and a tab between the partition type and the size. Changes this disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB to this disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:38:17 2019 (r344239) +++ head/stand/common/disk.c Sun Feb 17 23:46:11 2019 (r344240) @@ -75,7 +75,7 @@ display_size(uint64_t size, u_int sectorsize) size /= 1024; unit = 'M'; } - sprintf(buf, "%ld%cB", (long)size, unit); + sprintf(buf, "%4ld%cB", (long)size, unit); return (buf); } @@ -119,12 +119,9 @@ ptable_print(void *arg, const char *pname, const struc od = (struct open_disk *)pa->dev->dd.d_opendata; sectsize = od->sectorsize; partsize = part->end - part->start + 1; - sprintf(line, " %s%s: %s", pa->prefix, pname, - parttype2str(part->type)); - if (pa->verbose) - sprintf(line, "%-*s%s", PWIDTH, line, - display_size(partsize, sectsize)); - strcat(line, "\n"); + sprintf(line, " %s%s: %s\t%s\n", pa->prefix, pname, + parttype2str(part->type), + pa->verbose ? display_size(partsize, sectsize) : ""); if (pager_output(line)) return 1; res = 0; From owner-svn-src-head@freebsd.org Sun Feb 17 23:48:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 649EE14E635C; Sun, 17 Feb 2019 23:48:52 +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 00CF98F4E2; Sun, 17 Feb 2019 23:48:52 +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 BD1E1258FA; Sun, 17 Feb 2019 23:48:51 +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 x1HNmpii067501; Sun, 17 Feb 2019 23:48:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNmpO7067500; Sun, 17 Feb 2019 23:48:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172348.x1HNmpO7067500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344241 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00CF98F4E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 23:48:52 -0000 Author: ian Date: Sun Feb 17 23:48:51 2019 New Revision: 344241 URL: https://svnweb.freebsd.org/changeset/base/344241 Log: Garbage collection no-longer-used constant. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:46:11 2019 (r344240) +++ head/stand/common/disk.c Sun Feb 17 23:48:51 2019 (r344241) @@ -102,7 +102,6 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o blocks * od->sectorsize, (char *)buf, NULL)); } -#define PWIDTH 35 static int ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { @@ -154,7 +153,6 @@ ptable_print(void *arg, const char *pname, const struc return (res); } -#undef PWIDTH int disk_print(struct disk_devdesc *dev, char *prefix, int verbose) From owner-svn-src-head@freebsd.org Sun Feb 17 23:32:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A481214E57DC; Sun, 17 Feb 2019 23:32:10 +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 4AECF8E903; Sun, 17 Feb 2019 23:32:10 +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 34D0425602; Sun, 17 Feb 2019 23:32:10 +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 x1HNW9Fm059441; Sun, 17 Feb 2019 23:32:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNW9ut059440; Sun, 17 Feb 2019 23:32:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172332.x1HNW9ut059440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344238 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AECF8E903 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 23:32:11 -0000 Author: ian Date: Sun Feb 17 23:32:09 2019 New Revision: 344238 URL: https://svnweb.freebsd.org/changeset/base/344238 Log: Restore loader(8)'s ability for lsdev to show partitions within a bsd slice. I'm pretty sure this used to work at one time, perhaps long ago. It has been failing recently because if you call disk_open() with dev->d_partition set to -1 when d_slice refers to a bsd slice, it assumes you want it to open the first partition within that slice. When you then pass that open dev instance to ptable_open(), it tries to read the start of the 'a' partition and decides there is no recognizable partition type there. This restores the old functionality by resetting d_offset to the start of the raw slice after disk_open() returns. For good measure, d_partition is also set back to -1, although that doesn't currently affect anything. I would have preferred to make disk_open() avoid such rude assumptions and if you ask for partition -1 you get the raw slice. But the commit history shows that someone already did that once (r239058), and had to revert it (r239232), so I didn't even try to go down that road. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 20:25:07 2019 (r344237) +++ head/stand/common/disk.c Sun Feb 17 23:32:09 2019 (r344238) @@ -133,6 +133,13 @@ ptable_print(void *arg, const char *pname, const struc dev.d_partition = -1; if (disk_open(&dev, part->end - part->start + 1, od->sectorsize) == 0) { + /* + * disk_open() for partition -1 on a bsd slice assumes + * you want the first bsd partition. Reset things so + * that we're looking at the start of the raw slice. + */ + dev.d_partition = -1; + dev.d_offset = part->start; table = ptable_open(&dev, part->end - part->start + 1, od->sectorsize, ptblread); if (table != NULL) { From owner-svn-src-head@freebsd.org Sun Feb 17 23:38:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0531514E5AF2; Sun, 17 Feb 2019 23:38:18 +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 9D7C88EC1B; Sun, 17 Feb 2019 23:38:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A0E125746; Sun, 17 Feb 2019 23:38:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HNcHMA061984; Sun, 17 Feb 2019 23:38:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNcHhq061983; Sun, 17 Feb 2019 23:38:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172338.x1HNcHhq061983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344239 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D7C88EC1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 23:38:18 -0000 Author: ian Date: Sun Feb 17 23:38:17 2019 New Revision: 344239 URL: https://svnweb.freebsd.org/changeset/base/344239 Log: Use a couple local variables to avoid repetitive long expressions that cause line-wrapping. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:32:09 2019 (r344238) +++ head/stand/common/disk.c Sun Feb 17 23:38:17 2019 (r344239) @@ -112,15 +112,18 @@ ptable_print(void *arg, const char *pname, const struc struct ptable *table; char line[80]; int res; + u_int sectsize; + uint64_t partsize; pa = (struct print_args *)arg; od = (struct open_disk *)pa->dev->dd.d_opendata; + sectsize = od->sectorsize; + partsize = part->end - part->start + 1; sprintf(line, " %s%s: %s", pa->prefix, pname, parttype2str(part->type)); if (pa->verbose) sprintf(line, "%-*s%s", PWIDTH, line, - display_size(part->end - part->start + 1, - od->sectorsize)); + display_size(partsize, sectsize)); strcat(line, "\n"); if (pager_output(line)) return 1; @@ -131,8 +134,7 @@ ptable_print(void *arg, const char *pname, const struc dev.dd.d_unit = pa->dev->dd.d_unit; dev.d_slice = part->index; dev.d_partition = -1; - if (disk_open(&dev, part->end - part->start + 1, - od->sectorsize) == 0) { + if (disk_open(&dev, partsize, sectsize) == 0) { /* * disk_open() for partition -1 on a bsd slice assumes * you want the first bsd partition. Reset things so @@ -140,8 +142,7 @@ ptable_print(void *arg, const char *pname, const struc */ dev.d_partition = -1; dev.d_offset = part->start; - table = ptable_open(&dev, part->end - part->start + 1, - od->sectorsize, ptblread); + table = ptable_open(&dev, partsize, sectsize, ptblread); if (table != NULL) { sprintf(line, " %s%s", pa->prefix, pname); bsd.dev = pa->dev; From owner-svn-src-head@freebsd.org Mon Feb 18 01:57:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B64514EC1F0; Mon, 18 Feb 2019 01:57:49 +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 C73886D8A9; Mon, 18 Feb 2019 01:57:48 +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 9C29E26ED8; Mon, 18 Feb 2019 01:57:48 +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 x1I1vmx7035272; Mon, 18 Feb 2019 01:57:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I1vmlA035269; Mon, 18 Feb 2019 01:57:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201902180157.x1I1vmlA035269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 18 Feb 2019 01:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344242 - in head: etc/mtree stand/powerpc/uboot usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: etc/mtree stand/powerpc/uboot usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 344242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73886D8A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 01:57:49 -0000 Author: jhibbits Date: Mon Feb 18 01:57:47 2019 New Revision: 344242 URL: https://svnweb.freebsd.org/changeset/base/344242 Log: powerpc/boot: Move ubldr to /boot/uboot, and make this a separate filesystem Summary: Now that mpc85xx can boot via ubldr, move ubldr to a separate filesystem, mounted on /boot/uboot, so that a fresh install can boot correctly. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D18709 Modified: head/etc/mtree/BSD.root.dist head/stand/powerpc/uboot/Makefile head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sun Feb 17 23:48:51 2019 (r344241) +++ head/etc/mtree/BSD.root.dist Mon Feb 18 01:57:47 2019 (r344242) @@ -26,6 +26,8 @@ .. modules .. + uboot + .. zfs .. .. Modified: head/stand/powerpc/uboot/Makefile ============================================================================== --- head/stand/powerpc/uboot/Makefile Sun Feb 17 23:48:51 2019 (r344241) +++ head/stand/powerpc/uboot/Makefile Mon Feb 18 01:57:47 2019 (r344242) @@ -11,6 +11,7 @@ LOADER_BZIP2_SUPPORT?= no .include +BINDIR= /boot/uboot PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Sun Feb 17 23:48:51 2019 (r344241) +++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Feb 18 01:57:47 2019 (r344242) @@ -94,9 +94,10 @@ bootpart_size(const char *part_type) return (0); if (strcmp(platform, "chrp") == 0) return (800*1024); - if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0 || - strcmp(platform, "mpc85xx") == 0) + if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0) return (512*1024*1024); + if (strcmp(platform, "mpc85xx") == 0) + return (16*1024*1024); return (0); } @@ -111,13 +112,16 @@ bootpart_type(const char *scheme, const char **mountpo return ("prep-boot"); if (strcmp(platform, "powermac") == 0) return ("apple-boot"); - if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0 || - strcmp(platform, "mpc85xx") == 0) { + if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0) { *mountpoint = "/boot"; if (strcmp(scheme, "GPT") == 0) return ("ms-basic-data"); else if (strcmp(scheme, "MBR") == 0) return ("fat32"); + } + if (strcmp(platform, "mpc85xx") == 0) { + *mountpoint = "/boot/uboot"; + return ("fat16"); } return ("freebsd-boot"); From owner-svn-src-head@freebsd.org Mon Feb 18 02:59:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FD114EFCA6; Mon, 18 Feb 2019 02:59:48 +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 233DD70885; Mon, 18 Feb 2019 02:59:48 +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 135262792D; Mon, 18 Feb 2019 02:59:48 +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 x1I2xl0A066208; Mon, 18 Feb 2019 02:59:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I2xler066207; Mon, 18 Feb 2019 02:59:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902180259.x1I2xler066207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 Feb 2019 02:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344243 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 344243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DD70885 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 02:59:48 -0000 Author: kevans Date: Mon Feb 18 02:59:47 2019 New Revision: 344243 URL: https://svnweb.freebsd.org/changeset/base/344243 Log: lualoader: only clear the screen before first password prompt This was previously an unconditional screen clear, regardless of whether or not we would be prompting for any passwords. This is pointless, given that the screen clear is only there to put our screen into a consistent state before we draw the prompts and do cursor manipulation. This is also the only screen clear besides that to draw the menu. One can now see early pre-loader and loader output with the menu disabled, which may be useful for diagnostics. Reported by: ian MFC after: 3 days Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password -- Asterisks as a password mask local show_password_mask = false local twiddle_chars = {"/", "-", "\\", "|"} +local screen_setup = false -- Module exports function password.read(prompt_length) @@ -80,14 +81,18 @@ function password.read(prompt_length) end function password.check() - screen.clear() - screen.defcursor() -- pwd is optionally supplied if we want to check it local function doPrompt(prompt, pwd) local attempts = 1 local function clear_incorrect_text_prompt() printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) + end + + if not screen_setup then + screen.clear() + screen.defcursor() + screen_setup = true end while true do From owner-svn-src-head@freebsd.org Mon Feb 18 03:03:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E0614F0168 for ; Mon, 18 Feb 2019 03:03:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1798671131 for ; Mon, 18 Feb 2019 03:03:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 757218C65 for ; Mon, 18 Feb 2019 03:03:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f172.google.com with SMTP id z20so11987083ljj.10 for ; Sun, 17 Feb 2019 19:03:58 -0800 (PST) X-Gm-Message-State: AHQUAuYilVvWs+llVPH28vKyMpVBkzPhkpzjB2l0ToVWdzvry59yIZ46 U8h1647lSPe/maDvXALbI6qyDs2Hu+aB2ycY19o= X-Received: by 2002:a2e:6801:: with SMTP id c1mt758231lja.81.1550459036909; Sun, 17 Feb 2019 19:03:56 -0800 (PST) MIME-Version: 1.0 References: <201902180259.x1I2xler066207@repo.freebsd.org> In-Reply-To: <201902180259.x1I2xler066207@repo.freebsd.org> From: Kyle Evans Date: Sun, 17 Feb 2019 21:03:45 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1798671131 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 03:03:59 -0000 On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > Author: kevans > Date: Mon Feb 18 02:59:47 2019 > New Revision: 344243 > URL: https://svnweb.freebsd.org/changeset/base/344243 > > Log: > lualoader: only clear the screen before first password prompt > > This was previously an unconditional screen clear, regardless of whether or > not we would be prompting for any passwords. This is pointless, given that > the screen clear is only there to put our screen into a consistent state > before we draw the prompts and do cursor manipulation. > > This is also the only screen clear besides that to draw the menu. One can > now see early pre-loader and loader output with the menu disabled, which may > be useful for diagnostics. > > Reported by: ian > MFC after: 3 days > > Modified: > head/stand/lua/password.lua > > Modified: head/stand/lua/password.lua > ============================================================================== > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password > -- Asterisks as a password mask > local show_password_mask = false > local twiddle_chars = {"/", "-", "\\", "|"} > +local screen_setup = false > > -- Module exports > function password.read(prompt_length) > @@ -80,14 +81,18 @@ function password.read(prompt_length) > end > > function password.check() > - screen.clear() > - screen.defcursor() > -- pwd is optionally supplied if we want to check it > local function doPrompt(prompt, pwd) > local attempts = 1 > > local function clear_incorrect_text_prompt() > printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) > + end > + > + if not screen_setup then > + screen.clear() > + screen.defcursor() > + screen_setup = true > end > > while true do > I noted in testing that this may look kinda funky if you have neither a bootlock password or GELi prompt done by loader(8), but you have a loader password. The autoboot text gets blown away by the subsequent clear screen. I'd be interesting in feedback as to whether this looks odd or how important it is that the autoboot text remains intact, as it's an easy fix to retain it. From owner-svn-src-head@freebsd.org Mon Feb 18 03:15:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B08514F087B; Mon, 18 Feb 2019 03:15:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E35D8719AF; Mon, 18 Feb 2019 03:15:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3A327CF3; Mon, 18 Feb 2019 03:15:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1I3FP1L077891; Mon, 18 Feb 2019 03:15:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3FPkD077890; Mon, 18 Feb 2019 03:15:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902180315.x1I3FPkD077890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Feb 2019 03:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344244 - head/usr.sbin/rpc.ypupdated X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/rpc.ypupdated X-SVN-Commit-Revision: 344244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E35D8719AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 03:15:26 -0000 Author: avos Date: Mon Feb 18 03:15:25 2019 New Revision: 344244 URL: https://svnweb.freebsd.org/changeset/base/344244 Log: Fix memory / resource leaks in usr.sbin/rpc.ypupdated/update.c Re-apply r343909 to this file to get the issue fixed. PR: 204956 Reported by: David Binderman MFC after: 5 days Modified: head/usr.sbin/rpc.ypupdated/update.c Modified: head/usr.sbin/rpc.ypupdated/update.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/update.c Mon Feb 18 02:59:47 2019 (r344243) +++ head/usr.sbin/rpc.ypupdated/update.c Mon Feb 18 03:15:25 2019 (r344244) @@ -263,11 +263,14 @@ localupdate(char *name, char *filename, u_int op, u_in sprintf(tmpname, "%s.tmp", filename); rf = fopen(filename, "r"); if (rf == NULL) { - return (ERR_READ); + err = ERR_READ; + goto cleanup; } wf = fopen(tmpname, "w"); if (wf == NULL) { - return (ERR_WRITE); + fclose(rf); + err = ERR_WRITE; + goto cleanup; } err = -1; while (fgets(line, sizeof (line), rf)) { @@ -307,13 +310,17 @@ localupdate(char *name, char *filename, u_int op, u_in fclose(rf); if (err == 0) { if (rename(tmpname, filename) < 0) { - return (ERR_DBASE); + err = ERR_DBASE; + goto cleanup; } } else { if (unlink(tmpname) < 0) { - return (ERR_DBASE); + err = ERR_DBASE; + goto cleanup; } } +cleanup: + free(tmpname); return (err); } From owner-svn-src-head@freebsd.org Mon Feb 18 03:23:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB08114F0E4C; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ABD37206F; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0159327EBB; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1I3NAls082979; Mon, 18 Feb 2019 03:23:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3NAna082978; Mon, 18 Feb 2019 03:23:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902180323.x1I3NAna082978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Feb 2019 03:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344245 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Commit-Revision: 344245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4ABD37206F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 03:23:11 -0000 Author: avos Date: Mon Feb 18 03:23:10 2019 New Revision: 344245 URL: https://svnweb.freebsd.org/changeset/base/344245 Log: snmp_hostres(3): fix a typo in sanity checks in handle_chunk() PR: 204253 Submitted by: David Binderman MFC after: 5 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Mon Feb 18 03:15:25 2019 (r344244) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Mon Feb 18 03:23:10 2019 (r344245) @@ -312,7 +312,7 @@ handle_chunk(int32_t ds_index, const char *chunk_name, assert(chunk_name != NULL); assert(chunk_name[0] != '\0'); - if (chunk_name == NULL || chunk_name == '\0') + if (chunk_name == NULL || chunk_name[0] == '\0') return; HRDBG("ANALYZE chunk %s", chunk_name); From owner-svn-src-head@freebsd.org Mon Feb 18 03:41:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4438814F1476; Mon, 18 Feb 2019 03:41:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 96F0F72A19; Mon, 18 Feb 2019 03:41:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1I3fjva003562; Sun, 17 Feb 2019 19:41:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1I3fjf5003561; Sun, 17 Feb 2019 19:41:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344243 - head/stand/lua In-Reply-To: To: Kyle Evans Date: Sun, 17 Feb 2019 19:41:45 -0800 (PST) CC: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 96F0F72A19 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 03:41:49 -0000 > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > > > Author: kevans > > Date: Mon Feb 18 02:59:47 2019 > > New Revision: 344243 > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > Log: > > lualoader: only clear the screen before first password prompt > > > > This was previously an unconditional screen clear, regardless of whether or > > not we would be prompting for any passwords. This is pointless, given that > > the screen clear is only there to put our screen into a consistent state > > before we draw the prompts and do cursor manipulation. > > > > This is also the only screen clear besides that to draw the menu. One can > > now see early pre-loader and loader output with the menu disabled, which may > > be useful for diagnostics. > > > > Reported by: ian > > MFC after: 3 days > > > > Modified: > > head/stand/lua/password.lua > > > > Modified: head/stand/lua/password.lua > > ============================================================================== > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password > > -- Asterisks as a password mask > > local show_password_mask = false > > local twiddle_chars = {"/", "-", "\\", "|"} > > +local screen_setup = false > > > > -- Module exports > > function password.read(prompt_length) > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > end > > > > function password.check() > > - screen.clear() > > - screen.defcursor() > > -- pwd is optionally supplied if we want to check it > > local function doPrompt(prompt, pwd) > > local attempts = 1 > > > > local function clear_incorrect_text_prompt() > > printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) > > + end > > + > > + if not screen_setup then > > + screen.clear() > > + screen.defcursor() > > + screen_setup = true > > end > > > > while true do > > > > I noted in testing that this may look kinda funky if you have neither > a bootlock password or GELi prompt done by loader(8), but you have a > loader password. The autoboot text gets blown away by the subsequent > clear screen. I'd be interesting in feedback as to whether this looks > odd or how important it is that the autoboot text remains intact, as > it's an easy fix to retain it. Personally I would like to see all screen clears go away, as they always seem to wipe out the very diagnostic output that would tell you what went wrong. If possible, instead of clearing the screen, we should go to the bottom and scroll it upwards, drawing new things and scrolling old things off the top. screen clear == evil, unless specifically requested by the user. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 18 03:49:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73F3A14F171A; Mon, 18 Feb 2019 03:49:17 +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 180EF72CBC; Mon, 18 Feb 2019 03:49:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0927E287; Mon, 18 Feb 2019 03:49:17 +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 x1I3nGNA093919; Mon, 18 Feb 2019 03:49:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3nGnt093918; Mon, 18 Feb 2019 03:49:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902180349.x1I3nGnt093918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Feb 2019 03:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344246 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 344246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 180EF72CBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 03:49:17 -0000 Author: emaste Date: Mon Feb 18 03:49:16 2019 New Revision: 344246 URL: https://svnweb.freebsd.org/changeset/base/344246 Log: kdump: expand comment on reasons for CAPFAIL_LOOKUP Comment for CAPFAIL_LOOKUP refered only to paths containing ".." but it is returned for other restricted VFS lookup cases, such as absolute paths or openat(AT_FDCWD, ...). Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Feb 18 03:23:10 2019 (r344245) +++ head/usr.bin/kdump/kdump.c Mon Feb 18 03:49:16 2019 (r344246) @@ -2006,7 +2006,7 @@ ktrcapfail(struct ktr_cap_fail *ktr) printf("disallowed system call"); break; case CAPFAIL_LOOKUP: - /* used ".." in strict-relative mode */ + /* absolute or AT_FDCWD path, ".." path, etc. */ printf("restricted VFS lookup"); break; default: From owner-svn-src-head@freebsd.org Mon Feb 18 04:11:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0C014F1F88 for ; Mon, 18 Feb 2019 04:11:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 0CBBF7367C for ; Mon, 18 Feb 2019 04:11:17 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1550463008; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=tmOv4PTWVZW1oq8V0y8QsEtvVtqTOp6qlTX4saCgIvt2p1A9eVKdEnQQGaJExXlq/6+01T7OXpIKz fpeBPhWCDPhZgPquvvpuRGmgOuzYsvP74W4dTQVNdnrLZ5D8NnqrI2hxtp/SxzYfBG/XwAjhPEafxU lt2nlp1LeGOE8zpbM3CibiumczjIvvhLb/+5tIqgxrNLqBRFelDb2X08iOz7ZzhXK7aky+NfF8BQhD zZvbOoInUVXpDNnFKi5IkUIccYeLneD68zzoQz/IgXjeePhtUA1PS/DwmCykxVCffJ6QrPO0pRXkVI LldIBa3OfqcDLYajTqIGcCfbspHwk2g== 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=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=I8wGST9o2tdEZHzQYUPAxLrx1kEd2V3E8fJHByMk8P6eiSfEuQc2Aj0HBEAT2YB7//wKzbZneqBbd 3TBK8rdj65hAwjeKuy1g9gPu78uRHjyhSEUWgZpspS40R7KLvjysTNGUQtx3otYwcOEocgKZwXtuWD u4PRQ5ANYqbkPkONHoykL73kWhcm3rHKvZQhlf9srueVjw4Qcj3vid/C7/sw+dqfz3Fab16zDmat3R xKBbx56kl3JEpa+sMt1sqJf22yih7XGR1nIGtccG/alsylndzEBDvFJtJHNQgbUwoXg3DbImKrSOqS su+x5NvKx5qRIGDcQIvGjTpaYAhvjyw== 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=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=P/fe3PPVxhnnMRgjSoc0hSQo3P/Ly2b91l3VCv/UNJ9tqsAyNRb15ZyzyydPg8/uGw+KTFJGPMnGj DT/AOFLdQoytLnMuzefTOuP200tMI4VclYtroZCu24frPLFPU/u0hocCZTN46Jbg3x0HQ2bNijAvet /OXDkd9zLg7oF/xXgG8OV8XrsfJeI637YJOQIC80AZZkAqnNZYLArx3KbjljcG59xlaebQtVibwJzD cdyjYr9ZNcm9DjOXxYle/XBL0+kcOuNhqhW4dCYC7kov3mta/ajhVrW8jpZfx7L7m3yMB2s6pVGXTu tfiD5fDzgNqpxqMc98KMtSjp5X0Ty3A== X-MHO-RoutePath: aGlwcGll X-MHO-User: 12eb1e51-3333-11e9-befd-af03bedce89f 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 12eb1e51-3333-11e9-befd-af03bedce89f; Mon, 18 Feb 2019 04:10:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1I4B9uf076837; Sun, 17 Feb 2019 21:11:09 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua From: Ian Lepore To: rgrimes@freebsd.org, Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 17 Feb 2019 21:11:09 -0700 In-Reply-To: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> 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: 0CBBF7367C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 04:11:19 -0000 On Sun, 2019-02-17 at 19:41 -0800, Rodney W. Grimes wrote: > > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans > > wrote: > > > > > > Author: kevans > > > Date: Mon Feb 18 02:59:47 2019 > > > New Revision: 344243 > > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > > > Log: > > > lualoader: only clear the screen before first password prompt > > > > > > This was previously an unconditional screen clear, regardless > > > of whether or > > > not we would be prompting for any passwords. This is pointless, > > > given that > > > the screen clear is only there to put our screen into a > > > consistent state > > > before we draw the prompts and do cursor manipulation. > > > > > > This is also the only screen clear besides that to draw the > > > menu. One can > > > now see early pre-loader and loader output with the menu > > > disabled, which may > > > be useful for diagnostics. > > > > > > Reported by: ian > > > MFC after: 3 days > > > > > > Modified: > > > head/stand/lua/password.lua > > > > > > Modified: head/stand/lua/password.lua > > > ================================================================= > > > ============= > > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 > > > 2019 (r344242) > > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 > > > 2019 (r344243) > > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect > > > password > > > -- Asterisks as a password mask > > > local show_password_mask = false > > > local twiddle_chars = {"/", "-", "\\", "|"} > > > +local screen_setup = false > > > > > > -- Module exports > > > function password.read(prompt_length) > > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > > end > > > > > > function password.check() > > > - screen.clear() > > > - screen.defcursor() > > > -- pwd is optionally supplied if we want to check it > > > local function doPrompt(prompt, pwd) > > > local attempts = 1 > > > > > > local function clear_incorrect_text_prompt() > > > printc("\r" .. string.rep(" ", > > > #INCORRECT_PASSWORD)) > > > + end > > > + > > > + if not screen_setup then > > > + screen.clear() > > > + screen.defcursor() > > > + screen_setup = true > > > end > > > > > > while true do > > > > > > > I noted in testing that this may look kinda funky if you have > > neither > > a bootlock password or GELi prompt done by loader(8), but you have > > a > > loader password. The autoboot text gets blown away by the > > subsequent > > clear screen. I'd be interesting in feedback as to whether this > > looks > > odd or how important it is that the autoboot text remains intact, > > as > > it's an easy fix to retain it. > > Personally I would like to see all screen clears go away, > as they always seem to wipe out the very diagnostic output > that would tell you what went wrong. > > If possible, instead of clearing the screen, we should go to the > bottom and scroll it upwards, drawing new things and scrolling > old things off the top. > > screen clear == evil, unless specifically requested by the user. > Screen clear before drawing the menu makes sense. What I noticed is that the screen was still clearing even with beastie_disable=YES. Clearing before prompting for passwords seems like a marginal case... as Kyle mentioned, you've got to get the screen into a known state so that not-echoing the typed pw works reliably. -- Ian From owner-svn-src-head@freebsd.org Mon Feb 18 04:44:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E9C414F28FF; Mon, 18 Feb 2019 04:44:54 +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 A4F60748CC; Mon, 18 Feb 2019 04:44:53 +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 95668CFE; Mon, 18 Feb 2019 04:44:53 +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 x1I4ir9X024969; Mon, 18 Feb 2019 04:44:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I4irNv024967; Mon, 18 Feb 2019 04:44:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902180444.x1I4irNv024967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 04:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344247 - in head/stand/uboot: common lib X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/stand/uboot: common lib X-SVN-Commit-Revision: 344247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4F60748CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 04:44:54 -0000 Author: ian Date: Mon Feb 18 04:44:52 2019 New Revision: 344247 URL: https://svnweb.freebsd.org/changeset/base/344247 Log: Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot loaderdev variable works correctly. The uboot_devdesc struct is variously cast back and forth between uboot_devdesc and disk_devdesc as pointers are handed off through various opaque interfaces. uboot_devdesc attempted to mimic the layout of disk_devdesc by having a devdesc struct, followed by a union of some device-specific stuff that included a struct that contains the same fields as a disk_devdesc. However, one of those fields inside the struct is 64-bit which causes the entire union to be 64-bit aligned -- 32 bits of padding is added between the struct devdesc and the union, so the whole mess ends up NOT properly mimicking a disk_devdesc after all. (In disk_devdesc there is also 32 bits of padding, but it shows up immediately before the d_offset field, rather than before the whole collection of d_* fields.) This fixes the problem by using an anonymous union to overlay the devdesc field uboot network devices need with the disk_devdesc that uboot storage devices need. This is a different solution than the one contributed with the PR (so if anything goes wrong, the blame goes to me), but 95% of the credit for this fix goes to Pawel Worach and Manuel Stuhn who analyzed the problem and proposed a fix. PR: 233097 Modified: head/stand/uboot/common/main.c head/stand/uboot/lib/libuboot.h Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 03:49:16 2019 (r344246) +++ head/stand/uboot/common/main.c Mon Feb 18 04:44:52 2019 (r344247) @@ -310,13 +310,13 @@ print_disk_probe_info() char slice[32]; char partition[32]; - if (currdev.d_disk.slice > 0) - sprintf(slice, "%d", currdev.d_disk.slice); + if (currdev.d_disk.d_slice > 0) + sprintf(slice, "%d", currdev.d_disk.d_slice); else strcpy(slice, ""); - if (currdev.d_disk.partition >= 0) - sprintf(partition, "%d", currdev.d_disk.partition); + if (currdev.d_disk.d_partition >= 0) + sprintf(partition, "%d", currdev.d_disk.d_partition); else strcpy(partition, ""); @@ -332,8 +332,8 @@ probe_disks(int devidx, int load_type, int load_unit, int open_result, unit; struct open_file f; - currdev.d_disk.slice = load_slice; - currdev.d_disk.partition = load_partition; + currdev.d_disk.d_slice = load_slice; + currdev.d_disk.d_partition = load_partition; f.f_devdata = &currdev; open_result = -1; Modified: head/stand/uboot/lib/libuboot.h ============================================================================== --- head/stand/uboot/lib/libuboot.h Mon Feb 18 03:49:16 2019 (r344246) +++ head/stand/uboot/lib/libuboot.h Mon Feb 18 04:44:52 2019 (r344247) @@ -27,18 +27,14 @@ * $FreeBSD$ */ +#include + struct uboot_devdesc { - struct devdesc dd; /* Must be first. */ union { - struct { - int slice; - int partition; - off_t offset; - } disk; - } d_kind; + struct devdesc dd; + struct disk_devdesc d_disk; + }; }; - -#define d_disk d_kind.disk /* * Default network packet alignment in memory. On arm arches packets must be From owner-svn-src-head@freebsd.org Mon Feb 18 05:18:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB50C14F3535 for ; Mon, 18 Feb 2019 05:18:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E45A7592E for ; Mon, 18 Feb 2019 05:18:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x835.google.com with SMTP id n32so17856303qte.11 for ; Sun, 17 Feb 2019 21:18:32 -0800 (PST) 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=Qk9pHpPd+kQrC79Z3TmbUiq+OBO+OWKv6g25AaCx18k=; b=pc0ErA2uZMQg0o32PNQlGJ0KgQNFYScq09bKkQXc5GGs1RaQ+oeQZL+/KMK8O2Ail3 E3PXW9jst7spwkJxgt1WxXJLT6LouT1jIDGZh9sfEgRY4lqoHRCxIIDdJAiOb/y9K+hz PGZPPRZT8ukj3dekpP2OP1HA7kRU/MlBpBVHClV+NUW2MlW2RayyGvnSpBGywd68rye1 kVub2eNYSTvS+jyHmMmyT04yWow9GoRQ/yvXNdYO7U85/Bul8iZk4s5OfFFUwFrzgMkf LRgBau4Oy+gxlh0DUvJcPLqw17V+EC2pjjPpFzw6s0wiPQlYJYQWVlrkvoBWnGJKJ2Ue ZWIg== 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=Qk9pHpPd+kQrC79Z3TmbUiq+OBO+OWKv6g25AaCx18k=; b=iwAWU/lD8Qd3I8f80O3wWoFUi+dt/vgzFJiuc8gAjy8Rk/vxAgicSExsJNdi9a7j8m KGH4UQ0bVuu5qeoblsiawIX83Tis+ELL6UvZ4InyxPOOwM6Ww3kjHgFkv7vxRzETDUAe jKviAvqfmNRQee1Zvay39sW/zlo9pbEkSV51BbSS4QpqG76b+T9yti4L9nzQ983cRT+9 dnZgUykqEgMaGpI3y8DZvQqpq7W1yvXSui0ua538ZCdSLDH9KSipdhiPk97UhBNoM+ZB MktdFGGir7feG5kIWkwG6pfDOEJMfR0cc3NKGup79R+SITENR8Twk5WqzPHZzekDM/3G O3EA== X-Gm-Message-State: AHQUAuaHc9zKrhd7lUGdd+DWNOQkuM1J95XNMs7SE82lQz3TJilNkDNM BvUYE5A6cbi3lMQSQ6eHqctsUHNr8DEdO/9Z2T0pPw== X-Google-Smtp-Source: AHgI3IYdg95C7OgD8S3TWbWz8+jELar++ifFBb0/YaF9JZuDmIBno0J+S/HQqGgg3O3Ge506m0qsn2WB74PjtDH/xpY= X-Received: by 2002:a0c:e98f:: with SMTP id z15mr16251322qvn.115.1550467111786; Sun, 17 Feb 2019 21:18:31 -0800 (PST) MIME-Version: 1.0 References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 17 Feb 2019 22:18:20 -0700 Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4E45A7592E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 05:18:33 -0000 On Sun, Feb 17, 2019 at 8:42 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > > > > > Author: kevans > > > Date: Mon Feb 18 02:59:47 2019 > > > New Revision: 344243 > > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > > > Log: > > > lualoader: only clear the screen before first password prompt > > > > > > This was previously an unconditional screen clear, regardless of > whether or > > > not we would be prompting for any passwords. This is pointless, > given that > > > the screen clear is only there to put our screen into a consistent > state > > > before we draw the prompts and do cursor manipulation. > > > > > > This is also the only screen clear besides that to draw the menu. > One can > > > now see early pre-loader and loader output with the menu disabled, > which may > > > be useful for diagnostics. > > > > > > Reported by: ian > > > MFC after: 3 days > > > > > > Modified: > > > head/stand/lua/password.lua > > > > > > Modified: head/stand/lua/password.lua > > > > ============================================================================== > > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 > (r344242) > > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 > (r344243) > > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect > password > > > -- Asterisks as a password mask > > > local show_password_mask = false > > > local twiddle_chars = {"/", "-", "\\", "|"} > > > +local screen_setup = false > > > > > > -- Module exports > > > function password.read(prompt_length) > > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > > end > > > > > > function password.check() > > > - screen.clear() > > > - screen.defcursor() > > > -- pwd is optionally supplied if we want to check it > > > local function doPrompt(prompt, pwd) > > > local attempts = 1 > > > > > > local function clear_incorrect_text_prompt() > > > printc("\r" .. string.rep(" ", > #INCORRECT_PASSWORD)) > > > + end > > > + > > > + if not screen_setup then > > > + screen.clear() > > > + screen.defcursor() > > > + screen_setup = true > > > end > > > > > > while true do > > > > > > > I noted in testing that this may look kinda funky if you have neither > > a bootlock password or GELi prompt done by loader(8), but you have a > > loader password. The autoboot text gets blown away by the subsequent > > clear screen. I'd be interesting in feedback as to whether this looks > > odd or how important it is that the autoboot text remains intact, as > > it's an easy fix to retain it. > > Personally I would like to see all screen clears go away, > as they always seem to wipe out the very diagnostic output > that would tell you what went wrong. > Sometimes it's unavoidable. But we have bigger problems here: when you set the console output to something other than default, for example, all messages before we do that (which we necessarily have to do late) are lost. Clearing the screen isn't the problem here: the lack of a dmesg-like history is the problem. > If possible, instead of clearing the screen, we should go to the > bottom and scroll it upwards, drawing new things and scrolling > old things off the top. > This isn't always possible. We don't necessarily know how many lines to scroll, and this will cause things to be overwritten in all serial scenarios, which we get complaints about. > screen clear == evil, unless specifically requested by the user. > Again, the issue is destroying information, not necessarily screen clearing. We did a lot of that traditionally in the FORTH loader too, and weren't always that good about it. I do agree clearing unconditionally at the start is a hassle, especially when you turn off menus. However, with menus, the expectation is to clear the screen so you'd have a clean presentation of the menu. So if we're really worried about error messages, we should implement a history mechanism to get the early printed stuff. It was one of the items that we spoke about while I was doing the Lua work and associated technical debt retirement. There were many other items that were on the list ahead of this feature, and likely still are. Warner From owner-svn-src-head@freebsd.org Mon Feb 18 07:17:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E83714F5BD7; Mon, 18 Feb 2019 07:17:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 0B3218160E; Mon, 18 Feb 2019 07:17:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=53550 helo=[192.168.86.51]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gvd3l-0001Xc-2v; Sun, 17 Feb 2019 23:09:49 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344243 - head/stand/lua From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: Date: Sun, 17 Feb 2019 23:17:46 -0800 Cc: "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, dteske@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> To: Warner Losh Sender: devin@shxd.cx X-Rspamd-Queue-Id: 0B3218160E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 07:17:50 -0000 > On 17 Feb 2019, at 9:18 PM, Warner Losh wrote: >=20 > We did a lot of that traditionally in the FORTH loader too, and weren't al= ways that good about it. Uh, no. I only clear regions of the screen by positioning the cursor using A= NSI escape sequences and then drawing spaces. I do not clear the screen =E2=80= =9Ca lot=E2=80=9D and would like to think I was damned good about it. =E2=80=94=20 Devin= From owner-svn-src-head@freebsd.org Mon Feb 18 08:25:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB07214F724C; Mon, 18 Feb 2019 08:25:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBD483971; Mon, 18 Feb 2019 08:25:03 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 95AB92025619; Mon, 18 Feb 2019 08:24:57 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x1I8Ovlo062271 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 08:24:57 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x1I8OuXA062264; Mon, 18 Feb 2019 08:24:56 GMT (envelope-from phk) To: Devin Teske cc: Warner Losh , "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344243 - head/stand/lua In-reply-to: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> From: "Poul-Henning Kamp" References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <62261.1550478296.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Feb 2019 08:24:56 +0000 Message-ID: <62262.1550478296@critter.freebsd.dk> X-Rspamd-Queue-Id: 2BBD483971 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 08:25:04 -0000 -------- In message <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org>, Devin Teske= writes: >Uh, no. I only clear regions of the screen by positioning the cursor usin= g >ANSI escape sequences and then drawing spaces. [...] One thing the loader should do, is clear any scrolling regions which may have been left behind, for instance after a panic. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-head@freebsd.org Mon Feb 18 08:26:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D8414F72D3; Mon, 18 Feb 2019 08:26:19 +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 D55B283ADF; Mon, 18 Feb 2019 08:26:18 +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 C157D31F9; Mon, 18 Feb 2019 08:26:18 +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 x1I8QIgD040684; Mon, 18 Feb 2019 08:26:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I8QI0K040683; Mon, 18 Feb 2019 08:26:18 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902180826.x1I8QI0K040683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 18 Feb 2019 08:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344248 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 344248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D55B283ADF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 08:26:19 -0000 Author: tsoome Date: Mon Feb 18 08:26:18 2019 New Revision: 344248 URL: https://svnweb.freebsd.org/changeset/base/344248 Log: cd9660: dirmatch fails to unmatch when name is prefix for directory record Loader does fail to properly match the file name in directory record and does open file based on prefix match. For fix, we check the name lengths first. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19213 Modified: head/stand/libsa/cd9660.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Mon Feb 18 04:44:52 2019 (r344247) +++ head/stand/libsa/cd9660.c Mon Feb 18 08:26:18 2019 (r344248) @@ -241,6 +241,10 @@ dirmatch(struct open_file *f, const char *path, struct icase = 1; } else icase = 0; + + if (strlen(path) != len) + return (0); + for (i = len; --i >= 0; path++, cp++) { if (!*path || *path == '/') break; From owner-svn-src-head@freebsd.org Mon Feb 18 11:43:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CB5314D7514; Mon, 18 Feb 2019 11:43:07 +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 A2F5E8AB10; Mon, 18 Feb 2019 11:43:05 +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 c8694b62; Mon, 18 Feb 2019 06:40:51 -0500 (EST) 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 83485eea TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 18 Feb 2019 06:40:50 -0500 (EST) From: Charlie Li Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: freebsd-toolchain@freebsd.org References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> Openpgp: preference=signencrypt 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 Message-ID: Date: Mon, 18 Feb 2019 06:40:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zB5u772myuDxqfDd8RswRUnRHHcJn4JCU" X-Rspamd-Queue-Id: A2F5E8AB10 X-Spamd-Bar: -------- X-Spamd-Result: default: False [-8.57 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[vishwin.info:+]; DMARC_POLICY_ALLOW(-0.50)[vishwin.info,reject]; MX_GOOD(-0.01)[varun.vishwin.info,gehlot.vishwin.info]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-2.47)[ip: (-9.91), ipnet: 46.101.80.0/20(-4.96), asn: 14061(2.58), country: US(-0.07)]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[vishwin.info:s=fuccboi12]; TAGGED_FROM(0.00)[freebsd]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 11:43:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU Content-Type: multipart/mixed; boundary="GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G"; protected-headers="v1" From: Charlie Li To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: freebsd-toolchain@freebsd.org Message-ID: Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> In-Reply-To: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> --GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 11/12/2018 14:05, Dimitry Andric wrote: > head/contrib/libc++/include/type_traits >=20 The change to the above named file breaks building any C++ code containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, but not 8.0.0.r1 or any earlier LLVM) on head (but not projects/clang800-import, obviously). Example error, from our own copy of LLVM libunwind: --- libunwind.o --- In file included from /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56: error: _Float16 is not supported on this target template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; ^ 1 error generated. *** [libunwind.o] Error code 1 Upstream LLVM has already reverted this: https://reviews.llvm.org/D53670 world builds successfully after applying the upstream revert. Ports that use the clang portion of devel/llvm80 when set in DEFAULT_VERSIONS, ie gecko@, also build successfully. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G-- --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU 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+jnB43vIDq2wFAlxqmcAACgkQjnB43vID q2ypdRAAjZS/6RBLNWI8wJtLtdxzMuAoGdxs4eJy6+fGmaXPDVHEylE0bonjMZ3Q UlM0Gp16Iv4wfQixPHl4BVM93sbesODe6tzf1Un5CIfpZdQbqPSID3Ma1wD+Iles 4WAlRG+xgByAuNqEbBefQ19Ez/6h0UyobXe7OW59ZcJTACeTFLJsh0tBldZT6XvE nKhyi2AoBLwX4T5KYxvrB4dL4t4SN12zBzgIXG5rGk8iMm6W344LTYYFKf0/KP4+ tZ8Ey+vtquIKhipyp55Dp1maJ1Jmf9LUSYqmFJxyEtdPMb7hHtYUcXA+/YfbAMKw 3UWOAIXtIQYNxtaVOs3TfQCerj2LAbDMYnmXMJGKdwDrQ2/ol3utYwgGwKMmadyQ 57/rPojoIfqYMclm0L04xcYdv/PCA3yUKbb8ZbKlHERO0oH3xixfF8L9Iox9u2wb 6D61Jaf4JeVv/PUYcuWiaV4UN59gWHOmt7bLrpL+iVHsR4CRynHm/B2B7w0Gh7qA tw2EGstWpgl0+i4CwKLukwxCOG//wdzV45vL03AANsz2pteTAV0+blIRHxb6oqvb N2CiD6us/IPNJJJi0sx3eZAvVAaGve08WFclOu0P3xvLXWjBUE4WUSv4G3i+vyE5 R2K26mRICQKy0+Vjg/X7mFt2cpC+DUpi49mYyjkXVtsuKH0IedI= =EcN3 -----END PGP SIGNATURE----- --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU-- From owner-svn-src-head@freebsd.org Mon Feb 18 11:49:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A55E114D77D8; Mon, 18 Feb 2019 11:49:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 374D48AEBA; Mon, 18 Feb 2019 11:49:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [192.168.1.32] (92-111-45-98.static.v4.ziggozakelijk.nl [92.111.45.98]) (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 1BC6032367; Mon, 18 Feb 2019 12:49:08 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... Date: Mon, 18 Feb 2019 12:49:07 +0100 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org To: Charlie Li References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 11:49:17 -0000 --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 18 Feb 2019, at 12:40, Charlie Li via freebsd-toolchain = wrote: >=20 > On 11/12/2018 14:05, Dimitry Andric wrote: >> head/contrib/libc++/include/type_traits >>=20 > The change to the above named file breaks building any C++ code > containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, = but > not 8.0.0.r1 or any earlier LLVM) on head (but not > projects/clang800-import, obviously). Example error, from our own copy > of LLVM libunwind: >=20 > --- libunwind.o --- > In file included from > /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: > In file included from > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: > In file included from > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: > = /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56: > error: _Float16 is not supported on this target > template <> struct __libcpp_is_floating_point<_Float16> : > public true_type {}; > ^ > 1 error generated. > *** [libunwind.o] Error code 1 Hm, which target did you compile for? I have run multiple universe builds, so I thought I had covered all possible targets. Or are you building with gcc? > Upstream LLVM has already reverted this: = https://reviews.llvm.org/D53670 >=20 > world builds successfully after applying the upstream revert. Ports = that > use the clang portion of devel/llvm80 when set in DEFAULT_VERSIONS, ie > gecko@, also build successfully. Thanks, I'll take a look. -Dimitry --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14 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 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXGqbswAKCRCwXqMKLiCW o6ztAJ0TEzT8R6YqBoYDJmbOx28qZhyjbwCfVq88r0/J6AfoMQ0O+iQ3JuSqg1Y= =t2C1 -----END PGP SIGNATURE----- --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14-- From owner-svn-src-head@freebsd.org Mon Feb 18 12:02:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C57314D97B5; Mon, 18 Feb 2019 12:02:23 +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 B01638BB2B; Mon, 18 Feb 2019 12:02:22 +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 98149a9d; Mon, 18 Feb 2019 07:02:18 -0500 (EST) 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 911474ac TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 18 Feb 2019 07:02:18 -0500 (EST) Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> From: Charlie Li Openpgp: preference=signencrypt 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 Message-ID: Date: Mon, 18 Feb 2019 07:02:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ" X-Rspamd-Queue-Id: B01638BB2B X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[freebsd]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 12:02:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ Content-Type: multipart/mixed; boundary="vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ"; protected-headers="v1" From: Charlie Li To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org Message-ID: Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> In-Reply-To: --vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 18/02/2019 06:49, Dimitry Andric wrote: > On 18 Feb 2019, at 12:40, Charlie Li via freebsd-toolchain wrote: >> >> On 11/12/2018 14:05, Dimitry Andric wrote: >>> head/contrib/libc++/include/type_traits >>> >> The change to the above named file breaks building any C++ code >> containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, bu= t >> not 8.0.0.r1 or any earlier LLVM) on head (but not >> projects/clang800-import, obviously). Example error, from our own copy= >> of LLVM libunwind: >> >> --- libunwind.o --- >> In file included from >> /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: >> In file included from >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: >> In file included from >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56= : >> error: _Float16 is not supported on this target >> template <> struct __libcpp_is_floating_point<_Float16> : >> public true_type {}; >> ^ >> 1 error generated. >> *** [libunwind.o] Error code 1 >=20 > Hm, which target did you compile for? I have run multiple universe > builds, so I thought I had covered all possible targets. Or are you > building with gcc? >=20 Building head using xtoolchain-llvm80 on amd64, for amd64. Interestingly didn't error when cross-building for aarch64. The projects/clang800-import branch already has the bit in question reverted, so is a moot point there. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ-- --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ 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+jnB43vIDq2wFAlxqnsMACgkQjnB43vID q2yPcw/9HYsFnCBac7vX/Un9Co2E5cXVz11fma339t6bi6TPfSJvuE57rbiKoWwA J+A2pTjFsDFH4epmpeNcdbGDXs96vyYvipGKvA/i+zfqvsHJW/U3ypukpgIZoHMQ gLQ467P+mc1RXii1iqGf2Ypu9M1ZFiRwbx4gDZ2JkZjyOhx/ebyCw+nBoONy7yCi hTYj0Vy9+ES9ZBnrM7a7zFQMEzX1ZZqUx+/nsVIdOLHBge8kau8/yO6mSJxm0adq IrKwdauvKdyvZoRKPvXP9nHqtmugo93sNCYqGsH2AWpUspxVlHP9L7X0uLo9JXJ5 25i/uZcR51evXJsCRgsmq6gfgZQN1I6YV0XH+Xg4B3tNMBwNJUuqrjhfd+5ggUR2 HZhi9RU7T+Utrsn52rr39Luzmpf5timyt/09p8TlR6qN0gkr0HaWRSOiCApD05oU qrcyvEcCpVJpUpsZ6DVTr6hFqCwYxoWW784SmX53bopx7qhlvhIUyMLQLMo/53VH r6rrjAx3IY1B46vYLUSg6aTLSZC+5j+uZc9GfuUinu9CTdZ4GfRsirQ1q0bICsSF ZrRaj9dJ0sPi70diSTl8KtFfk/P6BdV1BCC7J3Ac1TzJyhJvgjFCpHRxBoYBeM0t /22GrSTfwTxZvKaKq1I9PqXtyoDolxgjHeSU534eURZE9pT3A8E= =3W4s -----END PGP SIGNATURE----- --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ-- From owner-svn-src-head@freebsd.org Mon Feb 18 13:09:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9366014DBBE8 for ; Mon, 18 Feb 2019 13:09:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-zteg10021301.me.com (pv50p00im-zteg10021301.me.com [17.58.6.46]) (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 2C00E8E097 for ; Mon, 18 Feb 2019 13:09:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-zteg10021301.me.com (Postfix) with ESMTPSA id C0B895800E8; Mon, 18 Feb 2019 13:09:05 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344238 - head/stand/common From: Toomas Soome In-Reply-To: <201902172332.x1HNW9ut059440@repo.freebsd.org> Date: Mon, 18 Feb 2019 15:09:02 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> References: <201902172332.x1HNW9ut059440@repo.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-18_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902180099 X-Rspamd-Queue-Id: 2C00E8E097 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 13:09:15 -0000 > On 18 Feb 2019, at 01:32, Ian Lepore wrote: >=20 > Author: ian > Date: Sun Feb 17 23:32:09 2019 > New Revision: 344238 > URL: https://svnweb.freebsd.org/changeset/base/344238 >=20 > Log: > Restore loader(8)'s ability for lsdev to show partitions within a bsd = slice. >=20 > I'm pretty sure this used to work at one time, perhaps long ago. It = has > been failing recently because if you call disk_open() with = dev->d_partition > set to -1 when d_slice refers to a bsd slice, it assumes you want it = to > open the first partition within that slice. When you then pass that = open > dev instance to ptable_open(), it tries to read the start of the 'a' > partition and decides there is no recognizable partition type there. >=20 > This restores the old functionality by resetting d_offset to the = start > of the raw slice after disk_open() returns. For good measure, = d_partition > is also set back to -1, although that doesn't currently affect = anything. >=20 > I would have preferred to make disk_open() avoid such rude = assumptions and > if you ask for partition -1 you get the raw slice. But the commit = history > shows that someone already did that once (r239058), and had to revert = it > (r239232), so I didn't even try to go down that road. What was the reason for the revert? I still do think the current = disk_open() approach is not good because it does break the promise to = get MBR partition (see common/disk.h).=20 Of course I can see the appeal for something like =E2=80=9Cboot = disk0:=E2=80=9D but case like that should be solved by iterating = partition table, and not by making API to do wrong thing - if I did ask = to for disk0s0: I really would expect to get disk0s0: and not disk0s0a: But anyhow, it would be good to understand the actual reasoning behind = that decision. rgds, toomas >=20 > Modified: > head/stand/common/disk.c >=20 > Modified: head/stand/common/disk.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/stand/common/disk.c Sun Feb 17 20:25:07 2019 = (r344237) > +++ head/stand/common/disk.c Sun Feb 17 23:32:09 2019 = (r344238) > @@ -133,6 +133,13 @@ ptable_print(void *arg, const char *pname, const = struc > dev.d_partition =3D -1; > if (disk_open(&dev, part->end - part->start + 1, > od->sectorsize) =3D=3D 0) { > + /* > + * disk_open() for partition -1 on a bsd slice = assumes > + * you want the first bsd partition. Reset = things so > + * that we're looking at the start of the raw = slice. > + */ > + dev.d_partition =3D -1; > + dev.d_offset =3D part->start; > table =3D ptable_open(&dev, part->end - = part->start + 1, > od->sectorsize, ptblread); > if (table !=3D NULL) { >=20 From owner-svn-src-head@freebsd.org Mon Feb 18 13:14:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F99F14DBE3E; Mon, 18 Feb 2019 13:14:54 +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 29D888E8C3; Mon, 18 Feb 2019 13:14:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D533F65BC; Mon, 18 Feb 2019 13:14:53 +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 x1IDErNL091675; Mon, 18 Feb 2019 13:14:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IDErbM091674; Mon, 18 Feb 2019 13:14:53 GMT (envelope-from br@FreeBSD.org) Message-Id: <201902181314.x1IDErbM091674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 18 Feb 2019 13:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344252 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29D888E8C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 13:14:54 -0000 Author: br Date: Mon Feb 18 13:14:53 2019 New Revision: 344252 URL: https://svnweb.freebsd.org/changeset/base/344252 Log: Avoid orphan sections between __bss_start and .(s)bss. 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. Submitted by: "J.R.T. Clarke" Differential Revision: https://reviews.freebsd.org/D18429 Modified: head/sys/conf/ldscript.riscv Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Mon Feb 18 10:51:27 2019 (r344251) +++ head/sys/conf/ldscript.riscv Mon Feb 18 13:14:53 2019 (r344252) @@ -87,6 +87,10 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); + /* 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. */ + . = .; __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : From owner-svn-src-head@freebsd.org Mon Feb 18 14:21:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E8C214DD371; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B02A6A03C; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B59A702E; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IELfNQ027287; Mon, 18 Feb 2019 14:21:41 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IELfEP027285; Mon, 18 Feb 2019 14:21:41 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201902181421.x1IELfEP027285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 18 Feb 2019 14:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344253 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 344253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B02A6A03C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 14:21:42 -0000 Author: vmaffione Date: Mon Feb 18 14:21:41 2019 New Revision: 344253 URL: https://svnweb.freebsd.org/changeset/base/344253 Log: netmap: don't schedule kqueue notify task when kqueue is not used This change adds a counter (kqueue_users) to keep track of how many kqueue users are referencing a given struct nm_selinfo. In this way, nm_os_selwakeup() can schedule the kevent notification task only when kqueue is actually being used. This is important to avoid wasting CPU in the common case where kqueue is not used. Reviewed by: Aleksandr Fedorov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19177 Modified: head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Feb 18 13:14:53 2019 (r344252) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Feb 18 14:21:41 2019 (r344253) @@ -105,6 +105,7 @@ int nm_os_selinfo_init(NM_SELINFO_T *si, const char *n snprintf(si->mtxname, sizeof(si->mtxname), "nmkl%s", name); mtx_init(&si->m, si->mtxname, NULL, MTX_DEF); knlist_init_mtx(&si->si.si_note, &si->m); + si->kqueue_users = 0; return (0); } @@ -1351,7 +1352,9 @@ void nm_os_selwakeup(struct nm_selinfo *si) { selwakeuppri(&si->si, PI_NET); - taskqueue_enqueue(si->ntfytq, &si->ntfytask); + if (si->kqueue_users > 0) { + taskqueue_enqueue(si->ntfytq, &si->ntfytask); + } } void @@ -1364,20 +1367,28 @@ static void netmap_knrdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = &priv->np_si[NR_RX]->si; + struct nm_selinfo *si = priv->np_si[NR_RX]; - nm_prinf("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, /*islocked=*/0); + knlist_remove(&si->si.si_note, kn, /*islocked=*/0); + NMG_LOCK(); + KASSERT(si->kqueue_users > 0, ("kqueue_user underflow on %s", + si->mtxname)); + si->kqueue_users--; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); } static void netmap_knwdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = &priv->np_si[NR_TX]->si; + struct nm_selinfo *si = priv->np_si[NR_TX]; - nm_prinf("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, /*islocked=*/0); + knlist_remove(&si->si.si_note, kn, /*islocked=*/0); + NMG_LOCK(); + si->kqueue_users--; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); } /* @@ -1465,6 +1476,10 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; + NMG_LOCK(); + si->kqueue_users++; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); knlist_add(&si->si.si_note, kn, /*islocked=*/0); return 0; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Feb 18 13:14:53 2019 (r344252) +++ head/sys/dev/netmap/netmap_kern.h Mon Feb 18 14:21:41 2019 (r344253) @@ -132,11 +132,14 @@ struct netmap_adapter *netmap_getna(if_t ifp); #define MBUF_QUEUED(m) 1 struct nm_selinfo { + /* Support for select(2) and poll(2). */ struct selinfo si; + /* Support for kqueue(9). See comments in netmap_freebsd.c */ struct taskqueue *ntfytq; struct task ntfytask; struct mtx m; char mtxname[32]; + int kqueue_users; }; From owner-svn-src-head@freebsd.org Mon Feb 18 14:31:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE2B14DD80B for ; Mon, 18 Feb 2019 14:31:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 CDAD36A6D4 for ; Mon, 18 Feb 2019 14:31:24 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1550500250; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Xrg/m/lGJwtL3EtJzKWwQbrJ4s8qjPIL21hv/46T2Ic1wNd1B8g5ecrQhuAxi57c8aEw28SeUanKk 432BuNeKmCRUHFu4JF2LUJP1CsJfFaG33datLOEwm4MzCPRIYKeQX6GkUZMaN6IA/S6H9Oy6iN3MeA BToE3vmkYl3k4DFSxOWNFSesrIXvD02Hvb3DzS2teiCAR166Law66pLZEwysr3OCtRqgqbkoMYtOw0 IB2tRuB8eAyCM/E8Or1DDbgog6aWoObFZamQEztymEdORwTPwI2OuziHU888uM/z+dBIT06pZFFtmX eKGHwJ1fpeGa/6MOm298I1NMC90kLog== 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=fWSqC37P5KAebJ7w2S/guvAEiOlVYUL4ahocWFLLBe0=; b=qrrD5kkZrRxm/T3Agp+OhQxi0vqLhiXaMhyQcnT3jbS+w2N6zigp5gCLHgpJMum0MuLskCeBw+X8w QTC56i8VVx1MucszJpUGrxYre4IndR6tz9UExnUuPPbLlCSBkcRBuFlzzGyjDyyN25ntC1FNJtuiOQ xtDYQrwubmhUx0ZL05vJ+TZSrRpJCjlLrUMzAGtvwrtQrhj0KmewApoSDLCziPdFeH5f36o/LX46yw YoZXes9ykYYyPfxJskqyWikUzt4gMKb+4KTZ9MnFC7ALn1kaL+nm0UjhRZxyeO0Ebz0o6j4jLz/9IK dmKgE+FnauotzGKB6yyTIuVS3OJlf0A== 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=fWSqC37P5KAebJ7w2S/guvAEiOlVYUL4ahocWFLLBe0=; b=fRlWFcTbhxNJApcaixu6nihuEtuw7eS7x+iOBxTRwHcucJtonjpUdvV+B3XtLC0Pfg40GG+Wq74kZ pUiZHIEfMmFEwOgVYowElh/MSQt6F0hcuPNfLCbVxf9OHKyQ1O88Porl/aAG6epbA9S0iL6N9tgHkI zbZhWtMGm1UccM6/ZrhekpN5j8FnuE3FoYCwCCTTf7jUCtIWPR05Hu+EVpXL0pmr0mhkA8x3lKybp2 Amge7n7TxJoiObITT0HnoGcnoYKVST/VHMCHudq+c9lHpOx6UH5njav9RP3PF+2EW3ZfwUIGKeyiZM 8a/JRdJ4xQTQZbAeZvV3MieQHc/2YCA== X-MHO-RoutePath: aGlwcGll X-MHO-User: c85eba61-3389-11e9-9789-75353a1f43cf 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 c85eba61-3389-11e9-9789-75353a1f43cf; Mon, 18 Feb 2019 14:30:48 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1IEVKMO078152; Mon, 18 Feb 2019 07:31:20 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> Subject: Re: svn commit: r344238 - head/stand/common From: Ian Lepore To: Toomas Soome Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Feb 2019 07:31:20 -0700 In-Reply-To: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDAD36A6D4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.985,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 14:31:26 -0000 On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > Author: ian > > Date: Sun Feb 17 23:32:09 2019 > > New Revision: 344238 > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > Log: > > Restore loader(8)'s ability for lsdev to show partitions within a bsd slice. > > > > I'm pretty sure this used to work at one time, perhaps long ago. It has > > been failing recently because if you call disk_open() with dev->d_partition > > set to -1 when d_slice refers to a bsd slice, it assumes you want it to > > open the first partition within that slice. When you then pass that open > > dev instance to ptable_open(), it tries to read the start of the 'a' > > partition and decides there is no recognizable partition type there. > > > > This restores the old functionality by resetting d_offset to the start > > of the raw slice after disk_open() returns. For good measure, d_partition > > is also set back to -1, although that doesn't currently affect anything. > > > > I would have preferred to make disk_open() avoid such rude assumptions and > > if you ask for partition -1 you get the raw slice. But the commit history > > shows that someone already did that once (r239058), and had to revert it > > (r239232), so I didn't even try to go down that road. > > > What was the reason for the revert? I still do think the current > disk_open() approach is not good because it does break the promise to > get MBR partition (see common/disk.h). > > Of course I can see the appeal for something like “boot disk0:†but > case like that should be solved by iterating partition table, and not > by making API to do wrong thing - if I did ask to for disk0s0: I > really would expect to get disk0s0: and not disk0s0a: > > But anyhow, it would be good to understand the actual reasoning > behind that decision. > I have no idea. As is so often the case, the commit message for the revert said what the commit did ("revert to historic behavior") without any hint of why the change was made. One has to assume that it broke some working cases and people complained. Part of the problem for the disk_open() "api" is that there is not even a comment block with some hints in it. I was thinking one potential solution might instead of using "if (partition < 0)" we could define a couple magical partition number values, PNUM_GETBEST = -1, PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully combing through the existing code looking at all calls to disk_open() and all usage of disk_devdesc.d_partition. -- Ian From owner-svn-src-head@freebsd.org Mon Feb 18 15:09:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE46414DE604; Mon, 18 Feb 2019 15:09:19 +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 7CA046BAED; Mon, 18 Feb 2019 15:09:19 +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 6C548782F; Mon, 18 Feb 2019 15:09:19 +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 x1IF9JmL050013; Mon, 18 Feb 2019 15:09:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IF9JcA050012; Mon, 18 Feb 2019 15:09:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181509.x1IF9JcA050012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 15:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344254 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CA046BAED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 15:09:20 -0000 Author: ian Date: Mon Feb 18 15:09:19 2019 New Revision: 344254 URL: https://svnweb.freebsd.org/changeset/base/344254 Log: Use DEV_TYP_NONE instead of -1 to indicate no device was specified. DEV_TYP_NONE has a value of zero, which makes more sense since the device type is a bunch of bits describing the device, crammed into an int. Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 14:21:41 2019 (r344253) +++ head/stand/uboot/common/main.c Mon Feb 18 15:09:19 2019 (r344254) @@ -156,7 +156,7 @@ get_device_type(const char *devstr, int *devtype) printf("Unknown device type '%s'\n", devstr); } - *devtype = -1; + *devtype = DEV_TYP_NONE; return (NULL); } @@ -202,7 +202,7 @@ get_load_device(int *type, int *unit, int *slice, int const char *p; char *endp; - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; *partition = -1; @@ -467,14 +467,14 @@ main(int argc, char **argv) currdev.dd.d_dev = devsw[i]; currdev.dd.d_unit = 0; - if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && + if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { if (probe_disks(i, load_type, load_unit, load_slice, load_partition) == 0) break; } - if ((load_type == -1 || (load_type & DEV_TYP_NET)) && + if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_NET)) && strcmp(devsw[i]->dv_name, "net") == 0) break; } From owner-svn-src-head@freebsd.org Mon Feb 18 15:28:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB2B14DEBCA; Mon, 18 Feb 2019 15:28:13 +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 99A7B6C3AE; Mon, 18 Feb 2019 15:28:12 +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 860937B8D; Mon, 18 Feb 2019 15:28:12 +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 x1IFSCGx060240; Mon, 18 Feb 2019 15:28:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IFSC5V060239; Mon, 18 Feb 2019 15:28:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181528.x1IFSC5V060239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 15:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344255 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99A7B6C3AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 15:28:13 -0000 Author: ian Date: Mon Feb 18 15:28:12 2019 New Revision: 344255 URL: https://svnweb.freebsd.org/changeset/base/344255 Log: Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'. Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 15:09:19 2019 (r344254) +++ head/stand/uboot/common/main.c Mon Feb 18 15:28:12 2019 (r344255) @@ -221,13 +221,13 @@ get_load_device(int *type, int *unit, int *slice, int p++; /* Unknown device name, or a known name without unit number. */ - if ((*type == -1) || (*p == '\0')) { + if ((*type == DEV_TYP_NONE) || (*p == '\0')) { return; } /* Malformed unit number. */ if (!isdigit(*p)) { - *type = -1; + *type = DEV_TYP_NONE; return; } @@ -242,7 +242,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Device string is malformed beyond unit number. */ if (*p != ':') { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; return; } @@ -255,7 +255,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Only DEV_TYP_STOR devices can have a slice specification. */ if (!(*type & DEV_TYP_STOR)) { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; return; } @@ -264,7 +264,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Malformed slice number. */ if (p == endp) { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; return; @@ -278,7 +278,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Device string is malformed beyond slice number. */ if (*p != '.') { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; return; @@ -298,7 +298,7 @@ get_load_device(int *type, int *unit, int *slice, int return; /* Junk beyond partition number. */ - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; *partition = -1; From owner-svn-src-head@freebsd.org Mon Feb 18 16:02:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D6A14E0566; Mon, 18 Feb 2019 16:02:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 848716DED6; Mon, 18 Feb 2019 16:02:01 +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 515C3822F; Mon, 18 Feb 2019 16:02:01 +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 x1IG215N081252; Mon, 18 Feb 2019 16:02:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IG21wm081251; Mon, 18 Feb 2019 16:02:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902181602.x1IG21wm081251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 Feb 2019 16:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344256 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 344256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 848716DED6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 16:02:02 -0000 Author: kib Date: Mon Feb 18 16:02:00 2019 New Revision: 344256 URL: https://svnweb.freebsd.org/changeset/base/344256 Log: amd64: cleanup pmap_init_pat(). The pmap_works variable is always true for amd64. Remove it, the branch in the initialization taken when false, and corresponding sysctl. Remove pat_table[] local array, work on pat_index[] directly. Collapse whole initialization to not override already assigned values. Add comment explaining the choice for PAT4 and PAT7. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week MFC note: Leave the sysctl around Differential revision: https://reviews.freebsd.org/D19225 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 18 15:28:12 2019 (r344255) +++ head/sys/amd64/amd64/pmap.c Mon Feb 18 16:02:00 2019 (r344256) @@ -353,10 +353,6 @@ pt_entry_t pg_nx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int pat_works = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, - "Is page attribute table fully functional?"); - static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pg_ps_enabled, 0, "Are large page mappings enabled?"); @@ -1222,7 +1218,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) void pmap_init_pat(void) { - int pat_table[PAT_INDEX_SIZE]; uint64_t pat_msr; u_long cr0, cr4; int i; @@ -1233,45 +1228,32 @@ pmap_init_pat(void) /* Set default PAT index table. */ for (i = 0; i < PAT_INDEX_SIZE; i++) - pat_table[i] = -1; - pat_table[PAT_WRITE_BACK] = 0; - pat_table[PAT_WRITE_THROUGH] = 1; - pat_table[PAT_UNCACHEABLE] = 3; - pat_table[PAT_WRITE_COMBINING] = 3; - pat_table[PAT_WRITE_PROTECTED] = 3; - pat_table[PAT_UNCACHED] = 3; + pat_index[i] = -1; + pat_index[PAT_WRITE_BACK] = 0; + pat_index[PAT_WRITE_THROUGH] = 1; + pat_index[PAT_UNCACHEABLE] = 3; + pat_index[PAT_WRITE_COMBINING] = 6; + pat_index[PAT_WRITE_PROTECTED] = 5; + pat_index[PAT_UNCACHED] = 2; - /* Initialize default PAT entries. */ + /* + * Initialize default PAT entries. + * Leave the indices 0-3 at the default of WB, WT, UC-, and UC. + * Program 5 and 6 as WP and WC. + * + * Leave 4 and 7 as WB and UC. Note that a recursive page table + * mapping for a 2M page uses a PAT value with the bit 3 set due + * to its overload with PG_PS. + */ pat_msr = PAT_VALUE(0, PAT_WRITE_BACK) | PAT_VALUE(1, PAT_WRITE_THROUGH) | PAT_VALUE(2, PAT_UNCACHED) | PAT_VALUE(3, PAT_UNCACHEABLE) | PAT_VALUE(4, PAT_WRITE_BACK) | - PAT_VALUE(5, PAT_WRITE_THROUGH) | - PAT_VALUE(6, PAT_UNCACHED) | + PAT_VALUE(5, PAT_WRITE_PROTECTED) | + PAT_VALUE(6, PAT_WRITE_COMBINING) | PAT_VALUE(7, PAT_UNCACHEABLE); - if (pat_works) { - /* - * Leave the indices 0-3 at the default of WB, WT, UC-, and UC. - * Program 5 and 6 as WP and WC. - * Leave 4 and 7 as WB and UC. - */ - pat_msr &= ~(PAT_MASK(5) | PAT_MASK(6)); - pat_msr |= PAT_VALUE(5, PAT_WRITE_PROTECTED) | - PAT_VALUE(6, PAT_WRITE_COMBINING); - pat_table[PAT_UNCACHED] = 2; - pat_table[PAT_WRITE_PROTECTED] = 5; - pat_table[PAT_WRITE_COMBINING] = 6; - } else { - /* - * Just replace PAT Index 2 with WC instead of UC-. - */ - pat_msr &= ~PAT_MASK(2); - pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING); - pat_table[PAT_WRITE_COMBINING] = 2; - } - /* Disable PGE. */ cr4 = rcr4(); load_cr4(cr4 & ~CR4_PGE); @@ -1286,8 +1268,6 @@ pmap_init_pat(void) /* Update PAT and index table. */ wrmsr(MSR_PAT, pat_msr); - for (i = 0; i < PAT_INDEX_SIZE; i++) - pat_index[i] = pat_table[i]; /* Flush caches and TLBs again. */ wbinvd(); From owner-svn-src-head@freebsd.org Mon Feb 18 16:19:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D945914E1190 for ; Mon, 18 Feb 2019 16:19:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 637B06EF25 for ; Mon, 18 Feb 2019 16:19:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id p25so19512993qtb.3 for ; Mon, 18 Feb 2019 08:19:46 -0800 (PST) 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=X87BLl/Efm7RMTXNQwxPR+z9H2ITTIK1Gk1Mw0n0B3Q=; b=0TfwmckiPAcqlwbqVxkvTI/walWSZTtiD6xXPtkl/6CPzawhUuapofww/hN5xdrTRW xRlaJymGNp9BvQ/BGD+a3PLvOk8OAw0K6PV2ynmb7IZ8Vpj7o5SohMJqGcI9/eGFq5u0 CJ2XKWNMnHB085Z5IDhVgGqadUsF1fpcL1ipOmFLVNId5viG4IoZJhGU450qQOo1ognc bFIzEvPjURpqA4h79lLkdgIkqMxM8+QWDkdlVsXycEPda9UATnhFbZZrJ2G0yC9iKKtJ CzLNga2kjjNZFpBwlM2eM4dUDuZtFxY5ilG7o0nBmQYXPX+iF/P8NEtHz5cIK8w4JQZ1 FbTA== 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=X87BLl/Efm7RMTXNQwxPR+z9H2ITTIK1Gk1Mw0n0B3Q=; b=GH4dNR7bcfQidPw5JofkxtsF3rmJy7YiSOQbcgJM6UmT8DVBzHkHP/SnbL/Gs7Q9NL LOkEza12xuQwOptPl0A/MUKM4P2l6n59FooAx9p5xtGAUNyJIvHztw48QLv+xqZhUhWo Y5cwl0pQZawvk533AAcxtml/TW2X1TNognDcoK4Y1kmjGRXjLQQcJM6Mvytu0umyKPLh 3Y0gbpOxQUZluA8NPyJKKnj9qc/95G9LhQpLp6Y5HVxMYTOnLgvc4XgofEBRBBlDTjwI k3qMrenhDlBRDczJ2T9R8QcU8OZiRZFlUWPE5AMELN3JnglUnHdSbFiJxUIHjjGN1QUf lnWA== X-Gm-Message-State: AHQUAuY2giTwhFLSfDoDpvYuc0hUa5PWWR2yVaugI91KJTTjxEjR77ny UI1zR77xOXm7b2dJcAoRKkBXpkgEFYzwnAbApvraKQ== X-Google-Smtp-Source: AHgI3IY3WMRUzDVRtuKZycqpxEbAjVrACgwWoZorybGvRu08UrskAngnxzmukp7GrbmM89xAHRY91QTDNZandBhELQY= X-Received: by 2002:ac8:3974:: with SMTP id t49mr19325846qtb.118.1550506785875; Mon, 18 Feb 2019 08:19:45 -0800 (PST) MIME-Version: 1.0 References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> In-Reply-To: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> From: Warner Losh Date: Mon, 18 Feb 2019 09:19:35 -0700 Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua To: Devin Teske Cc: "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 637B06EF25 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 16:19:47 -0000 On Mon, Feb 18, 2019 at 12:17 AM Devin Teske wrote: > > > > On 17 Feb 2019, at 9:18 PM, Warner Losh wrote: > > > > We did a lot of that traditionally in the FORTH loader too, and weren't > always that good about it. > > Uh, no. I only clear regions of the screen by positioning the cursor usin= g > ANSI escape sequences and then drawing spaces. I do not clear the screen = =E2=80=9Ca > lot=E2=80=9D and would like to think I was damned good about it. > Generally speaking, both FORTH and LUA clear it the same amount was more my point. It's more visible on the serial port than on the video screen, though, because that is attached to a terminal of who knows how large a screen. Part of the problem here, though, is that UEFI clears things independently from the others as it sets up the proper video modes as well, which neither FORTH nor LUA controls directly today. So my point was more that screen clearing is a red-herring issue if you want to preserve error messages. I'll gladly concede I used imprecise language to make one of points surrounding it. If we want to be able to preserve error messages, we need to preserve them, and we don't today. Warner From owner-svn-src-head@freebsd.org Mon Feb 18 16:25:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6752A14E15F0 for ; Mon, 18 Feb 2019 16:25:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F01CF6F5ED for ; Mon, 18 Feb 2019 16:25:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id z39so19859119qtz.0 for ; Mon, 18 Feb 2019 08:25:13 -0800 (PST) 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=QeCGp8iAmq194NJteXxBukowUS86SPt0DnFmhPckR/o=; b=eUu+k3B3t6B14iZXYQIito4XMPE1wbFCtmGQm9wOr9pndQDtnX1j+lexB2EasTNhtc DJT+5HDJa05Wd2ye+AXw2dLd0IEVRNEwrx0bQZuMYnBxrEFgDNAuY6re3+eamrJc3nTy C8TwhigJoQDhOqCiDNyJ2CIPl54yzyCYroTri38jilcdmZ80Nuk9kjcw2q1vQbHxUIjy ihU7C43PSYTW+q08S76l00ZlrfAzZeqN/dyNgHSLgPt08oaKL9BpmXv7z0aXmlOES8rm u996x2SURy9mnrPyObxR5YDwZf+s8my0TLSbDfzpOzI73QDRXLEseANJngm9+PCsPbXK IHPQ== 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=QeCGp8iAmq194NJteXxBukowUS86SPt0DnFmhPckR/o=; b=L2YsTLoGxoMAX+rzDunP7KxZZVtYjhd3ueuKGuYCtC41/SOUw3ARa7LHDTYuabrFZ1 o4o4XLh78vRuQEIl8aygE4ZRmIR/sr/g7mp6qhJrx69V8pLn7cPD5n0tJTfDYzDBj+nS mYR8Nf3atPk25Vw32gfUrA3qzOMEvQG2I+N/PwpF0jijDqW6P4ThuU7gv72gS0AbtdF+ OrInx1f57hMqdWbNPDQfI1fnmnqLPltfEMBGrJsWakSDjGxpDp4klnLZDzXyRuPBzOTD QGpju8kb2b1im5FNDSQTf3Hdhy+Bbkic1CAZvY0rYzkLPN9z6Yom0v90Gw/FSvYP7AJ1 bnpg== X-Gm-Message-State: AHQUAuZbsbsRAvql7IfdWN6l7CDl5r07MScfeQD0530axfRf13rFRye6 0IQ2UXVUA9SQDgZ11iIQ8EwHiaFd8MyGPNIMgEu5beww X-Google-Smtp-Source: AHgI3IbNOcaseM4hErMVKJ3jW3n665/t+rVKBK5zFJnBVCrmAg4FjaSO3F8P2BKA+xuuIRP8qtpwQe+WQvrZioa5T0w= X-Received: by 2002:a0c:b068:: with SMTP id l37mr18318816qvc.21.1550507113451; Mon, 18 Feb 2019 08:25:13 -0800 (PST) MIME-Version: 1.0 References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> In-Reply-To: <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> From: Warner Losh Date: Mon, 18 Feb 2019 09:25:02 -0700 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: Ian Lepore Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: F01CF6F5ED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 16:25:14 -0000 On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 17 23:32:09 2019 > > > New Revision: 344238 > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > Log: > > > Restore loader(8)'s ability for lsdev to show partitions within a bs= d > slice. > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. It > has > > > been failing recently because if you call disk_open() with > dev->d_partition > > > set to -1 when d_slice refers to a bsd slice, it assumes you want it > to > > > open the first partition within that slice. When you then pass that > open > > > dev instance to ptable_open(), it tries to read the start of the 'a' > > > partition and decides there is no recognizable partition type there. > > > > > > This restores the old functionality by resetting d_offset to the sta= rt > > > of the raw slice after disk_open() returns. For good measure, > d_partition > > > is also set back to -1, although that doesn't currently affect > anything. > > > > > > I would have preferred to make disk_open() avoid such rude > assumptions and > > > if you ask for partition -1 you get the raw slice. But the commit > history > > > shows that someone already did that once (r239058), and had to rever= t > it > > > (r239232), so I didn't even try to go down that road. > > > > > > What was the reason for the revert? I still do think the current > > disk_open() approach is not good because it does break the promise to > > get MBR partition (see common/disk.h). > > > > Of course I can see the appeal for something like =E2=80=9Cboot disk0:= =E2=80=9D but > > case like that should be solved by iterating partition table, and not > > by making API to do wrong thing - if I did ask to for disk0s0: I > > really would expect to get disk0s0: and not disk0s0a: > > > > But anyhow, it would be good to understand the actual reasoning > > behind that decision. > > > > I have no idea. As is so often the case, the commit message for the > revert said what the commit did ("revert to historic behavior") without > any hint of why the change was made. One has to assume that it broke > some working cases and people complained. > > Part of the problem for the disk_open() "api" is that there is not even > a comment block with some hints in it. I was thinking one potential > solution might instead of using "if (partition < 0)" we could define a > couple magical partition number values, PNUM_GETBEST =3D -1, > PNUM_RAWSLICE =3D -2, that sort of thing. But it would require carefully > combing through the existing code looking at all calls to disk_open() > and all usage of disk_devdesc.d_partition. > I think that we should fix the disk_open() api. And then fix everything that uses it to comply with the new rules. The current hodge-podge that we have causes a number of issues for different environments that are only mostly worked around. I've done some work in this area to make things more regular, but it's still a dog's breakfast of almost-stackable devices that we overload too many things on, resulting in the mis-mash we have today. When the whole world was just MBR + BSD label, we could get away with it. But now that we have GPT as well as GELI support and ZFS pool devices on top of disk devices, the arrangements aren't working as well as could be desired. Warner From owner-svn-src-head@freebsd.org Mon Feb 18 16:31:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA22B14E18BF; Mon, 18 Feb 2019 16:31:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817116FB34; Mon, 18 Feb 2019 16:31:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id i20so29319676otl.0; Mon, 18 Feb 2019 08:31:08 -0800 (PST) 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:content-transfer-encoding; bh=kJHRusBvMcFcwBosf6frrFCynlA+lBSHt3mcyjlxv1g=; b=nlrmnuiW7Bj6bWiDFdqSirYgrf3bLXJ7uQoCdBW0FBeNO4R4QUvZsJDUl0PW3vCnSN Fw/24R3XIRr7GDLH7Jkjz9w/PA/qaqO8USO6DdTFKgUxKRDVOFPSC0mLALThG36llb/A mz1k2Oarrzd7ysc+bSrI/5VBfYGTmEkf/fCISmY5JzTpy8n+NdlZUr4dh6mGfU71g878 OxS+AtgYYDM583nkD6N4Gpzg7pUUbP2MCImIxNkpqYcZGx6GIaGroWJX/AGufoXlUhe4 Fe64S8yOATtWkgd9NoG6uxhuVz2/T94Y89puQ2LAKecpEkTMFP/P7xFCRtw5hk8vmAhK tH3A== X-Gm-Message-State: AHQUAuab98pJPEhTjdvCW+L5nGj599r07As7Cgjz6qzq8mmzYQIYjkyN P5iVLkqiWgCo3BV1MDPEghoo3f9oRlS+GBiNseg= X-Google-Smtp-Source: AHgI3Ia+IhMbh7QsP5Gt6j0c+RHN98pWFK6OI/5u4hI6KiC5fZWdv+4g6LUO5vBV+EcZrfuAvnAIS2TaffssQUc7ZL4= X-Received: by 2002:a9d:7cd3:: with SMTP id r19mr1457212otn.139.1550507462117; Mon, 18 Feb 2019 08:31:02 -0800 (PST) MIME-Version: 1.0 References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> <36om-fw2j-wny@FreeBSD.org> <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> In-Reply-To: <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> From: Edward Napierala Date: Mon, 18 Feb 2019 16:30:50 +0000 Message-ID: Subject: Re: svn commit: r344021 - head/share/man/man7 To: Enji Cooper Cc: Jan Beich , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 817116FB34 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.81 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.81)[-0.810,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 16:31:09 -0000 niedz., 17 lut 2019 o 16:05 Enji Cooper napisa=C5= =82(a): > > > > On Feb 17, 2019, at 04:17, Jan Beich wrote: > > > > Edward Tomasz Napierala writes: > > > >> ... while the > >> +.Em quarterly > > > > .Em looks unnecessary as "the" is enough. /quarterly is a package set > > (or repository), not an actual name of the branch. > > > > - /head -> /latest > > - /branches/*Q* -> /quarterly > > - /tags/RELEASE_* -> /release_* Jan, do you mean to drop just this single .Em, drop .Ems in all places it's being used for "quarterly", or drop it for both "quarterly" and "head"? > >> +subdirectory, eg: > > > > Did you mean "subdirectory e.g.," ? > > > > https://english.stackexchange.com/questions/16172/should-i-always-use-a= -comma-after-e-g-or-i-e > > It=E2=80=99s actually =E2=80=9Csubdirectory, e.g.,=E2=80=9D. igor will co= rrect the usage :). It would, if only I've spelled it correctly, as "e.g." and not "eg". I'm not sure about this case, though, because it's followed by a colon. Should it become "subdirectory, e.g.,", and then the URL, without the colon= ? From owner-svn-src-head@freebsd.org Mon Feb 18 17:04:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4EAE14E3E28 for ; Mon, 18 Feb 2019 17:04:22 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-tydg10011801.me.com (pv50p00im-tydg10011801.me.com [17.58.6.52]) (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 502317239C for ; Mon, 18 Feb 2019 17:04:22 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-tydg10011801.me.com (Postfix) with ESMTPSA id 205726601B8; Mon, 18 Feb 2019 17:04:11 +0000 (UTC) From: Toomas Soome Message-Id: <7C165E48-DB8B-40F2-B9E9-2FB57C348252@me.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344238 - head/stand/common Date: Mon, 18 Feb 2019 19:04:09 +0200 In-Reply-To: Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-18_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902180127 X-Rspamd-Queue-Id: 502317239C X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 17:04:23 -0000 > On 18 Feb 2019, at 18:25, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore > wrote: > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > >=20 > > > Author: ian > > > Date: Sun Feb 17 23:32:09 2019 > > > New Revision: 344238 > > > URL: https://svnweb.freebsd.org/changeset/base/344238 = > > >=20 > > > Log: > > > Restore loader(8)'s ability for lsdev to show partitions within a = bsd slice. > > >=20 > > > I'm pretty sure this used to work at one time, perhaps long ago. = It has > > > been failing recently because if you call disk_open() with = dev->d_partition > > > set to -1 when d_slice refers to a bsd slice, it assumes you want = it to > > > open the first partition within that slice. When you then pass = that open > > > dev instance to ptable_open(), it tries to read the start of the = 'a' > > > partition and decides there is no recognizable partition type = there. > > >=20 > > > This restores the old functionality by resetting d_offset to the = start > > > of the raw slice after disk_open() returns. For good measure, = d_partition > > > is also set back to -1, although that doesn't currently affect = anything. > > >=20 > > > I would have preferred to make disk_open() avoid such rude = assumptions and > > > if you ask for partition -1 you get the raw slice. But the = commit history > > > shows that someone already did that once (r239058), and had to = revert it > > > (r239232), so I didn't even try to go down that road. > >=20 > >=20 > > What was the reason for the revert? I still do think the current > > disk_open() approach is not good because it does break the promise = to > > get MBR partition (see common/disk.h).=20 > >=20 > > Of course I can see the appeal for something like =E2=80=9Cboot = disk0:=E2=80=9D but > > case like that should be solved by iterating partition table, and = not > > by making API to do wrong thing - if I did ask to for disk0s0: I > > really would expect to get disk0s0: and not disk0s0a: > >=20 > > But anyhow, it would be good to understand the actual reasoning > > behind that decision. > >=20 >=20 > I have no idea. As is so often the case, the commit message for the > revert said what the commit did ("revert to historic behavior") = without > any hint of why the change was made. One has to assume that it broke > some working cases and people complained. >=20 > Part of the problem for the disk_open() "api" is that there is not = even > a comment block with some hints in it. I was thinking one potential > solution might instead of using "if (partition < 0)" we could define a > couple magical partition number values, PNUM_GETBEST =3D -1, > PNUM_RAWSLICE =3D -2, that sort of thing. But it would require = carefully > combing through the existing code looking at all calls to disk_open() > and all usage of disk_devdesc.d_partition. >=20 > I think that we should fix the disk_open() api. And then fix = everything that uses it to comply with the new rules. The current = hodge-podge that we have causes a number of issues for different = environments that are only mostly worked around. I've done some work in = this area to make things more regular, but it's still a dog's breakfast = of almost-stackable devices that we overload too many things on, = resulting in the mis-mash we have today. When the whole world was just = MBR + BSD label, we could get away with it. But now that we have GPT as = well as GELI support and ZFS pool devices on top of disk devices, the = arrangements aren't working as well as could be desired. >=20 > Warner I am looking on it too, but it has more traps than I was suspecting:) rgds, toomas From owner-svn-src-head@freebsd.org Mon Feb 18 17:12:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5DC14E499C; Mon, 18 Feb 2019 17:12:31 +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 58F917322D; Mon, 18 Feb 2019 17:12:31 +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 47D4D8E7E; Mon, 18 Feb 2019 17:12:31 +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 x1IHCVsN019307; Mon, 18 Feb 2019 17:12:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IHCV50019306; Mon, 18 Feb 2019 17:12:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181712.x1IHCV50019306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 17:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344260 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58F917322D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 17:12:32 -0000 Author: ian Date: Mon Feb 18 17:12:30 2019 New Revision: 344260 URL: https://svnweb.freebsd.org/changeset/base/344260 Log: Allow the u-boot loaderdev env var to be formatted in the "usual" loader(8) way: device[s|p]. E.g., disk0s2a or disk3p12. The code first tries to parse the variable in this format using the standard disk_parsedev(). If that fails, it falls back to parsing the legacy format that has been supported by ubldr for years. In addition to 'disk', all the valid uboot device names can also be used: mmc, sata, usb, ide, scsi. The 'disk' device serves as an alias for all those types and will match the Nth storage-type device found (where N is the unit number). Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 16:11:11 2019 (r344259) +++ head/stand/uboot/common/main.c Mon Feb 18 17:12:30 2019 (r344260) @@ -182,6 +182,14 @@ device_typename(int type) * The returned values for slice and partition are interpreted by * disk_open(). * + * The device string can be a standard loader(8) disk specifier: + * + * disks disk0s1 + * disks disk1s2a + * diskp disk0p4 + * + * or one of the following formats: + * * Valid device strings: For device types: * * DEV_TYP_STOR, DEV_TYP_NET @@ -198,6 +206,7 @@ device_typename(int type) static void get_load_device(int *type, int *unit, int *slice, int *partition) { + struct disk_devdesc dev; char *devstr; const char *p; char *endp; @@ -215,6 +224,19 @@ get_load_device(int *type, int *unit, int *slice, int printf("U-Boot env: loaderdev='%s'\n", devstr); p = get_device_type(devstr, type); + + /* + * If type is DEV_TYP_STOR we have a disk-like device. If we can parse + * the remainder of the string as a standard unit+slice+partition (e.g., + * 0s2a or 1p12), return those results. Otherwise we'll fall through to + * the code that parses the legacy format. + */ + if ((*type & DEV_TYP_STOR) && disk_parsedev(&dev, p, NULL) == 0) { + *unit = dev.dd.d_unit; + *slice = dev.d_slice; + *partition = dev.d_partition; + return; + } /* Ignore optional spaces after the device name. */ while (*p == ' ') From owner-svn-src-head@freebsd.org Mon Feb 18 17:51:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABFCC14E5DD3; Mon, 18 Feb 2019 17:51:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 394F074F6A; Mon, 18 Feb 2019 17:51:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1IHp9B8006396; Mon, 18 Feb 2019 09:51:09 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1IHp9gc006395; Mon, 18 Feb 2019 09:51:09 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344238 - head/stand/common In-Reply-To: To: Warner Losh Date: Mon, 18 Feb 2019 09:51:09 -0800 (PST) CC: Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 394F074F6A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.917,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 17:51:13 -0000 > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > > > Author: ian > > > > Date: Sun Feb 17 23:32:09 2019 > > > > New Revision: 344238 > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > > > Log: > > > > Restore loader(8)'s ability for lsdev to show partitions within a bsd > > slice. > > > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. It > > has > > > > been failing recently because if you call disk_open() with > > dev->d_partition > > > > set to -1 when d_slice refers to a bsd slice, it assumes you want it > > to > > > > open the first partition within that slice. When you then pass that > > open > > > > dev instance to ptable_open(), it tries to read the start of the 'a' > > > > partition and decides there is no recognizable partition type there. > > > > > > > > This restores the old functionality by resetting d_offset to the start > > > > of the raw slice after disk_open() returns. For good measure, > > d_partition > > > > is also set back to -1, although that doesn't currently affect > > anything. > > > > > > > > I would have preferred to make disk_open() avoid such rude > > assumptions and > > > > if you ask for partition -1 you get the raw slice. But the commit > > history > > > > shows that someone already did that once (r239058), and had to revert > > it > > > > (r239232), so I didn't even try to go down that road. > > > > > > > > > What was the reason for the revert? I still do think the current > > > disk_open() approach is not good because it does break the promise to > > > get MBR partition (see common/disk.h). > > > > > > Of course I can see the appeal for something like ?boot disk0:? but > > > case like that should be solved by iterating partition table, and not > > > by making API to do wrong thing - if I did ask to for disk0s0: I > > > really would expect to get disk0s0: and not disk0s0a: > > > > > > But anyhow, it would be good to understand the actual reasoning > > > behind that decision. > > > > > > > I have no idea. As is so often the case, the commit message for the > > revert said what the commit did ("revert to historic behavior") without > > any hint of why the change was made. One has to assume that it broke > > some working cases and people complained. > > > > Part of the problem for the disk_open() "api" is that there is not even > > a comment block with some hints in it. I was thinking one potential > > solution might instead of using "if (partition < 0)" we could define a > > couple magical partition number values, PNUM_GETBEST = -1, > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully > > combing through the existing code looking at all calls to disk_open() > > and all usage of disk_devdesc.d_partition. > > > > I think that we should fix the disk_open() api. And then fix everything > that uses it to comply with the new rules. The current hodge-podge that we > have causes a number of issues for different environments that are only > mostly worked around. I've done some work in this area to make things more > regular, but it's still a dog's breakfast of almost-stackable devices that > we overload too many things on, resulting in the mis-mash we have today. > When the whole world was just MBR + BSD label, we could get away with it. > But now that we have GPT as well as GELI support and ZFS pool devices on > top of disk devices, the arrangements aren't working as well as could be > desired. Yes please. Could this be some of the cause of issues with legacy mbr boots that use to work, that now stop working? I have observed this on zfs in mbr on a machine here. I did not have time to debug it, it was faster to nuke and pave the machine that was critical to operations, the error came as part of a failed freenas upgrade to the 11.2 based version. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 18 18:34:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D8C14E7765; Mon, 18 Feb 2019 18:34:14 +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 5551777D7E; Mon, 18 Feb 2019 18:34:14 +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 463729C2D; Mon, 18 Feb 2019 18:34:14 +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 x1IIYEOU064412; Mon, 18 Feb 2019 18:34:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IIYE81064411; Mon, 18 Feb 2019 18:34:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902181834.x1IIYE81064411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 Feb 2019 18:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344261 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 344261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5551777D7E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 18:34:14 -0000 Author: dim Date: Mon Feb 18 18:34:13 2019 New Revision: 344261 URL: https://svnweb.freebsd.org/changeset/base/344261 Log: Pull in r345199 from upstream libc++ trunk (by Petr Hosek): Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are floating-point types." This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 This prevents "_Float16 is not supported on this target" errors in libc++'s type_traits header, in some cases. Reported by: Charlie Li MFC after: 3 days Modified: head/contrib/libc++/include/type_traits Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Mon Feb 18 17:12:30 2019 (r344260) +++ head/contrib/libc++/include/type_traits Mon Feb 18 18:34:13 2019 (r344261) @@ -733,12 +733,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_ // is_floating_point template struct __libcpp_is_floating_point : public false_type {}; -#ifdef __clang__ -template <> struct __libcpp_is_floating_point<__fp16> : public true_type {}; -#endif -#ifdef __FLT16_MANT_DIG__ -template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; -#endif template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; From owner-svn-src-head@freebsd.org Mon Feb 18 19:07:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00D5E14E8826; Mon, 18 Feb 2019 19:07:17 +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 8ECAF8148E; Mon, 18 Feb 2019 19:07:16 +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 45456A14D; Mon, 18 Feb 2019 19:07:16 +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 x1IJ7Gnn081016; Mon, 18 Feb 2019 19:07:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJ7Grp081015; Mon, 18 Feb 2019 19:07:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902181907.x1IJ7Grp081015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 Feb 2019 19:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344264 - head/lib/clang/libllvmminimal X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang/libllvmminimal X-SVN-Commit-Revision: 344264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ECAF8148E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 19:07:17 -0000 Author: dim Date: Mon Feb 18 19:07:15 2019 New Revision: 344264 URL: https://svnweb.freebsd.org/changeset/base/344264 Log: Add one additional file to libllvmminimal, since in some cases (e.g. upgrading from stable/10 to stable/11) symbols from it are needed to link llvm-tblgen and clang-tblgen. Reported by: kib MFC after: 3 days Modified: head/lib/clang/libllvmminimal/Makefile Modified: head/lib/clang/libllvmminimal/Makefile ============================================================================== --- head/lib/clang/libllvmminimal/Makefile Mon Feb 18 18:57:52 2019 (r344263) +++ head/lib/clang/libllvmminimal/Makefile Mon Feb 18 19:07:15 2019 (r344264) @@ -18,6 +18,7 @@ SRCS+= Support/Errno.cpp SRCS+= Support/Error.cpp SRCS+= Support/ErrorHandling.cpp SRCS+= Support/FoldingSet.cpp +SRCS+= Support/FormatVariadic.cpp SRCS+= Support/FormattedStream.cpp SRCS+= Support/Hashing.cpp SRCS+= Support/Host.cpp From owner-svn-src-head@freebsd.org Mon Feb 18 19:50:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B96A14E9751; Mon, 18 Feb 2019 19:50:54 +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 40CA382EB9; Mon, 18 Feb 2019 19:50:54 +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 353F6A828; Mon, 18 Feb 2019 19:50:54 +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 x1IJos76005671; Mon, 18 Feb 2019 19:50:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJosT6005670; Mon, 18 Feb 2019 19:50:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181950.x1IJosT6005670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 19:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344267 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 344267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40CA382EB9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 19:50:54 -0000 Author: ian Date: Mon Feb 18 19:50:53 2019 New Revision: 344267 URL: https://svnweb.freebsd.org/changeset/base/344267 Log: Add a compatible string to match recent changes in the upstream dts. Modified: head/sys/arm/freescale/imx/imx6_snvs.c Modified: head/sys/arm/freescale/imx/imx6_snvs.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_snvs.c Mon Feb 18 19:16:14 2019 (r344266) +++ head/sys/arm/freescale/imx/imx6_snvs.c Mon Feb 18 19:50:53 2019 (r344267) @@ -73,6 +73,7 @@ struct snvs_softc { }; static struct ofw_compat_data compat_data[] = { + {"fsl,sec-v4.0-mon-rtc-lp", true}, {"fsl,sec-v4.0-mon", true}, {NULL, false} }; From owner-svn-src-head@freebsd.org Mon Feb 18 20:14:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FEB114EA506 for ; Mon, 18 Feb 2019 20:14:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F387C83F3B for ; Mon, 18 Feb 2019 20:14:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id o6so20621668qtk.6 for ; Mon, 18 Feb 2019 12:14:42 -0800 (PST) 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=xMdBmKAUyirc1/d4i/63DqIr+yBGhcb54pBAv+uoIa4=; b=VDjoWU/vUDuLnGicWRXIc0teYsEbuaIwxsYqGal1REaPqg+0yHH0b7+GTW81YfNiLu Wd5Q/55xBzyRAq9r80escB47dcuHKBgrF9Sc8aEvDCXqQFWOWGzRmhJR2S+cx2reOtJE R7IhIUsh897BNEApDN+0f4vtdRXz1vuhNPkgitsd98ZSMmViGkkV2io3yXqgiK2UucKW NvJonqMQ6F9KZgmwXvoz2KYGAz2WYi8+9apO6UcgVUn9dd0S691YpMwdXQO3XrttpLs4 hoKUjJ2hgfErYHoXygUaJiZNqmx+1EPAEgGvxrX64Nlkyq08m3RBoe5+AJJWX5dcChf8 kuvA== 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=xMdBmKAUyirc1/d4i/63DqIr+yBGhcb54pBAv+uoIa4=; b=V+VOcs7b/81uTqztunOojjsot0sXNO8qDv0NjidLGlhACxMoSRU/2ZUfcBlXmXsy2m FnQS/KyRSG7lamQRK6DptfGfakrPWn+P6Zzo8nSQsulGQZMrLoH16EolEdXK1zFot+fx J8nHvCTzIiCMc4ZfQeDFsYs5xsR5egIgSdYPVie3CSN0pvNpxgQ39r/9vGNRxFZKRAUj qH44oWl3QAnCY5etm3pxr4ClTxkQ9T1OSlQ8OaF+ZxN4Dp12REvFH1Ktx9gX+mEXDyT4 pCIc/5LpZQdotYYqf8yyedFvh4eX0FVSCQNSBZEKfv9FU+6kGqOxCbd0Q+HTn2selfvA zBww== X-Gm-Message-State: AHQUAuaO8KemHETGVXX/vRfG9YMd9UCxP/PrlQ53VKR+O2tEAfGEX8Iw yH9jPIVBIsBUAs1+UyD8KtNixupFk2zKM78/JsLHj95Q X-Google-Smtp-Source: AHgI3IZQD+7QpjQGnPqCeJn0dQ8bXvq07fn4h3FQcrkFw0CiHZaA8TF8HlQDCNtAf+eMU3DsMP3921ACP1fTinJk1r4= X-Received: by 2002:a0c:9c89:: with SMTP id i9mr18513307qvf.153.1550520882374; Mon, 18 Feb 2019 12:14:42 -0800 (PST) MIME-Version: 1.0 References: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 18 Feb 2019 13:14:31 -0700 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: "Rodney W. Grimes" Cc: Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: F387C83F3B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 20:14:43 -0000 On Mon, Feb 18, 2019 at 10:51 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > > > > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > > > > > Author: ian > > > > > Date: Sun Feb 17 23:32:09 2019 > > > > > New Revision: 344238 > > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > > > > > Log: > > > > > Restore loader(8)'s ability for lsdev to show partitions within a > bsd > > > slice. > > > > > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. > It > > > has > > > > > been failing recently because if you call disk_open() with > > > dev->d_partition > > > > > set to -1 when d_slice refers to a bsd slice, it assumes you want > it > > > to > > > > > open the first partition within that slice. When you then pass > that > > > open > > > > > dev instance to ptable_open(), it tries to read the start of the > 'a' > > > > > partition and decides there is no recognizable partition type > there. > > > > > > > > > > This restores the old functionality by resetting d_offset to the > start > > > > > of the raw slice after disk_open() returns. For good measure, > > > d_partition > > > > > is also set back to -1, although that doesn't currently affect > > > anything. > > > > > > > > > > I would have preferred to make disk_open() avoid such rude > > > assumptions and > > > > > if you ask for partition -1 you get the raw slice. But the commit > > > history > > > > > shows that someone already did that once (r239058), and had to > revert > > > it > > > > > (r239232), so I didn't even try to go down that road. > > > > > > > > > > > > What was the reason for the revert? I still do think the current > > > > disk_open() approach is not good because it does break the promise to > > > > get MBR partition (see common/disk.h). > > > > > > > > Of course I can see the appeal for something like ?boot disk0:? but > > > > case like that should be solved by iterating partition table, and not > > > > by making API to do wrong thing - if I did ask to for disk0s0: I > > > > really would expect to get disk0s0: and not disk0s0a: > > > > > > > > But anyhow, it would be good to understand the actual reasoning > > > > behind that decision. > > > > > > > > > > I have no idea. As is so often the case, the commit message for the > > > revert said what the commit did ("revert to historic behavior") without > > > any hint of why the change was made. One has to assume that it broke > > > some working cases and people complained. > > > > > > Part of the problem for the disk_open() "api" is that there is not even > > > a comment block with some hints in it. I was thinking one potential > > > solution might instead of using "if (partition < 0)" we could define a > > > couple magical partition number values, PNUM_GETBEST = -1, > > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully > > > combing through the existing code looking at all calls to disk_open() > > > and all usage of disk_devdesc.d_partition. > > > > > > > I think that we should fix the disk_open() api. And then fix everything > > that uses it to comply with the new rules. The current hodge-podge that > we > > have causes a number of issues for different environments that are only > > mostly worked around. I've done some work in this area to make things > more > > regular, but it's still a dog's breakfast of almost-stackable devices > that > > we overload too many things on, resulting in the mis-mash we have today. > > When the whole world was just MBR + BSD label, we could get away with it. > > But now that we have GPT as well as GELI support and ZFS pool devices on > > top of disk devices, the arrangements aren't working as well as could be > > desired. > > Yes please. > Could this be some of the cause of issues with legacy mbr boots > that use to work, that now stop working? I have observed this > on zfs in mbr on a machine here. I did not have time to debug > it, it was faster to nuke and pave the machine that was critical > to operations, the error came as part of a failed freenas upgrade > to the 11.2 based version. > I think the MBR issues are the same ones that Patrick Kelsey is looking into. He has a differential review. If the upgrade was to FreeBSD 11.2, however, that pre-dates most of the work we've done on the loader, so the root cause of that issue may be different. And it may already be fixed in stable/11 as we've since merged everything in current into stable/11 (except for a few things that changed the defaults in a user-visible way). Warner From owner-svn-src-head@freebsd.org Mon Feb 18 20:29:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D0C214EAB14; Mon, 18 Feb 2019 20:29:20 +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 3F9A0848ED; Mon, 18 Feb 2019 20:29:20 +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 DA263AEBD; Mon, 18 Feb 2019 20:29:19 +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 x1IKTJtd023334; Mon, 18 Feb 2019 20:29:19 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IKTJJA023333; Mon, 18 Feb 2019 20:29:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902182029.x1IKTJJA023333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 18 Feb 2019 20:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344268 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F9A0848ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 20:29:20 -0000 Author: tsoome Date: Mon Feb 18 20:29:19 2019 New Revision: 344268 URL: https://svnweb.freebsd.org/changeset/base/344268 Log: loader: ptable_close() should check its argument If the passed in table is NULL, just return. Modified: head/stand/common/part.c Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Mon Feb 18 19:50:53 2019 (r344267) +++ head/stand/common/part.c Mon Feb 18 20:29:19 2019 (r344268) @@ -788,6 +788,9 @@ ptable_close(struct ptable *table) { struct pentry *entry; + if (table == NULL) + return; + while (!STAILQ_EMPTY(&table->entries)) { entry = STAILQ_FIRST(&table->entries); STAILQ_REMOVE_HEAD(&table->entries, entry); From owner-svn-src-head@freebsd.org Mon Feb 18 21:27:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A3C14EC667; Mon, 18 Feb 2019 21:27:14 +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 318FB86E5A; Mon, 18 Feb 2019 21:27:14 +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 22A35B8EB; Mon, 18 Feb 2019 21:27:14 +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 x1ILREMf055772; Mon, 18 Feb 2019 21:27:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1ILRDJL055771; Mon, 18 Feb 2019 21:27:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902182127.x1ILRDJL055771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 18 Feb 2019 21:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344269 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 344269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 318FB86E5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 21:27:14 -0000 Author: glebius Date: Mon Feb 18 21:27:13 2019 New Revision: 344269 URL: https://svnweb.freebsd.org/changeset/base/344269 Log: With r343051 UMA switched from atomic counts to counter(9) and now kernel reports snap counts of how much a zone alloced and how much it freed. It may happen that snap values doesn't match, e.g alloced - freed < 0. Workaround that in memstat library. Reported by: pho Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Mon Feb 18 20:29:19 2019 (r344268) +++ head/lib/libmemstat/memstat_uma.c Mon Feb 18 21:27:13 2019 (r344269) @@ -213,6 +213,15 @@ retry: mtp->mt_numfrees += upsp->ups_frees; } + /* + * Values for uth_allocs and uth_frees frees are snap. + * It may happen that kernel reports that number of frees + * is greater than number of allocs. See counter(9) for + * details. + */ + if (mtp->mt_numallocs < mtp->mt_numfrees) + mtp->mt_numallocs = mtp->mt_numfrees; + mtp->mt_size = uthp->uth_size; mtp->mt_rsize = uthp->uth_rsize; mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size; From owner-svn-src-head@freebsd.org Mon Feb 18 21:37:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4E7114ECA95; Mon, 18 Feb 2019 21:37:14 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32447873D9; Mon, 18 Feb 2019 21:37:13 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x1ILbC14077058 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 13:37:12 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x1ILbBeX077057; Mon, 18 Feb 2019 13:37:11 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 18 Feb 2019 13:37:11 -0800 From: Gleb Smirnoff To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344188 - in head: lib/libc/sys sys/vm Message-ID: <20190218213711.GR83215@FreeBSD.org> References: <201902152336.x1FNaNUo039321@repo.freebsd.org> <20190217011341.S833@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190217011341.S833@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 32447873D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:2906, ipnet:198.45.48.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 21:37:15 -0000 Bruce, On Sun, Feb 17, 2019 at 02:58:43AM +1100, Bruce Evans wrote: B> This is only a rollback for the vnode pager pbufs sub-pool. Total B> resource usage (preallocated kva and maximum on RAM that can be mapped B> into this kva) is still about 5/2 times higher than before in my B> configuration. It would be 7/2 times higher if I configured fuse and B> smbfs. r343030 changed the allocation methods in all subsystems except B> out-of-tree modules, and broke at least the KBI for these modules (*), B> so it is easy to find the full expansion except for these modules by B> looking at the diffs (I found the use in fuse and smbfs by grepping B> some subtrees). Also, the user's and vfs_bio's resource limit is still B> broken by expanding it by this factor of 5/2 or more. B> B> In the old allocation method, there was a single pool of pbufs of size B> nswbuf which normally has its normal limiting value of 256, where this B> magic 256 is hard-coded in vfs_bio.c, but if the user somehow knows B> about this and the tunable kern.nswbuf, then it can be overridden. B> The limit of 256 was documented in pbuf(9), but the tunable was never B> documented AFAIK. The variable nswbuf for this was documented in B> pbuf(9). The 256 entries are shared between any number of subsystems. B> Most subsystems limited themselves to nswbuf/2 entries, and the man B> page recommended this. This gave overcommit by a factor of about 5/2 B> in my configuration (there are 7 subsystems, but some of these have a B> smaller limit). B> B> Now there each subsystem has a separate pool. The size of the sub-pool B> is still usually nswbuf / 2. This gives overallocation by a factor of B> about 5/2 in my configuration. The overcommit only causes minor B> performance problems. 2 subsystems might use all of the buffers, and B> then all all the other subsystems have to wait, but it is rare for even B> 2 subsystems to be under load at the same time. It is more of a problem B> that the limit is too small for a single subsystem. The overallocation B> gives worse problems such as crashing at boot time or a little later when B> the user or auto-tuning has maxed out nswbuf. This is all true and this is intentional. Before any two subsystems could screw up the system by allocating all bufs. Now they are more separated from each other and yes, the price is extra memory. B> Now the user has to know even more arcane details to limit the kva, and B> it is impossible to recover the old behaviour. To get the old limit, B> kern.nswbuf must be set to (256 * 2 / 5) in my configuration, but B> that significantly decreases the number of buffers for each subsystem. B> Users might already have set kern.nswbuf to a large value. Since most B> subsystems used to use half of that many buffers, the wastage from setting B> it large for the benefit of 1 subsystem was at most a factor of 2. Now B> the limit can't be increased as much without running out of kva, and the B> safe increase is more arcane and machine-dependent (starting with the B> undocumented default being 8 times higher for 64-bit systems, but only B> for 1 of the subsystems). Yes, this sucks. If you can propose auto-tuning algorithm, I'm all for it. For now I'm just shifting defaults from something that was reasonable in 2000 to something that is going to be reasonable in 2020. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Mon Feb 18 23:21:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D25CA14EF317; Mon, 18 Feb 2019 23:21:09 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::102]) (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 52D588A783; Mon, 18 Feb 2019 23:21:09 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback12o.mail.yandex.net (mxback12o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::63]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 51B71F201D3; Tue, 19 Feb 2019 02:21:05 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xuzGJEvI5K-L5m4oG1j; Tue, 19 Feb 2019 02:21:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1550532065; bh=ax+0y1wkbqk6FWzckaj4BxvWWJmsNB/XfaczI2wV288=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=thWPoNVLm87LTsqva6LdDZbtJdu1TcOk3//sGH7V9hAjwsLgEdYo+4fULkCFbwQDS unzYxAdw41TJMOCoVONzqgkARzQvFZXLT3ghvOMgbnAyYdmpIlFOnwTqhGm8KuTt8i Cps1XoOJayLUr1JCW16/wPWxcTWsVXYZ2d4GI/nY= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mSJGBLYniS-L4pSeEhG; Tue, 19 Feb 2019 02:21:04 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: svn commit: r344238 - head/stand/common To: Toomas Soome , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> From: "Andrey V. Elsukov" Openpgp: preference=signencrypt Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <87a39bba-c5d7-4429-79dd-123c8bd757fe@yandex.ru> Date: Tue, 19 Feb 2019 02:21:04 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> Content-Type: text/plain; charset=utf-8 Content-Language: ru Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D588A783 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 23:21:10 -0000 18.02.2019 16:09, Toomas Soome пишет: >> This restores the old functionality by resetting d_offset to the start >> of the raw slice after disk_open() returns. For good measure, d_partition >> is also set back to -1, although that doesn't currently affect anything. >> >> I would have preferred to make disk_open() avoid such rude assumptions and >> if you ask for partition -1 you get the raw slice. But the commit history >> shows that someone already did that once (r239058), and had to revert it >> (r239232), so I didn't even try to go down that road. > > > What was the reason for the revert? I still do think the current disk_open() approach is not good because it does break the promise to get MBR partition (see common/disk.h). The reason is that someone has reported that after the change the system fails to boot. > Of course I can see the appeal for something like “boot disk0:†but case like that should be solved by iterating partition table, and not by making API to do wrong thing - if I did ask to for disk0s0: I really would expect to get disk0s0: and not disk0s0a: > > But anyhow, it would be good to understand the actual reasoning behind that decision. -- WBR, Andrey V. Elsukov From owner-svn-src-head@freebsd.org Tue Feb 19 01:20:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49E4914F45C1; Tue, 19 Feb 2019 01:20:18 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-it1-x12e.google.com (mail-it1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD49F8FE20; Tue, 19 Feb 2019 01:20:17 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-it1-x12e.google.com with SMTP id f10so2394435ita.4; Mon, 18 Feb 2019 17:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XjbzkbhYsl+OFmxjs9XuQPFQxFOG1Z62oDXRpIuj3Wc=; b=X/Gm9Ijg5OCfp9ZfI+9NsQ5z1zjDccYROo8vMfe1p1WDSKjXCzc6JM7IjhDXp036sB Iu9f3qKRasdmhGm/T6MLL56HmfE/5s70vJSQFGNGpVISSsYqoGXolA2g6MkmWk6jLUW8 4SwaZVmMQXLlRM0OIHvEV9lj94Hxb8WbEaqTE= 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=XjbzkbhYsl+OFmxjs9XuQPFQxFOG1Z62oDXRpIuj3Wc=; b=ns2c6J9nhVC7Licq+/tbpRJxRwtQ9GQhgDIOfy2srxT8c2mFbcRJLdoRzmDsmm5QE8 xeDrrL9cglX/0Na5MzPO0UP7v9n3vMQkh5qVrdm3AiZe/N14JOGWTc4p0ajel7VnqYnW l3hJ+WPir2hM1fEnCvMpQ2Iax8XPb7bIsBConP+nR74dd+AwV6Gk09rPaRJZapUgCRwy VfzaDZZMXbVhZstJviJs3PodWDhugA9MekQvS3bNdgRUoAm12gSQIAntt8gYhvbt1IRu u4sVw53mnXP/N0T7bYFD+GKv2ghIW/9BTtCTIrWmJJliTynx4FMlPn59ZQ6VU1uWYw8I JqqQ== X-Gm-Message-State: AHQUAuY8kvlSESZnV4o5/j+WjGsDjyB6jELAms583kKeTMFKzMo2Otjf 0kb8DmBTMOccuBZiNWTLYkCGWQaMAPyKOrX1ogte5A== X-Google-Smtp-Source: AHgI3IZ8Nknyf/bS/wOlKNNfwCMM+iEvDAwFi/Mk8nSMEW9r2KJfXzJhLSGc3/rDzaAABhHz3FqdjwzLcJ9K71n7uKY= X-Received: by 2002:a6b:f70a:: with SMTP id k10mr17279233iog.68.1550539217106; Mon, 18 Feb 2019 17:20:17 -0800 (PST) MIME-Version: 1.0 References: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> In-Reply-To: From: Patrick Kelsey Date: Mon, 18 Feb 2019 20:20:04 -0500 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: Warner Losh Cc: "Rodney W. Grimes" , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: CD49F8FE20 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.72 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.72)[-0.716,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 01:20:18 -0000 On Mon, Feb 18, 2019 at 3:15 PM Warner Losh wrote: > > > On Mon, Feb 18, 2019 at 10:51 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: >> > >> > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: >> > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: >> > > > > >> > > > > Author: ian >> > > > > Date: Sun Feb 17 23:32:09 2019 >> > > > > New Revision: 344238 >> > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 >> > > > > >> > > > > Log: >> > > > > Restore loader(8)'s ability for lsdev to show partitions within >> a bsd >> > > slice. >> > > > > >> > > > > I'm pretty sure this used to work at one time, perhaps long >> ago. It >> > > has >> > > > > been failing recently because if you call disk_open() with >> > > dev->d_partition >> > > > > set to -1 when d_slice refers to a bsd slice, it assumes you >> want it >> > > to >> > > > > open the first partition within that slice. When you then pass >> that >> > > open >> > > > > dev instance to ptable_open(), it tries to read the start of the >> 'a' >> > > > > partition and decides there is no recognizable partition type >> there. >> > > > > >> > > > > This restores the old functionality by resetting d_offset to the >> start >> > > > > of the raw slice after disk_open() returns. For good measure, >> > > d_partition >> > > > > is also set back to -1, although that doesn't currently affect >> > > anything. >> > > > > >> > > > > I would have preferred to make disk_open() avoid such rude >> > > assumptions and >> > > > > if you ask for partition -1 you get the raw slice. But the >> commit >> > > history >> > > > > shows that someone already did that once (r239058), and had to >> revert >> > > it >> > > > > (r239232), so I didn't even try to go down that road. >> > > > >> > > > >> > > > What was the reason for the revert? I still do think the current >> > > > disk_open() approach is not good because it does break the promise >> to >> > > > get MBR partition (see common/disk.h). >> > > > >> > > > Of course I can see the appeal for something like ?boot disk0:? but >> > > > case like that should be solved by iterating partition table, and >> not >> > > > by making API to do wrong thing - if I did ask to for disk0s0: I >> > > > really would expect to get disk0s0: and not disk0s0a: >> > > > >> > > > But anyhow, it would be good to understand the actual reasoning >> > > > behind that decision. >> > > > >> > > >> > > I have no idea. As is so often the case, the commit message for the >> > > revert said what the commit did ("revert to historic behavior") >> without >> > > any hint of why the change was made. One has to assume that it broke >> > > some working cases and people complained. >> > > >> > > Part of the problem for the disk_open() "api" is that there is not >> even >> > > a comment block with some hints in it. I was thinking one potential >> > > solution might instead of using "if (partition < 0)" we could define a >> > > couple magical partition number values, PNUM_GETBEST = -1, >> > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully >> > > combing through the existing code looking at all calls to disk_open() >> > > and all usage of disk_devdesc.d_partition. >> > > >> > >> > I think that we should fix the disk_open() api. And then fix everything >> > that uses it to comply with the new rules. The current hodge-podge that >> we >> > have causes a number of issues for different environments that are only >> > mostly worked around. I've done some work in this area to make things >> more >> > regular, but it's still a dog's breakfast of almost-stackable devices >> that >> > we overload too many things on, resulting in the mis-mash we have today. >> > When the whole world was just MBR + BSD label, we could get away with >> it. >> > But now that we have GPT as well as GELI support and ZFS pool devices on >> > top of disk devices, the arrangements aren't working as well as could be >> > desired. >> >> Yes please. >> Could this be some of the cause of issues with legacy mbr boots >> that use to work, that now stop working? I have observed this >> on zfs in mbr on a machine here. I did not have time to debug >> it, it was faster to nuke and pave the machine that was critical >> to operations, the error came as part of a failed freenas upgrade >> to the 11.2 based version. >> > > I think the MBR issues are the same ones that Patrick Kelsey is looking > into. He has a differential review. If the upgrade was to FreeBSD 11.2, > however, that pre-dates most of the work we've done on the loader, so the > root cause of that issue may be different. And it may already be fixed in > stable/11 as we've since merged everything in current into stable/11 > (except for a few things that changed the defaults in a user-visible way). > > To clarify, I recently committed some boot code patches that were the result of me investigating a problem on a machine that I have that initially presented as 'upgraded a ZFS machine to 11.2 and it appeared to hang during boot'. I spent a lot of time root causing the issue I was having on the chance that it might be a/the root cause of problems others have encountered that have a similar summary description. However, it turned out the root cause of my problem was a firmware bug in a 3Ware 9650SE related to multi-sector I/Os being issued to either 'suitably large' LBAs or perhaps LBAs 'suitably close' to the end of the disk causing 60 second I/O timeouts each, and moving to 11.2 triggered it because in 11.2, the ZFS code was modified to look at all the ZFS labels, two of which are very close to the end of the disk. Thankfully my problem was fixed by installing the latest available firmware version for that card (otherwise, the hack needed in the loader would have been to break up multi-sector I/Os 'near' the end of the disk and issue them in descending LBA order). The patches I committed were for issues I found during my investigation that were unrelated to my problem, one of which was the potential for a buffer overrun in the ZFS support code (which I think could only occur on systems running an ashift=9 ZFS configuration on 4K drives), and the other of which was the resolution of an inconsistency between the ZFS probing behavior of zfsboot and loader. -Patrick From owner-svn-src-head@freebsd.org Tue Feb 19 10:17:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67EB214EB1BB; Tue, 19 Feb 2019 10:17:50 +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 0F02B804DA; Tue, 19 Feb 2019 10:17:50 +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 DD9FA1C58F; Tue, 19 Feb 2019 10:17:49 +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 x1JAHn9S057808; Tue, 19 Feb 2019 10:17:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JAHnbU057807; Tue, 19 Feb 2019 10:17:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191017.x1JAHnbU057807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 10:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344273 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F02B804DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 10:17:50 -0000 Author: trasz Date: Tue Feb 19 10:17:49 2019 New Revision: 344273 URL: https://svnweb.freebsd.org/changeset/base/344273 Log: Add kern.rpc.gss.client_hash tunable, to make it possible to bump it easily. This can lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:07:48 2019 (r344272) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:17:49 2019 (r344273) @@ -172,6 +172,7 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 u_int svc_rpc_gss_client_max = CLIENT_MAX; +u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); @@ -180,12 +181,16 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFL &svc_rpc_gss_client_max, 0, "Max number of rpc-gss clients"); +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_hash, CTLFLAG_RDTUN, + &svc_rpc_gss_client_hash_size, 0, + "Size of rpc-gss client hash table"); + static u_int svc_rpc_gss_client_count; SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, &svc_rpc_gss_client_count, 0, "Number of rpc-gss clients"); -struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; +struct svc_rpc_gss_client_list *svc_rpc_gss_client_hash; struct svc_rpc_gss_client_list svc_rpc_gss_clients; static uint32_t svc_rpc_gss_next_clientid = 1; @@ -194,7 +199,8 @@ svc_rpc_gss_init(void *arg) { int i; - for (i = 0; i < CLIENT_HASH_SIZE; i++) + svc_rpc_gss_client_hash = mem_alloc(sizeof(struct svc_rpc_gss_client_list) * svc_rpc_gss_client_hash_size); + for (i = 0; i < svc_rpc_gss_client_hash_size; i++) TAILQ_INIT(&svc_rpc_gss_client_hash[i]); TAILQ_INIT(&svc_rpc_gss_clients); svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); @@ -530,7 +536,7 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *i if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); - list = &svc_rpc_gss_client_hash[id->ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[id->ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(client, list, cl_link) { if (client->cl_id.ci_id == id->ci_id) { @@ -569,7 +575,7 @@ svc_rpc_gss_create_client(void) getboottime(&boottime); client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_INSERT_HEAD(list, client, cl_link); TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink); @@ -635,7 +641,7 @@ svc_rpc_gss_forget_client_locked(struct svc_rpc_gss_cl struct svc_rpc_gss_client_list *list; sx_assert(&svc_rpc_gss_lock, SX_XLOCKED); - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; TAILQ_REMOVE(list, client, cl_link); TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); svc_rpc_gss_client_count--; @@ -650,7 +656,7 @@ svc_rpc_gss_forget_client(struct svc_rpc_gss_client *c struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client *tclient; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(tclient, list, cl_link) { /* From owner-svn-src-head@freebsd.org Tue Feb 19 11:07:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE54D14EC9E6; Tue, 19 Feb 2019 11:07:03 +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 7C48A82599; Tue, 19 Feb 2019 11:07:03 +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 690111CE0C; Tue, 19 Feb 2019 11:07:03 +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 x1JB73Ur083935; Tue, 19 Feb 2019 11:07:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JB73Tj083934; Tue, 19 Feb 2019 11:07:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191107.x1JB73Tj083934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 11:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344276 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C48A82599 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 11:07:04 -0000 Author: trasz Date: Tue Feb 19 11:07:02 2019 New Revision: 344276 URL: https://svnweb.freebsd.org/changeset/base/344276 Log: Bump the default kern.rpc.gss.client_max from 128 to 1024. The old value resulted in bad performance, with high kernel and gssd(8) load, with more than ~64 clients; it also triggered crashes, which are to be fixed by a different patch. PR: 235582 Discussed with: rmacklem@ MFC after: 2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:40:35 2019 (r344275) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 11:07:02 2019 (r344276) @@ -170,7 +170,7 @@ struct svc_rpc_gss_cookedcred { }; #define CLIENT_HASH_SIZE 256 -#define CLIENT_MAX 128 +#define CLIENT_MAX 1024 u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; From owner-svn-src-head@freebsd.org Tue Feb 19 12:45:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6675114F013C; Tue, 19 Feb 2019 12:45:38 +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 A926885C50; Tue, 19 Feb 2019 12:45:37 +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 986341DEEC; Tue, 19 Feb 2019 12:45:37 +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 x1JCjb1U035487; Tue, 19 Feb 2019 12:45:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JCjbYc035486; Tue, 19 Feb 2019 12:45:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191245.x1JCjbYc035486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 12:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344277 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 344277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A926885C50 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 12:45:38 -0000 Author: trasz Date: Tue Feb 19 12:45:37 2019 New Revision: 344277 URL: https://svnweb.freebsd.org/changeset/base/344277 Log: Work around the "nfscl: bad open cnt on server" assertion that can happen when rerooting into NFSv4 rootfs with kernel built with INVARIANTS. I've talked to rmacklem@ (back in 2017), and while the root cause is still unknown, the case guarded by assertion (nfscl_doclose() being called from VOP_INACTIVE) is believed to be safe, and the whole thing seems to run just fine. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 11:07:02 2019 (r344276) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 12:45:37 2019 (r344277) @@ -3188,8 +3188,11 @@ lookformore: !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, nfhp->nfh_len)) { /* Found an open, close it. */ +#ifdef DIAGNOSTIC KASSERT((op->nfso_opencnt == 0), - ("nfscl: bad open cnt on server")); + ("nfscl: bad open cnt on server (%d)", + op->nfso_opencnt)); +#endif NFSUNLOCKCLSTATE(); nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, p); From owner-svn-src-head@freebsd.org Tue Feb 19 15:46:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 449B214F41EA; Tue, 19 Feb 2019 15:46:44 +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 D67128BC7A; Tue, 19 Feb 2019 15:46: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 C9CC41FCF6; Tue, 19 Feb 2019 15:46: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 x1JFkhnC032337; Tue, 19 Feb 2019 15:46:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JFkhZq032336; Tue, 19 Feb 2019 15:46:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902191546.x1JFkhZq032336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 15:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344278 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D67128BC7A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 15:46:44 -0000 Author: markj Date: Tue Feb 19 15:46:43 2019 New Revision: 344278 URL: https://svnweb.freebsd.org/changeset/base/344278 Log: Move a racy assertion in filt_pipewrite(). EVFILT_WRITE knotes for pipes live on the knlist for the other end of the pipe. Since they do not hold a reference on the corresponding file structure, they may be removed from the knlist by pipeclose() while still remaining active. In this case, there is no knlist lock acquired before filt_pipewrite() is called, so the assertion fails. Fix the problem by first checking whether that end of the pipe has been closed. These checks are memory safe since the knote holds a reference on one end of the pipe, and the pipe structure is not freed until both ends are closed. The checks are not racy since PIPE_EOF is never cleared after being set, and pipe_present is never set back to PIPE_ACTIVE after pipeclose() has been called. PR: 235640 Reported and tested by: pho Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19224 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Feb 19 12:45:37 2019 (r344277) +++ head/sys/kern/sys_pipe.c Tue Feb 19 15:46:43 2019 (r344278) @@ -1741,15 +1741,19 @@ static int filt_pipewrite(struct knote *kn, long hint) { struct pipe *wpipe; - + + /* + * If this end of the pipe is closed, the knote was removed from the + * knlist and the list lock (i.e., the pipe lock) is therefore not held. + */ wpipe = kn->kn_hook; - PIPE_LOCK_ASSERT(wpipe, MA_OWNED); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_data = 0; kn->kn_flags |= EV_EOF; return (1); } + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); kn->kn_data = (wpipe->pipe_buffer.size > 0) ? (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; if (wpipe->pipe_state & PIPE_DIRECTW) From owner-svn-src-head@freebsd.org Tue Feb 19 17:03:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC0C714F5B05; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 872D48E3AE; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 751BD20B2D; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JH3Z8d073847; Tue, 19 Feb 2019 17:03:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JH3ZC8073846; Tue, 19 Feb 2019 17:03:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902191703.x1JH3ZC8073846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 Feb 2019 17:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344279 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 872D48E3AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 17:03:36 -0000 Author: andrew Date: Tue Feb 19 17:03:34 2019 New Revision: 344279 URL: https://svnweb.freebsd.org/changeset/base/344279 Log: Create a common function to handle freeing the kcov info struct. Both places that may free the kcov info struct are identical. Create a new common function to hold the code. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Tue Feb 19 15:46:43 2019 (r344278) +++ head/sys/kern/kern_kcov.c Tue Feb 19 17:03:34 2019 (r344279) @@ -136,6 +136,7 @@ static d_mmap_single_t kcov_mmap_single; static d_ioctl_t kcov_ioctl; static int kcov_alloc(struct kcov_info *info, size_t entries); +static void kcov_free(struct kcov_info *info); static void kcov_init(const void *unused); static struct cdevsw kcov_cdevsw = { @@ -288,14 +289,7 @@ kcov_mmap_cleanup(void *arg) * The KCOV_STATE_DYING stops new threads from using it. * The lack of a thread means nothing is currently using the buffers. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static int @@ -398,6 +392,19 @@ kcov_alloc(struct kcov_info *info, size_t entries) return (0); } +static void +kcov_free(struct kcov_info *info) +{ + + if (info->kvaddr != 0) { + pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); + kva_free(info->kvaddr, info->bufsize); + } + if (info->bufobj != NULL && !info->mmap) + vm_object_deallocate(info->bufobj); + free(info, M_KCOV_INFO); +} + static int kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag __unused, struct thread *td) @@ -531,14 +538,7 @@ kcov_thread_dtor(void *arg __unused, struct thread *td * The KCOV_STATE_DYING stops new threads from using it. * It also stops the current thread from trying to use the info struct. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static void From owner-svn-src-head@freebsd.org Tue Feb 19 17:38:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D7914F688E; Tue, 19 Feb 2019 17:38: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 1D6448FA42; Tue, 19 Feb 2019 17:38: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 11F1221043; Tue, 19 Feb 2019 17:38: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 x1JHcOj3089951; Tue, 19 Feb 2019 17:38:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JHcOBS089949; Tue, 19 Feb 2019 17:38:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902191738.x1JHcOBS089949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Feb 2019 17:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344280 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 344280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D6448FA42 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 17:38:25 -0000 Author: emaste Date: Tue Feb 19 17:38:24 2019 New Revision: 344280 URL: https://svnweb.freebsd.org/changeset/base/344280 Log: freebsd-update: Clarify help text Improve help text to include example release numbers for reference and clarify the -F option. PR: 231185, 214619 Submitted by: Gerald Aryeetey Reviewed by: delphij, rgrimes MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18944 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:03:34 2019 (r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:38:24 2019 (r344280) @@ -89,13 +89,13 @@ Read configuration options from .It Fl F Force .Nm Cm fetch -to proceed where it normally would not, such as an unfinished upgrade +to proceed in the case of an unfinished upgrade. .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release to which +Specify the new release (e.g. 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:03:34 2019 (r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:38:24 2019 (r344280) @@ -45,7 +45,8 @@ Options: (default: /var/db/freebsd-update/) -f conffile -- Read configuration options from conffile (default: /etc/freebsd-update.conf) - -F -- Force a fetch operation to proceed + -F -- Force a fetch operation to proceed in the + case of an unfinished upgrade -k KEY -- Trust an RSA key with SHA256 hash of KEY -r release -- Target for upgrade (e.g., 11.1-RELEASE) -s server -- Server from which to fetch updates From owner-svn-src-head@freebsd.org Tue Feb 19 19:04:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3145214F9BE5; Tue, 19 Feb 2019 19:04:53 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B31786DBD2; Tue, 19 Feb 2019 19:04:52 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5D712207A; Tue, 19 Feb 2019 19:04:52 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJ4qiL036880; Tue, 19 Feb 2019 19:04:52 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJ4qIh036879; Tue, 19 Feb 2019 19:04:52 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201902191904.x1JJ4qIh036879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Tue, 19 Feb 2019 19:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344292 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 344292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B31786DBD2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:04:53 -0000 Author: thj Date: Tue Feb 19 19:04:52 2019 New Revision: 344292 URL: https://svnweb.freebsd.org/changeset/base/344292 Log: Fix style after r340832 Reported by: jhb Reviewed by: jhb, jtl Approved by: jtl (mentor) MFC after: 3 days Differential Revision: https://reviews/freebsd.org/D18354 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * Be sure we can get various info from the battery. */ if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) continue; /* If a battery is not installed, we sometimes get strange values. */ From owner-svn-src-head@freebsd.org Tue Feb 19 19:13:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA4FB14F9F8A; Tue, 19 Feb 2019 19:13: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 5A21D6E111; Tue, 19 Feb 2019 19:13: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 476BC22233; Tue, 19 Feb 2019 19:13: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 x1JJDnf1042270; Tue, 19 Feb 2019 19:13:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJDnTW042269; Tue, 19 Feb 2019 19:13:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902191913.x1JJDnTW042269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 19:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344293 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 344293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A21D6E111 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:13:49 -0000 Author: kib Date: Tue Feb 19 19:13:48 2019 New Revision: 344293 URL: https://svnweb.freebsd.org/changeset/base/344293 Log: Add definition for %cr4 PKRU enable bit. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Feb 19 19:04:52 2019 (r344292) +++ head/sys/x86/include/specialreg.h Tue Feb 19 19:13:48 2019 (r344293) @@ -77,6 +77,7 @@ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ #define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ #define CR4_SMAP 0x00200000 /* Supervisor-Mode Access Prevention */ +#define CR4_PKE 0x00400000 /* Protection Keys Enable */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From owner-svn-src-head@freebsd.org Tue Feb 19 19:15:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17A7B14FA00D; Tue, 19 Feb 2019 19:15:16 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B011E6E291; Tue, 19 Feb 2019 19:15:15 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BE702223D; Tue, 19 Feb 2019 19:15:15 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJFF1S042391; Tue, 19 Feb 2019 19:15:15 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJFFlt042390; Tue, 19 Feb 2019 19:15:15 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902191915.x1JJFFlt042390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 19 Feb 2019 19:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344294 - head/lib/libc/posix1e X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/lib/libc/posix1e X-SVN-Commit-Revision: 344294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B011E6E291 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:15:16 -0000 Author: sef Date: Tue Feb 19 19:15:15 2019 New Revision: 344294 URL: https://svnweb.freebsd.org/changeset/base/344294 Log: Remove some redundant code in _posix1e_acl_strip_np This was discovered through examination -- acl_copy_entry() copies the tag type and permset fields. Reviewed by: trasz, pfg Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D19240 Modified: head/lib/libc/posix1e/acl_strip.c Modified: head/lib/libc/posix1e/acl_strip.c ============================================================================== --- head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:13:48 2019 (r344293) +++ head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:15:15 2019 (r344294) @@ -70,7 +70,6 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat { acl_t acl_new, acl_old; acl_entry_t entry, entry_new; - acl_permset_t perm; acl_tag_t tag; int entry_id, have_mask_entry; @@ -104,15 +103,7 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat case ACL_USER_OBJ: case ACL_GROUP_OBJ: case ACL_OTHER: - if (acl_get_tag_type(entry, &tag) == -1) - goto fail; - if (acl_get_permset(entry, &perm) == -1) - goto fail; if (acl_create_entry(&acl_new, &entry_new) == -1) - goto fail; - if (acl_set_tag_type(entry_new, tag) == -1) - goto fail; - if (acl_set_permset(entry_new, perm) == -1) goto fail; if (acl_copy_entry(entry_new, entry) == -1) goto fail; From owner-svn-src-head@freebsd.org Tue Feb 19 19:17:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE44914FA0FD; Tue, 19 Feb 2019 19:17:21 +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 531706E596; Tue, 19 Feb 2019 19:17:21 +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 0FC622225D; Tue, 19 Feb 2019 19:17:21 +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 x1JJHKQ4042579; Tue, 19 Feb 2019 19:17:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJHK4m042577; Tue, 19 Feb 2019 19:17:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902191917.x1JJHK4m042577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 19:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344296 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 344296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 531706E596 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:17:21 -0000 Author: kib Date: Tue Feb 19 19:17:20 2019 New Revision: 344296 URL: https://svnweb.freebsd.org/changeset/base/344296 Log: Provide convenience C wrappers for RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Feb 19 19:16:28 2019 (r344295) +++ head/sys/amd64/include/cpufunc.h Tue Feb 19 19:17:20 2019 (r344296) @@ -627,6 +627,22 @@ cpu_mwait(u_long extensions, u_int hints) __asm __volatile("mwait" : : "a" (hints), "c" (extensions)); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #ifdef _KERNEL /* This is defined in but is too painful to get to */ #ifndef MSR_FSBASE Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Tue Feb 19 19:16:28 2019 (r344295) +++ head/sys/i386/include/cpufunc.h Tue Feb 19 19:17:20 2019 (r344296) @@ -726,6 +726,22 @@ intr_restore(register_t eflags) write_eflags(eflags); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); From owner-svn-src-head@freebsd.org Tue Feb 19 19:36:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FF4C14FAA61; Tue, 19 Feb 2019 19:36:45 +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 E53B86F319; Tue, 19 Feb 2019 19:36:44 +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 D6F65225FD; Tue, 19 Feb 2019 19:36:44 +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 x1JJai51052886; Tue, 19 Feb 2019 19:36:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJai3M052883; Tue, 19 Feb 2019 19:36:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191936.x1JJai3M052883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344297 - in head/sys: conf dev/drm modules modules/drm modules/drm/drm modules/drm/mach64 modules/drm/mga modules/drm/r128 modules/drm/savage modules/drm/sis modules/drm/tdfx modules/d... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/drm modules modules/drm modules/drm/drm modules/drm/mach64 modules/drm/mga modules/drm/r128 modules/drm/savage modules/drm/sis modules/drm/tdfx modules/drm/via X-SVN-Commit-Revision: 344297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E53B86F319 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:36:45 -0000 Author: imp Date: Tue Feb 19 19:36:43 2019 New Revision: 344297 URL: https://svnweb.freebsd.org/changeset/base/344297 Log: Per discussions on arch@ and elsewhere, retire drm module / drives. Retire the drm modules / drivers. These are now handled by the drm-legacy-kmod port and/or the drm-kmod port. All future development and maintanace will be handled there. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm.h head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_agpsupport.c head/sys/dev/drm/drm_atomic.h head/sys/dev/drm/drm_auth.c head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_context.c head/sys/dev/drm/drm_dma.c head/sys/dev/drm/drm_drawable.c head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_fops.c head/sys/dev/drm/drm_hashtab.c head/sys/dev/drm/drm_hashtab.h head/sys/dev/drm/drm_internal.h head/sys/dev/drm/drm_ioctl.c head/sys/dev/drm/drm_irq.c head/sys/dev/drm/drm_linux_list.h head/sys/dev/drm/drm_lock.c head/sys/dev/drm/drm_memory.c head/sys/dev/drm/drm_mm.c head/sys/dev/drm/drm_mm.h head/sys/dev/drm/drm_pci.c head/sys/dev/drm/drm_pciids.h head/sys/dev/drm/drm_sarea.h head/sys/dev/drm/drm_scatter.c head/sys/dev/drm/drm_sman.c head/sys/dev/drm/drm_sman.h head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm/drm_vm.c head/sys/dev/drm/mach64_dma.c head/sys/dev/drm/mach64_drm.h head/sys/dev/drm/mach64_drv.c head/sys/dev/drm/mach64_drv.h head/sys/dev/drm/mach64_irq.c head/sys/dev/drm/mach64_state.c head/sys/dev/drm/mga_dma.c head/sys/dev/drm/mga_drm.h head/sys/dev/drm/mga_drv.c head/sys/dev/drm/mga_drv.h head/sys/dev/drm/mga_irq.c head/sys/dev/drm/mga_state.c head/sys/dev/drm/mga_ucode.h head/sys/dev/drm/mga_warp.c head/sys/dev/drm/r128_cce.c head/sys/dev/drm/r128_drm.h head/sys/dev/drm/r128_drv.c head/sys/dev/drm/r128_drv.h head/sys/dev/drm/r128_irq.c head/sys/dev/drm/r128_state.c head/sys/dev/drm/savage_bci.c head/sys/dev/drm/savage_drm.h head/sys/dev/drm/savage_drv.c head/sys/dev/drm/savage_drv.h head/sys/dev/drm/savage_state.c head/sys/dev/drm/sis_drm.h head/sys/dev/drm/sis_drv.c head/sys/dev/drm/sis_drv.h head/sys/dev/drm/sis_ds.c head/sys/dev/drm/sis_ds.h head/sys/dev/drm/sis_mm.c head/sys/dev/drm/tdfx_drv.c head/sys/dev/drm/tdfx_drv.h head/sys/dev/drm/via_3d_reg.h head/sys/dev/drm/via_dma.c head/sys/dev/drm/via_dmablit.c head/sys/dev/drm/via_dmablit.h head/sys/dev/drm/via_drm.h head/sys/dev/drm/via_drv.c head/sys/dev/drm/via_drv.h head/sys/dev/drm/via_irq.c head/sys/dev/drm/via_map.c head/sys/dev/drm/via_mm.c head/sys/dev/drm/via_verifier.c head/sys/dev/drm/via_verifier.h head/sys/dev/drm/via_video.c head/sys/modules/drm/Makefile head/sys/modules/drm/Makefile.inc head/sys/modules/drm/drm/Makefile head/sys/modules/drm/mach64/Makefile head/sys/modules/drm/mga/Makefile head/sys/modules/drm/r128/Makefile head/sys/modules/drm/savage/Makefile head/sys/modules/drm/sis/Makefile head/sys/modules/drm/tdfx/Makefile head/sys/modules/drm/via/Makefile Modified: head/sys/conf/files head/sys/conf/kern.opts.mk head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/conf/files Tue Feb 19 19:36:43 2019 (r344297) @@ -1541,55 +1541,6 @@ dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme -dev/drm/ati_pcigart.c optional drm -dev/drm/drm_agpsupport.c optional drm -dev/drm/drm_auth.c optional drm -dev/drm/drm_bufs.c optional drm -dev/drm/drm_context.c optional drm -dev/drm/drm_dma.c optional drm -dev/drm/drm_drawable.c optional drm -dev/drm/drm_drv.c optional drm -dev/drm/drm_fops.c optional drm -dev/drm/drm_hashtab.c optional drm -dev/drm/drm_ioctl.c optional drm -dev/drm/drm_irq.c optional drm -dev/drm/drm_lock.c optional drm -dev/drm/drm_memory.c optional drm -dev/drm/drm_mm.c optional drm -dev/drm/drm_pci.c optional drm -dev/drm/drm_scatter.c optional drm -dev/drm/drm_sman.c optional drm -dev/drm/drm_sysctl.c optional drm -dev/drm/drm_vm.c optional drm -dev/drm/mach64_dma.c optional mach64drm -dev/drm/mach64_drv.c optional mach64drm -dev/drm/mach64_irq.c optional mach64drm -dev/drm/mach64_state.c optional mach64drm -dev/drm/mga_dma.c optional mgadrm -dev/drm/mga_drv.c optional mgadrm -dev/drm/mga_irq.c optional mgadrm -dev/drm/mga_state.c optional mgadrm -dev/drm/mga_warp.c optional mgadrm -dev/drm/r128_cce.c optional r128drm \ - compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" -dev/drm/r128_drv.c optional r128drm -dev/drm/r128_irq.c optional r128drm -dev/drm/r128_state.c optional r128drm -dev/drm/savage_bci.c optional savagedrm -dev/drm/savage_drv.c optional savagedrm -dev/drm/savage_state.c optional savagedrm -dev/drm/sis_drv.c optional sisdrm -dev/drm/sis_ds.c optional sisdrm -dev/drm/sis_mm.c optional sisdrm -dev/drm/tdfx_drv.c optional tdfxdrm -dev/drm/via_dma.c optional viadrm -dev/drm/via_dmablit.c optional viadrm -dev/drm/via_drv.c optional viadrm -dev/drm/via_irq.c optional viadrm -dev/drm/via_map.c optional viadrm -dev/drm/via_mm.c optional viadrm -dev/drm/via_verifier.c optional viadrm -dev/drm/via_video.c optional viadrm dev/drm2/drm_agpsupport.c optional drm2 dev/drm2/drm_auth.c optional drm2 dev/drm2/drm_bufs.c optional drm2 Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/conf/kern.opts.mk Tue Feb 19 19:36:43 2019 (r344297) @@ -50,7 +50,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ - MODULE_DRM \ MODULE_DRM2 \ NAND \ OFED \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/modules/Makefile Tue Feb 19 19:36:43 2019 (r344297) @@ -109,7 +109,6 @@ SUBDIR= \ dcons_crom \ de \ ${_dpms} \ - ${_drm} \ ${_drm2} \ dummynet \ ${_ed} \ @@ -582,9 +581,6 @@ _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs _dpms= dpms -.if ${MK_MODULE_DRM} != "no" -_drm= drm -.endif .if ${MK_MODULE_DRM2} != "no" _drm2= drm2 .endif @@ -776,9 +772,6 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq -.if ${MK_MODULE_DRM} != "no" -_drm= drm -.endif _exca= exca _ffec= ffec _nvd= nvd From owner-svn-src-head@freebsd.org Tue Feb 19 19:37:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF36E14FAADA; Tue, 19 Feb 2019 19:37:00 +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 CCD506F41F; Tue, 19 Feb 2019 19:36: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 E194B225FE; Tue, 19 Feb 2019 19:36:56 +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 x1JJauOc052946; Tue, 19 Feb 2019 19:36:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJauRP052944; Tue, 19 Feb 2019 19:36:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191936.x1JJauRP052944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344298 - in head/sys: conf modules modules/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms modules/drm2/radeonkmsfw modules/drm2/radeonkmsfw/ARUBA_me modules/drm2/ra... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf modules modules/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms modules/drm2/radeonkmsfw modules/drm2/radeonkmsfw/ARUBA_me modules/drm2/radeonkmsfw/ARUBA_pfp modul... X-SVN-Commit-Revision: 344298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCD506F41F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:37:01 -0000 Author: imp Date: Tue Feb 19 19:36:56 2019 New Revision: 344298 URL: https://svnweb.freebsd.org/changeset/base/344298 Log: Remove drm2 modules. Remove support for compiling drm2 as a module. This has transitioned to the drm-kmod or drm-legacy-kmodw ports. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/modules/drm2/Makefile head/sys/modules/drm2/Makefile.inc head/sys/modules/drm2/drm2/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_me/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_me/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/BTC_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_me/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_me/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile.inc head/sys/modules/drm2/radeonkmsfw/OLAND_ce/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_mc/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_me/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_me/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_me/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R100_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R200_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R300_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R420_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R520_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_me/Makefile head/sys/modules/drm2/radeonkmsfw/R600_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R700_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_me/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/RS600_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS690_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_me/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_ce/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_mc/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_me/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_me/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_ce/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_mc/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_me/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/gen-makefiles Modified: head/sys/conf/kern.opts.mk head/sys/modules/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Feb 19 19:36:43 2019 (r344297) +++ head/sys/conf/kern.opts.mk Tue Feb 19 19:36:56 2019 (r344298) @@ -50,7 +50,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ - MODULE_DRM2 \ NAND \ OFED \ RATELIMIT Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Feb 19 19:36:43 2019 (r344297) +++ head/sys/modules/Makefile Tue Feb 19 19:36:56 2019 (r344298) @@ -109,7 +109,6 @@ SUBDIR= \ dcons_crom \ de \ ${_dpms} \ - ${_drm2} \ dummynet \ ${_ed} \ ${_efirt} \ @@ -581,9 +580,6 @@ _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs _dpms= dpms -.if ${MK_MODULE_DRM2} != "no" -_drm2= drm2 -.endif _ed= ed _em= em _ena= ena @@ -781,9 +777,6 @@ _wi= wi .endif .if ${MACHINE_ARCH} == "powerpc64" -.if ${MK_MODULE_DRM2} != "no" -_drm2= drm2 -.endif _ipmi= ipmi .endif .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" From owner-svn-src-head@freebsd.org Tue Feb 19 19:37:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B4A914FAB3E; Tue, 19 Feb 2019 19:37:04 +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 9DAAD6F480; Tue, 19 Feb 2019 19:37:03 +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 5790522601; Tue, 19 Feb 2019 19:37:03 +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 x1JJb3BP053004; Tue, 19 Feb 2019 19:37:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJb3Ma053003; Tue, 19 Feb 2019 19:37:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191937.x1JJb3Ma053003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344299 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/radeon/reg_srcs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/radeon/reg_srcs X-SVN-Commit-Revision: 344299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DAAD6F480 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:37:04 -0000 Author: imp Date: Tue Feb 19 19:37:02 2019 New Revision: 344299 URL: https://svnweb.freebsd.org/changeset/base/344299 Log: Remove the i915 and radeon drivers. Per discussions on arch@ and elsewhere, the maintenance of this code has moved to the drm-kmod and drm-legacy-kmod ports. Remove the i915 and radeon drivers from the tree. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm2/ati_pcigart.c head/sys/dev/drm2/i915/dvo.h head/sys/dev/drm2/i915/dvo_ch7017.c head/sys/dev/drm2/i915/dvo_ch7xxx.c head/sys/dev/drm2/i915/dvo_ivch.c head/sys/dev/drm2/i915/dvo_ns2501.c head/sys/dev/drm2/i915/dvo_sil164.c head/sys/dev/drm2/i915/dvo_tfp410.c head/sys/dev/drm2/i915/i915_debug.c head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_context.c head/sys/dev/drm2/i915/i915_gem_evict.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_stolen.c head/sys/dev/drm2/i915/i915_gem_tiling.c head/sys/dev/drm2/i915/i915_ioc32.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/i915_suspend.c head/sys/dev/drm2/i915/intel_acpi.c head/sys/dev/drm2/i915/intel_bios.c head/sys/dev/drm2/i915/intel_bios.h head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_ddi.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_dvo.c head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/drm2/i915/intel_hdmi.c head/sys/dev/drm2/i915/intel_iic.c head/sys/dev/drm2/i915/intel_lvds.c head/sys/dev/drm2/i915/intel_modes.c head/sys/dev/drm2/i915/intel_opregion.c head/sys/dev/drm2/i915/intel_overlay.c head/sys/dev/drm2/i915/intel_panel.c head/sys/dev/drm2/i915/intel_pm.c head/sys/dev/drm2/i915/intel_ringbuffer.c head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/dev/drm2/i915/intel_sdvo.c head/sys/dev/drm2/i915/intel_sdvo_regs.h head/sys/dev/drm2/i915/intel_sprite.c head/sys/dev/drm2/i915/intel_tv.c head/sys/dev/drm2/radeon/ObjectID.h head/sys/dev/drm2/radeon/README head/sys/dev/drm2/radeon/atom-bits.h head/sys/dev/drm2/radeon/atom-names.h head/sys/dev/drm2/radeon/atom-types.h head/sys/dev/drm2/radeon/atom.c head/sys/dev/drm2/radeon/atom.h head/sys/dev/drm2/radeon/atombios.h head/sys/dev/drm2/radeon/atombios_crtc.c head/sys/dev/drm2/radeon/atombios_dp.c head/sys/dev/drm2/radeon/atombios_encoders.c head/sys/dev/drm2/radeon/atombios_i2c.c head/sys/dev/drm2/radeon/avivod.h head/sys/dev/drm2/radeon/cayman_blit_shaders.c head/sys/dev/drm2/radeon/cayman_blit_shaders.h head/sys/dev/drm2/radeon/cayman_reg_safe.h head/sys/dev/drm2/radeon/evergreen.c head/sys/dev/drm2/radeon/evergreen_blit_kms.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.h head/sys/dev/drm2/radeon/evergreen_cs.c head/sys/dev/drm2/radeon/evergreen_hdmi.c head/sys/dev/drm2/radeon/evergreen_reg.h head/sys/dev/drm2/radeon/evergreen_reg_safe.h head/sys/dev/drm2/radeon/evergreend.h head/sys/dev/drm2/radeon/ni.c head/sys/dev/drm2/radeon/ni_reg.h head/sys/dev/drm2/radeon/nid.h head/sys/dev/drm2/radeon/r100.c head/sys/dev/drm2/radeon/r100_reg_safe.h head/sys/dev/drm2/radeon/r100_track.h head/sys/dev/drm2/radeon/r100d.h head/sys/dev/drm2/radeon/r200.c head/sys/dev/drm2/radeon/r200_reg_safe.h head/sys/dev/drm2/radeon/r300.c head/sys/dev/drm2/radeon/r300_reg.h head/sys/dev/drm2/radeon/r300_reg_safe.h head/sys/dev/drm2/radeon/r300d.h head/sys/dev/drm2/radeon/r420.c head/sys/dev/drm2/radeon/r420_reg_safe.h head/sys/dev/drm2/radeon/r420d.h head/sys/dev/drm2/radeon/r500_reg.h head/sys/dev/drm2/radeon/r520.c head/sys/dev/drm2/radeon/r520d.h head/sys/dev/drm2/radeon/r600.c head/sys/dev/drm2/radeon/r600_audio.c head/sys/dev/drm2/radeon/r600_blit_kms.c head/sys/dev/drm2/radeon/r600_blit_shaders.c head/sys/dev/drm2/radeon/r600_blit_shaders.h head/sys/dev/drm2/radeon/r600_cp.h head/sys/dev/drm2/radeon/r600_cs.c head/sys/dev/drm2/radeon/r600_cs.h head/sys/dev/drm2/radeon/r600_hdmi.c head/sys/dev/drm2/radeon/r600_reg.h head/sys/dev/drm2/radeon/r600_reg_safe.h head/sys/dev/drm2/radeon/r600d.h head/sys/dev/drm2/radeon/radeon.h head/sys/dev/drm2/radeon/radeon_acpi.c head/sys/dev/drm2/radeon/radeon_acpi.h head/sys/dev/drm2/radeon/radeon_agp.c head/sys/dev/drm2/radeon/radeon_asic.c head/sys/dev/drm2/radeon/radeon_asic.h head/sys/dev/drm2/radeon/radeon_atombios.c head/sys/dev/drm2/radeon/radeon_benchmark.c head/sys/dev/drm2/radeon/radeon_bios.c head/sys/dev/drm2/radeon/radeon_blit_common.h head/sys/dev/drm2/radeon/radeon_clocks.c head/sys/dev/drm2/radeon/radeon_combios.c head/sys/dev/drm2/radeon/radeon_connectors.c head/sys/dev/drm2/radeon/radeon_cs.c head/sys/dev/drm2/radeon/radeon_cursor.c head/sys/dev/drm2/radeon/radeon_device.c head/sys/dev/drm2/radeon/radeon_display.c head/sys/dev/drm2/radeon/radeon_drm.h head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/drm2/radeon/radeon_drv.h head/sys/dev/drm2/radeon/radeon_encoders.c head/sys/dev/drm2/radeon/radeon_family.h head/sys/dev/drm2/radeon/radeon_fb.c head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_gart.c head/sys/dev/drm2/radeon/radeon_gem.c head/sys/dev/drm2/radeon/radeon_gem.h head/sys/dev/drm2/radeon/radeon_i2c.c head/sys/dev/drm2/radeon/radeon_irq.c head/sys/dev/drm2/radeon/radeon_irq_kms.c head/sys/dev/drm2/radeon/radeon_irq_kms.h head/sys/dev/drm2/radeon/radeon_kms.c head/sys/dev/drm2/radeon/radeon_kms.h head/sys/dev/drm2/radeon/radeon_legacy_crtc.c head/sys/dev/drm2/radeon/radeon_legacy_encoders.c head/sys/dev/drm2/radeon/radeon_legacy_tv.c head/sys/dev/drm2/radeon/radeon_mem.c head/sys/dev/drm2/radeon/radeon_mode.h head/sys/dev/drm2/radeon/radeon_object.c head/sys/dev/drm2/radeon/radeon_object.h head/sys/dev/drm2/radeon/radeon_pm.c head/sys/dev/drm2/radeon/radeon_prime.c head/sys/dev/drm2/radeon/radeon_reg.h head/sys/dev/drm2/radeon/radeon_ring.c head/sys/dev/drm2/radeon/radeon_sa.c head/sys/dev/drm2/radeon/radeon_semaphore.c head/sys/dev/drm2/radeon/radeon_test.c head/sys/dev/drm2/radeon/radeon_trace.h head/sys/dev/drm2/radeon/radeon_trace_points.c head/sys/dev/drm2/radeon/radeon_ttm.c head/sys/dev/drm2/radeon/reg_srcs/cayman head/sys/dev/drm2/radeon/reg_srcs/evergreen head/sys/dev/drm2/radeon/reg_srcs/r100 head/sys/dev/drm2/radeon/reg_srcs/r200 head/sys/dev/drm2/radeon/reg_srcs/r300 head/sys/dev/drm2/radeon/reg_srcs/r420 head/sys/dev/drm2/radeon/reg_srcs/r600 head/sys/dev/drm2/radeon/reg_srcs/rn50 head/sys/dev/drm2/radeon/reg_srcs/rs600 head/sys/dev/drm2/radeon/reg_srcs/rv515 head/sys/dev/drm2/radeon/rn50_reg_safe.h head/sys/dev/drm2/radeon/rs100d.h head/sys/dev/drm2/radeon/rs400.c head/sys/dev/drm2/radeon/rs400d.h head/sys/dev/drm2/radeon/rs600.c head/sys/dev/drm2/radeon/rs600_reg_safe.h head/sys/dev/drm2/radeon/rs600d.h head/sys/dev/drm2/radeon/rs690.c head/sys/dev/drm2/radeon/rs690d.h head/sys/dev/drm2/radeon/rv200d.h head/sys/dev/drm2/radeon/rv250d.h head/sys/dev/drm2/radeon/rv350d.h head/sys/dev/drm2/radeon/rv515.c head/sys/dev/drm2/radeon/rv515_reg_safe.h head/sys/dev/drm2/radeon/rv515d.h head/sys/dev/drm2/radeon/rv770.c head/sys/dev/drm2/radeon/rv770d.h head/sys/dev/drm2/radeon/si.c head/sys/dev/drm2/radeon/si_blit_shaders.c head/sys/dev/drm2/radeon/si_blit_shaders.h head/sys/dev/drm2/radeon/si_reg.h head/sys/dev/drm2/radeon/sid.h Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 19 19:36:56 2019 (r344298) +++ head/sys/conf/files Tue Feb 19 19:37:02 2019 (r344299) @@ -1584,7 +1584,6 @@ dev/drm2/ttm/ttm_execbuf_util.c optional drm2 dev/drm2/ttm/ttm_memory.c optional drm2 dev/drm2/ttm/ttm_page_alloc.c optional drm2 dev/drm2/ttm/ttm_bo_vm.c optional drm2 -dev/drm2/ati_pcigart.c optional drm2 agp pci dev/ed/if_ed.c optional ed dev/ed/if_ed_novell.c optional ed dev/ed/if_ed_rtl80x9.c optional ed From owner-svn-src-head@freebsd.org Tue Feb 19 19:37:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A90A014FAB82; Tue, 19 Feb 2019 19:37:15 +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 D9C3A6F589; Tue, 19 Feb 2019 19:37:14 +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 0616622602; Tue, 19 Feb 2019 19:37: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 x1JJb9kx053059; Tue, 19 Feb 2019 19:37:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJb9H6053057; Tue, 19 Feb 2019 19:37:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191937.x1JJb9H6053057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344300 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 344300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9C3A6F589 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:37:15 -0000 Author: imp Date: Tue Feb 19 19:37:09 2019 New Revision: 344300 URL: https://svnweb.freebsd.org/changeset/base/344300 Log: Add an UPDATING entry for the removal of drm and drm2 Also bump FreeBSD version to 1300013 since this series is a big change. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 19 19:37:02 2019 (r344299) +++ head/UPDATING Tue Feb 19 19:37:09 2019 (r344300) @@ -31,6 +31,11 @@ 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".) +20190219: + drm and drm2 have been removed from the tree. Please see + https://wiki.freebsd.org/Graphics for the latest information on + migrating to the drm ports. + 20190131: Iflib is no longer unconditionally compiled into the kernel. Drivers using iflib and statically compiled into the kernel, now require Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Feb 19 19:37:02 2019 (r344299) +++ head/sys/sys/param.h Tue Feb 19 19:37:09 2019 (r344300) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Feb 19 19:57:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8A714FB7A5; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C40A70F83; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1899122982; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJvtGb065455; Tue, 19 Feb 2019 19:57:55 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJvtdq065454; Tue, 19 Feb 2019 19:57:55 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201902191957.x1JJvtdq065454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Tue, 19 Feb 2019 19:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344301 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 344301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C40A70F83 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 19:57:56 -0000 Author: thj Date: Tue Feb 19 19:57:55 2019 New Revision: 344301 URL: https://svnweb.freebsd.org/changeset/base/344301 Log: When dropping a fragment queue count the number of fragments in the queue When dropping a fragment queue, account for the number of fragments in the queue. This improves accounting between the number of fragments received and the number of fragments dropped. Reviewed by: jtl, bz, transport Approved by: jtl (mentor), bz (mentor) Differential Revision: https://review.freebsd.org/D17521 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Feb 19 19:37:09 2019 (r344300) +++ head/sys/netinet6/frag6.c Tue Feb 19 19:57:55 2019 (r344301) @@ -593,7 +593,7 @@ insert: af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -603,7 +603,7 @@ insert: } if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -861,7 +861,8 @@ frag6_slowtimo(void) --q6->ip6q_ttl; q6 = q6->ip6q_next; if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); + IP6STAT_ADD(ip6s_fragtimeout, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(q6->ip6q_prev, i); } @@ -879,7 +880,8 @@ frag6_slowtimo(void) (V_ip6_maxfragpackets > 0 && V_ip6q[i].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } @@ -896,7 +898,8 @@ frag6_slowtimo(void) IP6Q_LOCK(i); head = IP6Q_HEAD(i); if (head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } From owner-svn-src-head@freebsd.org Tue Feb 19 20:12:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4437414FBC2B; Tue, 19 Feb 2019 20:12:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D895A71928; Tue, 19 Feb 2019 20:12:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C82EB22CC0; Tue, 19 Feb 2019 20:12:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JKCCMj071558; Tue, 19 Feb 2019 20:12:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JKCC6m071557; Tue, 19 Feb 2019 20:12:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201902192012.x1JKCC6m071557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 19 Feb 2019 20:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344302 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 344302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D895A71928 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 20:12:13 -0000 Author: mckusick Date: Tue Feb 19 20:12:12 2019 New Revision: 344302 URL: https://svnweb.freebsd.org/changeset/base/344302 Log: Ensure that inode updates are properly flushed out during the first pass of fsck_ffs. Some changes, such as check-hash corrections were being lost. Reported by: Michael Tuexen (tuexen@) Tested by: Michael Tuexen (tuexen@) MFC after: 3 days Modified: head/sbin/fsck_ffs/inode.c Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Tue Feb 19 19:57:55 2019 (r344301) +++ head/sbin/fsck_ffs/inode.c Tue Feb 19 20:12:12 2019 (r344302) @@ -349,9 +349,11 @@ getnextinode(ino_t inumber, int rebuildcg) lastinum += fullcnt; } /* + * Flush old contents in case they have been updated. * If getblk encounters an error, it will already have zeroed * out the buffer, so we do not need to do so here. */ + flush(fswritefd, &inobuf); getblk(&inobuf, blk, size); nextinop = inobuf.b_un.b_buf; } @@ -461,6 +463,10 @@ void freeinodebuf(void) { + /* + * Flush old contents in case they have been updated. + */ + flush(fswritefd, &inobuf); if (inobuf.b_un.b_buf != NULL) free((char *)inobuf.b_un.b_buf); inobuf.b_un.b_buf = NULL; From owner-svn-src-head@freebsd.org Tue Feb 19 20:26:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58C014D70B8; Tue, 19 Feb 2019 20:26:04 +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 6EB6E71FF3; Tue, 19 Feb 2019 20:26:04 +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 5D80D22E95; Tue, 19 Feb 2019 20:26:04 +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 x1JKQ4A5080779; Tue, 19 Feb 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JKQ4Kn080778; Tue, 19 Feb 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902192026.x1JKQ4Kn080778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344303 - head/usr.bin/mkuzip X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/mkuzip X-SVN-Commit-Revision: 344303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EB6E71FF3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 20:26:05 -0000 Author: kib Date: Tue Feb 19 20:26:03 2019 New Revision: 344303 URL: https://svnweb.freebsd.org/changeset/base/344303 Log: Minor cleanup for mkuzip(8) man page. List all single-letter options in summary. Order options alphabetically. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/usr.bin/mkuzip/mkuzip.8 Modified: head/usr.bin/mkuzip/mkuzip.8 ============================================================================== --- head/usr.bin/mkuzip/mkuzip.8 Tue Feb 19 20:12:12 2019 (r344302) +++ head/usr.bin/mkuzip/mkuzip.8 Tue Feb 19 20:26:03 2019 (r344303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2006 +.Dd February 19, 2019 .Dt MKUZIP 8 .Os .Sh NAME @@ -35,10 +35,10 @@ class .Sh SYNOPSIS .Nm -.Op Fl v +.Op Fl dLSsvZ +.Op Fl j Ar compression_jobs .Op Fl o Ar outfile .Op Fl s Ar cluster_size -.Op Fl j Ar compression_jobs .Ar infile .Sh DESCRIPTION The @@ -68,6 +68,33 @@ locating each individual cluster is written to the out .Pp The options are: .Bl -tag -width indent +.It Fl j Ar compression_jobs +Specify the number of compression jobs that +.Nm +runs in parallel to speed up compression. +When option is not specified the number of jobs set to be equal +to the value of +.Va hw.ncpu +.Xr sysctl 8 +variable. +.It Fl d +Enable de-duplication. +When the option is enabled the +.Nm +detects identical blocks in the input and replaces each subsequent occurence +of such block with pointer to the very first one in the output. +Setting this option results is moderate decrease of compressed image size, +typically around 3-5% of a final size of the compressed image. +.It Fl L +Use +.Xr lzma 3 +compression algorithm instead of the default +.Xr zlib 3 . +The +.Xr lzma 3 +provides noticeable better compression levels on the same data set +at the expense of much slower compression speed (10-20x) and somewhat slower +decompression (2-3x). .It Fl o Ar outfile Name of the output file .Ar outfile . @@ -79,16 +106,9 @@ compression or .Pa .ulzma for the .Xr lzma 3 . -.It Fl L -Use -.Xr lzma 3 -compression algorithm instead of the default -.Xr zlib 3 . -The -.Xr lzma 3 -provides noticeable better compression levels on the same data set -at the expense of much slower compression speed (10-20x) and somewhat slower -decompression (2-3x). +.It Fl S +Print summary about the compression ratio as well as output +file size after file has been processed. .It Fl s Ar cluster_size Split the image into clusters of .Ar cluster_size @@ -111,26 +131,6 @@ Setting .Fl Z results is slight increase of compressed image size, typically less than 0.1% of a final size of the compressed image. -.It Fl d -Enable de-duplication. -When the option is enabled the -.Nm -detects identical blocks in the input and replaces each subsequent occurence -of such block with pointer to the very first one in the output. -Setting this option results is moderate decrease of compressed image size, -typically around 3-5% of a final size of the compressed image. -.It Fl S -Print summary about the compression ratio as well as output -file size after file has been processed. -.It Fl j Ar compression_jobs -Specify the number of compression jobs that -.Nm -runs in parallel to speed up compression. -When option is not specified the number of jobs set to be equal -to the value of -.Va hw.ncpu -.Xr sysctl 8 -variable. .El .Sh NOTES The compression ratio largely depends on the cluster size used. From owner-svn-src-head@freebsd.org Tue Feb 19 21:20:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 607D214D9DE6; Tue, 19 Feb 2019 21:20:51 +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 078EB744F9; Tue, 19 Feb 2019 21:20:51 +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 EE276236F3; Tue, 19 Feb 2019 21:20: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 x1JLKod7009112; Tue, 19 Feb 2019 21:20:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLKoLb009111; Tue, 19 Feb 2019 21:20:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902192120.x1JLKoLb009111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 21:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344304 - in head/sys: amd64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 344304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 078EB744F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:20:51 -0000 Author: imp Date: Tue Feb 19 21:20:50 2019 New Revision: 344304 URL: https://svnweb.freebsd.org/changeset/base/344304 Log: Remove drm from LINT kernels drm was accidentally left in the LINT kernels. Pointy hat to: imp Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Feb 19 20:26:03 2019 (r344303) +++ head/sys/amd64/conf/NOTES Tue Feb 19 21:20:50 2019 (r344304) @@ -286,17 +286,6 @@ options ACPI_DEBUG # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -options DRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Feb 19 20:26:03 2019 (r344303) +++ head/sys/i386/conf/NOTES Tue Feb 19 21:20:50 2019 (r344304) @@ -489,17 +489,6 @@ device aibs # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -options DRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # From owner-svn-src-head@freebsd.org Tue Feb 19 21:22:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7402914D9FD4; Tue, 19 Feb 2019 21:22:23 +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 16F63748BD; Tue, 19 Feb 2019 21:22:23 +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 D15A023876; Tue, 19 Feb 2019 21:22:22 +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 x1JLMMrt012401; Tue, 19 Feb 2019 21:22:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLMMPM012400; Tue, 19 Feb 2019 21:22:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902192122.x1JLMMPM012400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 21:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344305 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16F63748BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:22:23 -0000 Author: markj Date: Tue Feb 19 21:22:22 2019 New Revision: 344305 URL: https://svnweb.freebsd.org/changeset/base/344305 Log: Impose a limit on the number of GEOM_CTL arguments. Otherwise a privileged user can trigger a memory allocation of unbounded size, or an integer overflow in the subsequent geom_alloc_copyin() call, leading to out-of-bounds accesses. Hard-code a large limit to circumvent this problem. admbug: 854 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: ae MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19251 Modified: head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; + if (req->narg > 2048) { + gctl_error(req, "too many arguments"); + req->arg = NULL; + return; + } + ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { gctl_error(req, "bad control request"); From owner-svn-src-head@freebsd.org Tue Feb 19 21:27:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EDD814DA17D; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22F0774BC3; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0454723894; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLRUP3012639; Tue, 19 Feb 2019 21:27:30 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLRUD3012636; Tue, 19 Feb 2019 21:27:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201902192127.x1JLRUD3012636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 19 Feb 2019 21:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344306 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 344306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22F0774BC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:27:31 -0000 Author: jilles Date: Tue Feb 19 21:27:30 2019 New Revision: 344306 URL: https://svnweb.freebsd.org/changeset/base/344306 Log: sh: Send normal output from bind builtin to stdout PR: 233343 Submitted by: Yuichiro NAITO (original version) Modified: head/bin/sh/histedit.c head/bin/sh/output.c head/bin/sh/output.h Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/histedit.c Tue Feb 19 21:27:30 2019 (r344306) @@ -472,10 +472,31 @@ str_to_event(const char *str, int last) int bindcmd(int argc, char **argv) { + int ret; + FILE *old; + FILE *out; if (el == NULL) error("line editing is disabled"); - return (el_parse(el, argc, __DECONST(const char **, argv))); + + INTOFF; + + out = out1fp(); + if (out == NULL) + error("Out of space"); + + el_get(el, EL_GETFP, 1, &old); + el_set(el, EL_SETFP, 1, out); + + ret = el_parse(el, argc, __DECONST(const char **, argv)); + + el_set(el, EL_SETFP, 1, old); + + fclose(out); + + INTON; + + return ret; } #else Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/output.c Tue Feb 19 21:27:30 2019 (r344306) @@ -340,6 +340,12 @@ doformat(struct output *dest, const char *f, va_list a } } +FILE * +out1fp(void) +{ + return fwopen(out1, doformat_wr); +} + /* * Version of write which resumes after a signal is caught. */ Modified: head/bin/sh/output.h ============================================================================== --- head/bin/sh/output.h Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/output.h Tue Feb 19 21:27:30 2019 (r344306) @@ -39,6 +39,7 @@ #include #include +#include struct output { char *nextc; @@ -75,6 +76,7 @@ void out1fmt(const char *, ...) __printflike(1, 2); void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); +FILE *out1fp(void); int xwrite(int, const char *, int); #define outc(c, file) ((file)->nextc == (file)->bufend ? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) From owner-svn-src-head@freebsd.org Tue Feb 19 21:33:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314FC14DA588; Tue, 19 Feb 2019 21:33:03 +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 C96CF751A7; Tue, 19 Feb 2019 21:33:02 +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 BCA8E23A43; Tue, 19 Feb 2019 21:33:02 +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 x1JLX27Q017462; Tue, 19 Feb 2019 21:33:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLX20V017461; Tue, 19 Feb 2019 21:33:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902192133.x1JLX20V017461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 21:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344307 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96CF751A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:33:03 -0000 Author: markj Date: Tue Feb 19 21:33:02 2019 New Revision: 344307 URL: https://svnweb.freebsd.org/changeset/base/344307 Log: Limit the number of entries allocated for a REPORT_ZONES command. The DIOCGETZONE ioctl can be used to fetch the zone list of an SMR drive, and the caller specifies the number of entries it wants to fetch. Clamp the caller's request to a sane limit so that a user cannot attempt large allocations. Callers already need to invoke the ioctl multiple times to fetch the full list in general, so there's no harm in limiting the number of entries returned. Fix style while here. admbug: 807 Reported by: Ilja Van Sprundel Reviewed by: asomers, ken Tested by: ken MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19249 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Feb 19 21:27:30 2019 (r344306) +++ head/sys/geom/geom_dev.c Tue Feb 19 21:33:02 2019 (r344307) @@ -677,8 +677,10 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data alloc_size = 0; if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) { - rep = &zone_args->zone_params.report; +#define MAXENTRIES (MAXPHYS / sizeof(struct disk_zone_rep_entry)) + if (rep->entries_allocated > MAXENTRIES) + rep->entries_allocated = MAXENTRIES; alloc_size = rep->entries_allocated * sizeof(struct disk_zone_rep_entry); if (alloc_size != 0) @@ -688,15 +690,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data rep->entries = new_entries; } error = g_io_zonecmd(zone_args, cp); - if ((zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) - && (alloc_size != 0) - && (error == 0)) { + if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES && + alloc_size != 0 && error == 0) error = copyout(new_entries, old_entries, alloc_size); - } - if ((old_entries != NULL) - && (rep != NULL)) + if (old_entries != NULL && rep != NULL) rep->entries = old_entries; - if (new_entries != NULL) g_free(new_entries); break; From owner-svn-src-head@freebsd.org Tue Feb 19 21:49:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6045C14DAD5B; Tue, 19 Feb 2019 21:49:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0229D75ADC; Tue, 19 Feb 2019 21:49:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9EDA23C1B; Tue, 19 Feb 2019 21:49:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLnmGX023151; Tue, 19 Feb 2019 21:49:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLnmFf023150; Tue, 19 Feb 2019 21:49:48 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201902192149.x1JLnmFf023150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 19 Feb 2019 21:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344308 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0229D75ADC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:49:49 -0000 Author: ed Date: Tue Feb 19 21:49:48 2019 New Revision: 344308 URL: https://svnweb.freebsd.org/changeset/base/344308 Log: Add missing __unused attributes to unused function arguments. This fixes the userspace build of libteken. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Tue Feb 19 21:33:02 2019 (r344307) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019 (r344308) @@ -372,7 +372,7 @@ teken_subr_cursor_up(teken_t *t, unsigned int nrows) } static void -teken_subr_set_cursor_style(teken_t *t, unsigned int style) +teken_subr_set_cursor_style(teken_t *t __unused, unsigned int style __unused) { /* TODO */ From owner-svn-src-head@freebsd.org Tue Feb 19 21:58:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D09414DB4EE; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E451762A2; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C51123DBD; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLwNBX028388; Tue, 19 Feb 2019 21:58:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLwNVo028387; Tue, 19 Feb 2019 21:58:23 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201902192158.x1JLwNVo028387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 19 Feb 2019 21:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344309 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E451762A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 21:58:24 -0000 Author: ed Date: Tue Feb 19 21:58:23 2019 New Revision: 344309 URL: https://svnweb.freebsd.org/changeset/base/344309 Log: Place an upper bound on the number of iterations for REP. Right now it's possible to invoke the REP escape sequence with a maximum of tens of millions of iterations. In practice, there is never any need to do this. Calling it more frequently than the number of cells in the terminal hardly makes any sense. By placing a limit on it, we can prevent users from exhausting resources in inside the terminal emulator. As support for this escape sequence is not present in any of the stable branches, there is no need to MFC. Reported by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11255 Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019 (r344308) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:58:23 2019 (r344309) @@ -1337,8 +1337,11 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi static void teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts) { + unsigned int max_repetitions; + max_repetitions = t->t_winsize.tp_row * t->t_winsize.tp_col; + if (rpts > max_repetitions) + rpts = max_repetitions; for (; t->t_last != 0 && rpts > 0; rpts--) teken_subr_regular_character(t, t->t_last); } - From owner-svn-src-head@freebsd.org Tue Feb 19 22:19:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120CA14DBD3C; Tue, 19 Feb 2019 22:19:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A022276EAB; Tue, 19 Feb 2019 22:19:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B05924152; Tue, 19 Feb 2019 22:19:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JMJW1S038903; Tue, 19 Feb 2019 22:19:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JMJW7x038902; Tue, 19 Feb 2019 22:19:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201902192219.x1JMJW7x038902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 19 Feb 2019 22:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344310 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 344310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A022276EAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 22:19:33 -0000 Author: ngie Date: Tue Feb 19 22:19:31 2019 New Revision: 344310 URL: https://svnweb.freebsd.org/changeset/base/344310 Log: Make `server_cat(..)` handle short receives In short, the prior code was far too simplistic when it came to calling recv(2) and failed intermittently (or in the case of Jenkins, deterministically). Handle short recv(2)s by checking the return code and incrementing the window into the buffer by the number of received bytes. If the number of received bytes <= 0, then bail out of the loop, and test the total number of received bytes vs the expected number of bytes sent for equality, and base whether or not the test passes/fails on that fact. Remove the expected failure, now that the hdtr testcases deterministically pass on my host after this change [1]. PR: 234809 [1], 235200 Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19188 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 21:58:23 2019 (r344309) +++ head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 22:19:31 2019 (r344310) @@ -156,6 +156,8 @@ setup_client(int domain, int type, int port) "Will try to connect to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); freeaddrinfo(res); @@ -187,6 +189,8 @@ setup_server(int domain, int type, int port) "Will try to bind socket to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); error = bind(sock, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); ATF_REQUIRE_EQ_MSG(error, 0, "bind failed: %s", strerror(errno)); @@ -204,11 +208,17 @@ setup_server(int domain, int type, int port) static void server_cat(const char *dest_filename, int server_sock, size_t len) { - char *buffer; + char *buffer, *buf_window_ptr; int recv_sock; - ssize_t received_bytes; + size_t buffer_size; + ssize_t received_bytes, recv_ret; - buffer = calloc(len + 1, sizeof(char)); + /* + * Ensure that there isn't excess data sent across the wire by + * capturing 10 extra bytes (plus 1 for nul). + */ + buffer_size = len + 10 + 1; + buffer = calloc(buffer_size, sizeof(char)); if (buffer == NULL) err(1, "malloc failed"); @@ -216,32 +226,26 @@ server_cat(const char *dest_filename, int server_sock, if (recv_sock == -1) err(1, "accept failed"); - /* - * XXX: this assumes the simplest case where all data is received in a - * single recv(2) call. - */ - if (recv(recv_sock, buffer, len, 0) == -1) - err(1, "recv failed"); + buf_window_ptr = buffer; + received_bytes = 0; + do { + recv_ret = recv(recv_sock, buf_window_ptr, + buffer_size - received_bytes, 0); + if (recv_ret <= 0) + break; + buf_window_ptr += recv_ret; + received_bytes += recv_ret; + } while (received_bytes < buffer_size); atf_utils_create_file(dest_filename, "%s", buffer); - /* - * This recv(2) call helps ensure the amount of sent data is exactly - * what was specified by `len`. - */ - received_bytes = recv(recv_sock, buffer, len, 0); - switch (received_bytes) { - case -1: - err(1, "recv failed"); - case 0: - break; - default: - errx(1, "received unexpected data: %s", buffer); - } - (void)close(recv_sock); (void)close(server_sock); free(buffer); + + if (received_bytes != len) + errx(1, "received unexpected data: %zd != %zd", received_bytes, + len); } static int @@ -666,10 +670,6 @@ hdtr_positive_test(int domain) trailers[0].iov_len = strlen(trailers[0].iov_base); offset = 0; nbytes = 0; - - atf_tc_expect_fail( - "The header/trailer testcases fail today with a data mismatch; " - "bug # 234809"); for (i = 0; i < nitems(testcases); i++) { struct sf_hdtr hdtr; From owner-svn-src-head@freebsd.org Tue Feb 19 23:22:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E8C14DD968; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4433281203; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34CA424D6D; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNMdt2075453; Tue, 19 Feb 2019 23:22:39 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNMdgm075452; Tue, 19 Feb 2019 23:22:39 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192322.x1JNMdgm075452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344314 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4433281203 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:22:40 -0000 Author: pjd Date: Tue Feb 19 23:22:39 2019 New Revision: 344314 URL: https://svnweb.freebsd.org/changeset/base/344314 Log: In the vdev_geom_open_by_path() function we assume that vdev path starts with "/dev/". Make sure this is the case. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 22:46:50 2019 (r344313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:22:39 2019 (r344314) @@ -794,7 +794,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t * /* * We must have a pathname, and it must be absolute. */ - if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { + if (vd->vdev_path == NULL || strncmp(vd->vdev_path, "/dev/", 5) != 0) { vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; return (EINVAL); } From owner-svn-src-head@freebsd.org Tue Feb 19 23:24:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A78714DDA73; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FA87813F3; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EA1E24D70; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNOexl075572; Tue, 19 Feb 2019 23:24:40 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNOe2o075571; Tue, 19 Feb 2019 23:24:40 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201902192324.x1JNOe2o075571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 19 Feb 2019 23:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344315 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 344315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FA87813F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:24:40 -0000 Author: cperciva Date: Tue Feb 19 23:24:39 2019 New Revision: 344315 URL: https://svnweb.freebsd.org/changeset/base/344315 Log: Fix sed script to insert Amazon NTP server into ntp.conf once rather than twice. Reported by: Rafal Lukawiecki MFC after: 1 week Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Tue Feb 19 23:22:39 2019 (r344314) +++ head/release/tools/ec2.conf Tue Feb 19 23:24:39 2019 (r344315) @@ -96,7 +96,7 @@ vm_extra_pre_umount() { # Use the NTP service provided by Amazon sed -i '' -e 's/^pool/#pool/' \ - -e 's/^#server.*/server 169.254.169.123 iburst/' \ + -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ ${DESTDIR}/etc/ntp.conf # The first time the AMI boots, the installed "first boot" scripts From owner-svn-src-head@freebsd.org Tue Feb 19 23:35:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1694914DDE6A; Tue, 19 Feb 2019 23:35:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77C088197E; Tue, 19 Feb 2019 23:35:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6404524F1D; Tue, 19 Feb 2019 23:35:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNZuK6080579; Tue, 19 Feb 2019 23:35:56 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNZu53080578; Tue, 19 Feb 2019 23:35:56 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192335.x1JNZu53080578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77C088197E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:35:57 -0000 Author: pjd Date: Tue Feb 19 23:35:55 2019 New Revision: 344316 URL: https://svnweb.freebsd.org/changeset/base/344316 Log: The way ZFS searches for its vdevs is the following: first it looks for a vdev that has the same name as the one stored in metadata and that has all VDEV labels in place. If it cannot find a GEOM provider with the given name and all VDEV labels it will scan all GEOM providers for the best match (the most VDEV labels available), but here the name is ignored. In case the ZFS pool is created, eg. using GPT partition label: # zpool create tank /dev/gpt/tank everything works, and on every import ZFS will pick /dev/gpt/tank and not /dev/da0p4. The problem occurs when da0p4 is extended and ZFS is unable to find all VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end of the partition are now somewhere else). In this case it will scan all GEOM providers and will pick the first one with the best match, ie. da0p4. Fix this problem by checking the VDEV/provider name even if we get the same match. If the name is the same as the one we have in pool's metadata, prefer this GEOM provider. Reported by: oshogbo, Michal Mroz Tested by: Michal Mroz Obtained from: Fudo Security Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:24:39 2019 (r344315) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:35:55 2019 (r344316) @@ -692,10 +692,12 @@ vdev_geom_attach_by_guids(vdev_t *vd) struct g_geom *gp; struct g_provider *pp, *best_pp; struct g_consumer *cp; + const char *vdpath; enum match match, best_match; g_topology_assert(); + vdpath = vd->vdev_path + sizeof("/dev/") - 1; cp = NULL; best_pp = NULL; best_match = NO_MATCH; @@ -710,6 +712,10 @@ vdev_geom_attach_by_guids(vdev_t *vd) if (match > best_match) { best_match = match; best_pp = pp; + } else if (match == best_match) { + if (strcmp(pp->name, vdpath) == 0) { + best_pp = pp; + } } if (match == FULL_MATCH) goto out; From owner-svn-src-head@freebsd.org Tue Feb 19 23:41:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D080014DDFD4; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 629E781DA5; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5595524F7D; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNfObW082378; Tue, 19 Feb 2019 23:41:24 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNfOD8082377; Tue, 19 Feb 2019 23:41:24 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192341.x1JNfOD8082377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344317 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 629E781DA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:41:25 -0000 Author: pjd Date: Tue Feb 19 23:41:23 2019 New Revision: 344317 URL: https://svnweb.freebsd.org/changeset/base/344317 Log: Grabage-collect no longer used variable. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:35:55 2019 (r344316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:41:23 2019 (r344317) @@ -270,7 +270,6 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = 0; c < rm->rm_firstdatacol; c++) { if (rm->rm_col[c].rc_abd != NULL) @@ -281,11 +280,9 @@ vdev_raidz_map_free(raidz_map_t *rm) rm->rm_col[c].rc_size); } - size = 0; for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) { if (rm->rm_col[c].rc_abd != NULL) abd_put(rm->rm_col[c].rc_abd); - size += rm->rm_col[c].rc_size; } if (rm->rm_abd_copy != NULL) From owner-svn-src-head@freebsd.org Tue Feb 19 23:43:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2631D14DE1C6; Tue, 19 Feb 2019 23:43:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B598582192; Tue, 19 Feb 2019 23:43:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8898250EC; Tue, 19 Feb 2019 23:43:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNhFDO085717; Tue, 19 Feb 2019 23:43:15 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNhFGa085716; Tue, 19 Feb 2019 23:43:15 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192343.x1JNhFGa085716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344318 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B598582192 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:43:16 -0000 Author: pjd Date: Tue Feb 19 23:43:15 2019 New Revision: 344318 URL: https://svnweb.freebsd.org/changeset/base/344318 Log: Change assertion to log the incorrect io_type we've got. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:41:23 2019 (r344317) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:43:15 2019 (r344318) @@ -2020,7 +2020,7 @@ vdev_raidz_io_start(zio_t *zio) return; } - ASSERT(zio->io_type == ZIO_TYPE_READ); + ASSERT3U(zio->io_type, ==, ZIO_TYPE_READ); /* * Iterate over the columns in reverse order so that we hit the parity From owner-svn-src-head@freebsd.org Tue Feb 19 23:44:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 426FA14DE232; Tue, 19 Feb 2019 23:44:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8619822F0; Tue, 19 Feb 2019 23:44:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB4D2250EE; Tue, 19 Feb 2019 23:44:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNi0E3085814; Tue, 19 Feb 2019 23:44:00 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNi0ND085813; Tue, 19 Feb 2019 23:44:00 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192344.x1JNi0ND085813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344319 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8619822F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:44:01 -0000 Author: pjd Date: Tue Feb 19 23:44:00 2019 New Revision: 344319 URL: https://svnweb.freebsd.org/changeset/base/344319 Log: Correct typo in the comment. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:43:15 2019 (r344318) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:44:00 2019 (r344319) @@ -2558,7 +2558,7 @@ vdev_raidz_io_done(zio_t *zio) /* * We're here because either: * - * total_errors == rm_first_datacol, or + * total_errors == rm_firstdatacol, or * vdev_raidz_combrec() failed * * In either case, there is enough bad data to prevent From owner-svn-src-head@freebsd.org Tue Feb 19 23:44:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B836114DE295 for ; Tue, 19 Feb 2019 23:44:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2437882400 for ; Tue, 19 Feb 2019 23:44:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-ed1-x541.google.com with SMTP id b3so18374960ede.1 for ; Tue, 19 Feb 2019 15:44:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rRdePG8ulxpGCBjn+lw9ZxrSQ5OcB+N6eVtttSTlUjI=; b=Z+2wGS+5+0Nxxn2E+AVg2kfAJ3RrEw9ujamdDfEz5bxgucbf4QDbmZb5jrJO1DDBgj 93yInAEcFuHM08M4J0XxgpnTg8VLjEoQfR2Djb9eCRBRvZ4f1Q9DnEdmuHExyOHc/aSe mPxysahD5lyReP5032szYR3viOnOVE3LxWawcK/VN8YO39jEFC5KEG1QUcNzq/ZR8Ag/ pG7yykaI/Z3Hx9cEkrqXxO0eiwDQJXjmvhaaaTIMEfRNLu8el98qPtX16l+r/FPujgcX aSq4g95IT2EP8V2OqRdmZ1n23PES3HOeMPDIYi+4uWs5GnaWk8KarRVKdZVJRJaxYEMg vcDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rRdePG8ulxpGCBjn+lw9ZxrSQ5OcB+N6eVtttSTlUjI=; b=rsf6+57Jk5WlRoNHizyUfBHQQNKy+Zt7UWKYLDOlvstgNZDsG4Fs9f/7WFd/Wh60Ix tGUkiT6IxmdtUhPYQ6LEdvy3XE4CB4ONYOUoMYBE4mCxi/YB1gQPMWPBI+RcU+gq8IYi Bs5Sclo9jVAYNi97L3ql7oldw/sfffF/nSh+2BqdyuOkwx1ZrtAlSSMz8Mv/q37V9R8D ZCcYmmcemSt9a36jP8yE3C5NbGyxe8Jtl90+mOV3R8A69Lmbo1wZ5xYNRSBw1c6Cc3+4 kT8CRTWXSSwJB31NoXmPsKECKKkImfzNjq2oXngZI1w91TfEv0bUA72ji+k5uyElIpUk 5TAg== X-Gm-Message-State: AHQUAua8GkpSid9emPcJ8dhTLEWCLQ8unE8Ln9dynTxKJZGxaM5oLTri RiXUYDwCKm4gScaQJAls7sRI0A== X-Google-Smtp-Source: AHgI3IZM9U4pcRAmxypnGp7dyYCZOWbar5ctJziPF6VH7G3KVaGCM6th0myrMkoAD0uVco0JZul8mA== X-Received: by 2002:a50:92d0:: with SMTP id l16mr25242386eda.153.1550619853021; Tue, 19 Feb 2019 15:44:13 -0800 (PST) Received: from mutt-hbsd ([185.165.169.165]) by smtp.gmail.com with ESMTPSA id o13sm4920289edq.57.2019.02.19.15.44.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 15:44:12 -0800 (PST) Date: Tue, 19 Feb 2019 18:43:28 -0500 From: Shawn Webb To: Pawel Jakub Dawidek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> References: <201902192335.x1JNZu53080578@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hnirbtvcopw34t5o" Content-Disposition: inline In-Reply-To: <201902192335.x1JNZu53080578@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD e44da5b3ebd(hardened/current/master) HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 2437882400 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:44:16 -0000 --hnirbtvcopw34t5o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 19, 2019 at 11:35:56PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Feb 19 23:35:55 2019 > New Revision: 344316 > URL: https://svnweb.freebsd.org/changeset/base/344316 >=20 > Log: > The way ZFS searches for its vdevs is the following: first it looks for > a vdev that has the same name as the one stored in metadata and that has > all VDEV labels in place. If it cannot find a GEOM provider with the gi= ven > name and all VDEV labels it will scan all GEOM providers for the best m= atch > (the most VDEV labels available), but here the name is ignored. > =20 > In case the ZFS pool is created, eg. using GPT partition label: > =20 > # zpool create tank /dev/gpt/tank > =20 > everything works, and on every import ZFS will pick /dev/gpt/tank and > not /dev/da0p4. > =20 > The problem occurs when da0p4 is extended and ZFS is unable to find all > VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end > of the partition are now somewhere else). In this case it will scan all > GEOM providers and will pick the first one with the best match, ie. da0= p4. > =20 > Fix this problem by checking the VDEV/provider name even if we get the = same > match. If the name is the same as the one we have in pool's metadata, p= refer > this GEOM provider. > =20 > Reported by: oshogbo, Michal Mroz > Tested by: Michal Mroz > Obtained from: Fudo Security >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c At the risk of painting a bikeshed a lovely color of neon purple, I'm curious about if/how these types of commits get merged upstream to (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very confused|is anyone else confused where upstream is?). Who is upstream? Is work like this going to remain as a downstream patch to ZFS? Or is FreeBSD going to work to upstream this type of work? I hope my curiousity doesn't offend anyone. ;) Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --hnirbtvcopw34t5o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlxslJwACgkQaoRlj1JF bu5s9A//alw1McK6fXYjINgJ6OhifqC+AxXBvmjNSUAETHX8RTGt+zUfG5eAan81 UX/T7tXSR2nn1yDy5tUxCpNiKajTG1KDIkw3gr5JLMOxyVCdCUoqrwKcVR2hk2yK Cg9+6MVUfDPeRb1c2qCxdRFExUWRG7eApLuCYuTCqsJgrGvURtrmV8hpPXALuli7 +7vsqIvXCIiiemwbl8gC5F96zVBefn8tJEJ1HTmPTajNR9BvmY+4I7W3q/JMlN8N hBvRgy1agyt6Krf2uGqE3O6zXvHL6XebGYESFdR34/hvRQ+T54IKQ3fXxa+XXQjp r3VNVx7G5ky+z5Cly0isYwdF8nqFGlEPNEVqYtckXG9qbYUPnNgU2AyBR0rlM3Xc KHwbKo48Bb9a9l7nDE6qmzW83ENd2V/GK2u7zxFIHWBth9plC6NLTu15aU6np/4L 1szowoMI05xHjIsVFQkwdUd89Oe1ijoNFWd2NM66b9nLQWF5GPMQM0NP5x/wbK2N 8h0zLXJXacDm9XhZPMgHKfRFVyCdx24jF45EmV00DFbM2lrAkwRXGZRGxbvajq9p tJ21POlVmFx2bWN8uRRZ/04LnqzLu0mExGocPZ0EMvK3WngT3vDxLmSee6ZPVC/O wTJ60T90VpEqPuKRO+tQSvoPF2FkiVKf/EQZU7zj1M1wzzxgPLk= =igqV -----END PGP SIGNATURE----- --hnirbtvcopw34t5o-- From owner-svn-src-head@freebsd.org Tue Feb 19 23:53:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774F214DE5E1; Tue, 19 Feb 2019 23:53:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EEC08292E; Tue, 19 Feb 2019 23:53:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F115225291; Tue, 19 Feb 2019 23:53:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNrX38090830; Tue, 19 Feb 2019 23:53:33 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNrX3a090829; Tue, 19 Feb 2019 23:53:33 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192353.x1JNrX3a090829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EEC08292E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 23:53:34 -0000 Author: pjd Date: Tue Feb 19 23:53:33 2019 New Revision: 344320 URL: https://svnweb.freebsd.org/changeset/base/344320 Log: Simplify the code. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:44:00 2019 (r344319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:53:33 2019 (r344320) @@ -360,16 +360,13 @@ trim_map_write_start(zio_t *zio) return (B_FALSE); } - ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL); - if (ts != NULL) { - /* - * Loop until all overlapping segments are removed. - */ - do { - trim_map_segment_remove(tm, ts, start, end); - ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL); - } while (ts != NULL); + /* + * Loop until all overlapping segments are removed. + */ + while ((ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL)) != NULL) { + trim_map_segment_remove(tm, ts, start, end); } + avl_add(&tm->tm_inflight_writes, zio); mutex_exit(&tm->tm_lock); From owner-svn-src-head@freebsd.org Wed Feb 20 00:25:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D3614DF5B6; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28F4F83C93; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157A3257B0; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K0PjHO006820; Wed, 20 Feb 2019 00:25:45 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K0PjnA006819; Wed, 20 Feb 2019 00:25:45 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902200025.x1K0PjnA006819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 20 Feb 2019 00:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344325 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28F4F83C93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 00:25:46 -0000 Author: pjd Date: Wed Feb 20 00:25:45 2019 New Revision: 344325 URL: https://svnweb.freebsd.org/changeset/base/344325 Log: Simplify the code. No functional changes. Reviewed by: rpokala Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Feb 20 00:19:11 2019 (r344324) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Feb 20 00:25:45 2019 (r344325) @@ -568,10 +568,7 @@ vdev_raidz_map_alloc(abd_t *abd, uint64_t size, uint64 abd_alloc_linear(rm->rm_col[c].rc_size, B_TRUE); } - rm->rm_col[c].rc_abd = abd_get_offset(abd, 0); - off = rm->rm_col[c].rc_size; - - for (c = c + 1; c < acols; c++) { + for (off = 0; c < acols; c++) { rm->rm_col[c].rc_abd = abd_get_offset(abd, off); off += rm->rm_col[c].rc_size; } From owner-svn-src-head@freebsd.org Wed Feb 20 01:56:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB54614E16BB; Wed, 20 Feb 2019 01:56:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2D98672E; Wed, 20 Feb 2019 01:56:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2C58A432FAD; Wed, 20 Feb 2019 12:56:43 +1100 (AEDT) Date: Wed, 20 Feb 2019 12:56:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tom Jones cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344292 - head/sys/dev/acpica In-Reply-To: <201902191904.x1JJ4qIh036879@repo.freebsd.org> Message-ID: <20190220123807.E1184@besplex.bde.org> References: <201902191904.x1JJ4qIh036879@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=pcXBGyXzM1LMojfo2MEA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 6D2D98672E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 01:56:55 -0000 On Tue, 19 Feb 2019, Tom Jones wrote: > Log: > Fix style after r340832 > > Reported by: jhb > Reviewed by: jhb, jtl > Approved by: jtl (mentor) Unfortunately, acpi (even the FreeBSD dev/acpica part) has a very non-KNF style. It is unclear even what this style is, so it is hard to write changes consistent with it. But it is clear that this style isn't the one one used in the line after the one touched by this commit. > Modified: head/sys/dev/acpica/acpi_battery.c > ============================================================================== > --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) > +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) > @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba > * Be sure we can get various info from the battery. > */ > if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || > - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > continue; > > /* If a battery is not installed, we sometimes get strange values. */ acpica uses 4-column indents, especially in this file, so the 'continue' line is clearly misindented here. acpica's indentation for continued lines is unclear. The KNF 4-column continuation indent works very badly when the main indent is also 4-column. But it is used in similar code (including a 'continue' just 5 lines after here). So it is consistently bad here. Elsewhere, acpica seems to use gnu style (-lp). Here and 5 lines later, that accidentally gives the 4-column indent by lining up with the parentheses of 'if (', A quick look at some other files shows many examples of gnu style (-lp) for long function parameter lists, and many similar regressions towards KNF style. Bruce From owner-svn-src-head@freebsd.org Wed Feb 20 02:14:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9FB14E1F93; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45E09871CF; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3824026A8E; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2EgAH064163; Wed, 20 Feb 2019 02:14:42 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2EgNF064162; Wed, 20 Feb 2019 02:14:42 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902200214.x1K2EgNF064162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 20 Feb 2019 02:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344331 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45E09871CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 02:14:42 -0000 Author: bde Date: Wed Feb 20 02:14:41 2019 New Revision: 344331 URL: https://svnweb.freebsd.org/changeset/base/344331 Log: Attempt to complete fixing programmable function keys for syscons. The flag for the driver capability of supporting the fix is independent of the flag for cons25 mode so that it can be managed independently, but I forget to preserve it when resetting the terminal. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Wed Feb 20 01:12:59 2019 (r344330) +++ head/sys/teken/teken_subr.h Wed Feb 20 02:14:41 2019 (r344331) @@ -1000,7 +1000,7 @@ teken_subr_do_reset(teken_t *t) t->t_scrollreg.ts_begin = 0; t->t_scrollreg.ts_end = t->t_winsize.tp_row; t->t_originreg = t->t_scrollreg; - t->t_stateflags &= TS_8BIT|TS_CONS25; + t->t_stateflags &= TS_8BIT | TS_CONS25 | TS_CONS25KEYS; t->t_stateflags |= TS_AUTOWRAP; t->t_scs[0] = teken_scs_us_ascii; From owner-svn-src-head@freebsd.org Wed Feb 20 02:40:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED5414E2A51; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2104487FB7; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0920E26E6F; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2ecLk075498; Wed, 20 Feb 2019 02:40:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2ec5b075465; Wed, 20 Feb 2019 02:40:38 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902200240.x1K2ec5b075465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 20 Feb 2019 02:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344332 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 344332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2104487FB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 02:40:39 -0000 Author: bde Date: Wed Feb 20 02:40:38 2019 New Revision: 344332 URL: https://svnweb.freebsd.org/changeset/base/344332 Log: Fix hangs in r341810 waiting for AP startup. idle_td is dereferenced without thread-locking it to make its contents is invariant, and was accessed without telling the compiler that its contents is invariant. Some compilers optimized accesses to the supposedly invariant contents by moving the critical checks for changes outside of the loop that waits for changes. Fix this using atomic ops. This bug only showed up for the following configuration: a Turion2 system, amd64 kernels, compiled by gcc, and SCHED_4BSD. clang fails to do the optimization with all CFLAGS that I tried, because it doesn't fully optimize the '__asm __volatile' for cpu_spinwait() although this asm has no memory clobber. gcc only does the optimization with most CFLAGS. I mostly used -Os with all compilers. i386 works because gcc -m32 -Os only moves 1 or the 2 accesses outside of the loop. Non-Turion2 systems and SCHED_ULE worked due to different timing (when all APs start before the BP checks them outside of the loop). Reviewed by: kib Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Wed Feb 20 02:14:41 2019 (r344331) +++ head/sys/x86/x86/mp_x86.c Wed Feb 20 02:40:38 2019 (r344332) @@ -1088,8 +1088,8 @@ smp_after_idle_runnable(void *arg __unused) for (cpu = 1; cpu < mp_ncpus; cpu++) { idle_td = pcpu_find(cpu)->pc_idlethread; - while (idle_td->td_lastcpu == NOCPU && - idle_td->td_oncpu == NOCPU) + while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && + atomic_load_int(&idle_td->td_oncpu) == NOCPU) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); From owner-svn-src-head@freebsd.org Wed Feb 20 02:49:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845E314E2BE8; Wed, 20 Feb 2019 02:49:00 +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 2C4388845E; Wed, 20 Feb 2019 02:49:00 +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 1C7F327034; Wed, 20 Feb 2019 02:49:00 +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 x1K2mxuZ079743; Wed, 20 Feb 2019 02:48:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2mxge079741; Wed, 20 Feb 2019 02:48:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902200248.x1K2mxge079741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Feb 2019 02:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344333 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C4388845E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 02:49:00 -0000 Author: cem Date: Wed Feb 20 02:48:59 2019 New Revision: 344333 URL: https://svnweb.freebsd.org/changeset/base/344333 Log: fuse: add descriptions for remaining sysctls (Except reclaim revoked; I don't know what that goal of that one is.) Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:48:59 2019 (r344333) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int fuse_fh_count = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLFLAG_RD, - &fuse_fh_count, 0, ""); + &fuse_fh_count, 0, "number of open FUSE filehandles"); int fuse_filehandle_open(struct vnode *vp, Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:48:59 2019 (r344333) @@ -180,17 +180,17 @@ struct vop_vector fuse_vnops = { static u_long fuse_lookup_cache_hits = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_hits, CTLFLAG_RD, - &fuse_lookup_cache_hits, 0, ""); + &fuse_lookup_cache_hits, 0, "number of positive cache hits in lookup"); static u_long fuse_lookup_cache_misses = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD, - &fuse_lookup_cache_misses, 0, ""); + &fuse_lookup_cache_misses, 0, "number of cache misses in lookup"); int fuse_lookup_cache_enable = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, lookup_cache_enable, CTLFLAG_RW, - &fuse_lookup_cache_enable, 0, ""); + &fuse_lookup_cache_enable, 0, "if non-zero, enable lookup cache"); /* * XXX: This feature is highly experimental and can bring to instabilities, From owner-svn-src-head@freebsd.org Wed Feb 20 02:49:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCEC414E2C3A; Wed, 20 Feb 2019 02:49:28 +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 69C268859F; Wed, 20 Feb 2019 02:49:28 +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 407D827035; Wed, 20 Feb 2019 02:49:28 +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 x1K2nSMZ079812; Wed, 20 Feb 2019 02:49:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2nQk8079803; Wed, 20 Feb 2019 02:49:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902200249.x1K2nQk8079803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Feb 2019 02:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344334 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69C268859F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 02:49:29 -0000 Author: cem Date: Wed Feb 20 02:49:26 2019 New Revision: 344334 URL: https://svnweb.freebsd.org/changeset/base/344334 Log: Fuse: whitespace and style(9) cleanup Take a pass through fixing some of the most egregious whitespace issues in fs/fuse. Also fix some style(9) warts while here. Not 100% cleaned up, but somewhat less painful to look at and edit. No functional change. Modified: head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse.h ============================================================================== --- head/sys/fs/fuse/fuse.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse.h Wed Feb 20 02:49:26 2019 (r344334) @@ -197,26 +197,27 @@ do { \ #define FUSE_TRACE 0 #endif -#define DEBUGX(cond, fmt, ...) do { \ - if (((cond))) { \ - printf("%s: " fmt, __func__, ## __VA_ARGS__); \ - } } while (0) +#define DEBUGX(cond, fmt, ...) do { \ + if (((cond))) { \ + printf("%s: " fmt, __func__, ## __VA_ARGS__); \ + } \ +} while (0) -#define fuse_lck_mtx_lock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_lock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - } while (0) +#define fuse_lck_mtx_lock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_lock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) -#define fuse_lck_mtx_unlock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_unlock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - } while (0) +#define fuse_lck_mtx_unlock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_unlock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) void fuse_ipc_init(void); void fuse_ipc_destroy(void); Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:49:26 2019 (r344334) @@ -317,7 +317,7 @@ again: return (err); } -static __inline int +static inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:49:26 2019 (r344334) @@ -91,11 +91,8 @@ SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLF &fuse_fh_count, 0, "number of open FUSE filehandles"); int -fuse_filehandle_open(struct vnode *vp, - fufh_type_t fufh_type, - struct fuse_filehandle **fufhp, - struct thread *td, - struct ucred *cred) +fuse_filehandle_open(struct vnode *vp, fufh_type_t fufh_type, + struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_open_in *foi; @@ -114,8 +111,8 @@ fuse_filehandle_open(struct vnode *vp, /* NOTREACHED */ } /* - * Note that this means we are effectively FILTERING OUT open() flags. - */ + * Note that this means we are effectively FILTERING OUT open() flags. + */ oflags = fuse_filehandle_xlate_to_oflags(fufh_type); if (vnode_isdir(vp)) { @@ -159,10 +156,8 @@ out: } int -fuse_filehandle_close(struct vnode *vp, - fufh_type_t fufh_type, - struct thread *td, - struct ucred *cred) +fuse_filehandle_close(struct vnode *vp, fufh_type_t fufh_type, + struct thread *td, struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_release_in *fri; @@ -265,10 +260,8 @@ fuse_filehandle_getrw(struct vnode *vp, fufh_type_t fu } void -fuse_filehandle_init(struct vnode *vp, - fufh_type_t fufh_type, - struct fuse_filehandle **fufhp, - uint64_t fh_id) +fuse_filehandle_init(struct vnode *vp, fufh_type_t fufh_type, + struct fuse_filehandle **fufhp, uint64_t fh_id) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh; Modified: head/sys/fs/fuse/fuse_file.h ============================================================================== --- head/sys/fs/fuse/fuse_file.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_file.h Wed Feb 20 02:49:26 2019 (r344334) @@ -67,75 +67,65 @@ #include typedef enum fufh_type { - FUFH_INVALID = -1, - FUFH_RDONLY = 0, - FUFH_WRONLY = 1, - FUFH_RDWR = 2, - FUFH_MAXTYPE = 3, + FUFH_INVALID = -1, + FUFH_RDONLY = 0, + FUFH_WRONLY = 1, + FUFH_RDWR = 2, + FUFH_MAXTYPE = 3, } fufh_type_t; +_Static_assert(FUFH_RDONLY == O_RDONLY, "RDONLY"); +_Static_assert(FUFH_WRONLY == O_WRONLY, "WRONLY"); +_Static_assert(FUFH_RDWR == O_RDWR, "RDWR"); struct fuse_filehandle { - uint64_t fh_id; - fufh_type_t fh_type; + uint64_t fh_id; + fufh_type_t fh_type; }; #define FUFH_IS_VALID(f) ((f)->fh_type != FUFH_INVALID) -static __inline__ -fufh_type_t +static inline fufh_type_t fuse_filehandle_xlate_from_mmap(int fflags) { - if (fflags & (PROT_READ | PROT_WRITE)) { - return FUFH_RDWR; - } else if (fflags & (PROT_WRITE)) { - return FUFH_WRONLY; - } else if ((fflags & PROT_READ) || (fflags & PROT_EXEC)) { - return FUFH_RDONLY; - } else { - return FUFH_INVALID; - } + if (fflags & (PROT_READ | PROT_WRITE)) + return FUFH_RDWR; + else if (fflags & (PROT_WRITE)) + return FUFH_WRONLY; + else if ((fflags & PROT_READ) || (fflags & PROT_EXEC)) + return FUFH_RDONLY; + else + return FUFH_INVALID; } -static __inline__ -fufh_type_t +static inline fufh_type_t fuse_filehandle_xlate_from_fflags(int fflags) { - if ((fflags & FREAD) && (fflags & FWRITE)) { - return FUFH_RDWR; - } else if (fflags & (FWRITE)) { - return FUFH_WRONLY; - } else if (fflags & (FREAD)) { - return FUFH_RDONLY; - } else { - panic("FUSE: What kind of a flag is this (%x)?", fflags); - } + if ((fflags & FREAD) && (fflags & FWRITE)) + return FUFH_RDWR; + else if (fflags & (FWRITE)) + return FUFH_WRONLY; + else if (fflags & (FREAD)) + return FUFH_RDONLY; + else + panic("FUSE: What kind of a flag is this (%x)?", fflags); } -static __inline__ -int +static inline int fuse_filehandle_xlate_to_oflags(fufh_type_t type) { - int oflags = -1; + int oflags = -1; - switch (type) { + switch (type) { + case FUFH_RDONLY: + case FUFH_WRONLY: + case FUFH_RDWR: + oflags = type; + break; + default: + break; + } - case FUFH_RDONLY: - oflags = O_RDONLY; - break; - - case FUFH_WRONLY: - oflags = O_WRONLY; - break; - - case FUFH_RDWR: - oflags = O_RDWR; - break; - - default: - break; - } - - return oflags; + return oflags; } int fuse_filehandle_valid(struct vnode *vp, fufh_type_t fufh_type); Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_internal.h Wed Feb 20 02:49:26 2019 (r344334) @@ -68,116 +68,114 @@ #include "fuse_ipc.h" #include "fuse_node.h" -static __inline int +static inline bool vfs_isrdonly(struct mount *mp) { - return ((mp->mnt_flag & MNT_RDONLY) != 0 ? 1 : 0); + return ((mp->mnt_flag & MNT_RDONLY) != 0); } -static __inline struct mount * +static inline struct mount * vnode_mount(struct vnode *vp) { return (vp->v_mount); } -static __inline int +static inline bool vnode_mountedhere(struct vnode *vp) { - return (vp->v_mountedhere != NULL ? 1 : 0); + return (vp->v_mountedhere != NULL); } -static __inline enum vtype +static inline enum vtype vnode_vtype(struct vnode *vp) { - return (vp->v_type); + return (vp->v_type); } -static __inline int +static inline bool vnode_isvroot(struct vnode *vp) { - return ((vp->v_vflag & VV_ROOT) != 0 ? 1 : 0); + return ((vp->v_vflag & VV_ROOT) != 0); } -static __inline int +static inline bool vnode_isreg(struct vnode *vp) { - return (vp->v_type == VREG ? 1 : 0); + return (vp->v_type == VREG); } -static __inline int +static inline bool vnode_isdir(struct vnode *vp) { - return (vp->v_type == VDIR ? 1 : 0); + return (vp->v_type == VDIR); } -static __inline int +static inline bool vnode_islnk(struct vnode *vp) { - return (vp->v_type == VLNK ? 1 : 0); + return (vp->v_type == VLNK); } -static __inline ssize_t +static inline ssize_t uio_resid(struct uio *uio) { - return (uio->uio_resid); + return (uio->uio_resid); } -static __inline off_t +static inline off_t uio_offset(struct uio *uio) { - return (uio->uio_offset); + return (uio->uio_offset); } -static __inline void +static inline void uio_setoffset(struct uio *uio, off_t offset) { - uio->uio_offset = offset; + uio->uio_offset = offset; } -static __inline void +static inline void uio_setresid(struct uio *uio, ssize_t resid) { - uio->uio_resid = resid; + uio->uio_resid = resid; } /* miscellaneous */ -static __inline__ -int +static inline bool fuse_isdeadfs(struct vnode *vp) { - struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp)); + struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp)); - return (data->dataflags & FSESS_DEAD); + return (data->dataflags & FSESS_DEAD); } -static __inline__ -int +static inline uint64_t fuse_iosize(struct vnode *vp) { - return vp->v_mount->mnt_stat.f_iosize; + return (vp->v_mount->mnt_stat.f_iosize); } /* access */ -#define FVP_ACCESS_NOOP 0x01 +#define FVP_ACCESS_NOOP 0x01 -#define FACCESS_VA_VALID 0x01 -#define FACCESS_DO_ACCESS 0x02 -#define FACCESS_STICKY 0x04 -#define FACCESS_CHOWN 0x08 -#define FACCESS_NOCHECKSPY 0x10 -#define FACCESS_SETGID 0x12 +#define FACCESS_VA_VALID 0x01 +#define FACCESS_DO_ACCESS 0x02 +#define FACCESS_STICKY 0x04 +#define FACCESS_CHOWN 0x08 +#define FACCESS_NOCHECKSPY 0x10 +#define FACCESS_SETGID 0x12 -#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID +#define FACCESS_XQUERIES (FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID) struct fuse_access_param { - uid_t xuid; - gid_t xgid; - uint32_t facc_flags; + uid_t xuid; + gid_t xgid; + uint32_t facc_flags; }; -static __inline int +static inline int fuse_match_cred(struct ucred *basecred, struct ucred *usercred) { if (basecred->cr_uid == usercred->cr_uid && @@ -186,17 +184,13 @@ fuse_match_cred(struct ucred *basecred, struct ucred * basecred->cr_groups[0] == usercred->cr_groups[0] && basecred->cr_groups[0] == usercred->cr_rgid && basecred->cr_groups[0] == usercred->cr_svgid) - return 0; + return (0); - return EPERM; + return (EPERM); } -int -fuse_internal_access(struct vnode *vp, - mode_t mode, - struct fuse_access_param *facp, - struct thread *td, - struct ucred *cred); +int fuse_internal_access(struct vnode *vp, mode_t mode, + struct fuse_access_param *facp, struct thread *td, struct ucred *cred); /* attributes */ @@ -209,186 +203,143 @@ fuse_internal_access(struct vnode *vp, * If the nominal attribute cache TTL is zero, do not cache on the 'vp' (but do * return the result to the caller). */ -static __inline -void -fuse_internal_attr_fat2vat(struct vnode *vp, - struct fuse_attr *fat, - uint64_t attr_valid, - uint32_t attr_valid_nsec, - struct vattr *vap) +static inline void +fuse_internal_attr_fat2vat(struct vnode *vp, struct fuse_attr *fat, + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) { - struct mount *mp; - struct fuse_vnode_data *fvdat; - struct vattr *vp_cache_at; + struct mount *mp; + struct fuse_vnode_data *fvdat; + struct vattr *vp_cache_at; - mp = vnode_mount(vp); - fvdat = VTOFUD(vp); + mp = vnode_mount(vp); + fvdat = VTOFUD(vp); - DEBUGX(FUSE_DEBUG_INTERNAL, - "node #%ju, mode 0%o\n", (uintmax_t)fat->ino, fat->mode); + DEBUGX(FUSE_DEBUG_INTERNAL, "node #%ju, mode 0%o\n", + (uintmax_t)fat->ino, fat->mode); - /* Honor explicit do-not-cache requests from user filesystems. */ - if (attr_valid == 0 && attr_valid_nsec == 0) - fvdat->valid_attr_cache = false; - else - fvdat->valid_attr_cache = true; + /* Honor explicit do-not-cache requests from user filesystems. */ + if (attr_valid == 0 && attr_valid_nsec == 0) + fvdat->valid_attr_cache = false; + else + fvdat->valid_attr_cache = true; - vp_cache_at = VTOVA(vp); + vp_cache_at = VTOVA(vp); - if (vap == NULL && vp_cache_at == NULL) - return; + if (vap == NULL && vp_cache_at == NULL) + return; - if (vap == NULL) - vap = vp_cache_at; + if (vap == NULL) + vap = vp_cache_at; - vattr_null(vap); + vattr_null(vap); - vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; - vap->va_mode = fat->mode & ~S_IFMT; - vap->va_nlink = fat->nlink; - vap->va_uid = fat->uid; - vap->va_gid = fat->gid; - vap->va_rdev = fat->rdev; - vap->va_size = fat->size; - vap->va_atime.tv_sec = fat->atime; /* XXX on some platforms cast from 64 bits to 32 */ - vap->va_atime.tv_nsec = fat->atimensec; - vap->va_mtime.tv_sec = fat->mtime; - vap->va_mtime.tv_nsec = fat->mtimensec; - vap->va_ctime.tv_sec = fat->ctime; - vap->va_ctime.tv_nsec = fat->ctimensec; - vap->va_blocksize = PAGE_SIZE; - vap->va_type = IFTOVT(fat->mode); - vap->va_bytes = fat->blocks * S_BLKSIZE; - vap->va_flags = 0; + vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; + vap->va_fileid = fat->ino; + vap->va_mode = fat->mode & ~S_IFMT; + vap->va_nlink = fat->nlink; + vap->va_uid = fat->uid; + vap->va_gid = fat->gid; + vap->va_rdev = fat->rdev; + vap->va_size = fat->size; + /* XXX on i386, seconds are truncated to 32 bits */ + vap->va_atime.tv_sec = fat->atime; + vap->va_atime.tv_nsec = fat->atimensec; + vap->va_mtime.tv_sec = fat->mtime; + vap->va_mtime.tv_nsec = fat->mtimensec; + vap->va_ctime.tv_sec = fat->ctime; + vap->va_ctime.tv_nsec = fat->ctimensec; + vap->va_blocksize = PAGE_SIZE; + vap->va_type = IFTOVT(fat->mode); + vap->va_bytes = fat->blocks * S_BLKSIZE; + vap->va_flags = 0; - if (vap != vp_cache_at && vp_cache_at != NULL) - memcpy(vp_cache_at, vap, sizeof(*vap)); + if (vap != vp_cache_at && vp_cache_at != NULL) + memcpy(vp_cache_at, vap, sizeof(*vap)); } #define cache_attrs(vp, fuse_out, vap_out) \ - fuse_internal_attr_fat2vat((vp), &(fuse_out)->attr, \ - (fuse_out)->attr_valid, (fuse_out)->attr_valid_nsec, (vap_out)) + fuse_internal_attr_fat2vat((vp), &(fuse_out)->attr, \ + (fuse_out)->attr_valid, (fuse_out)->attr_valid_nsec, (vap_out)) /* fsync */ -int -fuse_internal_fsync(struct vnode *vp, - struct thread *td, - struct ucred *cred, - struct fuse_filehandle *fufh); +int fuse_internal_fsync(struct vnode *vp, struct thread *td, + struct ucred *cred, struct fuse_filehandle *fufh); +int fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio); -int -fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio); - /* readdir */ struct pseudo_dirent { - uint32_t d_namlen; + uint32_t d_namlen; }; -int -fuse_internal_readdir(struct vnode *vp, - struct uio *uio, - struct fuse_filehandle *fufh, - struct fuse_iov *cookediov); +int fuse_internal_readdir(struct vnode *vp, struct uio *uio, + struct fuse_filehandle *fufh, struct fuse_iov *cookediov); +int fuse_internal_readdir_processdata(struct uio *uio, size_t reqsize, + void *buf, size_t bufsize, void *param); -int -fuse_internal_readdir_processdata(struct uio *uio, - size_t reqsize, - void *buf, - size_t bufsize, - void *param); - /* remove */ -int -fuse_internal_remove(struct vnode *dvp, - struct vnode *vp, - struct componentname *cnp, - enum fuse_opcode op); +int fuse_internal_remove(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp, enum fuse_opcode op); /* rename */ -int -fuse_internal_rename(struct vnode *fdvp, - struct componentname *fcnp, - struct vnode *tdvp, - struct componentname *tcnp); +int fuse_internal_rename(struct vnode *fdvp, struct componentname *fcnp, + struct vnode *tdvp, struct componentname *tcnp); + /* revoke */ -void -fuse_internal_vnode_disappear(struct vnode *vp); +void fuse_internal_vnode_disappear(struct vnode *vp); /* strategy */ /* entity creation */ -static __inline -int +static inline int fuse_internal_checkentry(struct fuse_entry_out *feo, enum vtype vtyp) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "feo=%p, vtype=%d\n", feo, vtyp); + DEBUGX(FUSE_DEBUG_INTERNAL, + "feo=%p, vtype=%d\n", feo, vtyp); - if (vtyp != IFTOVT(feo->attr.mode)) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode)); - return EINVAL; - } + if (vtyp != IFTOVT(feo->attr.mode)) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode)); + return (EINVAL); + } - if (feo->nodeid == FUSE_NULL_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is NULL\n"); - return EINVAL; - } + if (feo->nodeid == FUSE_NULL_ID) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- feo->nodeid is NULL\n"); + return (EINVAL); + } - if (feo->nodeid == FUSE_ROOT_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n"); - return EINVAL; - } + if (feo->nodeid == FUSE_ROOT_ID) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n"); + return (EINVAL); + } - return 0; + return (0); } -int -fuse_internal_newentry(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - enum fuse_opcode op, - void *buf, - size_t bufsize, - enum vtype vtyp); +int fuse_internal_newentry(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, enum fuse_opcode op, void *buf, size_t bufsize, + enum vtype vtyp); -void -fuse_internal_newentry_makerequest(struct mount *mp, - uint64_t dnid, - struct componentname *cnp, - enum fuse_opcode op, - void *buf, - size_t bufsize, - struct fuse_dispatcher *fdip); +void fuse_internal_newentry_makerequest(struct mount *mp, uint64_t dnid, + struct componentname *cnp, enum fuse_opcode op, void *buf, size_t bufsize, + struct fuse_dispatcher *fdip); -int -fuse_internal_newentry_core(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - enum vtype vtyp, - struct fuse_dispatcher *fdip); +int fuse_internal_newentry_core(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, enum vtype vtyp, struct fuse_dispatcher *fdip); /* entity destruction */ -int -fuse_internal_forget_callback(struct fuse_ticket *tick, struct uio *uio); - -void -fuse_internal_forget_send(struct mount *mp, - struct thread *td, - struct ucred *cred, - uint64_t nodeid, - uint64_t nlookup); +int fuse_internal_forget_callback(struct fuse_ticket *tick, struct uio *uio); +void fuse_internal_forget_send(struct mount *mp, struct thread *td, + struct ucred *cred, uint64_t nodeid, uint64_t nlookup); /* fuse start/stop */ Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_ipc.c Wed Feb 20 02:49:26 2019 (r344334) @@ -91,19 +91,11 @@ static struct fuse_ticket *fticket_alloc(struct fuse_d static void fticket_refresh(struct fuse_ticket *ftick); static void fticket_destroy(struct fuse_ticket *ftick); static int fticket_wait_answer(struct fuse_ticket *ftick); -static __inline__ int +static inline int fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio); static int fuse_body_audit(struct fuse_ticket *ftick, size_t blen); -static __inline__ void -fuse_setup_ihead(struct fuse_in_header *ihead, - struct fuse_ticket *ftick, - uint64_t nid, - enum fuse_opcode op, - size_t blen, - pid_t pid, - struct ucred *cred); static fuse_handler_t fuse_standard_handler; @@ -274,19 +266,19 @@ fticket_fini(void *mem, int size) mtx_destroy(&ftick->tk_aw_mtx); } -static __inline struct fuse_ticket * +static inline struct fuse_ticket * fticket_alloc(struct fuse_data *data) { return uma_zalloc_arg(ticket_zone, data, M_WAITOK); } -static __inline void +static inline void fticket_destroy(struct fuse_ticket *ftick) { return uma_zfree(ticket_zone, ftick); } -static __inline__ +static inline void fticket_refresh(struct fuse_ticket *ftick) { @@ -354,7 +346,7 @@ out: return err; } -static __inline__ +static inline int fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio) { @@ -717,13 +709,9 @@ fuse_body_audit(struct fuse_ticket *ftick, size_t blen return err; } -static void -fuse_setup_ihead(struct fuse_in_header *ihead, - struct fuse_ticket *ftick, - uint64_t nid, - enum fuse_opcode op, - size_t blen, - pid_t pid, +static inline void +fuse_setup_ihead(struct fuse_in_header *ihead, struct fuse_ticket *ftick, + uint64_t nid, enum fuse_opcode op, size_t blen, pid_t pid, struct ucred *cred) { ihead->len = sizeof(*ihead) + blen; @@ -767,12 +755,8 @@ fuse_standard_handler(struct fuse_ticket *ftick, struc } void -fdisp_make_pid(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct mount *mp, - uint64_t nid, - pid_t pid, - struct ucred *cred) +fdisp_make_pid(struct fuse_dispatcher *fdip, enum fuse_opcode op, + struct mount *mp, uint64_t nid, pid_t pid, struct ucred *cred) { struct fuse_data *data = fuse_get_mpdata(mp); @@ -792,12 +776,8 @@ fdisp_make_pid(struct fuse_dispatcher *fdip, } void -fdisp_make(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct mount *mp, - uint64_t nid, - struct thread *td, - struct ucred *cred) +fdisp_make(struct fuse_dispatcher *fdip, enum fuse_opcode op, struct mount *mp, + uint64_t nid, struct thread *td, struct ucred *cred) { RECTIFY_TDCR(td, cred); @@ -805,11 +785,8 @@ fdisp_make(struct fuse_dispatcher *fdip, } void -fdisp_make_vp(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct vnode *vp, - struct thread *td, - struct ucred *cred) +fdisp_make_vp(struct fuse_dispatcher *fdip, enum fuse_opcode op, + struct vnode *vp, struct thread *td, struct ucred *cred) { debug_printf("fdip=%p, op=%d, vp=%p\n", fdip, op, vp); RECTIFY_TDCR(td, cred); Modified: head/sys/fs/fuse/fuse_ipc.h ============================================================================== --- head/sys/fs/fuse/fuse_ipc.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_ipc.h Wed Feb 20 02:49:26 2019 (r344334) @@ -64,10 +64,10 @@ #include struct fuse_iov { - void *base; - size_t len; - size_t allocated_size; - int credit; + void *base; + size_t len; + size_t allocated_size; + int credit; }; void fiov_init(struct fuse_iov *fiov, size_t size); @@ -75,23 +75,22 @@ void fiov_teardown(struct fuse_iov *fiov); void fiov_refresh(struct fuse_iov *fiov); void fiov_adjust(struct fuse_iov *fiov, size_t size); -#define FUSE_DIMALLOC(fiov, spc1, spc2, amnt) \ -do { \ - fiov_adjust(fiov, (sizeof(*(spc1)) + (amnt))); \ - (spc1) = (fiov)->base; \ - (spc2) = (char *)(fiov)->base + (sizeof(*(spc1))); \ +#define FUSE_DIMALLOC(fiov, spc1, spc2, amnt) do { \ + fiov_adjust(fiov, (sizeof(*(spc1)) + (amnt))); \ + (spc1) = (fiov)->base; \ + (spc2) = (char *)(fiov)->base + (sizeof(*(spc1))); \ } while (0) #define FU_AT_LEAST(siz) max((siz), 160) -#define FUSE_ASSERT_AW_DONE(ftick) \ - KASSERT((ftick)->tk_aw_link.tqe_next == NULL && \ - (ftick)->tk_aw_link.tqe_prev == NULL, \ - ("FUSE: ticket still on answer delivery list %p", (ftick))) \ +#define FUSE_ASSERT_AW_DONE(ftick) \ + KASSERT((ftick)->tk_aw_link.tqe_next == NULL && \ + (ftick)->tk_aw_link.tqe_prev == NULL, \ + ("FUSE: ticket still on answer delivery list %p", (ftick))) -#define FUSE_ASSERT_MS_DONE(ftick) \ - KASSERT((ftick)->tk_ms_link.stqe_next == NULL, \ - ("FUSE: ticket still on message list %p", (ftick))) +#define FUSE_ASSERT_MS_DONE(ftick) \ + KASSERT((ftick)->tk_ms_link.stqe_next == NULL, \ + ("FUSE: ticket still on message list %p", (ftick))) struct fuse_ticket; struct fuse_data; @@ -99,66 +98,62 @@ struct fuse_data; typedef int fuse_handler_t(struct fuse_ticket *ftick, struct uio *uio); struct fuse_ticket { - /* fields giving the identity of the ticket */ - uint64_t tk_unique; - struct fuse_data *tk_data; - int tk_flag; - u_int tk_refcount; + /* fields giving the identity of the ticket */ + uint64_t tk_unique; + struct fuse_data *tk_data; + int tk_flag; + u_int tk_refcount; - /* fields for initiating an upgoing message */ - struct fuse_iov tk_ms_fiov; - void *tk_ms_bufdata; - size_t tk_ms_bufsize; - enum { FT_M_FIOV, FT_M_BUF } tk_ms_type; - STAILQ_ENTRY(fuse_ticket) tk_ms_link; + /* fields for initiating an upgoing message */ + struct fuse_iov tk_ms_fiov; + void *tk_ms_bufdata; + size_t tk_ms_bufsize; + enum { FT_M_FIOV, FT_M_BUF } tk_ms_type; + STAILQ_ENTRY(fuse_ticket) tk_ms_link; - /* fields for handling answers coming from userspace */ - struct fuse_iov tk_aw_fiov; - void *tk_aw_bufdata; - size_t tk_aw_bufsize; - enum { FT_A_FIOV, FT_A_BUF } tk_aw_type; + /* fields for handling answers coming from userspace */ + struct fuse_iov tk_aw_fiov; + void *tk_aw_bufdata; + size_t tk_aw_bufsize; + enum { FT_A_FIOV, FT_A_BUF } tk_aw_type; - struct fuse_out_header tk_aw_ohead; - int tk_aw_errno; - struct mtx tk_aw_mtx; - fuse_handler_t *tk_aw_handler; - TAILQ_ENTRY(fuse_ticket) tk_aw_link; + struct fuse_out_header tk_aw_ohead; + int tk_aw_errno; + struct mtx tk_aw_mtx; + fuse_handler_t *tk_aw_handler; + TAILQ_ENTRY(fuse_ticket) tk_aw_link; }; #define FT_ANSW 0x01 /* request of ticket has already been answered */ #define FT_DIRTY 0x04 /* ticket has been used */ -static __inline__ -struct fuse_iov * +static inline struct fuse_iov * fticket_resp(struct fuse_ticket *ftick) { - return (&ftick->tk_aw_fiov); + return (&ftick->tk_aw_fiov); } -static __inline__ -int +static inline bool fticket_answered(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); - return (ftick->tk_flag & FT_ANSW); + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); + return (ftick->tk_flag & FT_ANSW); } -static __inline__ -void +static inline void fticket_set_answered(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); - ftick->tk_flag |= FT_ANSW; + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); + ftick->tk_flag |= FT_ANSW; } -static __inline__ -enum fuse_opcode +static inline enum fuse_opcode fticket_opcode(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - return (((struct fuse_in_header *)(ftick->tk_ms_fiov.base))->opcode); + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + return (((struct fuse_in_header *)(ftick->tk_ms_fiov.base))->opcode); } int fticket_pull(struct fuse_ticket *ftick, struct uio *uio); @@ -169,35 +164,35 @@ enum mountpri { FM_NOMOUNTED, FM_PRIMARY, FM_SECONDARY * The data representing a FUSE session. */ struct fuse_data { - struct cdev *fdev; - struct mount *mp; - struct vnode *vroot; - struct ucred *daemoncred; - int dataflags; - int ref; + struct cdev *fdev; + struct mount *mp; + struct vnode *vroot; + struct ucred *daemoncred; + int dataflags; + int ref; - struct mtx ms_mtx; - STAILQ_HEAD(, fuse_ticket) ms_head; + struct mtx ms_mtx; + STAILQ_HEAD(, fuse_ticket) ms_head; - struct mtx aw_mtx; - TAILQ_HEAD(, fuse_ticket) aw_head; + struct mtx aw_mtx; + TAILQ_HEAD(, fuse_ticket) aw_head; - u_long ticketer; + u_long ticketer; - struct sx rename_lock; + struct sx rename_lock; - uint32_t fuse_libabi_major; - uint32_t fuse_libabi_minor; + uint32_t fuse_libabi_major; + uint32_t fuse_libabi_minor; - uint32_t max_write; - uint32_t max_read; - uint32_t subtype; - char volname[MAXPATHLEN]; + uint32_t max_write; + uint32_t max_read; + uint32_t subtype; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 20 03:00:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A2B314E32DA; Wed, 20 Feb 2019 03:00:56 +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 2256388D38; Wed, 20 Feb 2019 03:00:56 +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 17C2F271FC; Wed, 20 Feb 2019 03:00:56 +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 x1K30tVs086047; Wed, 20 Feb 2019 03:00:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K30tug086046; Wed, 20 Feb 2019 03:00:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902200300.x1K30tug086046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Feb 2019 03:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344335 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2256388D38 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 03:00:56 -0000 Author: ian Date: Wed Feb 20 03:00:55 2019 New Revision: 344335 URL: https://svnweb.freebsd.org/changeset/base/344335 Log: Fix the handling of legacy-format devices in the u-boot loaderdev variable. When I added support for the standard loader(8) disk0s2a: type formats, the parsing of legacy format was broken because it also contains a colon, but it comes before the slice and partition. That would cause disk_parsedev() to return success with the slice and partition set to wildcard values. This change examines the string first, and if it contains spaces, dots, or a colon at any position other than the end, it must be a legacy-format string and we don't even try to use disk_parsedev() on it. Reported by: Manuel Stuhn Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Wed Feb 20 02:49:26 2019 (r344334) +++ head/stand/uboot/common/main.c Wed Feb 20 03:00:55 2019 (r344335) @@ -226,16 +226,23 @@ get_load_device(int *type, int *unit, int *slice, int p = get_device_type(devstr, type); /* - * If type is DEV_TYP_STOR we have a disk-like device. If we can parse - * the remainder of the string as a standard unit+slice+partition (e.g., - * 0s2a or 1p12), return those results. Otherwise we'll fall through to - * the code that parses the legacy format. + * If type is DEV_TYP_STOR we have a disk-like device. If the remainder + * of the string contains spaces, dots, or a colon in any location other + * than the last char, it's legacy format. Otherwise it might be + * standard loader(8) format (e.g., disk0s2a or mmc1p12), so try to + * parse the remainder of the string as such, and if it works, return + * those results. Otherwise we'll fall through to the code that parses + * the legacy format. */ - if ((*type & DEV_TYP_STOR) && disk_parsedev(&dev, p, NULL) == 0) { - *unit = dev.dd.d_unit; - *slice = dev.d_slice; - *partition = dev.d_partition; - return; + if (*type & DEV_TYP_STOR) { + size_t len = strlen(p); + if (strcspn(p, " .") == len && strcspn(p, ":") >= len - 1 && + disk_parsedev(&dev, p, NULL) == 0) { + *unit = dev.dd.d_unit; + *slice = dev.d_slice; + *partition = dev.d_partition; + return; + } } /* Ignore optional spaces after the device name. */ From owner-svn-src-head@freebsd.org Wed Feb 20 05:19:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D702414E6306; Wed, 20 Feb 2019 05:19:17 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF2C38CA25; Wed, 20 Feb 2019 05:19:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9710A4C; Wed, 20 Feb 2019 05:19:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K5JG3N058197; Wed, 20 Feb 2019 05:19:16 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K5JGaC058196; Wed, 20 Feb 2019 05:19:16 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201902200519.x1K5JGaC058196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Wed, 20 Feb 2019 05:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344337 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 344337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF2C38CA25 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 05:19:18 -0000 Author: bcran Date: Wed Feb 20 05:19:16 2019 New Revision: 344337 URL: https://svnweb.freebsd.org/changeset/base/344337 Log: Add the unix path to the output of `efivar --load-option` Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19242 Modified: head/usr.sbin/efivar/efiutil.c Modified: head/usr.sbin/efivar/efiutil.c ============================================================================== --- head/usr.sbin/efivar/efiutil.c Wed Feb 20 03:07:11 2019 (r344336) +++ head/usr.sbin/efivar/efiutil.c Wed Feb 20 05:19:16 2019 (r344337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2019 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -120,6 +120,7 @@ bindump(uint8_t *data, size_t datalen) void efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) { + char *dev, *relpath, *abspath; uint8_t *ep = data + datalen; uint8_t *walker = data; uint32_t attr; @@ -131,6 +132,7 @@ efi_print_load_option(uint8_t *data, size_t datalen, i int len; void *opt; int optlen; + int rv; if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) return; @@ -162,8 +164,15 @@ efi_print_load_option(uint8_t *data, size_t datalen, i free(str); while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); + rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); dp = (efidp)((char *)dp + efidp_size(dp)); printf(" %s\n", buf); + if (rv == 0) { + printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); + free(dev); + free(relpath); + free(abspath); + } } if (optlen == 0) return; From owner-svn-src-head@freebsd.org Wed Feb 20 06:40:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F37B314E7CED; Wed, 20 Feb 2019 06:40: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 9258F8F1BD; Wed, 20 Feb 2019 06:40: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 869A61920; Wed, 20 Feb 2019 06:40: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 x1K6erDC099804; Wed, 20 Feb 2019 06:40:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K6eqA9099800; Wed, 20 Feb 2019 06:40:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201902200640.x1K6eqA9099800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Feb 2019 06:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344340 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 344340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9258F8F1BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 06:40:54 -0000 Author: bapt Date: Wed Feb 20 06:40:52 2019 New Revision: 344340 URL: https://svnweb.freebsd.org/changeset/base/344340 Log: calendar: use iconv to respect the output encoding calendar(1) can have input in various encoding, specifying LANG= to enable calendar(1) to determine which one to use. The problem is the content of the calendar itself is exposed as is making it unreadable in many cases. For example french calendar which is encoded ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment. Using iconv allows to solve this issue. This will also allow to keep only 1 encoding in base for those files without breaking user existing setup Reported by: many MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19221 Modified: head/usr.bin/calendar/Makefile head/usr.bin/calendar/calendar.c head/usr.bin/calendar/calendar.h head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/Makefile Wed Feb 20 06:40:52 2019 (r344340) @@ -13,6 +13,10 @@ INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_F DE_LINKS= de_DE.ISO8859-15 FR_LINKS= fr_FR.ISO8859-15 +.if ${MK_ICONV} == "yes" +CFLAGS+= -DWITH_ICONV +.endif + FILESGROUPS+= CALS CALS= calendars/calendar.all \ calendars/calendar.australia \ Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.c Wed Feb 20 06:40:52 2019 (r344340) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,6 +67,9 @@ static char *DEBUG = NULL; static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; +#ifdef WITH_ICONV +const char *outputEncoding; +#endif static void usage(void) __dead2; @@ -80,6 +84,12 @@ 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) { Modified: head/usr.bin/calendar/calendar.h ============================================================================== --- head/usr.bin/calendar/calendar.h Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.h Wed Feb 20 06:40:52 2019 (r344340) @@ -59,6 +59,9 @@ extern struct fixs neaster, npaskha, ncny, nfullmoon, extern struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; extern double UTCOffset; extern int EastLongitude; +#ifdef WITH_ICONV +extern const char *outputEncoding; +#endif #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) @@ -197,3 +200,7 @@ void fpom(int year, double utcoffset, double *ffms, do void equinoxsolstice(int year, double UTCoffset, int *equinoxdays, int *solsticedays); void fequinoxsolstice(int year, double UTCoffset, double *equinoxdays, double *solsticedays); int calculatesunlongitude30(int year, int degreeGMToffset, int *ichinesemonths); + +#ifdef WITH_ICONV +void set_new_encoding(void); +#endif Modified: head/usr.bin/calendar/events.c ============================================================================== --- head/usr.bin/calendar/events.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/events.c Wed Feb 20 06:40:52 2019 (r344340) @@ -35,10 +35,120 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV +#include +#include +#include +static iconv_t conv = (iconv_t)-1; +static char *currentEncoding = NULL; + +#endif + #include "pathnames.h" #include "calendar.h" +#ifdef WITH_ICONV +void +set_new_encoding(void) +{ + const char *newenc; + + newenc = nl_langinfo(CODESET); + if (currentEncoding == NULL) { + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + return; + } + if (strcmp(currentEncoding, newenc) == 0) + return; + free(currentEncoding); + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + if (conv != (iconv_t) -1) { + iconv_close(conv); + conv = (iconv_t) -1; + } +} +#endif + +static char * +convert(char *input) +{ + char *output; +#ifdef WITH_ICONV + size_t inleft, outleft, converted = 0; + char *outbuf, *tmp; + char *inbuf; + size_t outlen; + + if (currentEncoding == NULL) { + output = strdup(input); + if (output == NULL) + errx(1, "convert: cannot allocate memory"); + return (output); + } + if (conv == (iconv_t)-1) { + conv = iconv_open(outputEncoding, currentEncoding); + if (conv == (iconv_t)-1) { + if (errno == EINVAL) + errx(1, "Conversion is not supported"); + else + err(1, "Initialization failure"); + } + } + + inleft = strlen(input); + inbuf = input; + + outlen = inleft; + if ((output = malloc(outlen + 1)) == NULL) + errx(1, "convert: cannot allocate memory"); + + for (;;) { + errno = 0; + outbuf = output + converted; + outleft = outlen - converted; + + converted = iconv(conv, (char **) &inbuf, &inleft, &outbuf, &outleft); + if (converted != (size_t) -1 || errno == EINVAL) { + /* finished or invalid multibyte, so truncate and ignore */ + break; + } + + if (errno != E2BIG) { + free(output); + err(1, "convert"); + } + + converted = outbuf - output; + outlen += inleft * 2; + + if ((tmp = realloc(output, outlen + 1)) == NULL) { + free(output); + errx(1, "convert: cannot allocate memory"); + } + + output = tmp; + outbuf = output + converted; + } + + /* flush the iconv conversion */ + iconv(conv, NULL, NULL, &outbuf, &outleft); + + /* null terminate the string */ + *outbuf = '\0'; +#else + output = strdup(input); + if (output == NULL) + errx(1, "convert: cannot allocate memory"); +#endif + + return (output); +} + struct event * event_add(int year, int month, int day, char *date, int var, char *txt, char *extra) @@ -58,15 +168,15 @@ event_add(int year, int month, int day, char *date, in e->month = month; e->day = day; e->var = var; - e->date = strdup(date); + e->date = convert(date); if (e->date == NULL) errx(1, "event_add: cannot allocate memory"); - e->text = strdup(txt); + e->text = convert(txt); if (e->text == NULL) errx(1, "event_add: cannot allocate memory"); e->extra = NULL; if (extra != NULL && extra[0] != '\0') - e->extra = strdup(extra); + e->extra = convert(extra); addtodate(e, year, month, day); return (e); } @@ -74,23 +184,17 @@ event_add(int year, int month, int day, char *date, in void event_continue(struct event *e, char *txt) { - char *text; + char *oldtext, *text; - /* - * Adding text to the event: - * - Save a copy of the old text (unknown length, so strdup()) - * - Allocate enough space for old text + \n + new text + 0 - * - Store the old text + \n + new text - * - Destroy the saved copy. - */ - text = strdup(e->text); - if (text == NULL) + text = convert(txt); + oldtext = e->text; + if (oldtext == NULL) errx(1, "event_continue: cannot allocate memory"); - free(e->text); - asprintf(&e->text, "%s\n%s", text, txt); + asprintf(&e->text, "%s\n%s", oldtext, text); if (e->text == NULL) errx(1, "event_continue: cannot allocate memory"); + free(oldtext); free(text); return; Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/io.c Wed Feb 20 06:40:52 2019 (r344340) @@ -294,6 +294,9 @@ cal_parse(FILE *in, FILE *out) 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(); +#endif setnnames(); continue; } From owner-svn-src-head@freebsd.org Wed Feb 20 07:10:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCF014E8C07; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3307069E42; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DFBB1D26; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K7Ac0d017451; Wed, 20 Feb 2019 07:10:38 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K7Acj0017450; Wed, 20 Feb 2019 07:10:38 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902200710.x1K7Acj0017450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 20 Feb 2019 07:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344343 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3307069E42 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 07:10:39 -0000 Author: ganbold Date: Wed Feb 20 07:10:38 2019 New Revision: 344343 URL: https://svnweb.freebsd.org/changeset/base/344343 Log: Clarify notifications when battery capacity ratio reaches warning and shutdown thresholds. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Wed Feb 20 06:54:32 2019 (r344342) +++ head/sys/arm/allwinner/axp81x.c Wed Feb 20 07:10:38 2019 (r344343) @@ -1088,9 +1088,9 @@ axp8xx_intr(void *arg) if (bootverbose) device_printf(dev, "AXP_IRQSTAT4 val: %x\n", val); if (val & AXP_IRQSTAT4_BATLVL_LO0) - devctl_notify("PMU", "Battery", "lower than level 2", NULL); + devctl_notify("PMU", "Battery", "shutdown threshold", NULL); if (val & AXP_IRQSTAT4_BATLVL_LO1) - devctl_notify("PMU", "Battery", "lower than level 1", NULL); + devctl_notify("PMU", "Battery", "warning threshold", NULL); /* Acknowledge */ axp8xx_write(dev, AXP_IRQSTAT4, val); } From owner-svn-src-head@freebsd.org Wed Feb 20 07:56:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A47614E9C33; Wed, 20 Feb 2019 07:56:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4B9D6BD9C; Wed, 20 Feb 2019 07:56:13 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9612ECF42; Wed, 20 Feb 2019 07:56:13 +0000 (UTC) Date: Wed, 20 Feb 2019 07:56:13 +0000 From: Alexey Dokuchaev To: Shawn Webb Cc: Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190220075613.GC84455@FreeBSD.org> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: A4B9D6BD9C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.907,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 07:56:14 -0000 On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > At the risk of painting a bikeshed a lovely color of neon purple, I'm > curious about if/how these types of commits get merged upstream to > (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > confused|is anyone else confused where upstream is?). > > Who is upstream? Is work like this going to remain as a downstream > patch to ZFS? Or is FreeBSD going to work to upstream this type of > work? I've always felt that we should've become upstream to everyone else the moment we knew Oracle would eat Sun (20 April 2009), and never understood why it didn't happen and now, ten years later, we're talking about ZFS on fucking Linux becoming our upstream. Something'd got very wrong here and I'd like to know what and why. > I hope my curiousity doesn't offend anyone. ;) Not at all, I'm also confused and curious. ./danfe From owner-svn-src-head@freebsd.org Wed Feb 20 08:10:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 538E714EA324 for ; Wed, 20 Feb 2019 08:10:10 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10021101.me.com (pv50p00im-ztdg10021101.me.com [17.58.6.44]) (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 E61956C608 for ; Wed, 20 Feb 2019 08:10:09 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10021101.me.com (Postfix) with ESMTPSA id AC5E5180150; Wed, 20 Feb 2019 08:10:00 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Toomas Soome In-Reply-To: <20190220075613.GC84455@FreeBSD.org> Date: Wed, 20 Feb 2019 10:09:57 +0200 Cc: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <98312B69-2AC4-461A-8085-D6BAC68D453D@me.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-20_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=426 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902200060 X-Rspamd-Queue-Id: E61956C608 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 08:10:10 -0000 > On 20 Feb 2019, at 09:56, Alexey Dokuchaev wrote: >=20 > On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >> At the risk of painting a bikeshed a lovely color of neon purple, I'm >> curious about if/how these types of commits get merged upstream to >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very >> confused|is anyone else confused where upstream is?). >>=20 >> Who is upstream? Is work like this going to remain as a downstream >> patch to ZFS? Or is FreeBSD going to work to upstream this type of >> work? >=20 > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're = talking > about ZFS on fucking Linux becoming our upstream. Something'd got = very > wrong here and I'd like to know what and why. >=20 >> I hope my curiousity doesn't offend anyone. ;) >=20 > Not at all, I'm also confused and curious. >=20 > ./danfe >=20 The genuine lack of developers and development. If the updates do happen = in ZoL (for zfs), it only means the developers find it easier to work = there. rgds, toomas= From owner-svn-src-head@freebsd.org Wed Feb 20 09:38:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A94C14EC9C8; Wed, 20 Feb 2019 09:38:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 432046F107; Wed, 20 Feb 2019 09:38:20 +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 1D50C383C; Wed, 20 Feb 2019 09:38:20 +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 x1K9cKet094575; Wed, 20 Feb 2019 09:38:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9cJu2094571; Wed, 20 Feb 2019 09:38:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200938.x1K9cJu2094571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344351 - in head/sys: conf kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf kern sys X-SVN-Commit-Revision: 344351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 432046F107 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 09:38:20 -0000 Author: kib Date: Wed Feb 20 09:38:19 2019 New Revision: 344351 URL: https://svnweb.freebsd.org/changeset/base/344351 Log: Implement rangesets. The data structure implements non-intersecting intervals over the [0, UINT64_MAX] range, and supports fast insert, predicated clearing of subrange, and lookup of an interval containing the specified address. Internally it is a pctrie over the interval start addresses. Implementation provides additional guarantees over the structure state in case of memory allocation failures. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Added: head/sys/kern/subr_rangeset.c (contents, props changed) head/sys/sys/_rangeset.h (contents, props changed) head/sys/sys/rangeset.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 20 09:33:55 2019 (r344350) +++ head/sys/conf/files Wed Feb 20 09:38:19 2019 (r344351) @@ -3861,6 +3861,7 @@ kern/subr_pidctrl.c standard kern/subr_power.c standard kern/subr_prf.c standard kern/subr_prof.c standard +kern/subr_rangeset.c standard kern/subr_rman.c standard kern/subr_rtc.c standard kern/subr_sbuf.c standard Added: head/sys/kern/subr_rangeset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_rangeset.c Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,365 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#ifdef DIAGNOSTIC +static void rangeset_check(struct rangeset *rs); +#else +#define rangeset_check(rs) +#endif + +static uma_zone_t rs_node_zone; + +static void +rs_rangeset_init(void *arg __unused) +{ + + rs_node_zone = uma_zcreate("rangeset pctrie nodes", + pctrie_node_size(), NULL, NULL, pctrie_zone_init, NULL, + UMA_ALIGN_PTR, 0); +} +SYSINIT(rs, SI_SUB_LOCK, SI_ORDER_ANY, rs_rangeset_init, NULL); + +static void * +rs_node_alloc(struct pctrie *ptree) +{ + struct rangeset *rs; + + rs = __containerof(ptree, struct rangeset, rs_trie); + return (uma_zalloc(rs_node_zone, rs->rs_alloc_flags)); +} + +static void +rs_node_free(struct pctrie *ptree __unused, void *node) +{ + + uma_zfree(rs_node_zone, node); +} + +void +rangeset_init(struct rangeset *rs, rs_dup_data_t dup_data, + rs_free_data_t free_data, void *data_ctx, u_int alloc_flags) +{ + + pctrie_init(&rs->rs_trie); + rs->rs_dup_data = dup_data; + rs->rs_free_data = free_data; + rs->rs_data_ctx = data_ctx; + rs->rs_alloc_flags = alloc_flags; +} + +void +rangeset_fini(struct rangeset *rs) +{ + + rangeset_check(rs); + rangeset_remove_all(rs); +} + +bool +rangeset_check_empty(struct rangeset *rs, uint64_t start, uint64_t end) +{ + struct rs_el *r; + uint64_t *r1; + + rangeset_check(rs); + r1 = pctrie_lookup_le(&rs->rs_trie, end); + if (r1 != NULL) { + r = __containerof(r1, struct rs_el, re_start); + if (r->re_end > start) + return (false); + } + return (true); +} + +int +rangeset_insert(struct rangeset *rs, uint64_t start, uint64_t end, + void *data) +{ + struct rs_el *r; + int error; + + rangeset_check(rs); + error = rangeset_remove(rs, start, end); + if (error != 0) + return (error); + r = data; + r->re_start = start; + r->re_end = end; + error = pctrie_insert(&rs->rs_trie, &r->re_start, rs_node_alloc); + rangeset_check(rs); + return (error); +} + +int +rangeset_remove_pred(struct rangeset *rs, uint64_t start, uint64_t end, + rs_pred_t pred) +{ + struct rs_el *r, *rn; + uint64_t *r1; + int error; + + rangeset_check(rs); + error = 0; + for (; end > 0 && start < end;) { + r1 = pctrie_lookup_le(&rs->rs_trie, end - 1); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + + /* + * ------============================--|-------|---- + * rs re s e + */ + if (r->re_end <= start) + break; + + if (r->re_end <= end) { + if (r->re_start < start) { + /* + * ------========|==============-------|---- + * rs s re e + */ + if (pred(rs->rs_data_ctx, r)) + r->re_end = start; + break; + } + + /* + * ------|--------===================----------|---- + * s rs re e + */ + end = r->re_start; + if (pred(rs->rs_data_ctx, r)) { + pctrie_remove(&rs->rs_trie, r->re_start, + rs_node_free); + rs->rs_free_data(rs->rs_data_ctx, r); + } + continue; + } + + /* + * ------|--------====================|==========---- + * s rs e re + */ + if (r->re_start >= start) { + if (pred(rs->rs_data_ctx, r)) { + pctrie_remove(&rs->rs_trie, r->re_start, + rs_node_free); + r->re_start = end; + error = pctrie_insert(&rs->rs_trie, + &r->re_start, rs_node_alloc); + /* + * The insert above must succeed + * because rs_node zone is marked + * nofree and we freed one element + * just before. + */ + MPASS(error == 0); + } else { + end = r->re_start; + } + continue; + } + + /* + * ------=========|===================|==========---- + * rs s e re + */ + if (pred(rs->rs_data_ctx, r)) { + /* + * Split. Can only happen once, and then if + * any allocation fails, the rangeset is kept + * intact. + */ + rn = rs->rs_dup_data(rs->rs_data_ctx, r); + if (rn == NULL) { + error = ENOMEM; + break; + } + rn->re_start = end; + rn->re_end = r->re_end; + error = pctrie_insert(&rs->rs_trie, &rn->re_start, + rs_node_alloc); + if (error != 0) { + rs->rs_free_data(rs->rs_data_ctx, rn); + break; + } + r->re_end = start; + } + break; + } + rangeset_check(rs); + return (error); +} + +static bool +rangeset_true_pred(void *ctx __unused, void *r __unused) +{ + + return (true); +} + +int +rangeset_remove(struct rangeset *rs, uint64_t start, uint64_t end) +{ + + return (rangeset_remove_pred(rs, start, end, rangeset_true_pred)); +} + +void +rangeset_remove_all(struct rangeset *rs) +{ + struct rs_el *r; + uint64_t *r1; + + for (;;) { + r1 = pctrie_lookup_ge(&rs->rs_trie, 0); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + pctrie_remove(&rs->rs_trie, r->re_start, rs_node_free); + rs->rs_free_data(rs->rs_data_ctx, r); + } +} + +void * +rangeset_lookup(struct rangeset *rs, uint64_t place) +{ + struct rs_el *r; + uint64_t *r1; + + rangeset_check(rs); + r1 = pctrie_lookup_le(&rs->rs_trie, place); + if (r1 == NULL) + return (NULL); + r = __containerof(r1, struct rs_el, re_start); + if (r->re_end <= place) + return (NULL); + return (r); +} + +int +rangeset_copy(struct rangeset *dst_rs, struct rangeset *src_rs) +{ + struct rs_el *src_r, *dst_r; + uint64_t cursor, *r1; + int error; + + MPASS(pctrie_is_empty(&dst_rs->rs_trie)); + rangeset_check(src_rs); + MPASS(dst_rs->rs_dup_data == src_rs->rs_dup_data); + + error = 0; + for (cursor = 0;; cursor = src_r->re_start + 1) { + r1 = pctrie_lookup_ge(&src_rs->rs_trie, cursor); + if (r1 == NULL) + break; + src_r = __containerof(r1, struct rs_el, re_start); + dst_r = dst_rs->rs_dup_data(dst_rs->rs_data_ctx, src_r); + if (dst_r == NULL) { + error = ENOMEM; + break; + } + error = pctrie_insert(&dst_rs->rs_trie, &dst_r->re_start, + rs_node_alloc); + if (error != 0) + break; + } + if (error != 0) + rangeset_remove_all(dst_rs); + return (error); +} + +#ifdef DIAGNOSTIC +static void +rangeset_check(struct rangeset *rs) +{ + struct rs_el *r, *rp; + uint64_t cursor, *r1; + + for (cursor = 0, rp = NULL;; cursor = r->re_start + 1, rp = r) { + r1 = pctrie_lookup_ge(&rs->rs_trie, cursor); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + KASSERT(r->re_start < r->re_end, + ("invalid interval rs %p elem %p (%#jx, %#jx)", + rs, r, (uintmax_t)r->re_start, (uintmax_t)r->re_end)); + if (rp != NULL) { + KASSERT(rp->re_end <= r->re_start, + ("non-ascending neighbors rs %p " + "prev elem %p (%#jx, %#jx) elem %p (%#jx, %#jx)", + rs, rp, (uintmax_t)rp->re_start, + (uintmax_t)rp->re_end, r, (uintmax_t)r->re_start, + (uintmax_t)r->re_end)); + } + } +} +#endif + +#include "opt_ddb.h" +#ifdef DDB +#include +#include + +DB_SHOW_COMMAND(rangeset, rangeset_show_fn) +{ + struct rangeset *rs; + struct rs_el *r; + uint64_t cursor, *r1; + + if (!have_addr) { + db_printf("show rangeset addr\n"); + return; + } + + rs = (struct rangeset *)addr; + db_printf("rangeset %p\n", rs); + for (cursor = 0;; cursor = r->re_start + 1) { + r1 = pctrie_lookup_ge(&rs->rs_trie, cursor); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + db_printf(" el %p start %#jx end %#jx\n", + r, r->re_start, r->re_end); + } +} +#endif Added: head/sys/sys/_rangeset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_rangeset.h Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS__RANGESET_H +#define _SYS__RANGESET_H + +#include + +typedef void *(*rs_dup_data_t)(void *ctx, void *data); +typedef void (*rs_free_data_t)(void *ctx, void *data); + +struct rangeset { + struct pctrie rs_trie; + rs_dup_data_t rs_dup_data; + rs_free_data_t rs_free_data; + void *rs_data_ctx; + u_int rs_alloc_flags; +}; + +#endif + Added: head/sys/sys/rangeset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/rangeset.h Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,88 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_RANGESET_H +#define _SYS_RANGESET_H + +#ifdef _KERNEL + +#include + +typedef bool (*rs_pred_t)(void *ctx, void *r); + +/* + * This structure must be embedded at the start of the rangeset element. + */ +struct rs_el { + uint64_t re_start; /* pctrie key */ + uint64_t re_end; +}; + +void rangeset_init(struct rangeset *rs, rs_dup_data_t dup_data, + rs_free_data_t free_data, void *rs_data_ctx, u_int alloc_flags); +void rangeset_fini(struct rangeset *rs); + +bool rangeset_check_empty(struct rangeset *rs, uint64_t start, + uint64_t end); + +/* + * r point to the app data with struct rs_el at the beginning. + */ +int rangeset_insert(struct rangeset *rs, uint64_t start, uint64_t end, + void *r); + +/* + * Guarantees that on error the rangeset is not modified. Remove + * might need to split element if its start/end completely cover the + * removed range, in which case ENOMEM might be returned. + */ +void rangeset_remove_all(struct rangeset *rs); +int rangeset_remove(struct rangeset *rs, uint64_t start, uint64_t end); +int rangeset_remove_pred(struct rangeset *rs, uint64_t start, + uint64_t end, rs_pred_t pred); + +/* + * Really returns the pointer to the data with struct rs_el embedded + * at the beginning. + */ +void *rangeset_lookup(struct rangeset *rs, uint64_t place); + +/* + * Copies src_rs entries into dst_rs. dst_rs must be empty. + * Leaves dst_rs empty on failure. + */ +int rangeset_copy(struct rangeset *dst_rs, struct rangeset *src_rs); + +#endif + +#endif From owner-svn-src-head@freebsd.org Wed Feb 20 09:46:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDC5A14ECE9E; Wed, 20 Feb 2019 09:46:45 +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 7C1666F6F1; Wed, 20 Feb 2019 09:46:45 +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 6C98B3A17; Wed, 20 Feb 2019 09:46:45 +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 x1K9kjA8099741; Wed, 20 Feb 2019 09:46:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9kjNV099740; Wed, 20 Feb 2019 09:46:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200946.x1K9kjNV099740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344352 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 344352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C1666F6F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 09:46:46 -0000 Author: kib Date: Wed Feb 20 09:46:44 2019 New Revision: 344352 URL: https://svnweb.freebsd.org/changeset/base/344352 Log: amd64: add defines and decode protection keys and SGX page faults reasons. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Feb 20 09:38:19 2019 (r344351) +++ head/sys/amd64/amd64/trap.c Wed Feb 20 09:46:44 2019 (r344352) @@ -885,10 +885,12 @@ trap_fatal(frame, eva) #endif if (type == T_PAGEFLT) { printf("fault virtual address = 0x%lx\n", eva); - printf("fault code = %s %s %s, %s\n", + printf("fault code = %s %s %s%s%s, %s\n", code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", code & PGEX_I ? "instruction" : "data", + code & PGEX_PK ? " prot key" : " ", + code & PGEX_SGX ? " SGX" : " ", code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); } Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Feb 20 09:38:19 2019 (r344351) +++ head/sys/amd64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) @@ -131,6 +131,8 @@ #define PGEX_U 0x04 /* access from User mode (UPL) */ #define PGEX_RSV 0x08 /* reserved PTE field is non-zero */ #define PGEX_I 0x10 /* during an instruction fetch */ +#define PGEX_PK 0x20 /* protection key violation */ +#define PGEX_SGX 0x40 /* SGX-related */ /* * undef the PG_xx macros that define bits in the regular x86 PTEs that From owner-svn-src-head@freebsd.org Wed Feb 20 09:51:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9C7414ED007; Wed, 20 Feb 2019 09:51:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78FF76FA66; Wed, 20 Feb 2019 09:51:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4E83ABA; Wed, 20 Feb 2019 09:51:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K9pGFq001761; Wed, 20 Feb 2019 09:51:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9pDQs001745; Wed, 20 Feb 2019 09:51:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200951.x1K9pDQs001745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include X-SVN-Commit-Revision: 344353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78FF76FA66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 09:51:17 -0000 Author: kib Date: Wed Feb 20 09:51:13 2019 New Revision: 344353 URL: https://svnweb.freebsd.org/changeset/base/344353 Log: Add kernel support for Intel userspace protection keys feature on Skylake Xeons. See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/pmap.h head/sys/arm/include/pmap.h head/sys/arm64/include/pmap.h head/sys/i386/include/pmap.h head/sys/mips/include/pmap.h head/sys/powerpc/include/pmap.h head/sys/riscv/include/pmap.h head/sys/sparc64/include/pmap.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/x86/include/sysarch.h Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/initcpu.c Wed Feb 20 09:51:13 2019 (r344353) @@ -233,6 +233,9 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) cr4 |= CR4_FSGSBASE; + if (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) + cr4 |= CR4_PKE; + /* * Postpone enabling the SMEP on the boot CPU until the page * tables are switched from the boot loader identity mapping Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/pmap.c Wed Feb 20 09:51:13 2019 (r344353) @@ -48,7 +48,7 @@ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. - * Copyright (c) 2014-2018 The FreeBSD Foundation + * Copyright (c) 2014-2019 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Jake Burkholder, @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -155,6 +156,7 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#include #include static __inline boolean_t @@ -285,6 +287,13 @@ pmap_modified_bit(pmap_t pmap) return (mask); } +static __inline pt_entry_t +pmap_pku_mask_bit(pmap_t pmap) +{ + + return (pmap->pm_type == PT_X86 ? X86_PG_PKU_MASK : 0); +} + #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -424,6 +433,22 @@ static pml4_entry_t *pti_pml4; static vm_pindex_t pti_pg_idx; static bool pti_finalized; +struct pmap_pkru_range { + struct rs_el pkru_rs_el; + u_int pkru_keyidx; + int pkru_flags; +}; + +static uma_zone_t pmap_pkru_ranges_zone; +static bool pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static pt_entry_t pmap_pkru_get(pmap_t pmap, vm_offset_t va); +static void pmap_pkru_on_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static void *pkru_dup_range(void *ctx, void *data); +static void pkru_free_range(void *ctx, void *node); +static int pmap_pkru_copy(pmap_t dst_pmap, pmap_t src_pmap); +static int pmap_pkru_deassign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static void pmap_pkru_deassign_all(pmap_t pmap); + static int pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) { @@ -2846,6 +2871,12 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pcids[i].pm_gen = 1; } pmap_activate_boot(pmap); + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + pmap_pkru_ranges_zone = uma_zcreate("pkru ranges", + sizeof(struct pmap_pkru_range), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + } } void @@ -2934,6 +2965,10 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i pmap_pinit_pml4_pti(pml4pgu); pmap->pm_ucr3 = VM_PAGE_TO_PHYS(pml4pgu); } + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + rangeset_init(&pmap->pm_pkru, pkru_dup_range, + pkru_free_range, pmap, M_NOWAIT); + } } pmap->pm_root.rt_root = 0; @@ -3230,6 +3265,9 @@ pmap_release(pmap_t pmap) vm_page_unwire_noq(m); vm_page_free(m); } + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) + rangeset_fini(&pmap->pm_pkru); } static int @@ -4060,7 +4098,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v { pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; - pt_entry_t PG_A, PG_G, PG_M, PG_RW, PG_V; + pt_entry_t PG_A, PG_G, PG_M, PG_PKU_MASK, PG_RW, PG_V; vm_paddr_t mptepa; vm_page_t mpte; struct spglist free; @@ -4073,6 +4111,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_PTE_CACHE = pmap_cache_mask(pmap, 0); + PG_PKU_MASK = pmap_pku_mask_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); oldpde = *pde; @@ -4505,6 +4544,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t out: if (anyvalid) pmap_invalidate_all(pmap); + pmap_pkru_on_remove(pmap, sva, eva); PMAP_UNLOCK(pmap); pmap_delayed_invl_finished(); vm_page_free_pages_toq(&free, true); @@ -4816,7 +4856,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offs { pd_entry_t newpde; pt_entry_t *firstpte, oldpte, pa, *pte; - pt_entry_t PG_G, PG_A, PG_M, PG_RW, PG_V; + pt_entry_t PG_G, PG_A, PG_M, PG_RW, PG_V, PG_PKU_MASK; vm_page_t mpte; int PG_PTE_CACHE; @@ -4825,6 +4865,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offs PG_M = pmap_modified_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); + PG_PKU_MASK = pmap_pku_mask_bit(pmap); PG_PTE_CACHE = pmap_cache_mask(pmap, 0); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -5052,6 +5093,8 @@ retry: origpte = *pte; pv = NULL; + if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) + newpte |= pmap_pkru_get(pmap, va); /* * Is the specified virtual address already mapped? @@ -5271,6 +5314,25 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t " in pmap %p", va, pmap); return (KERN_RESOURCE_SHORTAGE); } + + /* + * If pkru is not same for the whole pde range, return failure + * and let vm_fault() cope. Check after pde allocation, since + * it could sleep. + */ + if (!pmap_pkru_same(pmap, va, va + NBPDR)) { + SLIST_INIT(&free); + if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { + pmap_invalidate_page(pmap, va); + vm_page_free_pages_toq(&free, true); + } + return (KERN_FAILURE); + } + if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { + newpde &= ~X86_PG_PKU_MASK; + newpde |= pmap_pkru_get(pmap, va); + } + pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); pde = &pde[pmap_pde_index(va)]; oldpde = *pde; @@ -5530,7 +5592,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; if (va < VM_MAXUSER_ADDRESS) - newpte |= PG_U; + newpte |= PG_U | pmap_pkru_get(pmap, va); pte_store(pte, newpte); return (mpte); } @@ -5906,6 +5968,36 @@ out: PMAP_UNLOCK(dst_pmap); } +int +pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap) +{ + int error; + + if (dst_pmap->pm_type != src_pmap->pm_type || + dst_pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0) + return (0); + for (;;) { + if (dst_pmap < src_pmap) { + PMAP_LOCK(dst_pmap); + PMAP_LOCK(src_pmap); + } else { + PMAP_LOCK(src_pmap); + PMAP_LOCK(dst_pmap); + } + error = pmap_pkru_copy(dst_pmap, src_pmap); + /* Clean up partial copy on failure due to no memory. */ + if (error == ENOMEM) + pmap_pkru_deassign_all(dst_pmap); + PMAP_UNLOCK(src_pmap); + PMAP_UNLOCK(dst_pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); +} + /* * Zero the specified hardware page. */ @@ -6305,6 +6397,7 @@ pmap_remove_pages(pmap_t pmap) if (lock != NULL) rw_wunlock(lock); pmap_invalidate_all(pmap); + pmap_pkru_deassign_all(pmap); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, true); } @@ -8939,6 +9032,285 @@ pmap_pti_remove_kva(vm_offset_t sva, vm_offset_t eva) } pmap_invalidate_range(kernel_pmap, sva, eva); VM_OBJECT_WUNLOCK(pti_obj); +} + +static void * +pkru_dup_range(void *ctx __unused, void *data) +{ + struct pmap_pkru_range *node, *new_node; + + new_node = uma_zalloc(pmap_pkru_ranges_zone, M_NOWAIT); + if (new_node == NULL) + return (NULL); + node = data; + memcpy(new_node, node, sizeof(*node)); + return (new_node); +} + +static void +pkru_free_range(void *ctx __unused, void *node) +{ + + uma_zfree(pmap_pkru_ranges_zone, node); +} + +static int +pmap_pkru_assign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, + int flags) +{ + struct pmap_pkru_range *ppr; + int error; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + if ((flags & AMD64_PKRU_EXCL) != 0 && + !rangeset_check_empty(&pmap->pm_pkru, sva, eva)) + return (EBUSY); + ppr = uma_zalloc(pmap_pkru_ranges_zone, M_NOWAIT); + if (ppr == NULL) + return (ENOMEM); + ppr->pkru_keyidx = keyidx; + ppr->pkru_flags = flags & AMD64_PKRU_PERSIST; + error = rangeset_insert(&pmap->pm_pkru, sva, eva, ppr); + if (error != 0) + uma_zfree(pmap_pkru_ranges_zone, ppr); + return (error); +} + +static int +pmap_pkru_deassign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + return (rangeset_remove(&pmap->pm_pkru, sva, eva)); +} + +static void +pmap_pkru_deassign_all(pmap_t pmap) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) + rangeset_remove_all(&pmap->pm_pkru); +} + +static bool +pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + struct pmap_pkru_range *ppr, *prev_ppr; + vm_offset_t va; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0 || + sva >= VM_MAXUSER_ADDRESS) + return (true); + MPASS(eva <= VM_MAXUSER_ADDRESS); + for (va = sva, prev_ppr = NULL; va < eva;) { + ppr = rangeset_lookup(&pmap->pm_pkru, va); + if ((ppr == NULL) ^ (prev_ppr == NULL)) + return (false); + if (ppr == NULL) { + va += PAGE_SIZE; + continue; + } + if (prev_ppr->pkru_keyidx != ppr->pkru_keyidx) + return (false); + va = ppr->pkru_rs_el.re_end; + } + return (true); +} + +static pt_entry_t +pmap_pkru_get(pmap_t pmap, vm_offset_t va) +{ + struct pmap_pkru_range *ppr; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0 || + va >= VM_MAXUSER_ADDRESS) + return (0); + ppr = rangeset_lookup(&pmap->pm_pkru, va); + if (ppr != NULL) + return (X86_PG_PKU(ppr->pkru_keyidx)); + return (0); +} + +static bool +pred_pkru_on_remove(void *ctx __unused, void *r) +{ + struct pmap_pkru_range *ppr; + + ppr = r; + return ((ppr->pkru_flags & AMD64_PKRU_PERSIST) == 0); +} + +static void +pmap_pkru_on_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + rangeset_remove_pred(&pmap->pm_pkru, sva, eva, + pred_pkru_on_remove); + } +} + +static int +pmap_pkru_copy(pmap_t dst_pmap, pmap_t src_pmap) +{ + + PMAP_LOCK_ASSERT(dst_pmap, MA_OWNED); + PMAP_LOCK_ASSERT(src_pmap, MA_OWNED); + MPASS(dst_pmap->pm_type == PT_X86); + MPASS(src_pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + if (src_pmap->pm_pkru.rs_data_ctx == NULL) + return (0); + return (rangeset_copy(&dst_pmap->pm_pkru, &src_pmap->pm_pkru)); +} + +static void +pmap_pkru_update_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx) +{ + pml4_entry_t *pml4e; + pdp_entry_t *pdpe; + pd_entry_t newpde, ptpaddr, *pde; + pt_entry_t newpte, *ptep, pte; + vm_offset_t va, va_next; + bool changed; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS(keyidx <= PMAP_MAX_PKRU_IDX); + + for (changed = false, va = sva; va < eva; va = va_next) { + pml4e = pmap_pml4e(pmap, va); + if ((*pml4e & X86_PG_V) == 0) { + va_next = (va + NBPML4) & ~PML4MASK; + if (va_next < va) + va_next = eva; + continue; + } + + pdpe = pmap_pml4e_to_pdpe(pml4e, va); + if ((*pdpe & X86_PG_V) == 0) { + va_next = (va + NBPDP) & ~PDPMASK; + if (va_next < va) + va_next = eva; + continue; + } + + va_next = (va + NBPDR) & ~PDRMASK; + if (va_next < va) + va_next = eva; + + pde = pmap_pdpe_to_pde(pdpe, va); + ptpaddr = *pde; + if (ptpaddr == 0) + continue; + + MPASS((ptpaddr & X86_PG_V) != 0); + if ((ptpaddr & PG_PS) != 0) { + if (va + NBPDR == va_next && eva >= va_next) { + newpde = (ptpaddr & ~X86_PG_PKU_MASK) | + X86_PG_PKU(keyidx); + if (newpde != ptpaddr) { + *pde = newpde; + changed = true; + } + continue; + } else if (!pmap_demote_pde(pmap, pde, va)) { + continue; + } + } + + if (va_next > eva) + va_next = eva; + + for (ptep = pmap_pde_to_pte(pde, va); va != va_next; + ptep++, va += PAGE_SIZE) { + pte = *ptep; + if ((pte & X86_PG_V) == 0) + continue; + newpte = (pte & ~X86_PG_PKU_MASK) | X86_PG_PKU(keyidx); + if (newpte != pte) { + *ptep = newpte; + changed = true; + } + } + } + if (changed) + pmap_invalidate_range(pmap, sva, eva); +} + +static int +pmap_pkru_check_uargs(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx, int flags) +{ + + if (pmap->pm_type != PT_X86 || keyidx > PMAP_MAX_PKRU_IDX || + (flags & ~(AMD64_PKRU_PERSIST | AMD64_PKRU_EXCL)) != 0) + return (EINVAL); + if (eva <= sva || eva > VM_MAXUSER_ADDRESS) + return (EFAULT); + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0) + return (ENOTSUP); + return (0); +} + +int +pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, + int flags) +{ + int error; + + sva = trunc_page(sva); + eva = round_page(eva); + error = pmap_pkru_check_uargs(pmap, sva, eva, keyidx, flags); + if (error != 0) + return (error); + for (;;) { + PMAP_LOCK(pmap); + error = pmap_pkru_assign(pmap, sva, eva, keyidx, flags); + if (error == 0) + pmap_pkru_update_range(pmap, sva, eva, keyidx); + PMAP_UNLOCK(pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); +} + +int +pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + int error; + + sva = trunc_page(sva); + eva = round_page(eva); + error = pmap_pkru_check_uargs(pmap, sva, eva, 0, 0); + if (error != 0) + return (error); + for (;;) { + PMAP_LOCK(pmap); + error = pmap_pkru_deassign(pmap, sva, eva); + if (error == 0) + pmap_pkru_update_range(pmap, sva, eva, 0); + PMAP_UNLOCK(pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); } #include "opt_ddb.h" Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/sys_machdep.c Wed Feb 20 09:51:13 2019 (r344353) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* for kernel_map */ +#include #include #include @@ -170,13 +172,16 @@ update_gdt_fsbase(struct thread *td, uint32_t base) int sysarch(struct thread *td, struct sysarch_args *uap) { - int error = 0; - struct pcb *pcb = curthread->td_pcb; + struct pcb *pcb; + struct vm_map *map; uint32_t i386base; uint64_t a64base; struct i386_ioperm_args iargs; struct i386_get_xfpustate i386xfpu; + struct i386_set_pkru i386pkru; struct amd64_get_xfpustate a64xfpu; + struct amd64_set_pkru a64pkru; + int error; #ifdef CAPABILITY_MODE /* @@ -194,11 +199,15 @@ sysarch(struct thread *td, struct sysarch_args *uap) case I386_GET_GSBASE: case I386_SET_GSBASE: case I386_GET_XFPUSTATE: + case I386_SET_PKRU: + case I386_CLEAR_PKRU: case AMD64_GET_FSBASE: case AMD64_SET_FSBASE: case AMD64_GET_GSBASE: case AMD64_SET_GSBASE: case AMD64_GET_XFPUSTATE: + case AMD64_SET_PKRU: + case AMD64_CLEAR_PKRU: break; case I386_SET_IOPERM: @@ -214,6 +223,10 @@ sysarch(struct thread *td, struct sysarch_args *uap) if (uap->op == I386_GET_LDT || uap->op == I386_SET_LDT) return (sysarch_ldt(td, uap, UIO_USERSPACE)); + + error = 0; + pcb = td->td_pcb; + /* * XXXKIB check that the BSM generation code knows to encode * the op argument. @@ -233,11 +246,27 @@ sysarch(struct thread *td, struct sysarch_args *uap) a64xfpu.addr = (void *)(uintptr_t)i386xfpu.addr; a64xfpu.len = i386xfpu.len; break; + case I386_SET_PKRU: + case I386_CLEAR_PKRU: + if ((error = copyin(uap->parms, &i386pkru, + sizeof(struct i386_set_pkru))) != 0) + return (error); + a64pkru.addr = (void *)(uintptr_t)i386pkru.addr; + a64pkru.len = i386pkru.len; + a64pkru.keyidx = i386pkru.keyidx; + a64pkru.flags = i386pkru.flags; + break; case AMD64_GET_XFPUSTATE: if ((error = copyin(uap->parms, &a64xfpu, sizeof(struct amd64_get_xfpustate))) != 0) return (error); break; + case AMD64_SET_PKRU: + case AMD64_CLEAR_PKRU: + if ((error = copyin(uap->parms, &a64pkru, + sizeof(struct amd64_set_pkru))) != 0) + return (error); + break; default: break; } @@ -324,6 +353,34 @@ sysarch(struct thread *td, struct sysarch_args *uap) fpugetregs(td); error = copyout((char *)(get_pcb_user_save_td(td) + 1), a64xfpu.addr, a64xfpu.len); + break; + + case I386_SET_PKRU: + case AMD64_SET_PKRU: + /* + * Read-lock the map to synchronize with parallel + * pmap_vmspace_copy() on fork. + */ + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock_read(map); + error = pmap_pkru_set(PCPU_GET(curpmap), + (vm_offset_t)a64pkru.addr, (vm_offset_t)a64pkru.addr + + a64pkru.len, a64pkru.keyidx, a64pkru.flags); + vm_map_unlock_read(map); + break; + + case I386_CLEAR_PKRU: + case AMD64_CLEAR_PKRU: + if (a64pkru.flags != 0 || a64pkru.keyidx != 0) { + error = EINVAL; + break; + } + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock_read(map); + error = pmap_pkru_clear(PCPU_GET(curpmap), + (vm_offset_t)a64pkru.addr, + (vm_offset_t)a64pkru.addr + a64pkru.len); + vm_map_unlock(map); break; default: Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/trap.c Wed Feb 20 09:51:13 2019 (r344353) @@ -808,6 +808,20 @@ trap_pfault(struct trapframe *frame, int usermode) } /* + * User-mode protection key violation (PKU). May happen + * either from usermode or from kernel if copyin accessed + * key-protected mapping. + */ + if ((frame->tf_err & PGEX_PK) != 0) { + if (eva > VM_MAXUSER_ADDRESS) { + trap_fatal(frame, eva); + return (-1); + } + rv = KERN_PROTECTION_FAILURE; + goto after_vmfault; + } + + /* * If nx protection of the usermode portion of kernel page * tables caused trap, panic. */ @@ -842,6 +856,7 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } +after_vmfault: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) { Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -66,6 +66,7 @@ #define X86_PG_AVAIL2 0x400 /* < programmers use */ #define X86_PG_AVAIL3 0x800 /* \ */ #define X86_PG_PDE_PAT 0x1000 /* PAT PAT index */ +#define X86_PG_PKU(idx) ((pt_entry_t)idx << 59) #define X86_PG_NX (1ul<<63) /* No-execute */ #define X86_PG_AVAIL(x) (1ul << (x)) @@ -73,6 +74,10 @@ #define X86_PG_PDE_CACHE (X86_PG_PDE_PAT | X86_PG_NC_PWT | X86_PG_NC_PCD) #define X86_PG_PTE_CACHE (X86_PG_PTE_PAT | X86_PG_NC_PWT | X86_PG_NC_PCD) +/* Protection keys indexes */ +#define PMAP_MAX_PKRU_IDX 0xf +#define X86_PG_PKU_MASK X86_PG_PKU(PMAP_MAX_PKRU_IDX) + /* * Intel extended page table (EPT) bit definitions. */ @@ -120,7 +125,7 @@ * (PTE) page mappings have identical settings for the following fields: */ #define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_CACHE | \ - PG_M | PG_A | PG_U | PG_RW | PG_V) + PG_M | PG_A | PG_U | PG_RW | PG_V | PG_PKU_MASK) /* * Page Protection Exception bits @@ -242,6 +247,8 @@ #include #include #include +#include +#include #include @@ -336,6 +343,7 @@ struct pmap { long pm_eptgen; /* EPT pmap generation id */ int pm_flags; struct pmap_pcids pm_pcids[MAXCPU]; + struct rangeset pm_pkru; }; /* flags */ @@ -454,6 +462,10 @@ void pmap_pti_pcid_invalidate(uint64_t ucr3, uint64_t void pmap_pti_pcid_invlpg(uint64_t ucr3, uint64_t kcr3, vm_offset_t va); void pmap_pti_pcid_invlrng(uint64_t ucr3, uint64_t kcr3, vm_offset_t sva, vm_offset_t eva); +int pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx, int flags); +int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); #endif /* _KERNEL */ /* Return various clipped indexes for a given VA */ Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/arm/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -71,5 +71,12 @@ void pmap_kremove_device(vm_offset_t, vm_size_t); vm_paddr_t pmap_kextract(vm_offset_t); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/arm64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -171,6 +171,13 @@ struct pcb *pmap_switch(struct thread *, struct thread #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/i386/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -244,6 +244,13 @@ extern vm_offset_t virtual_end; #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + struct sf_buf; /* Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/mips/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -185,6 +185,13 @@ int pmap_emulate_modified(pmap_t pmap, vm_offset_t va) void pmap_page_set_memattr(vm_page_t, vm_memattr_t); int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/powerpc/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -288,6 +288,13 @@ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/riscv/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -166,6 +166,13 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/sparc64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -128,4 +128,11 @@ SYSCTL_DECL(_debug_pmap_stats); #endif +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/vm/vm_fault.c Wed Feb 20 09:51:13 2019 (r344353) @@ -481,8 +481,20 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro fault_flags, true); } VM_OBJECT_WUNLOCK(fs->first_object); - pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | (wired ? - PMAP_ENTER_WIRED : 0), psind); + rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | + (wired ? PMAP_ENTER_WIRED : 0), psind); +#if defined(__amd64__) + if (psind > 0 && rv == KERN_FAILURE) { + for (i = 0; i < npages; i++) { + rv = pmap_enter(fs->map->pmap, vaddr + ptoa(i), + &m[i], prot, fault_type | + (wired ? PMAP_ENTER_WIRED : 0), 0); + MPASS(rv == KERN_SUCCESS); + } + } +#else + MPASS(rv == KERN_SUCCESS); +#endif VM_OBJECT_WLOCK(fs->first_object); m_mtx = NULL; for (i = 0; i < npages; i++) { Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/vm/vm_map.c Wed Feb 20 09:51:13 2019 (r344353) @@ -3544,7 +3544,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c vm_map_t new_map, old_map; vm_map_entry_t new_entry, old_entry; vm_object_t object; - int locked; + int error, locked; vm_inherit_t inh; old_map = &vm1->vm_map; @@ -3553,6 +3553,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c pmap_pinit); if (vm2 == NULL) return (NULL); + vm2->vm_taddr = vm1->vm_taddr; vm2->vm_daddr = vm1->vm_daddr; vm2->vm_maxsaddr = vm1->vm_maxsaddr; @@ -3563,7 +3564,17 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c locked = vm_map_trylock(new_map); /* trylock to silence WITNESS */ KASSERT(locked, ("vmspace_fork: lock failed")); + error = pmap_vmspace_copy(new_map->pmap, old_map->pmap); + if (error != 0) { + sx_xunlock(&old_map->lock); + sx_xunlock(&new_map->lock); + vm_map_process_deferred(); + vmspace_free(vm2); + return (NULL); + } + new_map->anon_loc = old_map->anon_loc; + old_entry = old_map->header.next; while (old_entry != &old_map->header) { Modified: head/sys/x86/include/sysarch.h ============================================================================== --- head/sys/x86/include/sysarch.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/x86/include/sysarch.h Wed Feb 20 09:51:13 2019 (r344353) @@ -52,6 +52,8 @@ #define I386_GET_GSBASE 9 #define I386_SET_GSBASE 10 #define I386_GET_XFPUSTATE 11 +#define I386_SET_PKRU 12 +#define I386_CLEAR_PKRU 13 /* Leave space for 0-127 for to avoid translating syscalls */ #define AMD64_GET_FSBASE 128 @@ -59,7 +61,13 @@ #define AMD64_GET_GSBASE 130 #define AMD64_SET_GSBASE 131 #define AMD64_GET_XFPUSTATE 132 +#define AMD64_SET_PKRU 133 +#define AMD64_CLEAR_PKRU 134 +/* Flags for AMD64_SET_PKRU */ +#define AMD64_PKRU_EXCL 0x0001 +#define AMD64_PKRU_PERSIST 0x0002 + struct i386_ioperm_args { unsigned int start; unsigned int length; @@ -94,11 +102,25 @@ struct i386_get_xfpustate { int len; }; +struct i386_set_pkru { + unsigned int addr; + unsigned int len; + unsigned int keyidx; + int flags; +}; + struct amd64_get_xfpustate { void *addr; int len; }; #endif + +struct amd64_set_pkru { + void *addr; + unsigned long len; + unsigned int keyidx; + int flags; +}; #ifndef _KERNEL union descriptor; From owner-svn-src-head@freebsd.org Wed Feb 20 09:56:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7510E14ED343; Wed, 20 Feb 2019 09:56: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 10C246FD43; Wed, 20 Feb 2019 09:56: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 0529E3C57; Wed, 20 Feb 2019 09:56: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 x1K9uOQD005113; Wed, 20 Feb 2019 09:56:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9uNv1005105; Wed, 20 Feb 2019 09:56:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200956.x1K9uNv1005105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344354 - in head: lib/libc/amd64 lib/libc/i386 lib/libc/x86/sys sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/amd64 lib/libc/i386 lib/libc/x86/sys sys/x86/include X-SVN-Commit-Revision: 344354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10C246FD43 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 09:56:25 -0000 Author: kib Date: Wed Feb 20 09:56:23 2019 New Revision: 344354 URL: https://svnweb.freebsd.org/changeset/base/344354 Log: Add usermode helpers for for Intel userspace protection keys feature. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Added: head/lib/libc/x86/sys/pkru.c (contents, props changed) Modified: head/lib/libc/amd64/Symbol.map head/lib/libc/i386/Symbol.map head/lib/libc/x86/sys/Makefile.inc head/sys/x86/include/sysarch.h Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/amd64/Symbol.map Wed Feb 20 09:56:23 2019 (r344354) @@ -44,6 +44,13 @@ FBSD_1.0 { vfork; }; +FBSD_1.6 { + x86_pkru_get_perm; + x86_pkru_set_perm; + x86_pkru_protect_range; + x86_pkru_unprotect_range; +}; + /* * * FreeBSD private ABI Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/i386/Symbol.map Wed Feb 20 09:56:23 2019 (r344354) @@ -46,6 +46,13 @@ FBSD_1.0 { ___tls_get_addr; }; +FBSD_1.6 { + x86_pkru_get_perm; + x86_pkru_set_perm; + x86_pkru_protect_range; + x86_pkru_unprotect_range; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ _getlogin; Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:56:23 2019 (r344354) @@ -3,7 +3,8 @@ .PATH: ${LIBC_SRCTOP}/x86/sys SRCS+= \ - __vdso_gettc.c + __vdso_gettc.c \ + pkru.c .if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV Added: head/lib/libc/x86/sys/pkru.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/pkru.c Wed Feb 20 09:56:23 2019 (r344354) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#define MAX_PKRU_IDX 0xf +#ifdef __i386__ +#define X86_SET_PKRU I386_SET_PKRU +#define X86_CLEAR_PKRU I386_CLEAR_PKRU +#else +#define X86_SET_PKRU AMD64_SET_PKRU +#define X86_CLEAR_PKRU AMD64_CLEAR_PKRU +#endif + +static int +x86_pkru_get_perm_unsup(u_int keyidx, int *access, int *modify) +{ + + errno = EOPNOTSUPP; + return (-1); +} + +static int +x86_pkru_get_perm_hw(u_int keyidx, int *access, int *modify) +{ + uint32_t pkru; + + if (keyidx > MAX_PKRU_IDX) { + errno = EINVAL; + return (-1); + } + keyidx *= 2; + pkru = rdpkru(); + *access = (pkru & (1 << keyidx)) == 0; + *modify = (pkru & (2 << keyidx)) == 0; + return (0); +} + +DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *), static) +{ + + return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? + x86_pkru_get_perm_unsup : x86_pkru_get_perm_hw); +} + +static int +x86_pkru_set_perm_unsup(u_int keyidx, int access, int modify) +{ + + errno = EOPNOTSUPP; + return (-1); +} + +static int +x86_pkru_set_perm_hw(u_int keyidx, int access, int modify) +{ + uint32_t pkru; + + if (keyidx > MAX_PKRU_IDX) { + errno = EINVAL; + return (-1); + } + keyidx *= 2; + pkru = rdpkru(); + pkru &= ~(3 << keyidx); + if (!access) + pkru |= 1 << keyidx; + if (!modify) + pkru |= 2 << keyidx; + wrpkru(pkru); + return (0); +} + +DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int), static) +{ + + return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? + x86_pkru_set_perm_unsup : x86_pkru_set_perm_hw); +} + +int +x86_pkru_protect_range(void *addr, unsigned long len, u_int keyidx, int flags) +{ + struct amd64_set_pkru a64pkru; + + memset(&a64pkru, 0, sizeof(a64pkru)); + a64pkru.addr = addr; + a64pkru.len = len; + a64pkru.keyidx = keyidx; + a64pkru.flags = flags; + return (sysarch(X86_SET_PKRU, &a64pkru)); +} + +int +x86_pkru_unprotect_range(void *addr, unsigned long len) +{ + struct amd64_set_pkru a64pkru; + + memset(&a64pkru, 0, sizeof(a64pkru)); + a64pkru.addr = addr; + a64pkru.len = len; + return (sysarch(X86_CLEAR_PKRU, &a64pkru)); +} Modified: head/sys/x86/include/sysarch.h ============================================================================== --- head/sys/x86/include/sysarch.h Wed Feb 20 09:51:13 2019 (r344353) +++ head/sys/x86/include/sysarch.h Wed Feb 20 09:56:23 2019 (r344354) @@ -142,6 +142,11 @@ int amd64_get_fsbase(void **); int amd64_get_gsbase(void **); int amd64_set_fsbase(void *); int amd64_set_gsbase(void *); +int x86_pkru_get_perm(unsigned int keyidx, int *access, int *modify); +int x86_pkru_set_perm(unsigned int keyidx, int access, int modify); +int x86_pkru_protect_range(void *addr, unsigned long len, unsigned int keyidx, + int flag); +int x86_pkru_unprotect_range(void *addr, unsigned long len); int sysarch(int, void *); __END_DECLS #else From owner-svn-src-head@freebsd.org Wed Feb 20 10:03:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B985414ED888; Wed, 20 Feb 2019 10:03:04 +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 54F1370397; Wed, 20 Feb 2019 10:03:04 +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 0BB803DFD; Wed, 20 Feb 2019 10:03:04 +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 x1KA33VO010103; Wed, 20 Feb 2019 10:03:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KA33li010101; Wed, 20 Feb 2019 10:03:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902201003.x1KA33li010101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 10:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344355 - head/lib/libc/x86/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/x86/sys X-SVN-Commit-Revision: 344355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54F1370397 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 10:03:05 -0000 Author: kib Date: Wed Feb 20 10:03:03 2019 New Revision: 344355 URL: https://svnweb.freebsd.org/changeset/base/344355 Log: pkru(3) man page. Reviewed by: alc, markj, jilles With more input from: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19211 Added: head/lib/libc/x86/sys/pkru.3 (contents, props changed) Modified: head/lib/libc/x86/sys/Makefile.inc Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:56:23 2019 (r344354) +++ head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 10:03:03 2019 (r344355) @@ -6,6 +6,9 @@ SRCS+= \ __vdso_gettc.c \ pkru.c +MAN+= \ + pkru.3 + .if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV .endif Added: head/lib/libc/x86/sys/pkru.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/pkru.3 Wed Feb 20 10:03:03 2019 (r344355) @@ -0,0 +1,206 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 16, 2019 +.Dt PKRU 3 +.Os +.Sh NAME +.Nm Protection Key Rights for User pages +.Nd provide fast user-managed key-based access control for pages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In machine/sysarch.h +.Ft int +.Fn x86_pkru_get_perm "unsigned int keyidx" "int *access" "int *modify" +.Ft int +.Fn x86_pkru_set_perm "unsigned int keyidx" "int access" "int modify" +.Ft int +.Fo x86_pkru_protect_range +.Fa "void *addr" +.Fa "unsigned long len" +.Fa "unsigned int keyidx" +.Fa "int flag" +.Fc +.Ft int +.Fn x86_pkru_unprotect_range "void *addr" "unsigned long len" +.Sh DESCRIPTION +The protection keys feature provides an additional mechanism, besides the +normal page permissions as established by +.Xr mmap 2 +and +.Xr mprotect 2 , +to control access to user-mode addresses. +The mechanism gives safety measures which can be used to avoid +incidental read or modification of sensitive memory, +or as a debugging feature. +It cannot guard against conscious accesses since permissions +are user-controllable. +.Pp +If supported by hardware, each mapped user linear address +has an associated 4-bit protection key. +A new per-thread PKRU hardware register determines, for each protection +key, whether user-mode addresses with that protection key may be +read or written. +.Pp +Only one key may apply to a given range at a time. +The default protection key index is zero, it is used even if no key +was explicitly assigned to the address, or if the key was removed. +.Pp +The protection prevents the system from accessing user addresses as well +as the user applications. +When a system call was unable to read or write user memory due to key +protection, it returns the +.Er EFAULT +error code. +Note that some side effects may have occurred if this error is reported. +.Pp +Protection keys require that the system uses 4-level paging +(also called long mode), +which means that it is only available on amd64 system. +Both 64-bit and 32-bit applications can use protection keys. +More information about the hardware feature is provided in the IA32 Software +Developer's Manual published by Intel Corp. +.Pp +The key indexes written into the page table entries are managed by the +.Fn sysarch +syscall. +Per-key permissions are managed using the user-mode instructions +.Em RDPKRU +and +.Em WRPKRU. +The system provides convenient library helpers for both the syscall and +the instructions, described below. +.Pp +The +.Fn x86_pkru_protect_range +function assigns key +.Fa keyidx +to the range starting at +.Fa addr +and having length +.Fa len . +Starting address is truncated to the page start, +and the end is rounded up to the end of the page. +After a successfull call, the range has the specified key assigned, +even if the key is zero and it did not change the page table entries. +.Pp +The +.Fa flags +argument takes the logical OR of the following values: +.Bl -tag -width +.It Bq Va AMD64_PKRU_EXCL +Only assign the key if the range does not have any other keys assigned +(including the zero key). +You must first remove any existing key with +.Fn x86_pkru_unprotect_range +in order for this request to succeed. +If the +.Va AMD64_PKRU_EXCL +flag is not specified, +.Fn x86_pkru_protect_range +replaces any existing key. +.It Bq Va AMD64_PKRU_PERSIST +The keys assigned to the range are persistent. +They are re-established when the current mapping is destroyed +and a new mapping is created in any sub-range of the specified range. +You must use a +.Fn x86_pkru_unprotect_range +call to forget the key. +.El +.Pp +The +.Fn x86_pkru_unprotect_range +function removes any keys assigned to the specified range. +Existing mappings are changed to use key index zero in page table entries. +Keys are no longer considered installed for all mappings in the range, +for the purposes of +.Fn x86_pkru_protect_range +with the +.Va AMD64_PKRU_EXCL +flag. +.Pp +The +.Fn x86_pkru_get_perm +function returns access rights for the key specified by the +.Fn keyidx +argument. +If the value pointed to by +.Fa access +is zero after the call, no read or write permissions is granted for +mappings which are assigned the key +.Fn keyidx . +If +.Fa access +is not zero, read access is permitted. +The non-zero value of the variable pointed to by the +.Fa modify +argument indicates that write access is permitted. +.Pp +Conversely, the +.Fn x86_pkru_set_perm +establishes the access and modify permissions for the given key index +as specified by its arguments. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EOPNOTSUPP +The hardware does not support protection keys. +.It Bq Er EINVAL +The supplied key index is invalid (greater than 15). +.It Bq Er EINVAL +The supplied +.Fa flags +argument for +.Fn x86_pkru_protect_range +has reserved bits set. +.It Bq Er EFAULT +The supplied address range does not completely fit into the user-managed +address range. +.It Bq Er ENOMEM +The memory shortage prevents the completion of the operation. +.It Bq Er EBUSY +The +.Va AMD64_PKRU_EXCL +flag was specified for +.Fn x86_pkru_protect_range +and the range already has defined protection keys. +.El +.Sh SEE ALSO +.Xr mmap 2 , +.Xr mprotect 2 , +.Xr munmap 2 , +.Xr sysarch 2 . +.Sh STANDARDS +The +.Nm +functions are non-standard and first appeared in +.Fx 13.0 . From owner-svn-src-head@freebsd.org Wed Feb 20 13:19:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 437CC14F3E2E; Wed, 20 Feb 2019 13:19:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB23A77396; Wed, 20 Feb 2019 13:19:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF57F5F3B; Wed, 20 Feb 2019 13:19:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KDJ8Td011376; Wed, 20 Feb 2019 13:19:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDJ82E011375; Wed, 20 Feb 2019 13:19:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201319.x1KDJ82E011375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344359 - head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 344359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB23A77396 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 13:19:09 -0000 Author: avg Date: Wed Feb 20 13:19:08 2019 New Revision: 344359 URL: https://svnweb.freebsd.org/changeset/base/344359 Log: fix userland illumos taskq code to pass relative timeout to cv_timedwait Unlike illumos, FreeBSD cv_timedwait requires a relative timeout. That applies both to the kernel illumos compatibility code and to the userland "fake kernel" code. MFC after: 2 weeks Sponsored by: Panzura Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Feb 20 11:58:40 2019 (r344358) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Feb 20 13:19:08 2019 (r344359) @@ -79,8 +79,13 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nal * immediately retry the allocation. */ tq->tq_maxalloc_wait++; +#ifdef __FreeBSD__ rv = cv_timedwait(&tq->tq_maxalloc_cv, + &tq->tq_lock, hz); +#else + rv = cv_timedwait(&tq->tq_maxalloc_cv, &tq->tq_lock, ddi_get_lbolt() + hz); +#endif tq->tq_maxalloc_wait--; if (rv > 0) goto again; /* signaled */ From owner-svn-src-head@freebsd.org Wed Feb 20 13:34:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096E014F461F; Wed, 20 Feb 2019 13:34:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1BC577F1A; Wed, 20 Feb 2019 13:34:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9550162AC; Wed, 20 Feb 2019 13:34:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KDYGs0021297; Wed, 20 Feb 2019 13:34:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDYGLU021296; Wed, 20 Feb 2019 13:34:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201334.x1KDYGLU021296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344360 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 344360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1BC577F1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 13:34:17 -0000 Author: avg Date: Wed Feb 20 13:34:16 2019 New Revision: 344360 URL: https://svnweb.freebsd.org/changeset/base/344360 Log: zpool.8: document -D flag for zpool status The description is taken from the illumos manual. Reported by: stilezy@gmail.com MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:19:08 2019 (r344359) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:34:16 2019 (r344360) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2018 +.Dd February 20, 2019 .Dt ZPOOL 8 .Os .Sh NAME @@ -187,7 +187,7 @@ .Op Ar device ... .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1862,7 +1862,7 @@ section, above, for more information on the available .It Xo .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1891,6 +1891,12 @@ done and the estimated time to completion. Both of the because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent +.It Fl D +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. From owner-svn-src-head@freebsd.org Wed Feb 20 13:37:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D51F14F46E7; Wed, 20 Feb 2019 13:37:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43E4800A3; Wed, 20 Feb 2019 13:37:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B821A62AE; Wed, 20 Feb 2019 13:37:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KDbRS4021473; Wed, 20 Feb 2019 13:37:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDbR8T021472; Wed, 20 Feb 2019 13:37:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201337.x1KDbR8T021472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344361 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 344361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C43E4800A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 13:37:28 -0000 Author: avg Date: Wed Feb 20 13:37:27 2019 New Revision: 344361 URL: https://svnweb.freebsd.org/changeset/base/344361 Log: zpool.8: sort zpool status flags in the same order as in illumos manual Just in case, while I was here. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:34:16 2019 (r344360) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:37:27 2019 (r344361) @@ -1897,14 +1897,6 @@ Display a histogram of deduplication statistics, showi and referenced .Pq logically referenced in the pool block counts and sizes by reference count. -.It Fl x -Only display status for pools that are exhibiting errors or are otherwise -unavailable. -Warnings about pools not using the latest on-disk format, having non-native -block size or disabled features will not be included. -.It Fl v -Displays verbose data error information, printing out a complete list of all -data errors since the last complete pool scrub. .It Fl T Cm d Ns | Ns Cm u Print a timestamp. .Pp @@ -1916,6 +1908,14 @@ Use modifier .Cm u for unixtime .Pq equals Qq Ic date +%s . +.It Fl v +Displays verbose data error information, printing out a complete list of all +data errors since the last complete pool scrub. +.It Fl x +Only display status for pools that are exhibiting errors or are otherwise +unavailable. +Warnings about pools not using the latest on-disk format, having non-native +block size or disabled features will not be included. .El .It Xo .Nm From owner-svn-src-head@freebsd.org Wed Feb 20 14:41:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F2714F5F0E; Wed, 20 Feb 2019 14:41:02 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::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 EF27B83BCE; Wed, 20 Feb 2019 14:41:01 +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 x1KEenbR051781 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Feb 2019 15:40:52 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: markj@FreeBSD.org Received: from [10.58.0.4] (dadv@[10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x1KEemeQ053013 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 20 Feb 2019 21:40:48 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r344305 - head/sys/geom To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902192122.x1JLMMPM012400@repo.freebsd.org> From: Eugene Grosbein Message-ID: <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> Date: Wed, 20 Feb 2019 21:40:45 +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: <201902192122.x1JLMMPM012400@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,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_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: EF27B83BCE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 14:41:02 -0000 20.02.2019 4:22, Mark Johnston wrote: > Author: markj > Date: Tue Feb 19 21:22:22 2019 > New Revision: 344305 > URL: https://svnweb.freebsd.org/changeset/base/344305 > > Log: > Impose a limit on the number of GEOM_CTL arguments. > > Otherwise a privileged user can trigger a memory allocation of > unbounded size, or an integer overflow in the subsequent > geom_alloc_copyin() call, leading to out-of-bounds accesses. > > Hard-code a large limit to circumvent this problem. > > admbug: 854 > Reported by: Anonymous of the Shellphish Grill Team > Reviewed by: ae > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D19251 > > Modified: > head/sys/geom/geom_ctl.c > > Modified: head/sys/geom/geom_ctl.c > ============================================================================== > --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) > +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) > @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) > char *p; > u_int i; > > + if (req->narg > 2048) { > + gctl_error(req, "too many arguments"); > + req->arg = NULL; > + return; > + } > + Could you replace magic constant 2048 with #define symbol, please? Something like GEOM_ARG_MAX in sys/sys/limits.h or similar. From owner-svn-src-head@freebsd.org Wed Feb 20 15:49:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99AB514F73F8; Wed, 20 Feb 2019 15:49:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12f.google.com (mail-it1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261AE85E38; Wed, 20 Feb 2019 15:49:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12f.google.com with SMTP id m137so16343424ita.0; Wed, 20 Feb 2019 07:49:36 -0800 (PST) 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=fUeKgPvIGKBs5XRqbXsROWyu1zlrXO6f5tx/FXikIPU=; b=Vb3+J5ShX017druqg76Hq+uPWC0yDC983VbdmxqcqyRAarLPipCHXJ/eBAvKGDvuST TUsYkb2rs7euaDdHertAerua3VsKp2BKVojmsUcruOziO4l2kbYQCPU9UpGn5Ajdd1fc rKydqlMp29Puv4nYekvHMwTGLe38FZAO1KuSf9nvdBZUCwAkaboUoCRVIz2hEd/BKd3v hs/FyG/PZjNygngS8HVKSC73tSmk4Dy4HTi4avPv1LPSIaJcehtEeHnmgvxNjUjhLlp6 o2cvfiL/bdMEqVbT5XyjSho9BjwuWm79B6MpZ8komENqyxXODEA36Z5yzZezWSIqgkuA LTsQ== 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=fUeKgPvIGKBs5XRqbXsROWyu1zlrXO6f5tx/FXikIPU=; b=V087tuOBGEUCeu0Wgz/ZN/timjuWSk4Y0s6v6OhfyFXA1AybNglfAS/huvwAkEkN9v xUg3FH3K5uB7//mETcmJ2Wx559+Lmal8EJFkGjchL9yX/8eHGzum8uteBdcQ7dRRgA/F +FOky/QPCnSgBPqpt/a65RsboSXwRPakEdIcLAUYxNzpCwbncgiLhDc/bg2kREx6MVrA hcgugNuKNT7uImZhbo2qMMrVQX7IqjxoyGfvj6OXmM64+1WB1/dNdsoZJSZfyiIPdYvl f4x00IQsb8UWFiofINrNpBClVqvQ9qEzBJXCbnxNZdksuAOF00fT3suA3kNs3xd41/Jw YVHw== X-Gm-Message-State: AHQUAuabhwPvpgR6opG+EcqLiYD6HLgEhUQ5vqZvmjREuzlDdglkOJpF DdwLt521Kzm8czsu2nzJSkQsjyHa X-Google-Smtp-Source: AHgI3IbrPivTML4VqUloWSZZmhSkEFVGqg22o2MiKXWMfvfQ7ZWNvEQOgPyLQPQk4Ri1j3TEduuqIA== X-Received: by 2002:a6b:7405:: with SMTP id s5mr19443018iog.1.1550677775437; Wed, 20 Feb 2019 07:49:35 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-36-102.dsl.bell.ca. [69.159.36.102]) by smtp.gmail.com with ESMTPSA id a16sm2994748itc.27.2019.02.20.07.49.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 07:49:34 -0800 (PST) Sender: Mark Johnston Date: Wed, 20 Feb 2019 10:49:29 -0500 From: Mark Johnston To: Eugene Grosbein Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344305 - head/sys/geom Message-ID: <20190220154929.GA6605@raichu> References: <201902192122.x1JLMMPM012400@repo.freebsd.org> <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 261AE85E38 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 15:49:36 -0000 On Wed, Feb 20, 2019 at 09:40:45PM +0700, Eugene Grosbein wrote: > 20.02.2019 4:22, Mark Johnston wrote: > > > Author: markj > > Date: Tue Feb 19 21:22:22 2019 > > New Revision: 344305 > > URL: https://svnweb.freebsd.org/changeset/base/344305 > > > > Log: > > Impose a limit on the number of GEOM_CTL arguments. > > > > Otherwise a privileged user can trigger a memory allocation of > > unbounded size, or an integer overflow in the subsequent > > geom_alloc_copyin() call, leading to out-of-bounds accesses. > > > > Hard-code a large limit to circumvent this problem. > > > > admbug: 854 > > Reported by: Anonymous of the Shellphish Grill Team > > Reviewed by: ae > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D19251 > > > > Modified: > > head/sys/geom/geom_ctl.c > > > > Modified: head/sys/geom/geom_ctl.c > > ============================================================================== > > --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) > > +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) > > @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) > > char *p; > > u_int i; > > > > + if (req->narg > 2048) { > > + gctl_error(req, "too many arguments"); > > + req->arg = NULL; > > + return; > > + } > > + > > Could you replace magic constant 2048 with #define symbol, please? > Something like GEOM_ARG_MAX in sys/sys/limits.h or similar. Sure. Here is the proposed diff: https://reviews.freebsd.org/D19271 From owner-svn-src-head@freebsd.org Wed Feb 20 16:09:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FBC14F7AED; Wed, 20 Feb 2019 16:09:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 25CB186957; Wed, 20 Feb 2019 16:09:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1KG93f3015883; Wed, 20 Feb 2019 08:09:03 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1KG92wk015882; Wed, 20 Feb 2019 08:09:02 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902201609.x1KG92wk015882@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev Date: Wed, 20 Feb 2019 08:09:02 -0800 (PST) CC: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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: 25CB186957 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 16:09:05 -0000 > On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > > At the risk of painting a bikeshed a lovely color of neon purple, I'm > > curious about if/how these types of commits get merged upstream to > > (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > > confused|is anyone else confused where upstream is?). > > > > Who is upstream? Is work like this going to remain as a downstream > > patch to ZFS? Or is FreeBSD going to work to upstream this type of > > work? > > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're talking > about ZFS on fucking Linux becoming our upstream. Something'd got very > wrong here and I'd like to know what and why. I think to answer why ZoL wins out over ZoF in the upstream selection is that ZoL has many more people working on it than does ZoF so they innovate much faster than us, that makes them a good choose in the since that developement moves faster. I do, like many, have reservations about other aspects perhaps not making this an ideal, but if ZoL develope a good developement model, they well kick ass over anything the FreeBSD project could ever do with ZFS. Like it or not, they have a larger critical mass than us, and that wins in the end game. Also since we did choose to be downstream from illumous that put is in the follow mode in many aspects, so we did not grow a bunch of ZFS developers, where as the ZoL project kinda grabbed the code and went full tilt with it, not totally ignoring upstream, but also not letting upstream stifle there efforts. > > > I hope my curiousity doesn't offend anyone. ;) > Not at all, I'm also confused and curious. Now running a ZoL instance just so I can get use to its look and feel and see how if at all it plays along with ZoF. > ./danfe -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 20 17:01:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2188014F9416; Wed, 20 Feb 2019 17:01:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 895CE88A92; Wed, 20 Feb 2019 17:01:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x642.google.com with SMTP id o6so12507080pls.13; Wed, 20 Feb 2019 09:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3DIvoqLjGNzcOMVoO9eW0jvDwwa9c4MzkdDak4uF3tI=; b=Rqj5zhysFezLIicSBui94V6oizcwwuvoUw3lYlRxQOtaPAeerAGd+nfiThNqUZflVB FGEKBdwESP1VDHyuTv4ZX/Zo7PtSqv12mbfIjTEVi4YC6yi+sHF/TMi//HA5WKxoog6w mczCCpav8kAMgnGw4Cbv0p7CaSsLyAcPCjzSeTcaxpf9ETciL9PN1IiA2BqGnmy4L999 4dOAxOFH4y58tocfA1KqBpqYIrDKRf1FTKvB54VBimblVcp/PoP/fECQ/PcONOkAAnJi PUWE4bNrnVdGN3C5u8pjskayv8+J8OEUvptA20k1B99TOXwsGuFcOM/TVisFvPetxV+x bcmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3DIvoqLjGNzcOMVoO9eW0jvDwwa9c4MzkdDak4uF3tI=; b=ZaRPwdVqdDfjPz42Pb1DRVVTzOeGM+twY+XONp7iBi7G+4AtLN8h/y+GFtdBnQKec2 nK/0sKAARXnEhe3oSFNWT0UjLCPJULpAHIolz7W1JtikNIbK1qK4LRsc7pY5Oe1/tiBW EkmcReBZXI2LShOKFihM52OEVgrUr+wcLBmpNNM2D//bDShH5STTASvSOCA26EA7SPof GYhKgR1kzLGN+d6871heJdo9G5T6ZLTJ2Tq1AAPsXn4YPBqA3EWdrgYUV5whKldTM9IJ +im4mkBnoaGnr2LXq52MecSXvD2PjGjArOX0DVBO3Apw5moBxmnUc0WoYn7IMuR9+nJ6 AT1g== X-Gm-Message-State: AHQUAuaZ69ECGK1zIQGfydIdt7mK3cLdS2QdMS8F19CJMx1nnuvj59UB vgEBaUOfuIv5/zL7guyIp3g9K9SR X-Google-Smtp-Source: AHgI3IZZqQiQNNfoqd7TIIPsZmx/NmZG51Q1yK/HGzaYgrU1lWYQCsm3VEANtJYYd42lfyFgYzIo1w== X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr38535553plk.309.1550682115176; Wed, 20 Feb 2019 09:01:55 -0800 (PST) Received: from [10.0.4.87] (173-160-198-249-Washington.hfc.comcastbusiness.net. [173.160.198.249]) by smtp.gmail.com with ESMTPSA id k7sm13668406pgr.28.2019.02.20.09.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 09:01:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <20190220075613.GC84455@FreeBSD.org> Date: Wed, 20 Feb 2019 09:01:53 -0800 Cc: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev X-Rspamd-Queue-Id: 895CE88A92 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 17:01:57 -0000 > On Feb 19, 2019, at 23:56, Alexey Dokuchaev wrote: >=20 >> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >> At the risk of painting a bikeshed a lovely color of neon purple, I'm >> curious about if/how these types of commits get merged upstream to >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very >> confused|is anyone else confused where upstream is?). >>=20 >> Who is upstream? Is work like this going to remain as a downstream >> patch to ZFS? Or is FreeBSD going to work to upstream this type of >> work? >=20 > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're talking > about ZFS on fucking Linux becoming our upstream. Something'd got very > wrong here and I'd like to know what and why. As others have pointed out, FreeBSD has less developer inertia than Linux, a= nd there are (seemingly) less developers or interested parties in running an= openindiana based stack. Also: better OS support for other general purpose infrastructure/usecases wi= th items like multitenancy via containerization/CGroups2, Java, etc, and min= dshare around this and other things. The only thing really holding ZoL back in Linux is the fact that (due to lic= ensing) it won=E2=80=99t ever be in the Linux kernel. -Enji= From owner-svn-src-head@freebsd.org Wed Feb 20 17:07:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F17F14F96ED; Wed, 20 Feb 2019 17:07:09 +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 0BD3A8910F; Wed, 20 Feb 2019 17:07:09 +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 EB72A863C; Wed, 20 Feb 2019 17:07:08 +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 x1KH78oq040263; Wed, 20 Feb 2019 17:07:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KH78nd040260; Wed, 20 Feb 2019 17:07:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201707.x1KH78nd040260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 17:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344365 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BD3A8910F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 17:07:09 -0000 Author: markj Date: Wed Feb 20 17:07:08 2019 New Revision: 344365 URL: https://svnweb.freebsd.org/changeset/base/344365 Log: Define a constant for the maximum number of GEOM_CTL arguments. Reviewed by: eugen MFC with: r344305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19271 Modified: head/sys/geom/geom_ctl.c head/sys/geom/geom_ctl.h Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Wed Feb 20 17:05:13 2019 (r344364) +++ head/sys/geom/geom_ctl.c Wed Feb 20 17:07:08 2019 (r344365) @@ -139,7 +139,7 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; - if (req->narg > 2048) { + if (req->narg > GEOM_CTL_ARG_MAX) { gctl_error(req, "too many arguments"); req->arg = NULL; return; Modified: head/sys/geom/geom_ctl.h ============================================================================== --- head/sys/geom/geom_ctl.h Wed Feb 20 17:05:13 2019 (r344364) +++ head/sys/geom/geom_ctl.h Wed Feb 20 17:07:08 2019 (r344365) @@ -78,7 +78,8 @@ struct gctl_req { #define GEOM_CTL _IOW('G', GCTL_VERSION, struct gctl_req) -#define PATH_GEOM_CTL "geom.ctl" +#define GEOM_CTL_ARG_MAX 2048 /* maximum number of parameters */ +#define PATH_GEOM_CTL "geom.ctl" #endif /* _GEOM_GEOM_CTL_H_ */ From owner-svn-src-head@freebsd.org Wed Feb 20 17:10:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A75814F985C; Wed, 20 Feb 2019 17:10:31 +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 2804F893EA; Wed, 20 Feb 2019 17:10:31 +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 1893E8643; Wed, 20 Feb 2019 17:10:31 +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 x1KHAUgt040859; Wed, 20 Feb 2019 17:10:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KHAUgP040858; Wed, 20 Feb 2019 17:10:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201710.x1KHAUgP040858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 17:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344366 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 344366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2804F893EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 17:10:31 -0000 Author: markj Date: Wed Feb 20 17:10:30 2019 New Revision: 344366 URL: https://svnweb.freebsd.org/changeset/base/344366 Log: MFV r344364: 9058 postmortem DTrace frequently broken under vmware illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:07:08 2019 (r344365) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:10:30 2019 (r344366) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -3040,9 +3040,6 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; timestamp = dt_buf_oldest(buf, dtp); - assert(timestamp >= dtp->dt_last_timestamp); - dtp->dt_last_timestamp = timestamp; - if (timestamp == buf->dtbd_timestamp) { /* * We've reached the end of the time covered @@ -3056,6 +3053,8 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; continue; } + assert(timestamp >= dtp->dt_last_timestamp); + dtp->dt_last_timestamp = timestamp; if ((rval = dt_consume_cpu(dtp, fp, buf->dtbd_cpu, buf, B_TRUE, pf, rf, arg)) != 0) From owner-svn-src-head@freebsd.org Wed Feb 20 17:11:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B7A14F9A4C; Wed, 20 Feb 2019 17:11:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 3F8BB89788; Wed, 20 Feb 2019 17:11:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1KHBeLC016159; Wed, 20 Feb 2019 09:11:40 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1KHBeiQ016158; Wed, 20 Feb 2019 09:11:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> To: Enji Cooper Date: Wed, 20 Feb 2019 09:11:40 -0800 (PST) CC: Alexey Dokuchaev , Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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: 3F8BB89788 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 17:11:44 -0000 > > On Feb 19, 2019, at 23:56, Alexey Dokuchaev wrote: > > > >> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > >> At the risk of painting a bikeshed a lovely color of neon purple, I'm > >> curious about if/how these types of commits get merged upstream to > >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > >> confused|is anyone else confused where upstream is?). > >> > >> Who is upstream? Is work like this going to remain as a downstream > >> patch to ZFS? Or is FreeBSD going to work to upstream this type of > >> work? > > > > I've always felt that we should've become upstream to everyone else > > the moment we knew Oracle would eat Sun (20 April 2009), and never > > understood why it didn't happen and now, ten years later, we're talking > > about ZFS on fucking Linux becoming our upstream. Something'd got very > > wrong here and I'd like to know what and why. > > As others have pointed out, FreeBSD has less developer inertia than Linux, > and there are (seemingly) less developers or interested parties in running > an openindiana based stack. > > Also: better OS support for other general purpose infrastructure/usecases > with items like multitenancy via containerization/CGroups2, Java, etc, > and mindshare around this and other things. > > The only thing really holding ZoL back in Linux is the fact that (due > to licensing) it won?t ever be in the Linux kernel. One can personally link ZoL into your own kernel, and a company/corporate can even do this and run it on 1000's of servers, you just can not distribute it to anyone else, which in the end is not really a big deal, unless your in the Linux distribution business. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 20 17:56:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15DC114FADC5; Wed, 20 Feb 2019 17:56:40 +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 AA35C8B555; Wed, 20 Feb 2019 17:56:39 +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 9EDD18EDC; Wed, 20 Feb 2019 17:56:39 +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 x1KHud6l072524; Wed, 20 Feb 2019 17:56:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KHucYj072518; Wed, 20 Feb 2019 17:56:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902201756.x1KHucYj072518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 20 Feb 2019 17:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344367 - 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: 344367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA35C8B555 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 17:56:40 -0000 Author: tuexen Date: Wed Feb 20 17:56:38 2019 New Revision: 344367 URL: https://svnweb.freebsd.org/changeset/base/344367 Log: Use exponential backoff for retransmitting SYN segments as specified in the TCP RFCs. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18974 Modified: head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_stacks/rack.c Wed Feb 20 17:56:38 2019 (r344367) @@ -2869,7 +2869,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_syn_backoff[tp->t_rxtshift]); + rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_backoff[tp->t_rxtshift]); else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) @@ -155,11 +155,11 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + - * tcp_syn_backoff[2] + - * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, + * TCPTV_RTOBASE * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 @@ -426,7 +426,7 @@ syncache_timeout(struct syncache *sc, struct syncache_ if (sc->sc_rxmits == 0) rexmt = TCPTV_RTOBASE; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_timer.c Wed Feb 20 17:56:38 2019 (r344367) @@ -233,9 +233,6 @@ tcp_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } -int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] = - { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 }; - int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; @@ -671,7 +668,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) @@ -199,7 +199,6 @@ extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; -extern int tcp_syn_backoff[]; extern int tcp_totbackoff; extern int tcp_rexmit_drop_options; From owner-svn-src-head@freebsd.org Wed Feb 20 18:03:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CC814FB180; Wed, 20 Feb 2019 18:03:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 814618BB92; Wed, 20 Feb 2019 18:03:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id wWDQgOPHR82YcwWDSg0KX5; Wed, 20 Feb 2019 11:03:31 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=XYtHlOxmKIrviYMon_oA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 0A15DB2B; Wed, 20 Feb 2019 10:03:27 -0800 (PST) Date: Wed, 20 Feb 2019 10:03:04 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Enji Cooper ,Alexey Dokuchaev CC: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Cy Schubert Message-ID: <6CE7079F-5B74-4DCF-AA38-AE2CB5175067@cschubert.com> X-CMAE-Envelope: MS4wfN0oPilJvgHZHJJSAQJ7s2qed9Mk8WWZRi/rS9d5xPwgVM3qYP6LBE1yMF1J+OST/ga4L84dKF7TS8vlf683Rahio2kyx1LrhuCS038N9KAvsNlZPfgi nWS9JY49j3AZUSbJIzHAGUaEx9gpyNM1uHY5bNO3K8IRI6ZifhA946BMsFVojzgXEWqTG6rCave++OR34aVt7mvDfcVGufi4yLg44mpMV79qcOeLCJvJdX6u fUgALiokql2rHmd1Iepjv485EvVRugxZ00Pc8utOEp/tIs8MJrcUzsBBZjVuC/2GE5BAH45yeEd19tu3aTfZt3O9YNVR9RHPUm5tXxwZPRN0tfLzfPZir+b9 qKNylUnl0T3sBQhGBOwj6AFBg07d3VGO649v3O6lv4TEDd92fis= X-Rspamd-Queue-Id: 814618BB92 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 18:03:34 -0000 On February 20, 2019 9:01:53 AM PST, Enji Cooper = wrote: > >> On Feb 19, 2019, at 23:56, Alexey Dokuchaev >wrote: >>=20 >>> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >>> At the risk of painting a bikeshed a lovely color of neon purple, >I'm >>> curious about if/how these types of commits get merged upstream to >>> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm >very >>> confused|is anyone else confused where upstream is?)=2E >>>=20 >>> Who is upstream? Is work like this going to remain as a downstream >>> patch to ZFS? Or is FreeBSD going to work to upstream this type of >>> work? >>=20 >> I've always felt that we should've become upstream to everyone else >> the moment we knew Oracle would eat Sun (20 April 2009), and never >> understood why it didn't happen and now, ten years later, we're >talking >> about ZFS on fucking Linux becoming our upstream=2E Something'd got >very >> wrong here and I'd like to know what and why=2E > >As others have pointed out, FreeBSD has less developer inertia than >Linux, and there are (seemingly) less developers or interested parties >in running an openindiana based stack=2E > >Also: better OS support for other general purpose >infrastructure/usecases with items like multitenancy via >containerization/CGroups2, Java, etc, and mindshare around this and >other things=2E > >The only thing really holding ZoL back in Linux is the fact that (due >to licensing) it won=E2=80=99t ever be in the Linux kernel=2E > >-Enji Exactly=2E This and the fact that our user base is considerably smaller, w= e don't have the gravitas and must settle being dictated to=2E POSIX is dea= d=2E I suppose a person could get on top of the soapbox again but =2E=2E=2E A way forward might be two pronged=2E Yes, maintain ZoF based on ZoL, illu= mos, or both, and a Linux KPI layer to allow ZoL (and anything else for tha= t matter) to be imported into ports=2E However maintaining a great shim to = the exclusion of good native support is existential=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Wed Feb 20 18:03:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6067A14FB1A3; Wed, 20 Feb 2019 18:03:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 008C68BC71; Wed, 20 Feb 2019 18:03:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC7C190EA; Wed, 20 Feb 2019 18:03:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KI3hiw078570; Wed, 20 Feb 2019 18:03:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KI3haW078567; Wed, 20 Feb 2019 18:03:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902201803.x1KI3haW078567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 20 Feb 2019 18:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344368 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 008C68BC71 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 18:03:46 -0000 Author: tuexen Date: Wed Feb 20 18:03:43 2019 New Revision: 344368 URL: https://svnweb.freebsd.org/changeset/base/344368 Log: Reduce the TCP initial retransmission timeout from 3 seconds to 1 second as allowed by RFC 6298. Reviewed by: kbowling@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18941 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 (r344368) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_backoff[1] + * tcp_backoff[2] + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 (r344368) @@ -77,7 +77,7 @@ #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ From owner-svn-src-head@freebsd.org Wed Feb 20 18:29:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FBDB14FB934; Wed, 20 Feb 2019 18:29:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 272D88CA7D; Wed, 20 Feb 2019 18:29:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C97B94C9; Wed, 20 Feb 2019 18:29:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KITqEK091971; Wed, 20 Feb 2019 18:29:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KITqwc091970; Wed, 20 Feb 2019 18:29:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201829.x1KITqwc091970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344369 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 272D88CA7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 18:29:53 -0000 Author: markj Date: Wed Feb 20 18:29:52 2019 New Revision: 344369 URL: https://svnweb.freebsd.org/changeset/base/344369 Log: Remove an obsolete comment. MFC after: 3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 20 18:03:43 2019 (r344368) +++ head/sys/kern/kern_descrip.c Wed Feb 20 18:29:52 2019 (r344369) @@ -2439,9 +2439,6 @@ fdcheckstd(struct thread *td) * Internal form of close. Decrement reference count on file structure. * Note: td may be NULL when closing a file that was being passed in a * message. - * - * XXXRW: Giant is not required for the caller, but often will be held; this - * makes it moderately likely the Giant will be recursed in the VFS case. */ int closef(struct file *fp, struct thread *td) From owner-svn-src-head@freebsd.org Wed Feb 20 18:32:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F7614FBC1D; Wed, 20 Feb 2019 18:32:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B3D8D083; Wed, 20 Feb 2019 18:32:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x444.google.com with SMTP id s22so12327700pfh.4; Wed, 20 Feb 2019 10:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=URMYHgKhdtfcc4+4VUr/uKCh4Q318W7jx7VVSgfjI1o=; b=OgBhQ5thY/yHD/zxvA4YI1wT5kIxlawfsDw0pL7WQcT8TSC/V8OtZduOaUURLJV6DO KsW6nelEhY7nqhdugMTqZylrmlC8ulRUNmyWGU8VqIrdG/TBoAyoAg3kl/e30bxn8c51 DgdkHRXLr28+sU0Dmd6YXU/RJ78e8T5TXPLwH7oAYMORFAqsz0Ytszpyo3zE7OtyY0ir iDSg/4qKzq0kg6aDwPnggbuixeqT0cuROBB74DnI9BRm3+YwL6Xq4qVZd9ncbWIQS//Z 4UHMYct2zQM44chhCLG3SHN064VxsrCRq3Q9Zg3E59INfEuHjn1z5BRMDyXde0EbhPRD l6uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=URMYHgKhdtfcc4+4VUr/uKCh4Q318W7jx7VVSgfjI1o=; b=EpurT/nLhNff4Hnoy2i5TOpFhvn7ilugidCDrlSQLzdVjmrcDePuEsmxMlAUQSx21A +0edNwZbyQWkOiigTs2MRI2SP9JCr3s93Wr41Rpf12c6b+PDDLnGmzwPSWoE0RhuNhzM ugm21XIVWG38jc4f6jnciavlNF7clVzuYsSaoyzfLu+18ehgwL9Fa0Trj2sO0sNPTpnh 7QEfp6y/F7EWeGTLOCej21BOfXXWSgewRIWGEPff9/q62T4IsyqA3begLdfKqiTsYwxx UqL/lDcCOHwMZcWeRFEP2K+G8y58IXNnOyo/IFyUnllYLPXDjq0D+3+/LROEDKIOr1vD Ur+Q== X-Gm-Message-State: AHQUAuY4cIOrMmkxABuJjBJOsWHhtKJUHg5J2aWueatjdS99lnKyJ1St zmF2OXlpTLeqjomqdWsMlCp+1reC X-Google-Smtp-Source: AHgI3IZRGXV8eV7Gp3pHrucvgoCATJNqbTTL13ujEbOM1P8s1rWoMxKZlFRdz98gY4TfLHA4pk4Yew== X-Received: by 2002:a65:6683:: with SMTP id b3mr30298727pgw.423.1550687567430; Wed, 20 Feb 2019 10:32:47 -0800 (PST) Received: from ?IPv6:2607:fb90:8378:20a7:f9af:9b65:229f:93f7? ([2607:fb90:8378:20a7:f9af:9b65:229f:93f7]) by smtp.gmail.com with ESMTPSA id a1sm14679529pfn.26.2019.02.20.10.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 10:32:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> Date: Wed, 20 Feb 2019 10:32:45 -0800 Cc: Alexey Dokuchaev , Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2E31FED5-0E0B-4624-AF11-2178C7E84308@gmail.com> References: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Rspamd-Queue-Id: D9B3D8D083 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.90)[-0.896,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 18:32:49 -0000 On Feb 20, 2019, at 09:11, Rodney W. Grimes = wrote: > One can personally link ZoL into your own kernel, and a company/corporate > can even do this and run it on 1000's of servers, you just can not > distribute it to anyone else, which in the end is not really a big > deal, unless your in the Linux distribution business. Very little organizations roll their own Linux kernels in the grand scheme o= f things (run of the mill sysadmins aren=E2=80=99t hackers), and making Linu= x VFS work with ZFS is a nontrivial job (ZoL might work with a kernel versio= n, but it won=E2=80=99t work with all target kernel versions). Groups like Fa= cebook, Google, Oracle, etc, do it because they have the developer manpower a= nd it=E2=80=99s in their vested interest to run a custom kernel config/kerne= l with backports/enhancements. Plus, they don=E2=80=99t need to release thei= r changes, as their server platforms won=E2=80=99t be productized (thus skat= ing around the GPLv2). I couldn=E2=80=99t find gregkh@=E2=80=98s diatribe about Linux kernel compat= ibility, but it was basically (put nicely), =E2=80=9Cput your code in the ke= rnel tree, cause we won=E2=80=99t necessarily provide backwards compatibilit= y, as we need to break interfaces from time to time.=E2=80=9D Given that zfs is licensed under the CDDL (a viral license to Linux), that c= ode will never, ever, hit the mainline tree. This is one of the code reasons why, over time, btrfs has evolved into the f= ile system that it is: it fills a niche that ext4 couldn=E2=80=99t and zfs d= id, while being licensed under an acceptable kernel license (GPLv2). -Enji= From owner-svn-src-head@freebsd.org Wed Feb 20 20:17:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D27714DA555; Wed, 20 Feb 2019 20:17:55 +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 31F466B735; Wed, 20 Feb 2019 20:17:55 +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 2336EA7D2; Wed, 20 Feb 2019 20:17:55 +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 x1KKHtlu062413; Wed, 20 Feb 2019 20:17:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKHtGZ062412; Wed, 20 Feb 2019 20:17:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902202017.x1KKHtGZ062412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 20 Feb 2019 20:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344381 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 344381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31F466B735 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 20:17:55 -0000 Author: dim Date: Wed Feb 20 20:17:54 2019 New Revision: 344381 URL: https://svnweb.freebsd.org/changeset/base/344381 Log: Fix more AddressSanitizer violations in usr.bin/top In line_update(), set lastcol correctly after moving to any non-zero column, so the "overwrite old stuff" part does not attempt to address negative offsets in the current line. Rewrite setup_buffer() to always allocate at least 80 characters, otherwise various calls to summary_format() will overwrite the end of the buffers, if the screen width gets small enough. MFC after: 1 week Modified: head/usr.bin/top/display.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Wed Feb 20 20:09:59 2019 (r344380) +++ head/usr.bin/top/display.c Wed Feb 20 20:17:54 2019 (r344381) @@ -378,13 +378,13 @@ u_procstates(int total, int *brkdn) if (ltotal != total) { /* move and overwrite */ -if (x_procstate == 0) { - Move_to(x_procstate, y_procstate); -} -else { - /* cursor is already there...no motion needed */ - assert(lastline == 1); -} + if (x_procstate == 0) { + Move_to(x_procstate, y_procstate); + } + else { + /* cursor is already there...no motion needed */ + assert(lastline == 1); + } printf("%d", total); /* if number of digits differs, rewrite the label */ @@ -1205,7 +1205,7 @@ line_update(char *old, char *new, int start, int line) cursor_on_line = true; putchar(ch); *old = ch; - lastcol = 1; + lastcol = start + 1; } old++; @@ -1341,33 +1341,27 @@ i_uptime(struct timeval *bt, time_t *tod) } } +#define SETUPBUFFER_MIN_SCREENWIDTH 80 #define SETUPBUFFER_REQUIRED_ADDBUFSIZ 2 static char * setup_buffer(char *buffer, int addlen) { - char *b = NULL; + size_t len; - if (NULL == buffer) { - setup_buffer_bufsiz = screen_width; - b = calloc(setup_buffer_bufsiz + addlen + - SETUPBUFFER_REQUIRED_ADDBUFSIZ, - sizeof(char)); - } else { - if (screen_width > setup_buffer_bufsiz) { - setup_buffer_bufsiz = screen_width; - free(buffer); - b = calloc(setup_buffer_bufsiz + addlen + - SETUPBUFFER_REQUIRED_ADDBUFSIZ, - sizeof(char)); - } else { - b = buffer; - } - } + setup_buffer_bufsiz = screen_width; + if (setup_buffer_bufsiz < SETUPBUFFER_MIN_SCREENWIDTH) + { + setup_buffer_bufsiz = SETUPBUFFER_MIN_SCREENWIDTH; + } - if (NULL == b) { - errx(4, "can't allocate sufficient memory"); - } + free(buffer); + len = setup_buffer_bufsiz + addlen + SETUPBUFFER_REQUIRED_ADDBUFSIZ; + buffer = calloc(len, sizeof(char)); + if (buffer == NULL) + { + errx(4, "can't allocate sufficient memory"); + } - return b; + return buffer; } From owner-svn-src-head@freebsd.org Wed Feb 20 20:48:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFDD14DB54D; Wed, 20 Feb 2019 20:48:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 332766D355; Wed, 20 Feb 2019 20:48:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9849AAD33; Wed, 20 Feb 2019 20:48:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKmB7L084409; Wed, 20 Feb 2019 20:48:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKmBG9084407; Wed, 20 Feb 2019 20:48:11 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902202048.x1KKmBG9084407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Feb 2019 20:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344384 - in head/sys: libkern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: libkern sys X-SVN-Commit-Revision: 344384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 332766D355 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 20:48:15 -0000 Author: mmacy Date: Wed Feb 20 20:48:10 2019 New Revision: 344384 URL: https://svnweb.freebsd.org/changeset/base/344384 Log: Add non-sleepable strdup variant strdup_flags debugfs expects to do non-sleepable allocations Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19259 Modified: head/sys/libkern/strdup.c head/sys/sys/libkern.h Modified: head/sys/libkern/strdup.c ============================================================================== --- head/sys/libkern/strdup.c Wed Feb 20 20:34:43 2019 (r344383) +++ head/sys/libkern/strdup.c Wed Feb 20 20:48:10 2019 (r344384) @@ -40,13 +40,22 @@ __FBSDID("$FreeBSD$"); #include char * -strdup(const char *string, struct malloc_type *type) +strdup_flags(const char *string, struct malloc_type *type, int flags) { size_t len; char *copy; len = strlen(string) + 1; - copy = malloc(len, type, M_WAITOK); + copy = malloc(len, type, flags); + if (copy == NULL) + return (NULL); bcopy(string, copy, len); return (copy); +} + +char * +strdup(const char *string, struct malloc_type *type) +{ + + return (strdup_flags(string, type, M_WAITOK)); } Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Wed Feb 20 20:34:43 2019 (r344383) +++ head/sys/sys/libkern.h Wed Feb 20 20:48:10 2019 (r344384) @@ -173,6 +173,7 @@ char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char * __restrict, const char * __restrict) __pure; +char *strdup_flags(const char *__restrict, struct malloc_type *, int); char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *); From owner-svn-src-head@freebsd.org Wed Feb 20 20:55:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 461BC14DBA88; Wed, 20 Feb 2019 20:55:03 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9636DFC4; Wed, 20 Feb 2019 20:55:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C76A4AEDC; Wed, 20 Feb 2019 20:55:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKt2Al090495; Wed, 20 Feb 2019 20:55:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKt2C4090493; Wed, 20 Feb 2019 20:55:02 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902202055.x1KKt2C4090493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Feb 2019 20:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344385 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 344385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD9636DFC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 20:55:03 -0000 Author: mmacy Date: Wed Feb 20 20:55:02 2019 New Revision: 344385 URL: https://svnweb.freebsd.org/changeset/base/344385 Log: PFS: Bump NAMELEN and don't require clients to be sleepable - debugfs consumers expect to be able to export names more than 48 characters - debugfs consumers expect to be able to hold locks across calls and are able to handle allocation failures Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19256 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 Wed Feb 20 20:48:10 2019 (r344384) +++ head/sys/fs/pseudofs/pseudofs.c Wed Feb 20 20:55:02 2019 (r344385) @@ -68,15 +68,20 @@ SYSCTL_INT(_vfs_pfs, OID_AUTO, trace, CTLFLAG_RW, &pfs * Allocate and initialize a node */ static struct pfs_node * -pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +pfs_alloc_node_flags(struct pfs_info *pi, const char *name, pfs_type_t type, int flags) { struct pfs_node *pn; + int malloc_flags; KASSERT(strlen(name) < PFS_NAMELEN, ("%s(): node name is too long", __func__)); - - pn = malloc(sizeof *pn, - M_PFSNODES, M_WAITOK|M_ZERO); + if (flags & PFS_NOWAIT) + malloc_flags = M_NOWAIT | M_ZERO; + else + malloc_flags = M_WAITOK | M_ZERO; + pn = malloc(sizeof *pn, M_PFSNODES, malloc_flags); + if (pn == NULL) + return (NULL); mtx_init(&pn->pn_mutex, "pfs_node", NULL, MTX_DEF | MTX_DUPOK); strlcpy(pn->pn_name, name, sizeof pn->pn_name); pn->pn_type = type; @@ -84,6 +89,12 @@ pfs_alloc_node(struct pfs_info *pi, const char *name, return (pn); } +static struct pfs_node * +pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +{ + return (pfs_alloc_node_flags(pi, name, type, 0)); +} + /* * Add a node to a directory */ @@ -160,15 +171,29 @@ pfs_detach_node(struct pfs_node *pn) /* * Add . and .. to a directory */ +static int +pfs_fixup_dir_flags(struct pfs_node *parent, int flags) +{ + struct pfs_node *dot, *dotdot; + + dot = pfs_alloc_node_flags(parent->pn_info, ".", pfstype_this, flags); + if (dot == NULL) + return (ENOMEM); + dotdot = pfs_alloc_node_flags(parent->pn_info, "..", pfstype_parent, flags); + if (dotdot == NULL) { + pfs_destroy(dot); + return (ENOMEM); + } + pfs_add_node(parent, dot); + pfs_add_node(parent, dotdot); + return (0); +} + static void pfs_fixup_dir(struct pfs_node *parent) { - struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, ".", pfstype_this); - pfs_add_node(parent, pn); - pn = pfs_alloc_node(parent->pn_info, "..", pfstype_parent); - pfs_add_node(parent, pn); + pfs_fixup_dir_flags(parent, 0); } /* @@ -180,16 +205,22 @@ pfs_create_dir(struct pfs_node *parent, const char *na int flags) { struct pfs_node *pn; + int rc; - pn = pfs_alloc_node(parent->pn_info, name, - (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir); + pn = pfs_alloc_node_flags(parent->pn_info, name, + (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir, flags); + if (pn == NULL) + return (NULL); pn->pn_attr = attr; pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; pfs_add_node(parent, pn); - pfs_fixup_dir(pn); - + rc = pfs_fixup_dir_flags(pn, flags); + if (rc) { + pfs_destroy(pn); + return (NULL); + } return (pn); } @@ -203,7 +234,9 @@ pfs_create_file(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_file); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_file, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; @@ -224,7 +257,9 @@ pfs_create_link(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_symlink); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_symlink, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Wed Feb 20 20:48:10 2019 (r344384) +++ head/sys/fs/pseudofs/pseudofs.h Wed Feb 20 20:55:02 2019 (r344385) @@ -52,7 +52,7 @@ struct vnode; /* * Limits and constants */ -#define PFS_NAMELEN 48 +#define PFS_NAMELEN 128 #define PFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ #define PFS_DELEN (offsetof(struct dirent, d_name) + PFS_NAMELEN) @@ -77,6 +77,7 @@ typedef enum { #define PFS_RAWWR 0x0008 /* raw writer */ #define PFS_RAW (PFS_RAWRD|PFS_RAWWR) #define PFS_PROCDEP 0x0010 /* process-dependent */ +#define PFS_NOWAIT 0x0020 /* allow malloc to fail */ /* * Data structures From owner-svn-src-head@freebsd.org Wed Feb 20 21:06:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4700914DBFAE; Wed, 20 Feb 2019 21:06:13 +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 3822B6E68C; Wed, 20 Feb 2019 21:06:12 +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 CCE6DB0A1; Wed, 20 Feb 2019 21:06:11 +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 x1KL6BAo097078; Wed, 20 Feb 2019 21:06:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KL6BL1097077; Wed, 20 Feb 2019 21:06:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902202106.x1KL6BL1097077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 20 Feb 2019 21:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344386 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 344386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3822B6E68C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 21:06:13 -0000 Author: dim Date: Wed Feb 20 21:06:11 2019 New Revision: 344386 URL: https://svnweb.freebsd.org/changeset/base/344386 Log: Pull in r354515 from upstream libc++ trunk: Fix the build with gcc when `-Wredundant-decls` is passed Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and ``, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of ``, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 Submitted by: ngie MFC after: 3 days Modified: head/contrib/libc++/include/__locale Modified: head/contrib/libc++/include/__locale ============================================================================== --- head/contrib/libc++/include/__locale Wed Feb 20 20:55:02 2019 (r344385) +++ head/contrib/libc++/include/__locale Wed Feb 20 21:06:11 2019 (r344386) @@ -1230,8 +1230,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); - template struct __narrow_to_utf8 { From owner-svn-src-head@freebsd.org Wed Feb 20 21:07:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E964314DC33C; Wed, 20 Feb 2019 21:07:10 +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 A123C6E9A4; Wed, 20 Feb 2019 21:07:10 +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 378A9B0A3; Wed, 20 Feb 2019 21:07:10 +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 x1KL7AbC097277; Wed, 20 Feb 2019 21:07:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KL7ASO097276; Wed, 20 Feb 2019 21:07:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902202107.x1KL7ASO097276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 20 Feb 2019 21:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344387 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 344387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A123C6E9A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 21:07:11 -0000 Author: tsoome Date: Wed Feb 20 21:07:09 2019 New Revision: 344387 URL: https://svnweb.freebsd.org/changeset/base/344387 Log: loader: really fix cd9660 dirmatch The cd9660_open() does pass whole path to dirmatch() and we need to compare only the current path component, not full path. Additinally, skip over duplicate / (if any) and check if the last component in the path was meant to be directory (having trailing /). If it is in fact a file, error out. Modified: head/stand/libsa/cd9660.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Wed Feb 20 21:06:11 2019 (r344386) +++ head/stand/libsa/cd9660.c Wed Feb 20 21:07:09 2019 (r344387) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -227,8 +228,8 @@ static int dirmatch(struct open_file *f, const char *path, struct iso_directory_record *dp, int use_rrip, int lenskip) { - size_t len; - char *cp; + size_t len, plen; + char *cp, *sep; int i, icase; if (use_rrip) @@ -242,7 +243,14 @@ dirmatch(struct open_file *f, const char *path, struct } else icase = 0; - if (strlen(path) != len) + sep = strchr(path, '/'); + if (sep != NULL) { + plen = sep - path; + } else { + plen = strlen(path); + } + + if (plen != len) return (0); for (i = len; --i >= 0; path++, cp++) { @@ -283,6 +291,7 @@ cd9660_open(const char *path, struct open_file *f) struct iso_directory_record rec; struct iso_directory_record *dp = NULL; int rc, first, use_rrip, lenskip; + bool isdir = false; /* First find the volume descriptor */ buf = malloc(buf_size = ISO_DEFAULT_BLOCK_SIZE); @@ -372,7 +381,24 @@ cd9660_open(const char *path, struct open_file *f) rec = *dp; while (*path && *path != '/') /* look for next component */ path++; - if (*path) path++; /* skip '/' */ + + if (*path) /* this component was directory */ + isdir = true; + + while (*path == '/') + path++; /* skip '/' */ + + if (*path) /* We do have next component. */ + isdir = false; + } + + /* + * if the path had trailing / but the path does point to file, + * report the error ENOTDIR. + */ + if (isdir == true && (isonum_711(rec.flags) & 2) == 0) { + rc = ENOTDIR; + goto out; } /* allocate file system specific data structure */ From owner-svn-src-head@freebsd.org Wed Feb 20 21:24:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C3C014DCF8D; Wed, 20 Feb 2019 21:24:57 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F29CA6F74A; Wed, 20 Feb 2019 21:24:56 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B32BEB40D; Wed, 20 Feb 2019 21:24:56 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KLOum0010011; Wed, 20 Feb 2019 21:24:56 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KLOuEF010010; Wed, 20 Feb 2019 21:24:56 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902202124.x1KLOuEF010010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Wed, 20 Feb 2019 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344388 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 344388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F29CA6F74A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 21:24:57 -0000 Author: sef Date: Wed Feb 20 21:24:56 2019 New Revision: 344388 URL: https://svnweb.freebsd.org/changeset/base/344388 Log: It turns out that setting the IV length is necessary with CCM in OpenSSL. This adds that back. Reviewed by: cem Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Wed Feb 20 21:07:09 2019 (r344387) +++ head/tools/tools/crypto/cryptocheck.c Wed Feb 20 21:24:56 2019 (r344388) @@ -1185,6 +1185,9 @@ openssl_ccm_encrypt(struct alg *alg, const EVP_CIPHER if (EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL) != 1) errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_IVLEN, iv_len, NULL) != 1) + errx(1, "OpenSSL %s (%zu) setting iv length failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_TAG, AES_CBC_MAC_HASH_LEN, NULL) != 1) errx(1, "OpenSSL %s (%zu) setting tag length failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); From owner-svn-src-head@freebsd.org Wed Feb 20 22:05:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A65A14DE25F; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A86D71152; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 191C3BCBC; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KM5iCf036320; Wed, 20 Feb 2019 22:05:44 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KM5iZX036319; Wed, 20 Feb 2019 22:05:44 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902202205.x1KM5iZX036319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 20 Feb 2019 22:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344389 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A86D71152 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 22:05:45 -0000 Author: dab Date: Wed Feb 20 22:05:44 2019 New Revision: 344389 URL: https://svnweb.freebsd.org/changeset/base/344389 Log: Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog The result of a strdup() was stored in a global variable and not freed before program exit. This is a follow-up to r343906. That change attempted to plug these resource leaks but managed to miss a code path on which the leak still occurs. Plug the leak on that path, too. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 (r344388) +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 (r344389) @@ -793,6 +793,9 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); + /* Free global dynamically-allocated storage. */ + free(timefnamefmt); + free(requestor); exit(1); } From owner-svn-src-head@freebsd.org Wed Feb 20 22:32:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB90E14DEE10; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE2171FB8; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41B11C1B3; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMWTHs051795; Wed, 20 Feb 2019 22:32:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMWTuD051794; Wed, 20 Feb 2019 22:32:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902202232.x1KMWTuD051794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Feb 2019 22:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344390 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EE2171FB8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 22:32:29 -0000 Author: andrew Date: Wed Feb 20 22:32:28 2019 New Revision: 344390 URL: https://svnweb.freebsd.org/changeset/base/344390 Log: Call pmap_qenter for each page when creating the kcov buffer. This removes the need to allocate a buffer to hold the vm_page_t objects at the cost of extra IPIs on some architectures. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19252 Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Wed Feb 20 22:05:44 2019 (r344389) +++ head/sys/kern/kern_kcov.c Wed Feb 20 22:32:28 2019 (r344390) @@ -357,7 +357,7 @@ static int kcov_alloc(struct kcov_info *info, size_t entries) { size_t n, pages; - vm_page_t *m; + vm_page_t m; KASSERT(info->kvaddr == 0, ("kcov_alloc: Already have a buffer")); KASSERT(info->state == KCOV_STATE_OPEN, @@ -376,16 +376,14 @@ kcov_alloc(struct kcov_info *info, size_t entries) info->bufobj = vm_pager_allocate(OBJT_PHYS, 0, info->bufsize, PROT_READ | PROT_WRITE, 0, curthread->td_ucred); - m = malloc(sizeof(*m) * pages, M_TEMP, M_WAITOK); VM_OBJECT_WLOCK(info->bufobj); for (n = 0; n < pages; n++) { - m[n] = vm_page_grab(info->bufobj, n, + m = vm_page_grab(info->bufobj, n, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); - m[n]->valid = VM_PAGE_BITS_ALL; + m->valid = VM_PAGE_BITS_ALL; + pmap_qenter(info->kvaddr + n * PAGE_SIZE, &m, 1); } VM_OBJECT_WUNLOCK(info->bufobj); - pmap_qenter(info->kvaddr, m, pages); - free(m, M_TEMP); info->entries = entries; From owner-svn-src-head@freebsd.org Wed Feb 20 22:33:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00DED14DEECA; Wed, 20 Feb 2019 22:33:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9180A721C5; Wed, 20 Feb 2019 22:33:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id h6so19754011itl.1; Wed, 20 Feb 2019 14:33:39 -0800 (PST) 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=FDaj4hwouwdm2Z/OlnxZovaffTn/OVEnndv00ph3I9k=; b=fnON2Uc9ATip5ydcMvJuaSxLRILOUvOR8p07vDvKIeaO4+pnvJ2xeu+HQLD9I/mqoM OBPI+WvWUrmt7qoNtykDQv1lyqIF7Av6C5fTMwC2oz/G1Dr9pUCylHLyqYjs0wtolV7R XZ9q3C0bst/kW1LyzKdN+Wc0X3KMm1L8dYblpExKQTFJm81S+U9kgNKG2xZ0ZNURMRrW N5ELZchk+KnUni/RnCnF5Jau2uS1hfh34QtdPavNe91wOmPLex0EQNoHqJRD47EqBx5q LMLYhJmzrG6fmxMv6TXS/O0hFa8htPWduKfHk7+POj0CqgVsHTN18slhgymaOQTl3YqT gL7A== X-Gm-Message-State: AHQUAuYnQ95IppQilPUWk7ar7U9pE1D5PH0AyH8Y3tkss460/VYAaruj 4ohx9UT7i+fezQVIthG17dWuqiVD X-Google-Smtp-Source: AHgI3IbdO6SbjLbvRMIvfWpSUmqKwDhcLyUUS7TerqlRqPI+Lhs+UidVQWgu9f81CQb7p5bsHJ2yOA== X-Received: by 2002:a05:660c:54d:: with SMTP id w13mr6481730itk.50.1550702012788; Wed, 20 Feb 2019 14:33:32 -0800 (PST) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id b9sm8587169iod.18.2019.02.20.14.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 14:33:32 -0800 (PST) Received: by mail-it1-f180.google.com with SMTP id z124so19761459itc.2; Wed, 20 Feb 2019 14:33:32 -0800 (PST) X-Received: by 2002:a02:4084:: with SMTP id n126mr15003660jaa.78.1550702012315; Wed, 20 Feb 2019 14:33:32 -0800 (PST) MIME-Version: 1.0 References: <201902200951.x1K9pDQs001745@repo.freebsd.org> In-Reply-To: <201902200951.x1K9pDQs001745@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 20 Feb 2019 14:33:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9180A721C5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 22:33:40 -0000 Hi Konstantin, What is the (K)API for this (do you have any intended consumers in mind)? Will it be documented in a manual page at some point? Does it make sense to expose to userspace via mmap(2) or similar? Thanks, Conrad On Wed, Feb 20, 2019 at 1:51 AM Konstantin Belousov wrote: > > Author: kib > Date: Wed Feb 20 09:51:13 2019 > New Revision: 344353 > URL: https://svnweb.freebsd.org/changeset/base/344353 > > Log: > Add kernel support for Intel userspace protection keys feature on > Skylake Xeons. > > See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the > RDPKRU and WRPKRU instructions. > > Reviewed by: markj > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D18893 From owner-svn-src-head@freebsd.org Wed Feb 20 22:41:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 375DB14DF54F; Wed, 20 Feb 2019 22:41:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAE9872928; Wed, 20 Feb 2019 22:41:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B609BC1FF; Wed, 20 Feb 2019 22:41:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMfEdJ055515; Wed, 20 Feb 2019 22:41:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMfEpZ055514; Wed, 20 Feb 2019 22:41:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902202241.x1KMfEpZ055514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Feb 2019 22:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344391 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAE9872928 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 22:41:18 -0000 Author: andrew Date: Wed Feb 20 22:41:14 2019 New Revision: 344391 URL: https://svnweb.freebsd.org/changeset/base/344391 Log: Unwire the kcov buffer when freeing the info struct. Without this the physical memory will not be returned to the kernel. While here call vm_object_reference on the object when mmapping the buffer. This removed the need for buggy tracking of if it has been mapped or not. This fixes issues where kcov could use all the system memory. Reported by: tuexen Reviewed by: kib Sponsored by: DARPA, AFTL Differential Revision: https://reviews.freebsd.org/D19252 Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Wed Feb 20 22:32:28 2019 (r344390) +++ head/sys/kern/kern_kcov.c Wed Feb 20 22:41:14 2019 (r344391) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include MALLOC_DEFINE(M_KCOV_INFO, "kcovinfo", "KCOV info type"); @@ -347,6 +348,7 @@ kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offse info->mmap != false) return (EINVAL); + vm_object_reference(info->bufobj); info->mmap = true; *offset = 0; *object = info->bufobj; @@ -393,13 +395,26 @@ kcov_alloc(struct kcov_info *info, size_t entries) static void kcov_free(struct kcov_info *info) { + vm_page_t m; + size_t i; if (info->kvaddr != 0) { pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); kva_free(info->kvaddr, info->bufsize); } - if (info->bufobj != NULL && !info->mmap) + if (info->bufobj != NULL) { + 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); vm_object_deallocate(info->bufobj); + } free(info, M_KCOV_INFO); } From owner-svn-src-head@freebsd.org Wed Feb 20 23:52:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C9714E16F5 for ; Wed, 20 Feb 2019 23:52:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB39C75A76 for ; Wed, 20 Feb 2019 23:52:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id h6so20177654itl.1 for ; Wed, 20 Feb 2019 15:52:47 -0800 (PST) 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:cc; bh=lb8j3J4dEqe0AzuH9DjWIJkvi872JvGn5ShEQWpEMuI=; b=m7YyKOjXGk+j2H7tM7u6iu9hwk3F6yj7xg42WBQVnDRAIyNA/xKXtNlwAOSod1e85v PTS8eoYhDUbLCcIReCWdHaSw7Qnr+6PFyUGXYtWPcViw8AUG1vo8rYUG8jC6mrctqMfe /e9g5KL8pL9yDzls7NXnfZ7yJkyuxnFlwwcnVmtNeN+XVEAJ9TzWSI21/XP+YX8MVCSm YXEq3I9JjFqkH1v3LdJ7+Oo2fFQWln0lPe64kfZ2SrNqcvHs+oR4ZEmxpaRh0/bqJU0i xNOELPeiwlmd78qlaXjjotALg0u6Wt9A+TJm+Moo4NxIozC3i1xKvAnWt1tyqIR6Y/Lx imRA== X-Gm-Message-State: AHQUAuahA3FOHtpX/F7asS/JUZGuRszZiNrm1xsF18T4wFn7axnffU9S qn9xNXTq4CWCP0hHxgdgCTbBtkzK X-Google-Smtp-Source: AHgI3IbGkV6aDNM8plReKjkyfQmzV0/gByFZDo8xMDMIr1w1RiKPNDSxhclyOQl+wcOYbmqoUxtRsg== X-Received: by 2002:a5d:818d:: with SMTP id u13mr20526833ion.20.1550706766863; Wed, 20 Feb 2019 15:52:46 -0800 (PST) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com. [209.85.166.169]) by smtp.gmail.com with ESMTPSA id n20sm1184985iom.5.2019.02.20.15.52.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 15:52:46 -0800 (PST) Received: by mail-it1-f169.google.com with SMTP id f10so19779961ita.4 for ; Wed, 20 Feb 2019 15:52:46 -0800 (PST) X-Received: by 2002:a5e:9243:: with SMTP id z3mt22986508iop.107.1550706766253; Wed, 20 Feb 2019 15:52:46 -0800 (PST) MIME-Version: 1.0 References: <201902200951.x1K9pDQs001745@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 20 Feb 2019 15:52:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EB39C75A76 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 23:52:48 -0000 Nevermind, sorry about that. I see the subsequent commits now. On Wed, Feb 20, 2019 at 2:33 PM Conrad Meyer wrote: > > Hi Konstantin, > > What is the (K)API for this (do you have any intended consumers in > mind)? Will it be documented in a manual page at some point? Does it > make sense to expose to userspace via mmap(2) or similar? > > Thanks, > Conrad > > On Wed, Feb 20, 2019 at 1:51 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Wed Feb 20 09:51:13 2019 > > New Revision: 344353 > > URL: https://svnweb.freebsd.org/changeset/base/344353 > > > > Log: > > Add kernel support for Intel userspace protection keys feature on > > Skylake Xeons. > > > > See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the > > RDPKRU and WRPKRU instructions. > > > > Reviewed by: markj > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Differential revision: https://reviews.freebsd.org/D18893 From owner-svn-src-head@freebsd.org Wed Feb 20 23:53:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF3614E176D; Wed, 20 Feb 2019 23:53:47 +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 3C32175BCE; Wed, 20 Feb 2019 23:53:47 +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 13BF1CF65; Wed, 20 Feb 2019 23:53:47 +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 x1KNrkXJ094385; Wed, 20 Feb 2019 23:53:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KNrewn094353; Wed, 20 Feb 2019 23:53:40 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902202353.x1KNrewn094353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Feb 2019 23:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344398 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/namespace ... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/namespace components/parser compone... X-SVN-Commit-Revision: 344398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C32175BCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 23:53:48 -0000 Author: jkim Date: Wed Feb 20 23:53:39 2019 New Revision: 344398 URL: https://svnweb.freebsd.org/changeset/base/344398 Log: MFV: r344395 Import ACPICA 20190215. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump1.c head/sys/contrib/dev/acpica/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exserial.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/include/acclib.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/actbinfo.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/changes.txt Wed Feb 20 23:53:39 2019 (r344398) @@ -1,11 +1,100 @@ ---------------------------------------- -08 January 2019. Summary of changes for version 20190108: +15 February 2019. Summary of changes for version 20190215: This release is available at https://acpica.org/downloads +0) Support for ACPI specification version 6.3: + +Add PCC operation region support for the AML interpreter. This adds PCC +operation region support in the AML interpreter and a default handler for +acpiexec. The change also renames the PCC region address space keyword to +PlatformCommChannel. + +Support for new predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG. +These methods provide OSPM with health information and device boot +status. + +PDTT: Add TriggerOrder to the PCC Identifier structure. The field value +defines if the trigger needs to be invoked by OSPM before or at the end +of kernel crash dump processing/handling operation. + +SRAT: Add Generic Affinity Structure subtable. This subtable in the SRAT +is used for describing devices such as heterogeneous processors, +accelerators, GPUs, and IO devices with integrated compute or DMA +engines. + +MADT: Add support for statistical profiling in GICC. Statistical +profiling extension (SPE) is an architecture-specific feature for ARM. + +MADT: Add online capable flag. If this bit is set, system hardware +supports enabling this processor during OS runtime. + +New Error Disconnect Recover Notification value. There are a number of +scenarios where system Firmware in collaboration with hardware may +disconnect one or more devices from the rest of the system for purposes +of error containment. Firmware can use this new notification value to +alert OSPM of such a removal. + +PPTT: New additional fields in Processor Structure Flags. These flags +provide more information about processor topology. + +NFIT/Disassembler: Change a field name from "Address Range" to "Region +Type". + +HMAT updates: make several existing fields to be reserved as well as +rename subtable 0 to "memory proximity domain attributes". + +GTDT: Add support for new GTDT Revision 3. This revision adds information +for the EL2 timer. + +iASL: Update the HMAT example template for new fields. + +iASL: Add support for the new revision of the GTDT (Rev 3). + + 1) ACPICA kernel-resident subsystem: +AML Parser: fix the main AML parse loop to correctly skip erroneous +extended opcodes. AML opcodes come in two lengths: 1-byte opcodes and 2- +byte extended opcodes. If an error occurs during an AML table load, the +AML parser will continue loading the table by skipping the offending +opcode. This implements a "load table at any cost" philosophy. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Add checks for illegal object references, such as a reference +outside of method to an object within a method. Such an object is only +temporary. + +iASL: Emit error for creation of a zero-length operation region. Such a +region is rather pointless. If encountered, a runtime error is also +implemented in the interpeter. + +Debugger: Fix a possible fault with the "test objects" command. + +iASL: Makefile: support parent directory filenames containing embedded +spaces. + +iASL: Update the TPM2 template to revision 4. + +iASL: Add the ability to report specific warnings or remarks as errors. + +Disassembler: Disassemble OEMx tables as actual AML byte code. +Previously, these tables were treated as "unknown table". + +iASL: Add definition and disassembly for TPM2 revision 3. + +iASL: Add support for TPM2 rev 3 compilation. + + +---------------------------------------- +08 January 2019. Summary of changes for version 20190108: + + +1) ACPICA kernel-resident subsystem: + Updated all copyrights to 2019. This affects all source code modules. @@ -1218,7 +1307,7 @@ internal cache) is detected and ignored via object poi Debugger: Fixed an AML interpreter mutex issue during the single stepping of control methods. If certain debugger commands are executed during -stepping, a mutex aquire/release error could occur. Lv Zheng. +stepping, a mutex acquire/release error could occur. Lv Zheng. Fixed some issues generating ACPICA with the Intel C compiler by restoring the original behavior and compiler-specific include file in @@ -6760,7 +6849,7 @@ keyword is not standard across compilers, and this typ be configured on a per-compiler basis. Lin Ming. -Made the system global AcpiGbl_SystemAwakeAndRunning publically +Made the system global AcpiGbl_SystemAwakeAndRunning publicly available. Added an extern for this boolean in acpixf.h. Some hosts utilize this value @@ -11427,9 +11516,9 @@ Helgaas. Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) -any implicit conversion of a Buffer to a String, 2) a String object +any implicit conversion of a Buffer to a String, 2) a String object result -of the ASL Concatentate operator, 3) the String object result of the ASL +of the ASL Concatenate operator, 3) the String object result of the ASL ToString operator. Fixed a problem in the Windows OS interface layer (OSL) where a @@ -13585,7 +13674,7 @@ next access width boundary (a common coding error.) Renamed OSD_HANDLER to ACPI_OSD_HANDLER, and OSD_EXECUTION_CALLBACK to ACPI_OSD_EXEC_CALLBACK for consistency with other ACPI symbols. Also, these -symbols are lowercased by the latest version of the AcpiSrc tool. +symbols are lowercase by the latest version of the AcpiSrc tool. The prototypes for the PCI interfaces in acpiosxf.h have been updated to rename "Register" to simply "Reg" to prevent certain compilers from @@ -14957,8 +15046,8 @@ with the Linux coding style. Removed the non-Linux SourceSafe module revision number from each module header. -Completed major overhaul of symbols to be lowercased for linux. -Doubled the number of symbols that are lowercased. +Completed major overhaul of symbols to be lowercase for linux. +Doubled the number of symbols that are lowercase. Fixed a problem where identifiers within procedure headers and within quotes were not fully lower cased (they were left with a @@ -16454,7 +16543,7 @@ Summary of changes for this label: 02_14_02 Implemented support in AcpiLoadTable to allow loading of FACS and FADT tables. -Suport for the now-obsolete interim 0.71 64-bit ACPI tables has +Support for the now-obsolete interim 0.71 64-bit ACPI tables has been removed. All 64-bit platforms should be migrated to the ACPI 2.0 tables. The actbl71.h header has been removed from the source tree. @@ -16804,7 +16893,7 @@ Updated all files to apply cleanly against 2.4.16. Added basic PCI Interrupt Routing Table (PRT) support for IA32 (acpi_pci.c), and unified the PRT code for IA32 and IA64. This -version supports both static and dyanmic PRT entries, but dynamic +version supports both static and dynamic PRT entries, but dynamic entries are treated as if they were static (not yet reconfigurable). Architecture- specific code to use this data is absent on IA32 but should be available shortly. @@ -16893,7 +16982,7 @@ power-down, and thermal passive cooling issues (coming Added additional typechecking for Fields within restricted access Operation Regions. All fields within EC and CMOS regions must be -declared with ByteAcc. All fields withing SMBus regions must be +declared with ByteAcc. All fields within SMBus regions must be declared with the BufferAcc access type. Fixed a problem where the listing file output of control methods @@ -17066,7 +17155,7 @@ objects to not be deleted during subsystem termination Fixed a problem with the external AcpiEvaluateObject interface where the subsystem would fault if the named object to be -evaluated refered to a constant such as Zero, Ones, etc. +evaluated referred to a constant such as Zero, Ones, etc. Fixed a problem with IndexFields and BankFields where the subsystem would fault if the index, data, or bank registers were @@ -17133,7 +17222,7 @@ sleeps.) The AcpiEnterSleepState and AcpiLeaveSleepState interfaces now support wake-enabled GPEs. This means that upon entering the sleep state, all GPEs that are not wake-enabled are disabled. -When leaving the sleep state, these GPEs are reenabled. +When leaving the sleep state, these GPEs are re-enabled. A local double-precision divide/modulo module has been added to enhance portability to OS kernels where a 64-bit math library is Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 20 23:53:39 2019 (r344398) @@ -305,6 +305,11 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_MSM", "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"), AH_PREDEF ("_MTL", "Minimum Throttle Limit", "Returns the minimum throttle limit for a thermal zone"), AH_PREDEF ("_MTP", "Memory Type", "Resource Descriptor field"), + AH_PREDEF ("_NBS", "NVDIMM Boot Status", "Returns information about NVDIMM device’s status at boot time"), + AH_PREDEF ("_NCH", "NVDIMM Current Health Information", "Returns current health information of the NVDIMM device"), + AH_PREDEF ("_NIC", "NVDIMM Health Error Injection Capabilities", "Returns health error injection capabilities that are supported by the platform"), + AH_PREDEF ("_NIG", "NVDIMM Inject Health Error Status","Returns currently active health errors and their error attributes that are injected by _NIH"), + AH_PREDEF ("_NIH", "NVDIMM Inject/Clear Health Errors", "Returns the status of injecting or clearing Health Errors"), AH_PREDEF ("_NTT", "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"), AH_PREDEF ("_OFF", "Power Off", "Sets a power resource to the off state"), AH_PREDEF ("_ON_", "Power On", "Sets a power resource to the on state"), @@ -393,7 +398,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_SDD", "Set Device Data", "Sets data for a SATA device"), AH_PREDEF ("_SEG", "PCI Segment", "Returns a device's PCI Segment Group number"), AH_PREDEF ("_SHL", "Set Hardware Limit", "Sets the hardware limit enforced by the Power Meter"), - AH_PREDEF ("_SHR", "Sharable", "Interrupt share status, Resource Descriptor field"), + AH_PREDEF ("_SHR", "Shareable", "Interrupt share status, Resource Descriptor field"), AH_PREDEF ("_SI_", "System Indicators", "Predefined scope"), AH_PREDEF ("_SIZ", "Size", "DMA transfer size, Resource Descriptor field"), AH_PREDEF ("_SLI", "System Locality Information", "Returns a list of NUMA system localities"), Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 20 23:53:39 2019 (r344398) @@ -226,7 +226,7 @@ AcpiAhMatchUuid ( for (Info = Gbl_AcpiUuids; Info->Description; Info++) { - /* Null string means desciption is a UUID class */ + /* Null string means description is a UUID class */ if (!Info->String) { Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1216,7 +1216,7 @@ AcpiDmCreateSubobjectForExternal ( * * DESCRIPTION: Add one external to the namespace by resolvign the external * (by performing a namespace lookup) and annotating the resulting - * namespace node with the approperiate information if the type + * namespace node with the appropriate information if the type * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 20 23:53:39 2019 (r344398) @@ -906,7 +906,7 @@ AcpiDmUpdateResourceName ( * * PARAMETERS: BitIndex - Index into the resource descriptor * Resource - Pointer to the raw resource data - * ResourceIndex - Index correspoinding to the resource type + * ResourceIndex - Index corresponding to the resource type * * RETURN: Pointer to the resource tag (ACPI_NAME). NULL if no match. * Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 20 23:53:39 2019 (r344398) @@ -320,7 +320,7 @@ static const char *AcpiDmHestNotifySubnames[ static const char *AcpiDmHmatSubnames[] = { - "Memory Subystem Address Range", + "Memory Proximity Domain Attributes", "System Locality Latency and Bandwidth Information", "Memory Side Cache Information", "Unknown Structure Type" /* Reserved */ @@ -400,6 +400,7 @@ static const char *AcpiDmSratSubnames[] = "Processor Local x2APIC Affinity", "GICC Affinity", "GIC ITS Affinity", /* Acpi 6.2 */ + "Generic Initiator Affinity", /* Acpi 6.3 */ "Unknown Subtable Type" /* Reserved */ }; Modified: head/sys/contrib/dev/acpica/common/dmtbdump1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbdump1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1106,9 +1106,26 @@ AcpiDmDumpGtdt ( return; } - /* Subtables */ + /* Rev 3 fields */ Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + if (Table->Revision > 2) + { + SubtableLength = sizeof (ACPI_GTDT_EL2); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + SubtableLength, AcpiDmTableInfoGtdtEl2); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += SubtableLength; + } + + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + /* Subtables */ + while (Offset < Table->Length) { /* Common subtable header */ @@ -1406,7 +1423,7 @@ AcpiDmDumpHmat ( case ACPI_HMAT_TYPE_ADDRESS_RANGE: InfoTable = AcpiDmTableInfoHmat0; - Length = sizeof (ACPI_HMAT_ADDRESS_RANGE); + Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN); break; case ACPI_HMAT_TYPE_LOCALITY: Modified: head/sys/contrib/dev/acpica/common/dmtbdump3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump3.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbdump3.c Wed Feb 20 23:53:39 2019 (r344398) @@ -333,6 +333,11 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat4; break; + case ACPI_SRAT_TYPE_GENERIC_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat5; + break; + default: AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", Subtable->Type); Modified: head/sys/contrib/dev/acpica/common/dmtbinfo1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -814,6 +814,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] = ACPI_DMT_TERMINATOR }; +/* GDTD EL2 timer info. This table is appended to AcpiDmTableInfoGtdt for rev 3 and later */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtEl2[] = +{ + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerGsiv), "Virtual EL2 Timer GSIV", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerFlags), "Virtual EL2 Timer Flags", 0}, + ACPI_DMT_TERMINATOR +}; + /* GTDT Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] = @@ -1105,20 +1114,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] = /* HMAT subtables */ -/* 0x00: Memory Subsystem Address Range */ +/* 0x00: Memory proximity domain attributes */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] = { {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG1, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Memory Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG2, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Reservation Hint", 0}, {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (ProcessorPD), "Processor Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressBase), "Physical Address Range Base", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressLength), "Physical Address Range Size", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved3), "Reserved3", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved4), "Reserved4", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/common/dmtbinfo2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo2.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo2.c Wed Feb 20 23:53:39 2019 (r344398) @@ -535,6 +535,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[] = {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, + {ACPI_DMT_FLAG1, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Runtime Online Capable", 0}, ACPI_DMT_TERMINATOR }; @@ -683,7 +684,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0}, {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (EfficiencyClass), "Efficiency Class", 0}, - {ACPI_DMT_UINT24, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (SpeInterrupt), "SPE Overflow Interrupt", 0}, ACPI_DMT_TERMINATOR }; @@ -946,7 +948,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[] = {ACPI_DMT_FLAG1, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Proximity Domain Valid", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (ProximityDomain), "Proximity Domain", 0}, - {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Address Range GUID", 0}, + {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Region Type GUID", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Address), "Address Range Base", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Length), "Address Range Length", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (MemoryMapping), "Memory Map Attribute", 0}, @@ -1246,6 +1248,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[] = {ACPI_DMT_UINT8, ACPI_PDTT0_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Runtime Trigger", 0}, {ACPI_DMT_FLAG1, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Wait for Completion", 0}, + {ACPI_DMT_FLAG2, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Trigger Order", 0}, ACPI_DMT_TERMINATOR }; @@ -1348,6 +1351,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] = {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0}, {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0}, + {ACPI_DMT_FLAG2, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Processor is a thread", 0}, + {ACPI_DMT_FLAG3, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Node is a leaf", 0}, + {ACPI_DMT_FLAG4, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Identical Implementation", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0}, @@ -1390,12 +1396,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] = { {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "VENDOR_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "LEVEL_1_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "LEVEL_2_ID", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "MAJOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "MINOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "SPIN_REV", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "Vendor ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "Level1 ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "Level2 ID", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "Major revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "Minor revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "Spin revision", 0}, ACPI_DMT_TERMINATOR }; @@ -1473,7 +1479,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] = /******************************************************************************* * - * SDEI - Software Delegated Execption Interface Descriptor Table + * SDEI - Software Delegated Exception Interface Descriptor Table * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/common/dmtbinfo3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo3.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo3.c Wed Feb 20 23:53:39 2019 (r344398) @@ -368,6 +368,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = ACPI_DMT_TERMINATOR }; +/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[] = +{ + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, + {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 20 23:53:39 2019 (r344398) @@ -494,6 +494,7 @@ CmDoCompile ( UtEndEvent (Event); UtEndEvent (FullCompile); + AslCheckExpectedExceptions (); CmCleanupAndExit (); return (0); @@ -811,7 +812,6 @@ CmCleanupAndExit ( BOOLEAN DeleteAmlFile = FALSE; - AslCheckExpectedExceptions (); AePrintErrorLog (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 20 23:53:39 2019 (r344398) @@ -702,7 +702,7 @@ OpnDoPackage ( /* - * aslopt - optmization + * aslopt - optimization */ void OptOptimizeNamePath ( @@ -1153,7 +1153,7 @@ OtXrefWalkPart1 ( /* - * aslutils - common compiler utilites + * aslutils - common compiler utilities */ void DbgPrint ( Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 20 23:53:39 2019 (r344398) @@ -692,7 +692,7 @@ NamePathTail [.]{NameSeg} "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ -"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ +"PlatformCommChannel" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ @@ -816,6 +816,13 @@ NamePathTail [.]{NameSeg} s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1); if (strcmp (AslCompilertext, "\\")) { + /* + * According to the ACPI specification, + * NameSegments must have length of 4. If + * the NameSegment has length less than 4, + * they are padded with underscores to meet + * the required length. + */ strcpy (s, "____"); AcpiUtStrupr (AslCompilertext); } Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Wed Feb 20 23:53:39 2019 (r344398) @@ -331,8 +331,8 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ - AslDualParseOpError (ASL_WARNING, ASL_MSG_EXTERN_COLLISION, Child, - Child->Asl.Value.String, ASL_MSG_EXTERN_FOUND_HERE, Node->Op, + AslDualParseOpError (ASL_WARNING, ASL_MSG_NAME_EXISTS, Child, + Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, Node->Op->Asl.ExternalName); } } @@ -575,7 +575,7 @@ LdNamespace1Begin ( if (Status == AE_NOT_FOUND) { /* - * This is either a foward reference or the object truly + * This is either a forward reference or the object truly * does not exist. The two cases can only be differentiated * during the cross-reference stage later. Mark the Op/Name * as not-found for now to indicate the need for further Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Feb 20 23:53:39 2019 (r344398) @@ -353,15 +353,17 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NULL_RESOURCE_TEMPLATE */ "Empty Resource Template (END_TAG only)", /* ASL_MSG_FOUND_HERE */ "Original name creation/declaration below: ", /* ASL_MSG_ILLEGAL_RECURSION */ "Illegal recursive call to method that creates named objects", -/* ASL_MSG_EXTERN_COLLISION */ "A name cannot be defined and declared external in the same table", -/* ASL_MSG_FOUND_HERE_EXTERN */ "Remove one of the declarations indicated above or below:", +/* ASL_MSG_PLACE_HOLDER_00 */ "", /* TODO: fill in this slot with a new error message */ +/* ASL_MSG_PLACE_HOLDER_01 */ "", /* TODO: fill in this slot with a new error message */ /* ASL_MSG_OEM_TABLE_ID */ "Invalid OEM Table ID", /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", /* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", /* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", -/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", +/* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", +/* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed" }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Feb 20 23:53:39 2019 (r344398) @@ -355,8 +355,8 @@ typedef enum ASL_MSG_NULL_RESOURCE_TEMPLATE, ASL_MSG_FOUND_HERE, ASL_MSG_ILLEGAL_RECURSION, - ASL_MSG_EXTERN_COLLISION, - ASL_MSG_EXTERN_FOUND_HERE, + ASL_MSG_PLACE_HOLDER_00, + ASL_MSG_PLACE_HOLDER_01, ASL_MSG_OEM_TABLE_ID, ASL_MSG_OEM_ID, ASL_MSG_UNLOAD, @@ -364,6 +364,8 @@ typedef enum ASL_MSG_LONG_SLEEP, ASL_MSG_PREFIX_NOT_EXIST, ASL_MSG_NAMEPATH_NOT_EXIST, + ASL_MSG_REGION_LENGTH, + ASL_MSG_TEMPORARY_OBJECT, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Feb 20 23:53:39 2019 (r344398) @@ -657,6 +657,7 @@ OpnDoRegion ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *Next; + ACPI_ADR_SPACE_TYPE SpaceId; /* Opcode is parent node */ @@ -664,9 +665,10 @@ OpnDoRegion ( Next = Op->Asl.Child; - /* Second child is the space ID*/ + /* Second child is the space ID */ Next = Next->Asl.Next; + SpaceId = (ACPI_ADR_SPACE_TYPE) Next->Common.Value.Integer; /* Third child is the region offset */ @@ -677,7 +679,13 @@ OpnDoRegion ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode == PARSEOP_INTEGER) { + /* Check for zero length */ + Op->Asl.Value.Integer = Next->Asl.Value.Integer; + if (!Op->Asl.Value.Integer && (SpaceId < ACPI_NUM_PREDEFINED_REGIONS)) + { + AslError (ASL_ERROR, ASL_MSG_REGION_LENGTH, Op, NULL); + } } else { Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Feb 20 23:53:39 2019 (r344398) @@ -814,7 +814,7 @@ OptOptimizeNamePath ( ACPI_FREE (ExternalNameString); /* - * Attempt an optmization depending on the type of namepath + * Attempt an optimization depending on the type of namepath */ if (Flags & (AML_NAMED | AML_CREATE)) { Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Feb 20 23:53:39 2019 (r344398) @@ -449,7 +449,7 @@ ApCheckPredefinedReturnValue ( * DESCRIPTION: Check for a predefined name for a static object (created via * the ASL Name operator). If it is a predefined ACPI name, ensure * that the name does not require any arguments (which would - * require a control method implemenation of the name), and that + * require a control method implementation of the name), and that * the type of the object is one of the expected types for the * predefined name. * Modified: head/sys/contrib/dev/acpica/compiler/aslprintf.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprintf.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslprintf.c Wed Feb 20 23:53:39 2019 (r344398) @@ -239,7 +239,7 @@ OpcDoFprintf ( * RETURN: None * * DESCRIPTION: Convert printf macro to a Store AML operation. The printf - * macro parse tree is layed out as follows: + * macro parse tree is laid out as follows: * * Op - printf parse op * Op->Child - Format string Modified: head/sys/contrib/dev/acpica/compiler/aslresources.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresources.y Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslresources.y Wed Feb 20 23:53:39 2019 (r344398) @@ -866,7 +866,7 @@ UartSerialBusTerm OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ @@ -891,7 +891,7 @@ UartSerialBusTermV2 OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Feb 20 23:53:39 2019 (r344398) @@ -610,7 +610,7 @@ loop: /* * Check for nested comment -- can help catch cases where a previous - * comment was accidently left unterminated + * comment was accidentally left unterminated */ if ((c1 == '/') && (c == '*')) { Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Wed Feb 20 23:53:39 2019 (r344398) @@ -174,6 +174,12 @@ XfNamespaceLocateEnd ( UINT32 Level, void *Context); +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node); + static ACPI_PARSE_OBJECT * XfGetParentMethod ( ACPI_PARSE_OBJECT *Op); @@ -408,6 +414,7 @@ XfGetParentMethod ( return (NULL); /* No parent method found */ } + /******************************************************************************* * * FUNCTION: XfNamespaceLocateBegin @@ -488,7 +495,7 @@ XfNamespaceLocateBegin ( Node->ArgCount = (UINT8) (((UINT8) NextOp->Asl.Value.Integer) & 0x07); - /* We will track all posible ArgXs */ + /* We will track all possible ArgXs */ for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { @@ -776,6 +783,15 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } + /* Check for an attempt to access an object in another method */ + + if (!XfValidateCrossReference (Op, OpInfo, Node)) + { + AslError (ASL_ERROR, ASL_MSG_TEMPORARY_OBJECT, Op, + Op->Asl.ExternalName); + return_ACPI_STATUS (Status); + } + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) @@ -1233,4 +1249,104 @@ XfNamespaceLocateEnd ( } return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: XfValidateCrossReference + * + * PARAMETERS: Op - Parse Op that references the object + * OpInfo - Parse Op info struct + * Node - Node for the referenced object + * + * RETURN: TRUE if the reference is legal, FALSE otherwise + * + * DESCRIPTION: Determine if a reference to another object is allowed. + * + * EXAMPLE: + * Method (A) {Name (INT1, 1)} Declaration of object INT1 + * Method (B) (Store (2, \A.INT1)} Illegal reference to object INT1 + * (INT1 is temporary, valid only during + * execution of A) + * + * NOTES: + * A null pointer returned by either XfGetParentMethod or + * UtGetParentMethod indicates that the parameter object is not + * within a control method. + * + * Five cases are handled: Case(Op, Node) + * 1) Case(0,0): Op is not within a method, Node is not --> OK + * 2) Case(0,1): Op is not within a method, but Node is --> Illegal + * 3) Case(1,0): Op is within a method, Node is not --> OK + * 4) Case(1,1): Both are within the same method --> OK + * 5) Case(1,1): Both are in methods, but not same method --> Illegal + * + ******************************************************************************/ + +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_PARSE_OBJECT *ReferencingMethodOp; + ACPI_NAMESPACE_NODE *ReferencedMethodNode; + + + /* Ignore actual named (and related) object declarations */ + + if (OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_DEFER | AML_HAS_ARGS)) + { + return (TRUE); + } + + /* + * 1) Search upwards in parse tree for owner of the referencing object + * 2) Search upwards in namespace to find the owner of the referenced object + */ + ReferencingMethodOp = XfGetParentMethod (Op); + ReferencedMethodNode = UtGetParentMethod (Node); + + if (!ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 1) Case (0,0): Both Op and Node are not within methods + * --> OK + */ + return (TRUE); + } + + if (!ReferencingMethodOp && ReferencedMethodNode) + { + /* + * 2) Case (0,1): Op is not in a method, but Node is within a + * method --> illegal + */ + return (FALSE); + } + else if (ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 3) Case (1,0): Op is within a method, but Node is not + * --> OK + */ + return (TRUE); + } + else if (ReferencingMethodOp->Asl.Node == ReferencedMethodNode) + { + /* + * 4) Case (1,1): Both Op and Node are within the same method + * --> OK + */ + return (TRUE); + } + else + { + /* + * 5) Case (1,1), Op and Node are in different methods + * --> Illegal + */ + return (FALSE); + } } Modified: head/sys/contrib/dev/acpica/compiler/cvcompiler.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/cvcompiler.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/cvcompiler.c Wed Feb 20 23:53:39 2019 (r344398) @@ -168,7 +168,7 @@ * * DESCRIPTION: Process a single line comment of a c Style comment. This * function captures a line of a c style comment in a char* and - * places the comment in the approperiate global buffer. + * places the comment in the appropriate global buffer. * ******************************************************************************/ @@ -294,7 +294,7 @@ CvProcessComment ( * RETURN: none * * DESCRIPTION: Process a single line comment. This function captures a comment - * in a char* and places the comment in the approperiate global + * in a char* and places the comment in the appropriate global * buffer through CvPlaceComment * ******************************************************************************/ @@ -333,7 +333,7 @@ CvProcessCommentType2 ( * * would be lexically analyzed as a single comment. * - * Create a new string with the approperiate spaces. Since we need + * Create a new string with the appropriate spaces. Since we need * to account for the proper spacing, the actual comment, * extra 2 spaces so that this comment can be converted to the "/ *" * style and the null terminator, the string would look something @@ -380,7 +380,7 @@ CvProcessCommentType2 ( * RETURN: TotalCommentLength - Length of all comments within this op. * * DESCRIPTION: Calculate the length that the each comment takes up within Op. - * Comments look like the follwoing: [0xA9 OptionBtye comment 0x00] + * Comments look like the following: [0xA9 OptionBtye comment 0x00] * therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual * length of this comment. * @@ -963,7 +963,7 @@ CvAppendInlineComment ( * RETURN: None * * DESCRIPTION: Given type and CommentString, this function places the - * CommentString in the approperiate global comment list or char* + * CommentString in the appropriate global comment list or char* * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/compiler/cvparser.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/cvparser.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/cvparser.c Wed Feb 20 23:53:39 2019 (r344398) @@ -276,7 +276,7 @@ CvInitFileTree ( AcpiGbl_FileTreeRoot->File = AcpiGbl_OutputFile; /* - * Set this to true because we dont need to output + * Set this to true because we don't need to output * an include statement for the topmost file */ AcpiGbl_FileTreeRoot->IncludeWritten = TRUE; @@ -514,7 +514,7 @@ CvFileAddressLookup( * RETURN: None * * DESCRIPTION: Takes a given parse op, looks up its Op->Common.Aml field - * within the file tree and fills in approperiate file information + * within the file tree and fills in appropriate file information * from a matching node within the tree. * This is referred as ASL_CV_LABEL_FILENODE. * @@ -1005,7 +1005,7 @@ CvCaptureComments ( * * RETURN: None * - * DESCRIPTION: Transfer all of the commments stored in global containers to the + * DESCRIPTION: Transfer all of the comments stored in global containers to the * given Op. This will be invoked shortly after the parser creates * a ParseOp. * This is referred as ASL_CV_TRANSFER_COMMENTS. Modified: head/sys/contrib/dev/acpica/compiler/dtexpress.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtexpress.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dtexpress.c Wed Feb 20 23:53:39 2019 (r344398) @@ -372,7 +372,7 @@ DtDoOperator ( * * RETURN: Table offset associated with the label * - * DESCRIPTION: Lookup a lable and return its value. + * DESCRIPTION: Lookup a label and return its value. * *****************************************************************************/ Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Wed Feb 20 23:53:39 2019 (r344398) @@ -375,7 +375,7 @@ DtParseLine ( return (AE_OK); } - /* All lines after "Raw Table Data" are ingored */ + /* All lines after "Raw Table Data" are ignored */ if (strstr (LineBuffer, ACPI_RAW_TABLE_DATA_HEADER)) { Modified: head/sys/contrib/dev/acpica/compiler/dttable1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dttable1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -831,7 +831,7 @@ DtCompileDrtm ( DtInsertSubtable (ParentTable, Subtable); /* - * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care + * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HADER fields. */ #if 0 @@ -1002,13 +1002,35 @@ DtCompileGtdt ( ACPI_SUBTABLE_HEADER *GtdtHeader; ACPI_DMTABLE_INFO *InfoTable; UINT32 GtCount; + ACPI_TABLE_HEADER *Header; + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + + /* Compile the main table */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); + } + + /* GTDT revision 3 later contains 2 extra fields before subtables */ + + if (Header->Revision > 2) + { + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoGtdtEl2, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } ParentTable = DtPeekSubtable (); Modified: head/sys/contrib/dev/acpica/compiler/dttable2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable2.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dttable2.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1733,6 +1733,11 @@ DtCompileSrat ( InfoTable = AcpiDmTableInfoSrat4; break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 21 01:17:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C197014E4ECE; Thu, 21 Feb 2019 01:17:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 419D081547; Thu, 21 Feb 2019 01:17:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7B5503D6168; Thu, 21 Feb 2019 12:17:23 +1100 (AEDT) Date: Thu, 21 Feb 2019 12:17:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Bright cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog In-Reply-To: <201902202205.x1KM5iZX036319@repo.freebsd.org> Message-ID: <20190221121712.Y989@besplex.bde.org> References: <201902202205.x1KM5iZX036319@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=tFM545eivrnJSQZQWzUA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 419D081547 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 01:17:34 -0000 On Wed, 20 Feb 2019, David Bright wrote: > Log: > Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog > > The result of a strdup() was stored in a global variable and not freed > before program exit. This is a follow-up to r343906. That change This was an especially large bug in Coverity. Understanding that exit(3) exits is about the first thing to understand for a checker. Now it is also a style bug in the source code. > attempted to plug these resource leaks but managed to miss a code path > on which the leak still occurs. Plug the leak on that path, too. > Modified: head/usr.sbin/newsyslog/newsyslog.c > ============================================================================== > --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 (r344388) > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 (r344389) > @@ -793,6 +793,9 @@ usage(void) > fprintf(stderr, > "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" > " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); > + /* Free global dynamically-allocated storage. */ > + free(timefnamefmt); > + free(requestor); > exit(1); > } There was no leak here. exit(3) frees storage much more finally than free(3). It is especially obvious that there is no leak here, since the exit() is 1-2 lines later than the frees. In theory, exit() might fail because it tries to allocate 100 MB more storage but wouldn't fail if 100 bytes are freed here (applications can easily do this foot shooting by allocating without freeing in atexit() destructors). In practice, even allocation failures "can't happen", except in programs that use setrlimit followed but foot shooting to test the limits. setrlimit is now broken for this purpose, since it doesn't limit allocations done using mmap() instead of break(), and malloc() now uses mmap(). If coverity understood this and wanted to spam you with warnings, then it would not warn about this, but would warn about more important things like failure to fflush() or fclose() or check for or handle errors for all open streams before calling exit(). Also, if all callers of usage() are not understood, for failures to switch stderr to unbuffered mode before using it in usage(). The error reporting is even harder to do if stderr is not available. Windowing systems and even curses need to do lots more cleanup _before_ exit() and it may be difficult to clean up enough to print error messages using the windowing system. Bruce From owner-svn-src-head@freebsd.org Thu Feb 21 01:30:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D458414E631A; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0DA8258B; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C979E22C; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L1UbSo044522; Thu, 21 Feb 2019 01:30:37 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L1Ub8c044520; Thu, 21 Feb 2019 01:30:37 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902210130.x1L1Ub8c044520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 21 Feb 2019 01:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344402 - in head: sys/kgssapi usr.sbin/gssd X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head: sys/kgssapi usr.sbin/gssd X-SVN-Commit-Revision: 344402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A0DA8258B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 01:30:39 -0000 Author: sef Date: Thu Feb 21 01:30:37 2019 New Revision: 344402 URL: https://svnweb.freebsd.org/changeset/base/344402 Log: * Handle SIGPIPE in gssd We've got some cases where the other end of gssd's AF_LOCAL socket gets closed, resulting in an error (and SIGPIPE) when it tries to do I/O to it. Closing without cleaning up means the next time nfsd starts up, it hangs, unkillably; this allows gssd to handle that particular error. * Limit the retry cound in gssd_syscall to 5. The default is INT_MAX, which effectively means forever. And it's an uninterruptable RPC call, so it will never stop. The two changes mitigate the problem. Reviewed by: macklem MFC after: 2 weeks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D19153 Modified: head/sys/kgssapi/gss_impl.c head/usr.sbin/gssd/gssd.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Thu Feb 21 00:44:26 2019 (r344401) +++ head/sys/kgssapi/gss_impl.c Thu Feb 21 01:30:37 2019 (r344402) @@ -112,6 +112,15 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscal cl = clnt_reconnect_create(nconf, (struct sockaddr *) &sun, GSSD, GSSDVERS, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + /* + * The number of retries defaults to INT_MAX, which effectively + * means an infinite, uninterruptable loop. Limiting it to + * five retries keeps it from running forever. + */ + if (cl != NULL) { + int retry_count = 5; + CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + } } else cl = NULL; Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Thu Feb 21 00:44:26 2019 (r344401) +++ head/usr.sbin/gssd/gssd.c Thu Feb 21 01:30:37 2019 (r344402) @@ -202,6 +202,7 @@ main(int argc, char **argv) signal(SIGHUP, SIG_IGN); } signal(SIGTERM, gssd_terminate); + signal(SIGPIPE, gssd_terminate); memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL; From owner-svn-src-head@freebsd.org Thu Feb 21 02:41:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3F014EAA71; Thu, 21 Feb 2019 02:41:58 +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 4019785AC6; Thu, 21 Feb 2019 02:41:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32C92F1A3; Thu, 21 Feb 2019 02:41:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L2fwir084130; Thu, 21 Feb 2019 02:41:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2fwrk084129; Thu, 21 Feb 2019 02:41:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902210241.x1L2fwrk084129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Feb 2019 02:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344407 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4019785AC6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 02:41:58 -0000 Author: cem Date: Thu Feb 21 02:41:57 2019 New Revision: 344407 URL: https://svnweb.freebsd.org/changeset/base/344407 Log: fuse: Fix a regression introduced in r337165 On systems with non-default DFLTPHYS and/or MAXBSIZE, FUSE would attempt to use a buf cache block size in excess of permitted size. This did not affect most configurations, since DFLTPHYS and MAXBSIZE both default to 64kB. The issue was discovered and reported using a custom kernel with a DFLTPHYS of 512kB. PR: 230260 (comment #9) Reported by: ken@ MFC after: Ï€/ð‘’ weeks Modified: head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Thu Feb 21 02:37:01 2019 (r344406) +++ head/sys/fs/fuse/fuse_vfsops.c Thu Feb 21 02:41:57 2019 (r344407) @@ -338,7 +338,7 @@ fuse_vfsop_mount(struct mount *mp) mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ - mp->mnt_stat.f_iosize = DFLTPHYS; + mp->mnt_stat.f_iosize = MIN(DFLTPHYS, MAXBSIZE); if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); From owner-svn-src-head@freebsd.org Thu Feb 21 04:58:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EFA414F2D6C; Thu, 21 Feb 2019 04:58:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 827E98C5D5; Thu, 21 Feb 2019 04:58:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52a.google.com with SMTP id q206so13166774pgq.4; Wed, 20 Feb 2019 20:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8SRbZvW2DQdpeX/1YUyPPSIJUJ+O8xxLNlilgTneM6M=; b=A+Q8MLAbKmOEX/KBDWj2vcYdgGvknukilHv1d5AYY4sjpCUxrGpz8QgGqR4bCCVl3K NyTP1taHg0Rm/nZVYgP+N3qHA+ndN7iKR8+LYkZ0kThR0vxKCZ8SpcywlvN9DvZHP3Ry 9G7S8gTmK+wRx5PU9Qkmdsouj4R9ThiOuVV34D97YFWovGp+kw2zxZ8aXx0NBzZ9Pr+p +O/Qy7ibph88Xip8unDxRWy2SLc49toN5IsU3p2Af/46E1hWwG1/PEs+1YR3Z4QyWQBY /qzNe/FmWjPbnRC8JYK5DFsg/pVSEp6OOHHwGBAp/96941TQ2SinRsqVpKNvvkT1tnlZ XsMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8SRbZvW2DQdpeX/1YUyPPSIJUJ+O8xxLNlilgTneM6M=; b=ANHFV0KMxVjWRxrYeVBhvBLbGLgKrIXN3meHGPI2pxaVkdv0Fpk1v0HvgrvKReYJx9 HV8vJQHn74gEN+Bbo2qB63NjVBf/fGt7D42ciXNXWEHeSlTWMBgFzRF6k/2acVsrd/Ui dpnU0H2GDr7WOBoJO2YaWNPWbaMjtY2ukb9+uDYABOIUyKqmsUOCBd7dUmalKa8niKRb meKpD3y9kTmwvOE4iiYM8m4iogjpwstwrfeoRmnwTbn60uXYhNt2RjX7MvJ2+PK+U3W6 SUyWdgCH+F6aLipirSY5cIIO+D5kPHLDuRNjDZeDgnOHKmKLevSTdqULnraxvT7RPTUo E3yQ== X-Gm-Message-State: AHQUAubHet/kVTXSENmsmL3wFkMX9Uv/uDZViVHM6ntQhSu3pLZgQMxd 4XyC956PBPS7aFmpeoXaDNI= X-Google-Smtp-Source: AHgI3IakhE8QbXYyFr1OoLTLSG0bovKjFFopJ3ow2xpxl0mxpe182BLQXaqCyuFi7wLosQFfNNGTgw== X-Received: by 2002:a65:510c:: with SMTP id f12mr19411672pgq.40.1550725124355; Wed, 20 Feb 2019 20:58:44 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z18sm34255713pfl.164.2019.02.20.20.58.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 20:58:43 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog From: Enji Cooper In-Reply-To: <20190221121712.Y989@besplex.bde.org> Date: Wed, 20 Feb 2019 20:58:42 -0800 Cc: David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 827E98C5D5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 04:58:46 -0000 > On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: >=20 > On Wed, 20 Feb 2019, David Bright wrote: >=20 >> Log: >> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog >>=20 >> The result of a strdup() was stored in a global variable and not = freed >> before program exit. This is a follow-up to r343906. That change >=20 > This was an especially large bug in Coverity. Understanding that = exit(3) > exits is about the first thing to understand for a checker. >=20 > Now it is also a style bug in the source code. >=20 >> attempted to plug these resource leaks but managed to miss a code = path >> on which the leak still occurs. Plug the leak on that path, too. >=20 >> Modified: head/usr.sbin/newsyslog/newsyslog.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/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 = (r344388) >> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 = (r344389) >> @@ -793,6 +793,9 @@ usage(void) >> fprintf(stderr, >> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] = [-f config_file]\n" >> " [-S pidfile] [-t timefmt] [[-R tagname] = file ...]\n"); >> + /* Free global dynamically-allocated storage. */ >> + free(timefnamefmt); >> + free(requestor); >> exit(1); >> } >=20 > There was no leak here. exit(3) frees storage much more finally than > free(3). >=20 > It is especially obvious that there is no leak here, since the exit() = is > 1-2 lines later than the frees. >=20 > In theory, exit() might fail because it tries to allocate 100 MB more > storage but wouldn't fail if 100 bytes are freed here (applications = can > easily do this foot shooting by allocating without freeing in atexit() > destructors). In practice, even allocation failures "can't happen", > except in programs that use setrlimit followed but foot shooting to = test > the limits. setrlimit is now broken for this purpose, since it = doesn't > limit allocations done using mmap() instead of break(), and malloc() = now > uses mmap(). >=20 > If coverity understood this and wanted to spam you with warnings, then = it > would not warn about this, but would warn about more important things = like > failure to fflush() or fclose() or check for or handle errors for all > open streams before calling exit(). Also, if all callers of usage() = are > not understood, for failures to switch stderr to unbuffered mode = before > using it in usage(). >=20 > The error reporting is even harder to do if stderr is not available. > Windowing systems and even curses need to do lots more cleanup = _before_ > exit() and it may be difficult to clean up enough to print error = messages > using the windowing system. I agree with Bruce. Items like these should be ignored in the Coverity = UI as false positives with reasoning, like =E2=80=9Cglobal variables; = freed on exit=E2=80=9D. As others have noted in past mailing threads, freeing variables on exit = can cause applications to hang for a period of time, while the memory is = being reclaimed. I think it=E2=80=99s best to ignore these kinds of = allocations on exit to avoid introducing unnecessary complexity in the = program, as they=E2=80=99re benign issues. Thank you, -Enji= From owner-svn-src-head@freebsd.org Thu Feb 21 05:20:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA46114F4058 for ; Thu, 21 Feb 2019 05:20:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71FD68D3A5 for ; Thu, 21 Feb 2019 05:20:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id y15so2123949qki.8 for ; Wed, 20 Feb 2019 21:20:22 -0800 (PST) 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=WZO4cSS3pdlTJDHNjH1CexprcxmppJ/U+PIxvcgRCnY=; b=G4HHFMKfhYS1qVStHnqSSKjGqconbMf2q9CMUrduixwDJaTyxd6VCXAj6sI1I/9Kvi UInaVw65wQwvgAibQxdyw5amrwzPShZGnqcopDc2evMFc0Q2BRwFztwhKIWgZDug23qv +r8ruRAw7gwc3XbB4u7UQ9Moe9rQJOtSggsKfglbgkA2bkp70DJO+U9OwHSpmT6U/Esm iciLtxIIM8wCsFSeHrOJ472e7sEXHtBFyPlXehiRgVJN2t7SKxz3s4rX0YA7ZawAexCQ Rhwntn/k8F+30gY7PVUne8Iu5bsAYfdwyiDMK7th04KbBciACwlhZQnP5gHhRu5ka08B g1xg== 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=WZO4cSS3pdlTJDHNjH1CexprcxmppJ/U+PIxvcgRCnY=; b=j/a5tbhDtEN3B4i43yWEJiG5wBJjv+TKgaomNji27xy7kXetqVqYyUiudBIO8kFjxL BXGAiZuTt95Zfs6ESbcdHMxfu3PYcEF9Sb5+LTJdJnPcrPWDiZBVBoQaPQlAOGKISjnt MN3tv9pqFv80Aq5jaDt4QNJKgdcqDs/ihbVeauze+5wDkuEOmnAeFN1h5xqiW/dg1Ck2 yFF42yCBsT8hpqFDXshyzR45XxMyWTge5/98kS2uAzMJaEemQRN9BqKtEN/+clUKp+IN Wn+L+YUE0OPRrtW0cxFJ6QTl9mEsWcc7A9wW7JXVEFk7BPTttDpwuMsiRr0aKkcwZcCL OILg== X-Gm-Message-State: AHQUAuY1wMG8WGccEAUwZeRbqcGm1WcvBchnOtsQYK6v/MtCd0rKnqIB iZZaNbdKkB7SF1AMftDEuSLLmm8lMfB0oO67q6xLSg== X-Google-Smtp-Source: AHgI3IYpxHvwnFKmVaJCOrKPgVjP3eCe1v3belgI3QgVIzsFvKDkNwai8V97MqSfw/ZbHVimtTmI4NRJvoq8D4ZOb1Y= X-Received: by 2002:a37:6fc2:: with SMTP id k185mr17330360qkc.175.1550726421724; Wed, 20 Feb 2019 21:20:21 -0800 (PST) MIME-Version: 1.0 References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> In-Reply-To: <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> From: Warner Losh Date: Wed, 20 Feb 2019 22:20:09 -0700 Message-ID: Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog To: Garrett Cooper Cc: Bruce Evans , David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 71FD68D3A5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 05:20:23 -0000 On Wed, Feb 20, 2019, 9:59 PM Enji Cooper > > On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: > > > > On Wed, 20 Feb 2019, David Bright wrote: > > > >> Log: > >> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog > >> > >> The result of a strdup() was stored in a global variable and not freed > >> before program exit. This is a follow-up to r343906. That change > > > > This was an especially large bug in Coverity. Understanding that exit(= 3) > > exits is about the first thing to understand for a checker. > > > > Now it is also a style bug in the source code. > > > >> attempted to plug these resource leaks but managed to miss a code path > >> on which the leak still occurs. Plug the leak on that path, too. > > > >> Modified: head/usr.sbin/newsyslog/newsyslog.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/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 > (r344388) > >> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 > (r344389) > >> @@ -793,6 +793,9 @@ usage(void) > >> fprintf(stderr, > >> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] > [-f config_file]\n" > >> " [-S pidfile] [-t timefmt] [[-R tagname] fil= e > ...]\n"); > >> + /* Free global dynamically-allocated storage. */ > >> + free(timefnamefmt); > >> + free(requestor); > >> exit(1); > >> } > > > > There was no leak here. exit(3) frees storage much more finally than > > free(3). > > > > It is especially obvious that there is no leak here, since the exit() i= s > > 1-2 lines later than the frees. > > > > In theory, exit() might fail because it tries to allocate 100 MB more > > storage but wouldn't fail if 100 bytes are freed here (applications can > > easily do this foot shooting by allocating without freeing in atexit() > > destructors). In practice, even allocation failures "can't happen", > > except in programs that use setrlimit followed but foot shooting to tes= t > > the limits. setrlimit is now broken for this purpose, since it doesn't > > limit allocations done using mmap() instead of break(), and malloc() no= w > > uses mmap(). > > > > If coverity understood this and wanted to spam you with warnings, then = it > > would not warn about this, but would warn about more important things > like > > failure to fflush() or fclose() or check for or handle errors for all > > open streams before calling exit(). Also, if all callers of usage() ar= e > > not understood, for failures to switch stderr to unbuffered mode before > > using it in usage(). > > > > The error reporting is even harder to do if stderr is not available. > > Windowing systems and even curses need to do lots more cleanup _before_ > > exit() and it may be difficult to clean up enough to print error messag= es > > using the windowing system. > > I agree with Bruce. Items like these should be ignored in the Coverity UI > as false positives with reasoning, like =E2=80=9Cglobal variables; freed = on exit=E2=80=9D. > > As others have noted in past mailing threads, freeing variables on exit > can cause applications to hang for a period of time, while the memory is > being reclaimed. I think it=E2=80=99s best to ignore these kinds of alloc= ations on > exit to avoid introducing unnecessary complexity in the program, as they= =E2=80=99re > benign issues. > It's been a long running debate since 92 or so when purify came out and this problem started to be found. In the last 25 years the question hasn't been settled. I tend to think it's a waste of time, though I get that issues like this create a lot of false positives. Warner Thank you, > -Enji > From owner-svn-src-head@freebsd.org Thu Feb 21 08:32:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DA414FCF2B; Thu, 21 Feb 2019 08:32:47 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5679623C; Thu, 21 Feb 2019 08:32:46 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pg1-x536.google.com with SMTP id h11so11072159pgl.0; Thu, 21 Feb 2019 00:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ei4Jjnt754yWA/xrjc4VZZOuSWC143LiIyKb16aMlXo=; b=G0tc0Ri3ksfkdd4agd5M2DDbZad2wXpwQABogx+pCj0UkfW5Ccvy9vr8GjZiH7Ca4s 29ezoxeVBHdFV6NECP9dqjbrVEtrrHFKHaynOrxQUtx9dsVNhUMQZ2ubEPuKp2kz5yaG K81mUZCEXU62a/omvQSLOJFrJu9uNDvpIJampYo7VJC8rCEOwcDqLi9K+PpwpHzhRilI +6S2Yv2PD5dZOGTsiFUyAhd6E6HlmWCVOKNsymjTLfdwF5o2oqj2xu3GAb39UqY9/VEM 2SdhjM3UaRhXksBvhFVGbO87QQ0IqETRRh/ZF50GhFsaKvvdNLWai7JU2SXzOOsWOEJj geJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ei4Jjnt754yWA/xrjc4VZZOuSWC143LiIyKb16aMlXo=; b=q7bmShJN6BuzDxmwHaZqEfBSH0MjLvxa/w/OYUOiCrgTHEgRVmhSwVRTmBk/Rdl19S nVwTCD4YcYKQSL636zgc59Qf3P4xnuZ7aR3vrR19Jux3nAcfs8KloT+q0OzYrkgB2WJ8 QPGDypRq/ucgSGVQDqgoDZwWmjRjBApNrijAebA67JoxryRN7se/odjeBbtlOV1/KXYn iieCbZLCahqKuUe5vmZBQK8KsCrnOlaVHjw8+d8fwXZPueqJa7BG0wLUO0fE9U6rtqIw NK5/UdnFZtYocAxLCCyoOR30NTDZUABJaRaGgC56R2a5GrUy+gJbN71RKuiEodN7PgNo pQ/g== X-Gm-Message-State: AHQUAuZAdH8ObIkzXpfTYGx6HbWs2TMurHqi0AzxK5lwW6ANHXdvXCeL Rjt7vpU0zGzg5bV3Wnn9ySes9VxT X-Google-Smtp-Source: AHgI3IZwCoaPjF9YEVwBBAwPc6JAgjtSXBVL3glqzkKmVeIIq+Ylz5K0hSShJZ+Zt6XyO4eGhCKvjw== X-Received: by 2002:aa7:8d57:: with SMTP id s23mr38911849pfe.237.1550737965022; Thu, 21 Feb 2019 00:32:45 -0800 (PST) Received: from [192.168.1.105] (119-18-15-55.77120f.syd.nbn.aussiebb.net. [119.18.15.55]) by smtp.gmail.com with ESMTPSA id p2sm26562806pfi.95.2019.02.21.00.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 00:32:44 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r344368 - head/sys/netinet To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902201803.x1KI3haW078567@repo.freebsd.org> From: Kubilay Kocak Message-ID: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 19:32:41 +1100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Thunderbird/66.0 MIME-Version: 1.0 In-Reply-To: <201902201803.x1KI3haW078567@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6B5679623C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 08:32:47 -0000 On 21/02/2019 5:03 am, Michael Tuexen wrote: > Author: tuexen > Date: Wed Feb 20 18:03:43 2019 > New Revision: 344368 > URL: https://svnweb.freebsd.org/changeset/base/344368 > > Log: > Reduce the TCP initial retransmission timeout from 3 seconds to > 1 second as allowed by RFC 6298. > > Reviewed by: kbowling@, Richard Scheffenegger > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D18941 > > Modified: > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_timer.h > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================== > --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) > +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 (r344368) > @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str > * tcp_backoff[1] + > * tcp_backoff[2] + > * tcp_backoff[3]) + 3 * tcp_rexmit_slop, > - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, > + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, > * the odds are that the user has given up attempting to connect by then. > */ > #define SYNCACHE_MAXREXMTS 3 > > Modified: head/sys/netinet/tcp_timer.h > ============================================================================== > --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) > +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 (r344368) > @@ -77,7 +77,7 @@ > #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ > #define TCPTV_SRTTBASE 0 /* base roundtrip time; > if 0, no idea yet */ > -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ > +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ > > #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ > #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ > _______________________________________________ Any way this can be a run-time tunable? From owner-svn-src-head@freebsd.org Thu Feb 21 08:37:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 127B414FD166; Thu, 21 Feb 2019 08:37:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B10C2964BE; Thu, 21 Feb 2019 08:37:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A2671B03A; Thu, 21 Feb 2019 08:37:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L8bekf070586; Thu, 21 Feb 2019 08:37:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L8beve070582; Thu, 21 Feb 2019 08:37:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902210837.x1L8beve070582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 08:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344427 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 344427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B10C2964BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 08:37:41 -0000 Author: bde Date: Thu Feb 21 08:37:39 2019 New Revision: 344427 URL: https://svnweb.freebsd.org/changeset/base/344427 Log: Restore syscons' terminal emulators. The trivial fixes to make them compile will be committed later. The "sc" emulator has the advantages of full support for cons25 and running about 8 times faster than teken (for writing to the frame buffer). The "dumb" emulator has the advantage of being simple. Runtime choice of the emulator is good, but compile time choice is bad. Added: - copied unchanged from r186680, head/sys/dev/syscons/scterm-dumb.c - copied unchanged from r186680, head/sys/dev/syscons/scterm-sc.c - copied unchanged from r186680, head/sys/dev/syscons/sctermvar.h Directory Properties: head/sys/dev/syscons/scterm-dumb.c (props changed) head/sys/dev/syscons/scterm-sc.c (props changed) head/sys/dev/syscons/sctermvar.h (props changed) Copied: head/sys/dev/syscons/scterm-dumb.c (from r186680, head/sys/dev/syscons/scterm-dumb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/scterm-dumb.c) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_syscons.h" + +#include +#include +#include + +#if defined(__sparc64__) || defined(__powerpc__) +#include +#else +#include +#endif + +#include +#include + +#ifdef SC_DUMB_TERMINAL + +/* dumb terminal emulator */ + +static sc_term_init_t dumb_init; +static sc_term_term_t dumb_term; +static sc_term_puts_t dumb_puts; +static sc_term_ioctl_t dumb_ioctl; +static sc_term_clear_t dumb_clear; +static sc_term_input_t dumb_input; +static void dumb_nop(void); + +static sc_term_sw_t sc_term_dumb = { + { NULL, NULL }, + "dumb", /* emulator name */ + "dumb terminal", /* description */ + "*", /* matching renderer */ + 0, /* softc size */ + 0, + dumb_init, + dumb_term, + dumb_puts, + dumb_ioctl, + (sc_term_reset_t *)dumb_nop, + (sc_term_default_attr_t *)dumb_nop, + dumb_clear, + (sc_term_notify_t *)dumb_nop, + dumb_input, +}; + +SCTERM_MODULE(dumb, sc_term_dumb); + +static int +dumb_init(scr_stat *scp, void **softc, int code) +{ + switch (code) { + case SC_TE_COLD_INIT: + ++sc_term_dumb.te_refcount; + break; + case SC_TE_WARM_INIT: + break; + } + return 0; +} + +static int +dumb_term(scr_stat *scp, void **softc) +{ + --sc_term_dumb.te_refcount; + return 0; +} + +static void +dumb_puts(scr_stat *scp, u_char *buf, int len) +{ + while (len > 0) { + ++scp->sc->write_in_progress; + sc_term_gen_print(scp, &buf, &len, SC_NORM_ATTR << 8); + sc_term_gen_scroll(scp, scp->sc->scr_map[0x20], + SC_NORM_ATTR << 8); + --scp->sc->write_in_progress; + } +} + +static int +dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, + int flag, struct proc *p) +{ + vid_info_t *vi; + + switch (cmd) { + case GIO_ATTR: /* get current attributes */ + *(int*)data = SC_NORM_ATTR; + return 0; + case CONS_GETINFO: /* get current (virtual) console info */ + vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return EINVAL; + vi->mv_norm.fore = SC_NORM_ATTR & 0x0f; + vi->mv_norm.back = (SC_NORM_ATTR >> 4) & 0x0f; + vi->mv_rev.fore = SC_NORM_ATTR & 0x0f; + vi->mv_rev.back = (SC_NORM_ATTR >> 4) & 0x0f; + /* + * The other fields are filled by the upper routine. XXX + */ + return ENOIOCTL; + } + return ENOIOCTL; +} + +static void +dumb_clear(scr_stat *scp) +{ + sc_move_cursor(scp, 0, 0); + sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], SC_NORM_ATTR << 8); + mark_all(scp); +} + +static int +dumb_input(scr_stat *scp, int c, struct tty *tp) +{ + return FALSE; +} + +static void +dumb_nop(void) +{ + /* nothing */ +} + +#endif /* SC_DUMB_TERMINAL */ Copied: head/sys/dev/syscons/scterm-sc.c (from r186680, head/sys/dev/syscons/scterm-sc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/scterm-sc.c Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/scterm-sc.c) @@ -0,0 +1,811 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * Copyright (c) 1992-1998 Søren Schmidt + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_syscons.h" + +#include +#include +#include +#include +#include + +#if defined(__sparc64__) || defined(__powerpc__) +#include +#else +#include +#endif + +#include +#include + +#ifndef SC_DUMB_TERMINAL + +#define MAX_ESC_PAR 5 + +/* attribute flags */ +typedef struct { + u_short fg; /* foreground color */ + u_short bg; /* background color */ +} color_t; + +typedef struct { + int flags; +#define SCTERM_BUSY (1 << 0) + int esc; + int num_param; + int last_param; + int param[MAX_ESC_PAR]; + int saved_xpos; + int saved_ypos; + int attr_mask; /* current logical attr mask */ +#define NORMAL_ATTR 0x00 +#define BLINK_ATTR 0x01 +#define BOLD_ATTR 0x02 +#define UNDERLINE_ATTR 0x04 +#define REVERSE_ATTR 0x08 +#define FG_CHANGED 0x10 +#define BG_CHANGED 0x20 + int cur_attr; /* current hardware attr word */ + color_t cur_color; /* current hardware color */ + color_t std_color; /* normal hardware color */ + color_t rev_color; /* reverse hardware color */ + color_t dflt_std_color; /* default normal color */ + color_t dflt_rev_color; /* default reverse color */ +} term_stat; + +static sc_term_init_t scterm_init; +static sc_term_term_t scterm_term; +static sc_term_puts_t scterm_puts; +static sc_term_ioctl_t scterm_ioctl; +static sc_term_reset_t scterm_reset; +static sc_term_default_attr_t scterm_default_attr; +static sc_term_clear_t scterm_clear; +static sc_term_notify_t scterm_notify; +static sc_term_input_t scterm_input; + +static sc_term_sw_t sc_term_sc = { + { NULL, NULL }, + "sc", /* emulator name */ + "syscons terminal", /* description */ + "*", /* matching renderer, any :-) */ + sizeof(term_stat), /* softc size */ + 0, + scterm_init, + scterm_term, + scterm_puts, + scterm_ioctl, + scterm_reset, + scterm_default_attr, + scterm_clear, + scterm_notify, + scterm_input, +}; + +SCTERM_MODULE(sc, sc_term_sc); + +static term_stat reserved_term_stat; +static void scterm_scan_esc(scr_stat *scp, term_stat *tcp, + u_char c); +static int mask2attr(term_stat *tcp); + +static int +scterm_init(scr_stat *scp, void **softc, int code) +{ + term_stat *tcp; + + if (*softc == NULL) { + if (reserved_term_stat.flags & SCTERM_BUSY) + return EINVAL; + *softc = &reserved_term_stat; + } + tcp = *softc; + + switch (code) { + case SC_TE_COLD_INIT: + bzero(tcp, sizeof(*tcp)); + tcp->flags = SCTERM_BUSY; + tcp->esc = 0; + tcp->saved_xpos = -1; + tcp->saved_ypos = -1; + tcp->attr_mask = NORMAL_ATTR; + /* XXX */ + tcp->dflt_std_color.fg = SC_NORM_ATTR & 0x0f; + tcp->dflt_std_color.bg = (SC_NORM_ATTR >> 4) & 0x0f; + tcp->dflt_rev_color.fg = SC_NORM_REV_ATTR & 0x0f; + tcp->dflt_rev_color.bg = (SC_NORM_REV_ATTR >> 4) & 0x0f; + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + ++sc_term_sc.te_refcount; + break; + + case SC_TE_WARM_INIT: + tcp->esc = 0; + tcp->saved_xpos = -1; + tcp->saved_ypos = -1; +#if 0 + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; +#endif + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + } + + return 0; +} + +static int +scterm_term(scr_stat *scp, void **softc) +{ + if (*softc == &reserved_term_stat) { + *softc = NULL; + bzero(&reserved_term_stat, sizeof(reserved_term_stat)); + } + --sc_term_sc.te_refcount; + return 0; +} + +static void +scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c) +{ + static u_char ansi_col[16] = { + FG_BLACK, FG_RED, FG_GREEN, FG_BROWN, + FG_BLUE, FG_MAGENTA, FG_CYAN, FG_LIGHTGREY, + FG_DARKGREY, FG_LIGHTRED, FG_LIGHTGREEN, FG_YELLOW, + FG_LIGHTBLUE, FG_LIGHTMAGENTA, FG_LIGHTCYAN, FG_WHITE + }; + static int cattrs[] = { + 0, /* block */ + CONS_BLINK_CURSOR, /* blinking block */ + CONS_CHAR_CURSOR, /* underline */ + CONS_CHAR_CURSOR | CONS_BLINK_CURSOR, /* blinking underline */ + CONS_RESET_CURSOR, /* reset to default */ + CONS_HIDDEN_CURSOR, /* hide cursor */ + }; + static int tcattrs[] = { + CONS_RESET_CURSOR | CONS_LOCAL_CURSOR, /* normal */ + CONS_HIDDEN_CURSOR | CONS_LOCAL_CURSOR, /* invisible */ + CONS_BLINK_CURSOR | CONS_LOCAL_CURSOR, /* very visible */ + }; + sc_softc_t *sc; + int v0, v1, v2; + int i, n; + + i = n = 0; + sc = scp->sc; + if (tcp->esc == 1) { /* seen ESC */ + switch (c) { + + case '7': /* Save cursor position */ + tcp->saved_xpos = scp->xpos; + tcp->saved_ypos = scp->ypos; + break; + + case '8': /* Restore saved cursor position */ + if (tcp->saved_xpos >= 0 && tcp->saved_ypos >= 0) + sc_move_cursor(scp, tcp->saved_xpos, + tcp->saved_ypos); + break; + + case '[': /* Start ESC [ sequence */ + tcp->esc = 2; + tcp->last_param = -1; + for (i = tcp->num_param; i < MAX_ESC_PAR; i++) + tcp->param[i] = 1; + tcp->num_param = 0; + return; + + case 'M': /* Move cursor up 1 line, scroll if at top */ + sc_term_up_scroll(scp, 1, sc->scr_map[0x20], + tcp->cur_attr, 0, 0); + break; +#ifdef notyet + case 'Q': + tcp->esc = 4; + return; +#endif + case 'c': /* reset */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color + = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_attr = mask2attr(tcp); + sc_change_cursor_shape(scp, + CONS_RESET_CURSOR | CONS_LOCAL_CURSOR, -1, -1); + sc_clear_screen(scp); + break; + + case '(': /* iso-2022: designate 94 character set to G0 */ + tcp->esc = 5; + return; + } + } else if (tcp->esc == 2) { /* seen ESC [ */ + if (c >= '0' && c <= '9') { + if (tcp->num_param < MAX_ESC_PAR) { + if (tcp->last_param != tcp->num_param) { + tcp->last_param = tcp->num_param; + tcp->param[tcp->num_param] = 0; + } else { + tcp->param[tcp->num_param] *= 10; + } + tcp->param[tcp->num_param] += c - '0'; + return; + } + } + tcp->num_param = tcp->last_param + 1; + switch (c) { + + case ';': + if (tcp->num_param < MAX_ESC_PAR) + return; + break; + + case '=': + tcp->esc = 3; + tcp->last_param = -1; + for (i = tcp->num_param; i < MAX_ESC_PAR; i++) + tcp->param[i] = 1; + tcp->num_param = 0; + return; + + case 'A': /* up n rows */ + sc_term_up(scp, tcp->param[0], 0); + break; + + case 'B': /* down n rows */ + sc_term_down(scp, tcp->param[0], 0); + break; + + case 'C': /* right n columns */ + sc_term_right(scp, tcp->param[0]); + break; + + case 'D': /* left n columns */ + sc_term_left(scp, tcp->param[0]); + break; + + case 'E': /* cursor to start of line n lines down */ + n = tcp->param[0]; + if (n < 1) + n = 1; + sc_move_cursor(scp, 0, scp->ypos + n); + break; + + case 'F': /* cursor to start of line n lines up */ + n = tcp->param[0]; + if (n < 1) + n = 1; + sc_move_cursor(scp, 0, scp->ypos - n); + break; + + case 'f': /* Cursor move */ + case 'H': + if (tcp->num_param == 0) + sc_move_cursor(scp, 0, 0); + else if (tcp->num_param == 2) + sc_move_cursor(scp, tcp->param[1] - 1, + tcp->param[0] - 1); + break; + + case 'J': /* Clear all or part of display */ + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + sc_term_clr_eos(scp, n, sc->scr_map[0x20], + tcp->cur_attr); + break; + + case 'K': /* Clear all or part of line */ + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + sc_term_clr_eol(scp, n, sc->scr_map[0x20], + tcp->cur_attr); + break; + + case 'L': /* Insert n lines */ + sc_term_ins_line(scp, scp->ypos, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'M': /* Delete n lines */ + sc_term_del_line(scp, scp->ypos, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'P': /* Delete n chars */ + sc_term_del_char(scp, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr); + break; + + case '@': /* Insert n chars */ + sc_term_ins_char(scp, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr); + break; + + case 'S': /* scroll up n lines */ + sc_term_del_line(scp, 0, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'T': /* scroll down n lines */ + sc_term_ins_line(scp, 0, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'X': /* erase n characters in line */ + n = tcp->param[0]; + if (n < 1) + n = 1; + if (n > scp->xsize - scp->xpos) + n = scp->xsize - scp->xpos; + sc_vtb_erase(&scp->vtb, scp->cursor_pos, n, + sc->scr_map[0x20], tcp->cur_attr); + mark_for_update(scp, scp->cursor_pos); + mark_for_update(scp, scp->cursor_pos + n - 1); + break; + + case 'Z': /* move n tabs backwards */ + sc_term_backtab(scp, tcp->param[0]); + break; + + case '`': /* move cursor to column n */ + sc_term_col(scp, tcp->param[0]); + break; + + case 'a': /* move cursor n columns to the right */ + sc_term_right(scp, tcp->param[0]); + break; + + case 'd': /* move cursor to row n */ + sc_term_row(scp, tcp->param[0]); + break; + + case 'e': /* move cursor n rows down */ + sc_term_down(scp, tcp->param[0], 0); + break; + + case 'm': /* change attribute */ + if (tcp->num_param == 0) { + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + } + for (i = 0; i < tcp->num_param; i++) { + switch (n = tcp->param[i]) { + case 0: /* back to normal */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + case 1: /* bold */ + tcp->attr_mask |= BOLD_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 4: /* underline */ + tcp->attr_mask |= UNDERLINE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 5: /* blink */ + tcp->attr_mask |= BLINK_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 7: /* reverse */ + tcp->attr_mask |= REVERSE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 22: /* remove bold (or dim) */ + tcp->attr_mask &= ~BOLD_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 24: /* remove underline */ + tcp->attr_mask &= ~UNDERLINE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 25: /* remove blink */ + tcp->attr_mask &= ~BLINK_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 27: /* remove reverse */ + tcp->attr_mask &= ~REVERSE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 30: case 31: /* set ansi fg color */ + case 32: case 33: case 34: + case 35: case 36: case 37: + tcp->attr_mask |= FG_CHANGED; + tcp->cur_color.fg = ansi_col[n - 30]; + tcp->cur_attr = mask2attr(tcp); + break; + case 39: /* restore fg color back to normal */ + tcp->attr_mask &= ~(FG_CHANGED|BOLD_ATTR); + tcp->cur_color.fg = tcp->std_color.fg; + tcp->cur_attr = mask2attr(tcp); + break; + case 40: case 41: /* set ansi bg color */ + case 42: case 43: case 44: + case 45: case 46: case 47: + tcp->attr_mask |= BG_CHANGED; + tcp->cur_color.bg = ansi_col[n - 40]; + tcp->cur_attr = mask2attr(tcp); + break; + case 49: /* restore bg color back to normal */ + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg; + tcp->cur_attr = mask2attr(tcp); + break; + } + } + break; + + case 's': /* Save cursor position */ + tcp->saved_xpos = scp->xpos; + tcp->saved_ypos = scp->ypos; + break; + + case 'u': /* Restore saved cursor position */ + if (tcp->saved_xpos >= 0 && tcp->saved_ypos >= 0) + sc_move_cursor(scp, tcp->saved_xpos, + tcp->saved_ypos); + break; + + case 'x': + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + switch (n) { + case 0: /* reset colors and attributes back to normal */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color + = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_attr = mask2attr(tcp); + break; + case 1: /* set ansi background */ + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg + = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 2: /* set ansi foreground */ + tcp->attr_mask &= ~FG_CHANGED; + tcp->cur_color.fg = tcp->std_color.fg + = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 3: /* set adapter attribute directly */ + tcp->attr_mask &= ~(FG_CHANGED | BG_CHANGED); + tcp->cur_color.fg = tcp->std_color.fg + = tcp->param[1] & 0x0f; + tcp->cur_color.bg = tcp->std_color.bg + = (tcp->param[1] >> 4) & 0x0f; + tcp->cur_attr = mask2attr(tcp); + break; + case 5: /* set ansi reverse background */ + tcp->rev_color.bg = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 6: /* set ansi reverse foreground */ + tcp->rev_color.fg = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 7: /* set adapter reverse attribute directly */ + tcp->rev_color.fg = tcp->param[1] & 0x0f; + tcp->rev_color.bg = (tcp->param[1] >> 4) & 0x0f; + tcp->cur_attr = mask2attr(tcp); + break; + } + break; + + case 'z': /* switch to (virtual) console n */ + if (tcp->num_param == 1) + sc_switch_scr(sc, tcp->param[0]); + break; + } + } else if (tcp->esc == 3) { /* seen ESC [0-9]+ = */ + if (c >= '0' && c <= '9') { + if (tcp->num_param < MAX_ESC_PAR) { + if (tcp->last_param != tcp->num_param) { + tcp->last_param = tcp->num_param; + tcp->param[tcp->num_param] = 0; + } else { + tcp->param[tcp->num_param] *= 10; + } + tcp->param[tcp->num_param] += c - '0'; + return; + } + } + tcp->num_param = tcp->last_param + 1; + switch (c) { + + case ';': + if (tcp->num_param < MAX_ESC_PAR) + return; + break; + + case 'A': /* set display border color */ + if (tcp->num_param == 1) { + scp->border=tcp->param[0] & 0xff; + if (scp == sc->cur_scp) + sc_set_border(scp, scp->border); + } + break; + + case 'B': /* set bell pitch and duration */ + if (tcp->num_param == 2) { + scp->bell_pitch = tcp->param[0]; + scp->bell_duration = + (tcp->param[1] * hz + 99) / 100; + } + break; + + case 'C': /* set global/parmanent cursor type & shape */ + i = spltty(); + n = tcp->num_param; + v0 = tcp->param[0]; + v1 = tcp->param[1]; + v2 = tcp->param[2]; + switch (n) { + case 1: /* flags only */ + if (v0 < sizeof(cattrs)/sizeof(cattrs[0])) + v0 = cattrs[v0]; + else /* backward compatibility */ + v0 = cattrs[v0 & 0x3]; + sc_change_cursor_shape(scp, v0, -1, -1); + break; + case 2: + v2 = 0; + v0 &= 0x1f; /* backward compatibility */ + v1 &= 0x1f; + /* FALL THROUGH */ + case 3: /* base and height */ + if (v2 == 0) /* count from top */ + sc_change_cursor_shape(scp, -1, + scp->font_size - v1 - 1, + v1 - v0 + 1); + else if (v2 == 1) /* count from bottom */ + sc_change_cursor_shape(scp, -1, + v0, v1 - v0 + 1); + break; + } + splx(i); + break; + + case 'F': /* set adapter foreground */ + if (tcp->num_param == 1) { + tcp->attr_mask &= ~FG_CHANGED; + tcp->cur_color.fg = tcp->std_color.fg + = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'G': /* set adapter background */ + if (tcp->num_param == 1) { + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg + = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'H': /* set adapter reverse foreground */ + if (tcp->num_param == 1) { + tcp->rev_color.fg = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'I': /* set adapter reverse background */ + if (tcp->num_param == 1) { + tcp->rev_color.bg = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'S': /* set local/temporary cursor type & shape */ + i = spltty(); + n = tcp->num_param; + v0 = tcp->param[0]; + switch (n) { + case 0: + v0 = 0; + /* FALL THROUGH */ + case 1: + if (v0 < sizeof(tcattrs)/sizeof(tcattrs[0])) + sc_change_cursor_shape(scp, + tcattrs[v0], -1, -1); + break; + } + splx(i); + break; + } +#ifdef notyet + } else if (tcp->esc == 4) { /* seen ESC Q */ + /* to be filled */ +#endif + } else if (tcp->esc == 5) { /* seen ESC ( */ + switch (c) { + case 'B': /* iso-2022: desginate ASCII into G0 */ + break; + /* other items to be filled */ + default: + break; + } + } + tcp->esc = 0; +} + +static void +scterm_puts(scr_stat *scp, u_char *buf, int len) +{ + term_stat *tcp; + + tcp = scp->ts; +outloop: + scp->sc->write_in_progress++; + + if (tcp->esc) { + scterm_scan_esc(scp, tcp, *buf); + buf++; + len--; + } else { + switch (*buf) { + case 0x1b: + tcp->esc = 1; + tcp->num_param = 0; + buf++; + len--; + break; + default: + sc_term_gen_print(scp, &buf, &len, tcp->cur_attr); + break; + } + } + + sc_term_gen_scroll(scp, scp->sc->scr_map[0x20], tcp->cur_attr); + + scp->sc->write_in_progress--; + if (len) + goto outloop; +} + +static int +scterm_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, + struct thread *td) +{ + term_stat *tcp = scp->ts; + vid_info_t *vi; + + switch (cmd) { + case GIO_ATTR: /* get current attributes */ + /* FIXME: */ + *(int*)data = (tcp->cur_attr >> 8) & 0xff; + return 0; + case CONS_GETINFO: /* get current (virtual) console info */ + vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return EINVAL; + vi->mv_norm.fore = tcp->std_color.fg; + vi->mv_norm.back = tcp->std_color.bg; + vi->mv_rev.fore = tcp->rev_color.fg; + vi->mv_rev.back = tcp->rev_color.bg; + /* + * The other fields are filled by the upper routine. XXX + */ + return ENOIOCTL; + } + return ENOIOCTL; +} + +static int +scterm_reset(scr_stat *scp, int code) +{ + /* FIXME */ + return 0; +} + +static void +scterm_default_attr(scr_stat *scp, int color, int rev_color) +{ + term_stat *tcp = scp->ts; + + tcp->dflt_std_color.fg = color & 0x0f; + tcp->dflt_std_color.bg = (color >> 4) & 0x0f; + tcp->dflt_rev_color.fg = rev_color & 0x0f; + tcp->dflt_rev_color.bg = (rev_color >> 4) & 0x0f; + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); +} + +static void +scterm_clear(scr_stat *scp) +{ + term_stat *tcp = scp->ts; + + sc_move_cursor(scp, 0, 0); + sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], tcp->cur_attr); + mark_all(scp); +} + +static void +scterm_notify(scr_stat *scp, int event) +{ + switch (event) { + case SC_TE_NOTIFY_VTSWITCH_IN: + break; + case SC_TE_NOTIFY_VTSWITCH_OUT: + break; + } +} + +static int +scterm_input(scr_stat *scp, int c, struct tty *tp) +{ + return FALSE; +} + +/* + * Calculate hardware attributes word using logical attributes mask and + * hardware colors + */ + +/* FIXME */ +static int +mask2attr(term_stat *tcp) +{ + int attr, mask = tcp->attr_mask; + + if (mask & REVERSE_ATTR) { + attr = ((mask & FG_CHANGED) ? + tcp->cur_color.bg : tcp->rev_color.fg) | + (((mask & BG_CHANGED) ? + tcp->cur_color.fg : tcp->rev_color.bg) << 4); + } else + attr = tcp->cur_color.fg | (tcp->cur_color.bg << 4); + + /* XXX: underline mapping for Hercules adapter can be better */ + if (mask & (BOLD_ATTR | UNDERLINE_ATTR)) + attr ^= 0x08; + if (mask & BLINK_ATTR) + attr ^= 0x80; + + return (attr << 8); +} + +#endif /* SC_DUMB_TERMINAL */ Copied: head/sys/dev/syscons/sctermvar.h (from r186680, head/sys/dev/syscons/sctermvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/sctermvar.h Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/sctermvar.h) @@ -0,0 +1,432 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS 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. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 21 09:22:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D9514FF62E; Thu, 21 Feb 2019 09:22:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D8D69C89; Thu, 21 Feb 2019 09:22:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.9] (p57BB46EC.dip0.t-ipconnect.de [87.187.70.236]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id CA965721E281A; Thu, 21 Feb 2019 10:21:57 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344368 - head/sys/netinet From: Michael Tuexen In-Reply-To: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 10:21:56 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-transport@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1141FFDF-F764-4CBB-B245-8E92815FCE8F@freebsd.org> References: <201902201803.x1KI3haW078567@repo.freebsd.org> <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> To: "koobs@freebsd.org" X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 09:22:05 -0000 > On 21. Feb 2019, at 09:32, Kubilay Kocak wrote: >=20 > On 21/02/2019 5:03 am, Michael Tuexen wrote: >> Author: tuexen >> Date: Wed Feb 20 18:03:43 2019 >> New Revision: 344368 >> URL: https://svnweb.freebsd.org/changeset/base/344368 >> Log: >> Reduce the TCP initial retransmission timeout from 3 seconds to >> 1 second as allowed by RFC 6298. >> Reviewed by: kbowling@, Richard Scheffenegger >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D18941 >> Modified: >> head/sys/netinet/tcp_syncache.c >> head/sys/netinet/tcp_timer.h >> Modified: head/sys/netinet/tcp_syncache.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/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -159,7 +159,7 @@ static int syncookie_cmp(struct = in_conninfo *inc, str >> * tcp_backoff[1] + >> * tcp_backoff[2] + >> * tcp_backoff[3]) + 3 * tcp_rexmit_slop, >> - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 45600 ms, >> + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 15600 ms, >> * the odds are that the user has given up attempting to connect by = then. >> */ >> #define SYNCACHE_MAXREXMTS 3 >> Modified: head/sys/netinet/tcp_timer.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -77,7 +77,7 @@ >> #define TCPTV_MSL ( 30*hz) /* max seg = lifetime (hah!) */ >> #define TCPTV_SRTTBASE 0 /* base = roundtrip time; >> if 0, no idea yet */ >> -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO = if no info */ >> +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO = if no info */ >> #define TCPTV_PERSMIN ( 5*hz) /* minimum = persist interval */ >> #define TCPTV_PERSMAX ( 60*hz) /* maximum = persist interval */ >> _______________________________________________ >=20 > Any way this can be a run-time tunable? That is definitely possible. However, changing the default should be = separate from making it sysctl-able. I'll bring this up in the bi-weekly transport call and see what others = think. Best regards Michael >=20 From owner-svn-src-head@freebsd.org Thu Feb 21 09:34:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 428E614D9094; Thu, 21 Feb 2019 09:34: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 DA3B46A928; Thu, 21 Feb 2019 09:34: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 AD7141BAF3; Thu, 21 Feb 2019 09:34: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 x1L9YlK9001870; Thu, 21 Feb 2019 09:34:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9Ylos001869; Thu, 21 Feb 2019 09:34:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902210934.x1L9Ylos001869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Feb 2019 09:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344428 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA3B46A928 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 09:34:48 -0000 Author: tuexen Date: Thu Feb 21 09:34:47 2019 New Revision: 344428 URL: https://svnweb.freebsd.org/changeset/base/344428 Log: This patch addresses an issue brought up by bz@ in D18968: When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen, if user data was received during the TCP handshake and BB logging is used. A KASSERT is also added to detect tcp_reass() calls with illegal parameter combinations. Reported by: bz@ Reviewed by: rrs@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19254 Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Feb 21 08:37:39 2019 (r344427) +++ head/sys/netinet/tcp_reass.c Thu Feb 21 09:34:47 2019 (r344428) @@ -542,6 +542,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq * and should be rewritten (see NetBSD for optimizations). */ + KASSERT(th == NULL || (seq_start != NULL && tlenp != NULL), + ("tcp_reass called with illegal parameter combination " + "(tp=%p, th=%p, seq_start=%p, tlenp=%p, m=%p)", + tp, th, seq_start, tlenp, m)); /* * Call with th==NULL after become established to * force pre-ESTABLISHED data up to user socket. @@ -1062,12 +1066,20 @@ present: } else { #ifdef TCP_REASS_LOGGING tcp_reass_log_new_in(tp, q->tqe_start, q->tqe_len, q->tqe_m, TCP_R_LOG_READ, q); - tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 1); + if (th != NULL) { + tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 1); + } else { + tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 1); + } #endif sbappendstream_locked(&so->so_rcv, q->tqe_m, 0); } #ifdef TCP_REASS_LOGGING - tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 2); + if (th != NULL) { + tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 2); + } else { + tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 2); + } #endif KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt, ("tp:%p seg queue goes negative", tp)); @@ -1083,7 +1095,11 @@ present: tp, &tp->t_segq, tp->t_segqmbuflen); #else #ifdef TCP_REASS_LOGGING - tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, TCP_R_LOG_ZERO, 0); + if (th != NULL) { + tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, TCP_R_LOG_ZERO, 0); + } else { + tcp_log_reassm(tp, NULL, NULL, 0, 0, TCP_R_LOG_ZERO, 0); + } #endif tp->t_segqmbuflen = 0; #endif From owner-svn-src-head@freebsd.org Thu Feb 21 09:43:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F007014D99A8; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B706B6B1FD; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80141BCB2; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9hEJ6006975; Thu, 21 Feb 2019 09:43:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9hElJ006974; Thu, 21 Feb 2019 09:43:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902210943.x1L9hElJ006974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 21 Feb 2019 09:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344429 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 344429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B706B6B1FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 09:43:15 -0000 Author: andrew Date: Thu Feb 21 09:43:14 2019 New Revision: 344429 URL: https://svnweb.freebsd.org/changeset/base/344429 Log: Use KCOV_ENTRY_SIZE for the entry size. Previously it was sizeof(uint64_t). While this is currently true, it may not be on all future architectures. Sponsored by: DARPA, AFRL Modified: head/tests/sys/kern/kcov.c Modified: head/tests/sys/kern/kcov.c ============================================================================== --- head/tests/sys/kern/kcov.c Thu Feb 21 09:34:47 2019 (r344428) +++ head/tests/sys/kern/kcov.c Thu Feb 21 09:43:14 2019 (r344429) @@ -89,7 +89,7 @@ ATF_TC_BODY(kcov_mmap, tc) fd, 0) == MAP_FAILED); ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, - 2 * PAGE_SIZE / sizeof(uint64_t)) == 0); + 2 * PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) == MAP_FAILED); @@ -113,7 +113,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap, tc) fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); @@ -128,7 +128,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap_no_close, tc) fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); @@ -144,7 +144,7 @@ kcov_mmap_enable_thread(void *data) fd = open_kcov(); *(int *)data = fd; - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); @@ -180,7 +180,7 @@ ATF_TC_BODY(kcov_enable, tc) ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == -1); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); /* We need to enable before disable */ ATF_CHECK(ioctl(fd, KIODISABLE, 0) == -1); @@ -208,7 +208,7 @@ ATF_TC_BODY(kcov_enable_no_disable, tc) int fd; fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); close(fd); } @@ -219,7 +219,7 @@ ATF_TC_BODY(kcov_enable_no_disable_no_close, tc) int fd; fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); } @@ -232,7 +232,7 @@ common_head(int *fdp) fd = open_kcov(); ATF_REQUIRE_MSG(ioctl(fd, KIOSETBUFSIZE, - PAGE_SIZE / sizeof(uint64_t)) == 0, + PAGE_SIZE / KCOV_ENTRY_SIZE) == 0, "Unable to set the kcov buffer size"); data = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); From owner-svn-src-head@freebsd.org Thu Feb 21 10:11:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00AA014DA57E; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE096C36A; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65B2E1C058; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LABGdf021112; Thu, 21 Feb 2019 10:11:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LABGQr021111; Thu, 21 Feb 2019 10:11:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902211011.x1LABGQr021111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 21 Feb 2019 10:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344432 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 344432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CE096C36A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 10:11:17 -0000 Author: andrew Date: Thu Feb 21 10:11:15 2019 New Revision: 344432 URL: https://svnweb.freebsd.org/changeset/base/344432 Log: Allow the kcov buffer to be mmaped multiple times. After r344391 this restriction is no longer needed. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_kcov.c head/tests/sys/kern/kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Thu Feb 21 09:54:57 2019 (r344431) +++ head/sys/kern/kern_kcov.c Thu Feb 21 10:11:15 2019 (r344432) @@ -127,7 +127,6 @@ struct kcov_info { size_t bufsize; /* (o) */ kcov_state_t state; /* (s) */ int mode; /* (l) */ - bool mmap; }; /* Prototypes */ @@ -303,7 +302,6 @@ kcov_open(struct cdev *dev, int oflags, int devtype, s info->state = KCOV_STATE_OPEN; info->thread = NULL; info->mode = -1; - info->mmap = false; if ((error = devfs_set_cdevpriv(info, kcov_mmap_cleanup)) != 0) kcov_mmap_cleanup(info); @@ -344,12 +342,10 @@ kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offse if ((error = devfs_get_cdevpriv((void **)&info)) != 0) return (error); - if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries || - info->mmap != false) + if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries) return (EINVAL); vm_object_reference(info->bufobj); - info->mmap = true; *offset = 0; *object = info->bufobj; return (0); Modified: head/tests/sys/kern/kcov.c ============================================================================== --- head/tests/sys/kern/kcov.c Thu Feb 21 09:54:57 2019 (r344431) +++ head/tests/sys/kern/kcov.c Thu Feb 21 10:11:15 2019 (r344432) @@ -80,7 +80,7 @@ ATF_TC_BODY(kcov_bufsize, tc) ATF_TC_WITHOUT_HEAD(kcov_mmap); ATF_TC_BODY(kcov_mmap, tc) { - void *data; + void *data1, *data2; int fd; fd = open_kcov(); @@ -95,12 +95,18 @@ ATF_TC_BODY(kcov_mmap, tc) fd, 0) == MAP_FAILED); ATF_CHECK(mmap(NULL, 3 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) == MAP_FAILED); - ATF_REQUIRE((data = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, + ATF_REQUIRE((data1 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) != MAP_FAILED); - ATF_CHECK(mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, - fd, 0) == MAP_FAILED); + ATF_REQUIRE((data2 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, + MAP_SHARED, fd, 0)) != MAP_FAILED); - munmap(data, 2 * PAGE_SIZE); + *(uint64_t *)data1 = 0x123456789abcdeful; + ATF_REQUIRE(*(uint64_t *)data2 == 0x123456789abcdefull); + *(uint64_t *)data2 = 0xfedcba9876543210ul; + ATF_REQUIRE(*(uint64_t *)data1 == 0xfedcba9876543210ull); + + munmap(data1, 2 * PAGE_SIZE); + munmap(data2, 2 * PAGE_SIZE); close(fd); } From owner-svn-src-head@freebsd.org Thu Feb 21 10:35:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6FC514DB464; Thu, 21 Feb 2019 10:35:33 +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 6C6496D216; Thu, 21 Feb 2019 10:35:33 +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 5D1F41C558; Thu, 21 Feb 2019 10:35:33 +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 x1LAZXuC033119; Thu, 21 Feb 2019 10:35:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LAZXM2033118; Thu, 21 Feb 2019 10:35:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902211035.x1LAZXM2033118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Feb 2019 10:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344433 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C6496D216 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 10:35:34 -0000 Author: tuexen Date: Thu Feb 21 10:35:32 2019 New Revision: 344433 URL: https://svnweb.freebsd.org/changeset/base/344433 Log: The receive buffer autoscaling for TCP is based on a linear growth, which is acceptable in the congestion avoidance phase, but not during slow start. The MTU is is also not taken into account. Use a method instead, which is based on exponential growth working also in slow start and being independent from the MTU. This is joint work with rrs@. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18375 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Feb 21 10:11:15 2019 (r344432) +++ head/sys/netinet/tcp_input.c Thu Feb 21 10:35:32 2019 (r344433) @@ -212,11 +212,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLF &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); -VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(tcp_autorcvbuf_inc), 0, - "Incrementor step size of automatic receive buffer"); - VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, @@ -1449,13 +1444,16 @@ drop: * The criteria to step up the receive buffer one notch are: * 1. Application has not set receive buffer size with * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. - * 2. the number of bytes received during the time it takes - * one timestamp to be reflected back to us (the RTT); - * 3. received bytes per RTT is within seven eighth of the - * current socket buffer size; - * 4. receive buffer size has not hit maximal automatic size; + * 2. the number of bytes received during 1/2 of an sRTT + * is at least 3/8 of the current socket buffer size. + * 3. receive buffer size has not hit maximal automatic size; * - * This algorithm does one step per RTT at most and only if + * If all of the criteria are met we increaset the socket buffer + * by a 1/2 (bounded by the max). This allows us to keep ahead + * of slow-start but also makes it so our peer never gets limited + * by our rwnd which we then open up causing a burst. + * + * This algorithm does two steps per RTT at most and only if * we receive a bulk stream w/o packet losses or reorderings. * Shrinking the buffer during idle times is not necessary as * it doesn't consume any memory when idle. @@ -1472,11 +1470,10 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, stru if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) && tp->t_srtt != 0 && tp->rfbuf_ts != 0 && TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) > - (tp->t_srtt >> TCP_RTT_SHIFT)) { - if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && + ((tp->t_srtt >> TCP_RTT_SHIFT)/2)) { + if (tp->rfbuf_cnt > ((so->so_rcv.sb_hiwat / 2)/ 4 * 3) && so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) { - newsize = min(so->so_rcv.sb_hiwat + - V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); + newsize = min((so->so_rcv.sb_hiwat + (so->so_rcv.sb_hiwat/2)), V_tcp_autorcvbuf_max); } TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); From owner-svn-src-head@freebsd.org Thu Feb 21 14:10:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F55214E1EDC; Thu, 21 Feb 2019 14:10:15 +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 21CAF743FF; Thu, 21 Feb 2019 14:10:15 +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 126411E8DB; Thu, 21 Feb 2019 14:10:15 +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 x1LEAElX042272; Thu, 21 Feb 2019 14:10:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LEAEa2042271; Thu, 21 Feb 2019 14:10:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902211410.x1LEAEa2042271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 14:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344437 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 344437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21CAF743FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 14:10:15 -0000 Author: mav Date: Thu Feb 21 14:10:14 2019 New Revision: 344437 URL: https://svnweb.freebsd.org/changeset/base/344437 Log: Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. Its a hack, we can't know/list all DMA engines, but this covers all I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 (r344436) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 (r344437) @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) if (sc->alut) PNTX_WRITE(sc, 0xc94, 0); - /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ - PNTX_WRITE(sc, 0xdb4, 0x00090001); + /* Enable all Link Interface LUT entries for peer. */ + for (i = 0; i < 32; i += 2) { + PNTX_WRITE(sc, 0xdb4 + i * 2, + 0x00010001 | ((i + 1) << 19) | (i << 3)); + } } /* - * Enable Virtual Interface LUT entry 0 for 0:0.0 and - * entry 1 for our Requester ID reported by chip. + * Enable Virtual Interface LUT entry 0 for 0:0.*. + * entry 1 for our Requester ID reported by the chip, + * entries 2-5 for 0/64/128/192:4.* of I/OAT DMA engines. + * XXX: Its a hack, we can't know all DMA engines, but this covers all + * I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. */ val = (NTX_READ(sc, 0xc90) << 16) | 0x00010001; NTX_WRITE(sc, sc->link ? 0xdb4 : 0xd94, val); + NTX_WRITE(sc, sc->link ? 0xdb8 : 0xd98, 0x40210021); + NTX_WRITE(sc, sc->link ? 0xdbc : 0xd9c, 0xc0218021); /* Set Link to Virtual address translation. */ for (i = 0; i < sc->mw_count; i++) { From owner-svn-src-head@freebsd.org Thu Feb 21 15:08:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5A6B14E43B1; Thu, 21 Feb 2019 15:08:28 +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 786F376C68; Thu, 21 Feb 2019 15:08:28 +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 691AF1F360; Thu, 21 Feb 2019 15:08:28 +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 x1LF8SiL074408; Thu, 21 Feb 2019 15:08:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LF8QeC074396; Thu, 21 Feb 2019 15:08:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902211508.x1LF8QeC074396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Feb 2019 15:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344438 - in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Commit-Revision: 344438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 786F376C68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 15:08:29 -0000 Author: emaste Date: Thu Feb 21 15:08:25 2019 New Revision: 344438 URL: https://svnweb.freebsd.org/changeset/base/344438 Log: svn: support building with WITH_PIE Subversion builds and links against its own .a archives using local rules, so did not benefit from with the WITH_PIE library support added in r344179. Apply the same _pie suffix locally. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D19246 Modified: head/usr.bin/svn/Makefile.inc head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svnbench/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnfsfs/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile Modified: head/usr.bin/svn/Makefile.inc ============================================================================== --- head/usr.bin/svn/Makefile.inc Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/Makefile.inc Thu Feb 21 15:08:25 2019 (r344438) @@ -2,13 +2,14 @@ .include -MK_PIE:= no # Explicit libXXX.a references - .if ${MK_SVN} == "yes" SVNLITE?= .else SVNLITE?= lite .endif +.if ${MK_PIE} != "no" +PIE_SUFFIX= _pie +.endif PACKAGE= svn @@ -40,23 +41,23 @@ LIBSVN_REPOSDIR= ${.OBJDIR:H}/lib/libsvn_repos LIBSVN_SUBRDIR= ${.OBJDIR:H}/lib/libsvn_subr LIBSVN_WCDIR= ${.OBJDIR:H}/lib/libsvn_wc -LIBAPR= ${LIBAPRDIR}/libapr.a -LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a -LIBSERF= ${LIBSERFDIR}/libserf.a +LIBAPR= ${LIBAPRDIR}/libapr${PIE_SUFFIX}.a +LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util${PIE_SUFFIX}.a +LIBSERF= ${LIBSERFDIR}/libserf${PIE_SUFFIX}.a -LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client.a -LIBSVN_DELTA= ${LIBSVN_DELTADIR}/libsvn_delta.a -LIBSVN_DIFF= ${LIBSVN_DIFFDIR}/libsvn_diff.a -LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs.a -LIBSVN_FS_FS= ${LIBSVN_FS_FSDIR}/libsvn_fs_fs.a -LIBSVN_FS_UTIL= ${LIBSVN_FS_UTILDIR}/libsvn_fs_util.a -LIBSVN_FS_X= ${LIBSVN_FS_XDIR}/libsvn_fs_x.a -LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra.a -LIBSVN_RA_LOCAL= ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local.a -LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn.a -LIBSVN_RA_SERF= ${LIBSVN_RA_SERFDIR}/libsvn_ra_serf.a -LIBSVN_REPOS= ${LIBSVN_REPOSDIR}/libsvn_repos.a -LIBSVN_SUBR= ${LIBSVN_SUBRDIR}/libsvn_subr.a -LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc.a +LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client${PIE_SUFFIX}.a +LIBSVN_DELTA= ${LIBSVN_DELTADIR}/libsvn_delta${PIE_SUFFIX}.a +LIBSVN_DIFF= ${LIBSVN_DIFFDIR}/libsvn_diff${PIE_SUFFIX}.a +LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs${PIE_SUFFIX}.a +LIBSVN_FS_FS= ${LIBSVN_FS_FSDIR}/libsvn_fs_fs${PIE_SUFFIX}.a +LIBSVN_FS_UTIL= ${LIBSVN_FS_UTILDIR}/libsvn_fs_util${PIE_SUFFIX}.a +LIBSVN_FS_X= ${LIBSVN_FS_XDIR}/libsvn_fs_x${PIE_SUFFIX}.a +LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra${PIE_SUFFIX}.a +LIBSVN_RA_LOCAL= ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local${PIE_SUFFIX}.a +LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn${PIE_SUFFIX}.a +LIBSVN_RA_SERF= ${LIBSVN_RA_SERFDIR}/libsvn_ra_serf${PIE_SUFFIX}.a +LIBSVN_REPOS= ${LIBSVN_REPOSDIR}/libsvn_repos${PIE_SUFFIX}.a +LIBSVN_SUBR= ${LIBSVN_SUBRDIR}/libsvn_subr${PIE_SUFFIX}.a +LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc${PIE_SUFFIX}.a .endif Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svn/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -26,23 +26,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z magic crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ Modified: head/usr.bin/svn/svnadmin/Makefile ============================================================================== --- head/usr.bin/svn/svnadmin/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnadmin/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnbench/Makefile ============================================================================== --- head/usr.bin/svn/svnbench/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnbench/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -19,23 +19,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z magic crypto ssl pthread Modified: head/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- head/usr.bin/svn/svndumpfilter/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svndumpfilter/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypt pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnfsfs/Makefile ============================================================================== --- head/usr.bin/svn/svnfsfs/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnfsfs/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnlook/Makefile ============================================================================== --- head/usr.bin/svn/svnlook/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnlook/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,16 +18,16 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnmucc/Makefile ============================================================================== --- head/usr.bin/svn/svnmucc/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnmucc/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,23 +18,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} \ Modified: head/usr.bin/svn/svnrdump/Makefile ============================================================================== --- head/usr.bin/svn/svnrdump/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnrdump/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,23 +18,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ Modified: head/usr.bin/svn/svnserve/Makefile ============================================================================== --- head/usr.bin/svn/svnserve/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnserve/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,20 +18,20 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ Modified: head/usr.bin/svn/svnsync/Makefile ============================================================================== --- head/usr.bin/svn/svnsync/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnsync/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,20 +18,20 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ Modified: head/usr.bin/svn/svnversion/Makefile ============================================================================== --- head/usr.bin/svn/svnversion/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnversion/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,12 +18,12 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_WC} ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} \ From owner-svn-src-head@freebsd.org Thu Feb 21 15:29:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA27214E4C8D for ; Thu, 21 Feb 2019 15:29:50 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE32F776A2 for ; Thu, 21 Feb 2019 15:29:49 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-qk1-x741.google.com with SMTP id z13so3173833qki.2 for ; Thu, 21 Feb 2019 07:29:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7O8B8NiQCRhhilisquiHkWkqKzojKEJDUHqSyvgYLLM=; b=KRQQUSSk+M3DQVMS0PmerVgM79cJoCgOp9tCrpaUmm/PN1n8BySG/+k4K7/gErircg vzHAY8mNtiqLXVSXEPCZTG6sxnIfcPjSoDNGIsh+2V0UF9TcSnTR+v26rIReR665aou/ bkbO1uje9q9P2pVvEBu8Udl+S1ifMFndGX+BrApeiWLdH0EmjOrKJlTuZ++8ZPHvh/JO NqqUhZSADGS+GI1YlRJ+vsDYNZDo7Bg+IRWrjg5x80TWXDD4Xtj9JQT1LA7FwOaOHiu4 a/XoZuKnRNxuRkafrzwB0AmUem2R4/o9o7Q/ex1CDb2XqYdPr2BepzZ5dxyxviuCegmW 5dBw== X-Gm-Message-State: AHQUAuZnuXpnBAqsZIPkKvwlOEgfmexgviT0OyHexoc13LTcfeTI2elA cSRgljax6GIufFpT4BwQfO1bFA== X-Google-Smtp-Source: AHgI3Iaj6KvBeXPBcqwY01apj5i6ECMvcqH3rYd2DbDu+7+XPP007ZxHo0I9e9R/hJIHG9qwN9WQIA== X-Received: by 2002:a37:a783:: with SMTP id q125mr22998180qke.264.1550762988648; Thu, 21 Feb 2019 07:29:48 -0800 (PST) Received: from ?IPv6:2607:fb10:7061:7fd::8d34? ([2607:fb10:7061:7fd::8d34]) by smtp.gmail.com with ESMTPSA id k27sm2165688qki.19.2019.02.21.07.29.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 07:29:47 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r344099 - head/sys/net From: Randall Stewart In-Reply-To: <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> Date: Thu, 21 Feb 2019 10:29:46 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: BE32F776A2 X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.61 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; NEURAL_HAM_SHORT(-0.94)[-0.935,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.17)[ip: (3.82), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-1.99), country: US(-0.07)]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; 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]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 15:29:51 -0000 > On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >=20 > On 2/13/19 10:03 AM, Randall Stewart wrote: >> oh and one other thing.. >>=20 >> It was *not* a random IFP.. it was the IFP to the lagg. >>=20 >> I.e. an alloc() was done to the lagg.. and the free was >> done back to the same IFP (that provided the allocate). >=20 > Yes, that's wrong. Suppose the route changes so that my traffic is = now over > em0 instead of lagg0 (where em0 isn't a member of the lagg), how do = you > expect if_lagg_free to invoke em0's free routine? In your case it = does, > but only by accident. It doesn't work in the other case I described = which > is if you have non-lagg interfaces and a route moves from cc0 to em0. = In > that case your existing code that is using the wrong ifp will just = panic. >=20 > These aren't real alloc routines as the lagg and vlan ones don't = allocate > anything, they pass along the request to the child and the child = allocates > the tag. Only ifnet's that actually allocate tags should need to free = them, > and you should be using tag->ifp to as the ifp whose if_snd_tag_free = works. But thats what the lagg=E2=80=99s routine does, use the tag sent in to find the real ifp (where the tag was allocated) and call the if_snd_tag_free() on that. Its not an accident it works, it calls the free of the actual interface where the allocation came from. I don=E2=80=99t see how it would panic. R >=20 >> R >>=20 >>> On Feb 13, 2019, at 1:02 PM, Randall Stewart = wrote: >>>=20 >>> I disagree. If you define an alloc it is only >>> reciprocal that you should define a free. >>>=20 >>> The code in question that hit this was changed (its in a version >>> of rack that has the rate-limit and TLS code).. but I think these >>> things *should* be balanced.. if you provide an Allocate, you >>> should also provide a Free=E2=80=A6=20 >>>=20 >>> R >>>=20 >>>=20 >>>> On Feb 13, 2019, at 12:09 PM, John Baldwin wrote: >>>>=20 >>>> On 2/13/19 6:57 AM, Randall Stewart wrote: >>>>> Author: rrs >>>>> Date: Wed Feb 13 14:57:59 2019 >>>>> New Revision: 344099 >>>>> URL: https://svnweb.freebsd.org/changeset/base/344099 >>>>>=20 >>>>> Log: >>>>> This commit adds the missing release mechanism for the >>>>> ratelimiting code. The two modules (lagg and vlan) did have >>>>> allocation routines, and even though they are indirect (and >>>>> vector down to the underlying interfaces) they both need to >>>>> have a free routine (that also vectors down to the actual = interface). >>>>>=20 >>>>> Sponsored by: Netflix Inc. >>>>> Differential Revision: https://reviews.freebsd.org/D19032 >>>>=20 >>>> Hmm, I don't understand why you'd ever invoke if_snd_tag_free from = anything >>>> but 'tag->ifp' rather than some other ifp. What if the route for a = connection >>>> moves so that a tag allocated on cc0 is now on a route that goes = over em0? >>>> You can't expect em0 to have an if_snd_tag_free routine that will = know to >>>> go invoke cxgbe's snd_tag_free. I think you should always be using >>>> 'tag->ifp->if_snd_tag_free' to free tags and never using any other = ifp. >>>>=20 >>>> That is, I think this should be reverted and that instead you need = to fix >>>> the code invoking if_snd_tag_free to invoke it on the tag's ifp = instead of >>>> some random other ifp. >>>>=20 >>>> --=20 >>>> John Baldwin >>>>=20 >>>>=20 >>>=20 >>> ------ >>> Randall Stewart >>> rrs@netflix.com >>>=20 >>>=20 >>>=20 >>=20 >> ------ >> Randall Stewart >> rrs@netflix.com >>=20 >>=20 >>=20 >=20 >=20 > --=20 > John Baldwin ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Thu Feb 21 15:44:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B202214E53C5; Thu, 21 Feb 2019 15:44: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 4D3D080078; Thu, 21 Feb 2019 15:44: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 3AABD1FA1D; Thu, 21 Feb 2019 15:44: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 x1LFiX5a094849; Thu, 21 Feb 2019 15:44:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LFiXOf094848; Thu, 21 Feb 2019 15:44:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902211544.x1LFiXOf094848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 15:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344440 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D3D080078 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 15:44:33 -0000 Author: markj Date: Thu Feb 21 15:44:32 2019 New Revision: 344440 URL: https://svnweb.freebsd.org/changeset/base/344440 Log: Clear pointers to indicate that the respective locks are released. This fixes a problem in r344231: vm_pageout_launder() may scan two queues when swap is disabled. Reported by: pho MFC with: r344231 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Feb 21 15:31:01 2019 (r344439) +++ head/sys/vm/vm_pageout.c Thu Feb 21 15:44:32 2019 (r344440) @@ -893,10 +893,14 @@ free_page: object = NULL; } } - if (mtx != NULL) + if (mtx != NULL) { mtx_unlock(mtx); - if (object != NULL) + mtx = NULL; + } + if (object != NULL) { VM_OBJECT_WUNLOCK(object); + object = NULL; + } vm_pagequeue_lock(pq); vm_pageout_end_scan(&ss); vm_pagequeue_unlock(pq); From owner-svn-src-head@freebsd.org Thu Feb 21 16:47:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A321714E7A6E; Thu, 21 Feb 2019 16:47: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 4CF2E82FC5; Thu, 21 Feb 2019 16:47: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 36362204D2; Thu, 21 Feb 2019 16:47: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 x1LGlbxf027485; Thu, 21 Feb 2019 16:47:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LGlas2027483; Thu, 21 Feb 2019 16:47:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902211647.x1LGlas2027483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 16:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344441 - head/sys/dev/ioat X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ioat X-SVN-Commit-Revision: 344441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CF2E82FC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 16:47:37 -0000 Author: mav Date: Thu Feb 21 16:47:36 2019 New Revision: 344441 URL: https://svnweb.freebsd.org/changeset/base/344441 Log: Fix few issues in ioat(4) driver. - Do not explicitly count active descriptors. It allows hardware reset to happen while device is still referenced, plus simplifies locking. - Do not stop/start callout each time the queue becomes empty. Let it run to completion and rearm if needed, that is much cheaper then to touch it every time, plus also simplifies locking. - Decouple submit and cleanup locks, making driver reentrant. - Avoid memory mapped status register read on every interrupt. - Improve locking during device attach/detach. - Remove some no longer used variables. Reviewed by: cem MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D19231 Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Feb 21 15:44:32 2019 (r344440) +++ head/sys/dev/ioat/ioat.c Thu Feb 21 16:47:36 2019 (r344441) @@ -1,6 +1,7 @@ /*- * Copyright (C) 2012 Intel Corporation * All rights reserved. + * Copyright (C) 2018 Alexander Motin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$"); #ifndef BUS_SPACE_MAXADDR_40BIT #define BUS_SPACE_MAXADDR_40BIT 0xFFFFFFFFFFULL #endif -#define IOAT_REFLK (&ioat->submit_lock) static int ioat_probe(device_t device); static int ioat_attach(device_t device); @@ -77,7 +77,7 @@ static void ioat_dmamap_cb(void *arg, bus_dma_segment_ static void ioat_interrupt_handler(void *arg); static boolean_t ioat_model_resets_msix(struct ioat_softc *ioat); static int chanerr_to_errno(uint32_t); -static void ioat_process_events(struct ioat_softc *ioat); +static void ioat_process_events(struct ioat_softc *ioat, boolean_t intr); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); static void ioat_free_ring(struct ioat_softc *, uint32_t size, @@ -97,15 +97,8 @@ static int ioat_reset_hw(struct ioat_softc *ioat); static void ioat_reset_hw_task(void *, int); static void ioat_setup_sysctl(device_t device); static int sysctl_handle_reset(SYSCTL_HANDLER_ARGS); -static inline struct ioat_softc *ioat_get(struct ioat_softc *, - enum ioat_ref_kind); -static inline void ioat_put(struct ioat_softc *, enum ioat_ref_kind); -static inline void _ioat_putn(struct ioat_softc *, uint32_t, - enum ioat_ref_kind, boolean_t); -static inline void ioat_putn(struct ioat_softc *, uint32_t, - enum ioat_ref_kind); -static inline void ioat_putn_locked(struct ioat_softc *, uint32_t, - enum ioat_ref_kind); +static void ioat_get(struct ioat_softc *); +static void ioat_put(struct ioat_softc *); static void ioat_drain_locked(struct ioat_softc *); #define ioat_log_message(v, ...) do { \ @@ -157,6 +150,8 @@ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNE static unsigned ioat_channel_index = 0; SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, "Number of IOAT channels attached"); +static struct mtx ioat_list_mtx; +MTX_SYSINIT(ioat_list_mtx, &ioat_list_mtx, "ioat list mtx", MTX_DEF); static struct _pcsid { @@ -266,7 +261,7 @@ static int ioat_attach(device_t device) { struct ioat_softc *ioat; - int error; + int error, i; ioat = DEVICE2SOFTC(device); ioat->device = device; @@ -297,11 +292,26 @@ ioat_attach(device_t device) if (error != 0) goto err; - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); ioat_setup_sysctl(device); - ioat->chan_idx = ioat_channel_index; - ioat_channel[ioat_channel_index++] = ioat; + mtx_lock(&ioat_list_mtx); + for (i = 0; i < IOAT_MAX_CHANNELS; i++) { + if (ioat_channel[i] == NULL) + break; + } + if (i >= IOAT_MAX_CHANNELS) { + mtx_unlock(&ioat_list_mtx); + device_printf(device, "Too many I/OAT devices in system\n"); + error = ENXIO; + goto err; + } + ioat->chan_idx = i; + ioat_channel[i] = ioat; + if (i >= ioat_channel_index) + ioat_channel_index = i + 1; + mtx_unlock(&ioat_list_mtx); + ioat_test_attach(); err: @@ -317,19 +327,28 @@ ioat_detach(device_t device) ioat = DEVICE2SOFTC(device); + mtx_lock(&ioat_list_mtx); + ioat_channel[ioat->chan_idx] = NULL; + while (ioat_channel_index > 0 && + ioat_channel[ioat_channel_index - 1] == NULL) + ioat_channel_index--; + mtx_unlock(&ioat_list_mtx); + ioat_test_detach(); taskqueue_drain(taskqueue_thread, &ioat->reset_task); - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); ioat->quiescing = TRUE; ioat->destroying = TRUE; wakeup(&ioat->quiescing); wakeup(&ioat->resetting); - ioat_channel[ioat->chan_idx] = NULL; - ioat_drain_locked(ioat); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + while (ioat_get_active(ioat) > 0) + msleep(&ioat->tail, &ioat->cleanup_lock, 0, "ioat_drain", 1); + mtx_unlock(&ioat->cleanup_lock); ioat_teardown_intr(ioat); callout_drain(&ioat->poll_timer); @@ -458,15 +477,12 @@ ioat3_attach(device_t device) TASK_INIT(&ioat->reset_task, 0, ioat_reset_hw_task, ioat); /* Establish lock order for Witness */ - mtx_lock(&ioat->submit_lock); mtx_lock(&ioat->cleanup_lock); - mtx_unlock(&ioat->cleanup_lock); + mtx_lock(&ioat->submit_lock); mtx_unlock(&ioat->submit_lock); + mtx_unlock(&ioat->cleanup_lock); ioat->is_submitter_processing = FALSE; - ioat->is_completion_pending = FALSE; - ioat->is_reset_pending = FALSE; - ioat->is_channel_running = FALSE; bus_dma_tag_create(bus_get_dma_tag(ioat->device), sizeof(uint64_t), 0x0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, @@ -521,7 +537,7 @@ ioat3_attach(device_t device) dma_hw_desc->next = RING_PHYS_ADDR(ioat, i + 1); } - ioat->head = ioat->hw_head = 0; + ioat->head = 0; ioat->tail = 0; ioat->last_seen = 0; *ioat->comp_update = 0; @@ -641,7 +657,7 @@ ioat_interrupt_handler(void *arg) struct ioat_softc *ioat = arg; ioat->stats.interrupts++; - ioat_process_events(ioat); + ioat_process_events(ioat, TRUE); } static int @@ -661,13 +677,12 @@ chanerr_to_errno(uint32_t chanerr) } static void -ioat_process_events(struct ioat_softc *ioat) +ioat_process_events(struct ioat_softc *ioat, boolean_t intr) { struct ioat_descriptor *desc; struct bus_dmadesc *dmadesc; uint64_t comp_update, status; uint32_t completed, chanerr; - boolean_t pending; int error; mtx_lock(&ioat->cleanup_lock); @@ -721,42 +736,21 @@ ioat_process_events(struct ioat_softc *ioat) if (completed != 0) { ioat->last_seen = RING_PHYS_ADDR(ioat, ioat->tail - 1); ioat->stats.descriptors_processed += completed; + wakeup(&ioat->tail); } out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); - - /* Perform a racy check first; only take the locks if it passes. */ - pending = (ioat_get_active(ioat) != 0); - if (!pending && ioat->is_completion_pending) { - mtx_unlock(&ioat->cleanup_lock); - mtx_lock(&ioat->submit_lock); - mtx_lock(&ioat->cleanup_lock); - - pending = (ioat_get_active(ioat) != 0); - if (!pending && ioat->is_completion_pending) { - ioat->is_completion_pending = FALSE; - callout_stop(&ioat->poll_timer); - } - mtx_unlock(&ioat->submit_lock); - } mtx_unlock(&ioat->cleanup_lock); - if (pending) - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - - if (completed != 0) { - ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); - wakeup(&ioat->tail); - } - /* * The device doesn't seem to reliably push suspend/halt statuses to * the channel completion memory address, so poll the device register - * here. + * here. For performance reasons skip it on interrupts, do it only + * on much more rare polling events. */ - comp_update = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; + if (!intr) + comp_update = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; if (!is_ioat_halted(comp_update) && !is_ioat_suspended(comp_update)) return; @@ -767,16 +761,17 @@ out: * work with error status and restart the engine. */ mtx_lock(&ioat->submit_lock); - mtx_lock(&ioat->cleanup_lock); ioat->quiescing = TRUE; + mtx_unlock(&ioat->submit_lock); + /* - * This is safe to do here because we have both locks and the submit - * queue is quiesced. We know that we will drain all outstanding - * events, so ioat_reset_hw can't deadlock. It is necessary to - * protect other ioat_process_event threads from racing ioat_reset_hw, - * reading an indeterminate hw state, and attempting to continue - * issuing completions. + * This is safe to do here because the submit queue is quiesced. We + * know that we will drain all outstanding events, so ioat_reset_hw + * can't deadlock. It is necessary to protect other ioat_process_event + * threads from racing ioat_reset_hw, reading an indeterminate hw + * state, and attempting to continue issuing completions. */ + mtx_lock(&ioat->cleanup_lock); ioat->resetting_cleanup = TRUE; chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); @@ -795,7 +790,6 @@ out: dmadesc->callback_fn(dmadesc->callback_arg, chanerr_to_errno(chanerr)); - ioat_putn_locked(ioat, 1, IOAT_ACTIVE_DESCR_REF); ioat->tail++; ioat->stats.descriptors_processed++; ioat->stats.descriptors_error++; @@ -803,16 +797,10 @@ out: CTR5(KTR_IOAT, "%s channel=%u head=%u tail=%u active=%u", __func__, ioat->chan_idx, ioat->head, ioat->tail, ioat_get_active(ioat)); - if (ioat->is_completion_pending) { - ioat->is_completion_pending = FALSE; - callout_stop(&ioat->poll_timer); - } - /* Clear error status */ ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); mtx_unlock(&ioat->cleanup_lock); - mtx_unlock(&ioat->submit_lock); ioat_log_message(0, "Resetting channel to recover from error\n"); error = taskqueue_enqueue(taskqueue_thread, &ioat->reset_task); @@ -854,31 +842,39 @@ ioat_get_dmaengine(uint32_t index, int flags) KASSERT((flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK), ("invalid wait | nowait")); - if (index >= ioat_channel_index) + mtx_lock(&ioat_list_mtx); + if (index >= ioat_channel_index || + (ioat = ioat_channel[index]) == NULL) { + mtx_unlock(&ioat_list_mtx); return (NULL); + } + mtx_lock(&ioat->submit_lock); + mtx_unlock(&ioat_list_mtx); - ioat = ioat_channel[index]; - if (ioat == NULL || ioat->destroying) + if (ioat->destroying) { + mtx_unlock(&ioat->submit_lock); return (NULL); + } + ioat_get(ioat); if (ioat->quiescing) { - if ((flags & M_NOWAIT) != 0) + if ((flags & M_NOWAIT) != 0) { + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); return (NULL); + } - mtx_lock(IOAT_REFLK); while (ioat->quiescing && !ioat->destroying) - msleep(&ioat->quiescing, IOAT_REFLK, 0, "getdma", 0); - mtx_unlock(IOAT_REFLK); + msleep(&ioat->quiescing, &ioat->submit_lock, 0, "getdma", 0); - if (ioat->destroying) + if (ioat->destroying) { + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); return (NULL); + } } - - /* - * There's a race here between the quiescing check and HW reset or - * module destroy. - */ - return (&ioat_get(ioat, IOAT_DMAENGINE_REF)->dmaengine); + mtx_unlock(&ioat->submit_lock); + return (&ioat->dmaengine); } void @@ -887,7 +883,9 @@ ioat_put_dmaengine(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - ioat_put(ioat, IOAT_DMAENGINE_REF); + mtx_lock(&ioat->submit_lock); + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); } int @@ -975,18 +973,17 @@ ioat_release(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - CTR4(KTR_IOAT, "%s channel=%u dispatch1 hw_head=%u head=%u", __func__, - ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + CTR3(KTR_IOAT, "%s channel=%u dispatch1 head=%u", __func__, + ioat->chan_idx, ioat->head); KFAIL_POINT_CODE(DEBUG_FP, ioat_release, /* do nothing */); - CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__, - ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + CTR3(KTR_IOAT, "%s channel=%u dispatch2 head=%u", __func__, + ioat->chan_idx, ioat->head); if (ioat->acq_head != ioat->head) { ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, - (uint16_t)ioat->hw_head); + (uint16_t)ioat->head); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; + if (!callout_pending(&ioat->poll_timer)) { callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, ioat); } @@ -1403,7 +1400,7 @@ ioat_reserve_space(struct ioat_softc *ioat, uint32_t n CTR2(KTR_IOAT, "%s channel=%u attempting to process events", __func__, ioat->chan_idx); - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); mtx_lock(&ioat->submit_lock); dug = TRUE; @@ -1481,7 +1478,12 @@ ioat_poll_timer_callback(void *arg) ioat = arg; ioat_log_message(3, "%s\n", __func__); - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); + + mtx_lock(&ioat->submit_lock); + if (ioat_get_active(ioat) > 0) + callout_schedule(&ioat->poll_timer, 1); + mtx_unlock(&ioat->submit_lock); } /* @@ -1493,12 +1495,9 @@ ioat_submit_single(struct ioat_softc *ioat) mtx_assert(&ioat->submit_lock, MA_OWNED); - ioat_get(ioat, IOAT_ACTIVE_DESCR_REF); - atomic_add_rel_int(&ioat->head, 1); - atomic_add_rel_int(&ioat->hw_head, 1); - CTR5(KTR_IOAT, "%s channel=%u head=%u hw_head=%u tail=%u", __func__, - ioat->chan_idx, ioat->head, ioat->hw_head & UINT16_MAX, - ioat->tail); + ioat->head++; + CTR4(KTR_IOAT, "%s channel=%u head=%u tail=%u", __func__, + ioat->chan_idx, ioat->head, ioat->tail); ioat->stats.descriptors_submitted++; } @@ -1513,24 +1512,24 @@ ioat_reset_hw(struct ioat_softc *ioat) CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); while (ioat->resetting && !ioat->destroying) - msleep(&ioat->resetting, IOAT_REFLK, 0, "IRH_drain", 0); + msleep(&ioat->resetting, &ioat->submit_lock, 0, "IRH_drain", 0); if (ioat->destroying) { - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); return (ENXIO); } ioat->resetting = TRUE; - ioat->quiescing = TRUE; - ioat_drain_locked(ioat); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + while (ioat_get_active(ioat) > 0) + msleep(&ioat->tail, &ioat->cleanup_lock, 0, "ioat_drain", 1); /* * Suspend ioat_process_events while the hardware and softc are in an * indeterminate state. */ - mtx_lock(&ioat->cleanup_lock); ioat->resetting_cleanup = TRUE; mtx_unlock(&ioat->cleanup_lock); @@ -1621,10 +1620,9 @@ ioat_reset_hw(struct ioat_softc *ioat) * The internal ring counter resets to zero, so we have to start over * at zero as well. */ - ioat->tail = ioat->head = ioat->hw_head = 0; + ioat->tail = ioat->head = 0; ioat->last_seen = 0; *ioat->comp_update = 0; - KASSERT(!ioat->is_completion_pending, ("bogus completion_pending")); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); @@ -1649,18 +1647,15 @@ out: mtx_unlock(&ioat->cleanup_lock); /* Unblock submission of new work */ - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); ioat->quiescing = FALSE; wakeup(&ioat->quiescing); ioat->resetting = FALSE; wakeup(&ioat->resetting); - if (ioat->is_completion_pending) - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); CTR2(KTR_IOAT, "%s channel=%u reset done", __func__, ioat->chan_idx); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); return (error); } @@ -1804,8 +1799,6 @@ ioat_setup_sysctl(device_t device) 0, "SW descriptor head pointer index"); SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, 0, "SW descriptor tail pointer index"); - SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "hw_head", CTLFLAG_RD, - &ioat->hw_head, 0, "HW DMACOUNT"); SYSCTL_ADD_UQUAD(ctx, state, OID_AUTO, "last_completion", CTLFLAG_RD, ioat->comp_update, "HW addr of last completion"); @@ -1813,12 +1806,6 @@ ioat_setup_sysctl(device_t device) SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_submitter_processing", CTLFLAG_RD, &ioat->is_submitter_processing, 0, "submitter processing"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_completion_pending", - CTLFLAG_RD, &ioat->is_completion_pending, 0, "completion pending"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_reset_pending", CTLFLAG_RD, - &ioat->is_reset_pending, 0, "reset pending"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_channel_running", CTLFLAG_RD, - &ioat->is_channel_running, 0, "channel running"); SYSCTL_ADD_PROC(ctx, state, OID_AUTO, "chansts", CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", @@ -1864,91 +1851,35 @@ ioat_setup_sysctl(device_t device) "Descriptors per interrupt"); } -static inline struct ioat_softc * -ioat_get(struct ioat_softc *ioat, enum ioat_ref_kind kind) +static void +ioat_get(struct ioat_softc *ioat) { - uint32_t old; - KASSERT(kind < IOAT_NUM_REF_KINDS, ("bogus")); + mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT(ioat->refcnt < UINT32_MAX, ("refcnt overflow")); - old = atomic_fetchadd_32(&ioat->refcnt, 1); - KASSERT(old < UINT32_MAX, ("refcnt overflow")); - -#ifdef INVARIANTS - old = atomic_fetchadd_32(&ioat->refkinds[kind], 1); - KASSERT(old < UINT32_MAX, ("refcnt kind overflow")); -#endif - - return (ioat); + ioat->refcnt++; } -static inline void -ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) +static void +ioat_put(struct ioat_softc *ioat) { - _ioat_putn(ioat, n, kind, FALSE); -} + mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT(ioat->refcnt >= 1, ("refcnt error")); -static inline void -ioat_putn_locked(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) -{ - - _ioat_putn(ioat, n, kind, TRUE); + if (--ioat->refcnt == 0) + wakeup(&ioat->refcnt); } -static inline void -_ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind, - boolean_t locked) -{ - uint32_t old; - - KASSERT(kind < IOAT_NUM_REF_KINDS, ("bogus")); - - if (n == 0) - return; - -#ifdef INVARIANTS - old = atomic_fetchadd_32(&ioat->refkinds[kind], -n); - KASSERT(old >= n, ("refcnt kind underflow")); -#endif - - /* Skip acquiring the lock if resulting refcnt > 0. */ - for (;;) { - old = ioat->refcnt; - if (old <= n) - break; - if (atomic_cmpset_32(&ioat->refcnt, old, old - n)) - return; - } - - if (locked) - mtx_assert(IOAT_REFLK, MA_OWNED); - else - mtx_lock(IOAT_REFLK); - - old = atomic_fetchadd_32(&ioat->refcnt, -n); - KASSERT(old >= n, ("refcnt error")); - - if (old == n) - wakeup(IOAT_REFLK); - if (!locked) - mtx_unlock(IOAT_REFLK); -} - -static inline void -ioat_put(struct ioat_softc *ioat, enum ioat_ref_kind kind) -{ - - ioat_putn(ioat, 1, kind); -} - static void ioat_drain_locked(struct ioat_softc *ioat) { - mtx_assert(IOAT_REFLK, MA_OWNED); + mtx_assert(&ioat->submit_lock, MA_OWNED); + while (ioat->refcnt > 0) - msleep(IOAT_REFLK, IOAT_REFLK, 0, "ioat_drain", 0); + msleep(&ioat->refcnt, &ioat->submit_lock, 0, "ioat_drain", 0); } #ifdef DDB @@ -1991,15 +1922,11 @@ DB_SHOW_COMMAND(ioat, db_show_ioat) db_printf(" destroying: %d\n", (int)sc->destroying); db_printf(" is_submitter_processing: %d\n", (int)sc->is_submitter_processing); - db_printf(" is_completion_pending: %d\n", (int)sc->is_completion_pending); - db_printf(" is_reset_pending: %d\n", (int)sc->is_reset_pending); - db_printf(" is_channel_running: %d\n", (int)sc->is_channel_running); db_printf(" intrdelay_supported: %d\n", (int)sc->intrdelay_supported); db_printf(" resetting: %d\n", (int)sc->resetting); db_printf(" head: %u\n", sc->head); db_printf(" tail: %u\n", sc->tail); - db_printf(" hw_head: %u\n", sc->hw_head); db_printf(" ring_size_order: %u\n", sc->ring_size_order); db_printf(" last_seen: 0x%lx\n", sc->last_seen); db_printf(" ring: %p\n", sc->ring); @@ -2040,11 +1967,6 @@ DB_SHOW_COMMAND(ioat, db_show_ioat) db_show_lock(&sc->cleanup_lock); db_printf(" refcnt: %u\n", sc->refcnt); -#ifdef INVARIANTS - CTASSERT(IOAT_NUM_REF_KINDS == 2); - db_printf(" refkinds: [ENG=%u, DESCR=%u]\n", sc->refkinds[0], - sc->refkinds[1]); -#endif db_printf(" stats:\n"); db_printf(" interrupts: %lu\n", sc->stats.interrupts); db_printf(" descriptors_processed: %lu\n", sc->stats.descriptors_processed); Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Thu Feb 21 15:44:32 2019 (r344440) +++ head/sys/dev/ioat/ioat_internal.h Thu Feb 21 16:47:36 2019 (r344441) @@ -426,12 +426,6 @@ struct ioat_descriptor { #define IOAT_OP_OLD_XOR 0x85 #define IOAT_OP_OLD_XOR_VAL 0x86 -enum ioat_ref_kind { - IOAT_DMAENGINE_REF = 0, - IOAT_ACTIVE_DESCR_REF, - IOAT_NUM_REF_KINDS -}; - /* One of these per allocated PCI device. */ struct ioat_softc { bus_dmaengine_t dmaengine; @@ -442,22 +436,22 @@ struct ioat_softc { offsetof(struct ioat_softc, dmaengine)); \ }) + device_t device; int version; unsigned chan_idx; - struct mtx submit_lock; - device_t device; bus_space_tag_t pci_bus_tag; bus_space_handle_t pci_bus_handle; - int pci_resource_id; struct resource *pci_resource; + int pci_resource_id; uint32_t max_xfer_size; uint32_t capabilities; + uint32_t ring_size_order; uint16_t intrdelay_max; uint16_t cached_intrdelay; - struct resource *res; int rid; + struct resource *res; void *tag; bus_dma_tag_t hw_desc_tag; @@ -468,27 +462,13 @@ struct ioat_softc { uint64_t *comp_update; bus_addr_t comp_update_bus_addr; - struct callout poll_timer; - struct callout shrink_timer; - struct task reset_task; - boolean_t quiescing; boolean_t destroying; boolean_t is_submitter_processing; - boolean_t is_completion_pending; /* submit_lock */ - boolean_t is_reset_pending; - boolean_t is_channel_running; boolean_t intrdelay_supported; boolean_t resetting; /* submit_lock */ boolean_t resetting_cleanup; /* cleanup_lock */ - uint32_t head; - uint32_t acq_head; - uint32_t tail; - uint32_t hw_head; - uint32_t ring_size_order; - bus_addr_t last_seen; - struct ioat_descriptor *ring; union ioat_hw_descriptor { @@ -506,11 +486,16 @@ struct ioat_softc { #define RING_PHYS_ADDR(sc, i) (sc)->hw_desc_bus_addr + \ (((i) % (1 << (sc)->ring_size_order)) * sizeof(struct ioat_dma_hw_descriptor)) - struct mtx cleanup_lock; - volatile uint32_t refcnt; -#ifdef INVARIANTS - volatile uint32_t refkinds[IOAT_NUM_REF_KINDS]; -#endif + struct mtx_padalign submit_lock; + struct callout poll_timer; + struct task reset_task; + struct mtx_padalign cleanup_lock; + + uint32_t refcnt; + uint32_t head; + uint32_t acq_head; + uint32_t tail; + bus_addr_t last_seen; struct { uint64_t interrupts; From owner-svn-src-head@freebsd.org Thu Feb 21 17:31:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA3EE14E93CF; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C193849C4; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3815B20D11; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LHVZ5M052052; Thu, 21 Feb 2019 17:31:35 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LHVXtf052045; Thu, 21 Feb 2019 17:31:33 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902211731.x1LHVXtf052045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 17:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344443 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C193849C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 17:31:35 -0000 Author: bde Date: Thu Feb 21 17:31:33 2019 New Revision: 344443 URL: https://svnweb.freebsd.org/changeset/base/344443 Log: Move scterm_teken.c from 6 MD files lists to the MI files list so that it is easier to configure. It is MI, unlike some of the other syscons files already in the MI list. Move scvtb.c similarly. It is needed whenever sc is configured, and is more MI than most of the files already in the MI list. This only changes the combined list for arm64 and mips. These arches already cannot build sc or even NOTES. Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.sparc64 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files Thu Feb 21 17:31:33 2019 (r344443) @@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc +dev/syscons/scterm-teken.c optional sc dev/syscons/scvidctl.c optional sc +dev/syscons/scvtb.c optional sc dev/syscons/snake/snake_saver.c optional snake_saver dev/syscons/star/star_saver.c optional star_saver dev/syscons/syscons.c optional sc Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.amd64 Thu Feb 21 17:31:33 2019 (r344443) @@ -486,10 +486,8 @@ dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm -dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga -dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm dev/tpm/tpm_crb.c optional tpm acpi Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.arm Thu Feb 21 17:31:33 2019 (r344443) @@ -132,8 +132,6 @@ dev/pci/pci_host_generic_fdt.c optional pci_host_gener dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt font.h optional sc \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.i386 Thu Feb 21 17:31:33 2019 (r344443) @@ -309,10 +309,8 @@ dev/sio/sio_pci.c optional sio pci dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm -dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga -dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.mips Thu Feb 21 17:31:33 2019 (r344443) @@ -75,8 +75,6 @@ dev/cfe/cfe_env.c optional cfe_env # syscons support dev/fb/fb.c optional sc dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc mips/mips/sc_machdep.c optional sc # FDT support Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.powerpc Thu Feb 21 17:31:33 2019 (r344443) @@ -74,8 +74,6 @@ dev/sound/macio/onyx.c optional snd_ai2s iicbus power dev/sound/macio/snapper.c optional snd_ai2s iicbus powermac dev/sound/macio/tumbler.c optional snd_ai2s iicbus powermac dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec dev/uart/uart_cpu_powerpc.c optional uart Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.sparc64 Thu Feb 21 17:31:33 2019 (r344443) @@ -56,8 +56,6 @@ dev/pcf/pcf_ebus.c optional pcf ebus dev/sound/sbus/cs4231.c optional snd_audiocs ebus | \ snd_audiocs sbus dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_sparc64.c optional uart dev/uart/uart_kbd_sun.c optional uart sc | vt dev/vt/hw/ofwfb/ofwfb.c optional vt From owner-svn-src-head@freebsd.org Thu Feb 21 18:13:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3788A14EABFE; Thu, 21 Feb 2019 18:13:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 893B286508; Thu, 21 Feb 2019 18:13:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id g6so14103363pfh.13; Thu, 21 Feb 2019 10:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VCyPQWdc0bDdIjLLiYXLKr2D2cLQXRNK3BxIJfgDY5A=; b=DDgD922eDAS9LjEcu1l4Fh9TDxICxn9+AGhQ3SU9/kxR5wWG0sIwrJOMn7/k22k9PM 3S52Zs0w+wBA8MiTKLbMKe86/8TNKhvJkVARlTJPFV/JQLPPEF8+UY8F1hITu6pWrz8U vVx2i/O0RmcRp/6dsnYT9IqVgh9up489vRJSWt0RGRZaQTii+88t3LhhVIEpkWrdzgv9 3GOK5R2d0db33rDk6lU5ceOfCOX9fg/iOB7E0QWAOBq6UqOkbe9gUGk13LhNSgj2qPS2 bTW368TOveNw+tmgZaEmCl8XkCdzfXQXVXxJQUTZqkVixUZIloaHifSzDHxkwmHYIbBm t9wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VCyPQWdc0bDdIjLLiYXLKr2D2cLQXRNK3BxIJfgDY5A=; b=KCrPGAdCUL356RZTBBnPz8dxv58L+8dioYl2XOobWv/lwsianXVm88E/LJoNS8xAC2 5VD98ywVsQok6vZXSKe5HBf8mJ2kS3lHF/k1Pfq+QooKcGqr/qAHUzH2+BjWsyVJUx9H NNk/ZC3hkloLhWDEexTdP7lDIWelHKxmVSNPuvOqKvyEycBdnfgufYaDExPdP1LsAz1l vwVCn/k3yu+Du/jOh4scf+W67bRZWa8/vVgJ99nywPXL5pkv/DvLe9a+Si94Vki9icTZ bBHr7gyiF2nqZwjsZ17nE9p+yMB8MYObgl7ZaHqaSYkkvIcA2CoVc7Xr1T82w8TQuzQk 05Og== X-Gm-Message-State: AHQUAubOTD2zCbOhZ8VaT1IAAFmausM6r05YtTmhKAOQ/GIQDuhd+MuI lpkfL0/9M9WFU5EIw/DZaUvQBG8j X-Google-Smtp-Source: AHgI3IZ1mc9rB+HwylrK4b4bGrVTKQ5/qnQZcOBHj3zsi4rK4cmbzkbj/OURja1L0fIXhik5L+N7Lw== X-Received: by 2002:a62:1d0c:: with SMTP id d12mr41672355pfd.126.1550772792956; Thu, 21 Feb 2019 10:13:12 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v1sm19207167pff.9.2019.02.21.10.13.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:13:12 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw From: Enji Cooper In-Reply-To: <201902211410.x1LEAEa2042271@repo.freebsd.org> Date: Thu, 21 Feb 2019 10:13:11 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> References: <201902211410.x1LEAEa2042271@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 893B286508 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:13:15 -0000 > On Feb 21, 2019, at 6:10 AM, Alexander Motin wrote: >=20 > Author: mav > Date: Thu Feb 21 14:10:14 2019 > New Revision: 344437 > URL: https://svnweb.freebsd.org/changeset/base/344437 >=20 > Log: > Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >=20 > Its a hack, we can't know/list all DMA engines, but this covers all > I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >=20 > MFC after: 1 week > Sponsored by: iXsystems, Inc. >=20 > Modified: > head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >=20 > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.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/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 = (r344436) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 = (r344437) > @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) > if (sc->alut) > PNTX_WRITE(sc, 0xc94, 0); >=20 > - /* Enable Link Interface LUT entries 0/1 for peer 0/1. = */ > - PNTX_WRITE(sc, 0xdb4, 0x00090001); > + /* Enable all Link Interface LUT entries for peer. */ > + for (i =3D 0; i < 32; i +=3D 2) { Is `32` written down in the NTB spec somewhere? Should it be a = #define, or should it be programmatically adjusted based on the CPU? Thank you! -Enji= From owner-svn-src-head@freebsd.org Thu Feb 21 18:19:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C400014EAE60; Thu, 21 Feb 2019 18:19:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC7C86824; Thu, 21 Feb 2019 18:19:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc44.google.com with SMTP id v201so11187167ywa.9; Thu, 21 Feb 2019 10:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=47HT63DqvmMUTgwX3oytIzlZ3JsNYzxfMzmmyv4hxz0=; b=FyIUyIe2sb9YCoEH64HEA2Badt7G2n9+kkGEzuR9u9wVeR9NJEpB30OEsGLj/iiWnG i/PYDq9lDeFHY5o5c9DQc7Le0JLZ4nhS2xfFFNjQkEb0hnzgA1U3X7jUnQdpwzShd+jy ee3fZX3ZoC+hFP6j8zmpTzrsDsDxbXgO/PUIMRP8foxxLuoY9rfbiQ3ipz0u6eZ7k8da /A//ar0Q4oCNLVzA7sU25q28cbjAf9QDP6aX/X+UZ/6YXHliR/tkiaGVdPGz1XaPcOPS OVBnbjZSyQqW02Z4E1at4Q2LpLFPCOF4XrA9Mf2LMslT2BOptD2hvV5Edpa9dLSyFGfL WYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=47HT63DqvmMUTgwX3oytIzlZ3JsNYzxfMzmmyv4hxz0=; b=ltD4HJV3sBH7GfQojRgZ/Bj/4JfqANRwCCfz2J+cVLWcjfLaxcjKeHhqwTyKJOyO7t EC+HV4rCcRz4XJMKn9Y4KhNgja/+IGEAKA2uBway+FIW7ZnqdYhGpW5rQ6s6V2iecvAs G7SRXGQZ8JGQUkYyuygP6eTA6Q7015ybU19c5yWy9V62X3Kkxr3MGzjTqi6/BHFSoqvr gdq9NRWgtBpFkasIwygR1E1YNO2aWAaRub/DaRHpG9yMP77rUmZfJtzIWp1/fERHzMQL Z4gzTa9rXebB7JjTN/u9CxOqTDurZP8BY1Xbq33hAA+D/gWHcASLH24Iw9s+sDnNakzn FnCg== X-Gm-Message-State: AHQUAuaReDJr2uezQEJ4N5oYphj1rQOpgub+xTNZUmL4SMhO89xqXgBK GemZhEHEw54QTfd5/6zvON0z4gpD X-Google-Smtp-Source: AHgI3Ib1hzK96KC+5An9WEzbDnO5+B9UHTMc0/jWRQMsm+mtrBHi2gvJpPfJMvGKgz6dhHuV3nPFxA== X-Received: by 2002:a81:3c47:: with SMTP id j68mr34279275ywa.69.1550773163082; Thu, 21 Feb 2019 10:19:23 -0800 (PST) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id a190sm8627620ywg.76.2019.02.21.10.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:19:22 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902211410.x1LEAEa2042271@repo.freebsd.org> <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> Date: Thu, 21 Feb 2019 13:19:21 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3AC7C86824 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:19:25 -0000 On 21.02.2019 13:13, Enji Cooper wrote: > >> On Feb 21, 2019, at 6:10 AM, Alexander Motin wrote: >> >> Author: mav >> Date: Thu Feb 21 14:10:14 2019 >> New Revision: 344437 >> URL: https://svnweb.freebsd.org/changeset/base/344437 >> >> Log: >> Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >> >> Its a hack, we can't know/list all DMA engines, but this covers all >> I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >> >> MFC after: 1 week >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >> >> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >> ============================================================================== >> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 (r344436) >> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 (r344437) >> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) >> if (sc->alut) >> PNTX_WRITE(sc, 0xc94, 0); >> >> - /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ >> - PNTX_WRITE(sc, 0xdb4, 0x00090001); >> + /* Enable all Link Interface LUT entries for peer. */ >> + for (i = 0; i < 32; i += 2) { > > Is `32` written down in the NTB spec somewhere? Should it be a #define, or should it be programmatically adjusted based on the CPU? It is a property of the hardware, it has 32 LUT entries. #define would be good indeed, but the code is already full of other numeric constants. -- Alexander Motin From owner-svn-src-head@freebsd.org Thu Feb 21 18:22:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2621C14EB11C; Thu, 21 Feb 2019 18:22:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94CC286C7C; Thu, 21 Feb 2019 18:22:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42c.google.com with SMTP id n22so14136595pfa.3; Thu, 21 Feb 2019 10:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4r3MGQ7GR4Wd32iVQrhVjmz1AJkuyXG7QtNps6pEeGI=; b=DlOnbxDpok4GB1L32FdtWM9QcEMsM5t7mCsGLgtdD4WmWnFgWYegRJOfeytre/nEPk R96oTejKFugDqNmbTZKHX4NJD9rKaxp9GcHz5H4DB3oX1ymcWI/AK/OZHyGjMN0wzAdz +Lh+dLoAiWMXPcYChnQ4XHbBRpimOg3YcAAFENVhuNkuIhBmYU/Hnzi3FbiKVak5ITfK Zj6HoJvlpnGijf0apgqdrbG1y/t+zo3FPJ/WURRFPEwu6l/1gbomM2nXe6XlwXmnQQqq /Hw3nCB2W6bW99c42G7K+pfYGy7HF9VEplwsiMJefMRgf8STJN9KQl+VBQyaGwLJAYts Q/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4r3MGQ7GR4Wd32iVQrhVjmz1AJkuyXG7QtNps6pEeGI=; b=uhV4986fNVdSVZ9KAaNE+aRBVmBMlawQEvnIeDPo3zT6wEsqKy+NvIT0YL/P/VCKL/ md7HYHAUIz//d3wFSJ3fp2kHnZMVNpInmi6EactVs4oM0XomxH+PQkPTKQnZjl+sSTT6 OC9Zo8z+66NdAaDwrgzt/OnJwIGDZUKwAe6XET9PWww8L6+NXfFQuEI/uWBdUtMBlRz6 X3pPNxLYDaaLP2T19SVfVxXCCij7Aw0IBS23kS4EQgFn2Vdbrvqehf4hxlDpv5XSoJFN TJvtSmZLDeExWhT93U7beymAlbiJRY5seiQbodr4XvKPaL9wGBWQRA7OWlBuT+iOHXXs bxLg== X-Gm-Message-State: AHQUAub3fLIPARUQVxRMAhJYUbgiN6dry437xggXRvPwg/iIaBxsM3fR zCj9+dGWF7EfhHdRWlYcrPVKsTvt X-Google-Smtp-Source: AHgI3IbtQppaArLLRKsx1Gd4WjxDqLAdxB0bHxOUfE6WM9dQLmm0T7mGR5x1Om64MghyiZjvohWsfg== X-Received: by 2002:a62:e082:: with SMTP id d2mr42819151pfm.240.1550773362183; Thu, 21 Feb 2019 10:22:42 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y133sm31388011pfb.107.2019.02.21.10.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:22:41 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw Date: Thu, 21 Feb 2019 10:22:40 -0800 In-Reply-To: <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Alexander Motin References: <201902211410.x1LEAEa2042271@repo.freebsd.org> <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 94CC286C7C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:22:44 -0000 > On Feb 21, 2019, at 10:19 AM, Alexander Motin wrote: >=20 > On 21.02.2019 13:13, Enji Cooper wrote: >>=20 >>> On Feb 21, 2019, at 6:10 AM, Alexander Motin = wrote: >>>=20 >>> Author: mav >>> Date: Thu Feb 21 14:10:14 2019 >>> New Revision: 344437 >>> URL: https://svnweb.freebsd.org/changeset/base/344437 >>>=20 >>> Log: >>> Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >>>=20 >>> Its a hack, we can't know/list all DMA engines, but this covers all >>> I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >>>=20 >>> MFC after: 1 week >>> Sponsored by: iXsystems, Inc. >>>=20 >>> Modified: >>> head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >>>=20 >>> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.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/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 = (r344436) >>> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 = (r344437) >>> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) >>> if (sc->alut) >>> PNTX_WRITE(sc, 0xc94, 0); >>>=20 >>> - /* Enable Link Interface LUT entries 0/1 for peer 0/1. = */ >>> - PNTX_WRITE(sc, 0xdb4, 0x00090001); >>> + /* Enable all Link Interface LUT entries for peer. */ >>> + for (i =3D 0; i < 32; i +=3D 2) { >>=20 >> Is `32` written down in the NTB spec somewhere? Should it be a = #define, or should it be programmatically adjusted based on the CPU? >=20 > It is a property of the hardware, it has 32 LUT entries. Cool! I was thinking that this is probably a number that can change in = the future, as processor designs evolve. > #define would be good indeed, but the code is already full of other = numeric constants. Yes, but it would make the code more readable/easier to reason through. = That=E2=80=99s where my concern is coming from. Also, thank you very much for working on this :). Cheers! -Enji= From owner-svn-src-head@freebsd.org Thu Feb 21 18:23:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC2D514EB1A2; Thu, 21 Feb 2019 18:23:24 +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 7900186DD5; Thu, 21 Feb 2019 18:23:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (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 84F8FCBCD; Thu, 21 Feb 2019 18:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog To: Warner Losh , Garrett Cooper Cc: Bruce Evans , David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> 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: Thu, 21 Feb 2019 10:22:55 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7900186DD5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.88)[-0.883,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:23:25 -0000 On 2/20/19 9:20 PM, Warner Losh wrote: > On Wed, Feb 20, 2019, 9:59 PM Enji Cooper >> >>> On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: >>> >>> On Wed, 20 Feb 2019, David Bright wrote: >>> >>>> Log: >>>> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog >>>> >>>> The result of a strdup() was stored in a global variable and not freed >>>> before program exit. This is a follow-up to r343906. That change >>> >>> This was an especially large bug in Coverity. Understanding that exit(3) >>> exits is about the first thing to understand for a checker. >>> >>> Now it is also a style bug in the source code. >>> >>>> attempted to plug these resource leaks but managed to miss a code path >>>> on which the leak still occurs. Plug the leak on that path, too. >>> >>>> Modified: head/usr.sbin/newsyslog/newsyslog.c >>>> >> ============================================================================== >>>> --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 >> (r344388) >>>> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 >> (r344389) >>>> @@ -793,6 +793,9 @@ usage(void) >>>> fprintf(stderr, >>>> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] >> [-f config_file]\n" >>>> " [-S pidfile] [-t timefmt] [[-R tagname] file >> ...]\n"); >>>> + /* Free global dynamically-allocated storage. */ >>>> + free(timefnamefmt); >>>> + free(requestor); >>>> exit(1); >>>> } >>> >>> There was no leak here. exit(3) frees storage much more finally than >>> free(3). >>> >>> It is especially obvious that there is no leak here, since the exit() is >>> 1-2 lines later than the frees. >>> >>> In theory, exit() might fail because it tries to allocate 100 MB more >>> storage but wouldn't fail if 100 bytes are freed here (applications can >>> easily do this foot shooting by allocating without freeing in atexit() >>> destructors). In practice, even allocation failures "can't happen", >>> except in programs that use setrlimit followed but foot shooting to test >>> the limits. setrlimit is now broken for this purpose, since it doesn't >>> limit allocations done using mmap() instead of break(), and malloc() now >>> uses mmap(). >>> >>> If coverity understood this and wanted to spam you with warnings, then it >>> would not warn about this, but would warn about more important things >> like >>> failure to fflush() or fclose() or check for or handle errors for all >>> open streams before calling exit(). Also, if all callers of usage() are >>> not understood, for failures to switch stderr to unbuffered mode before >>> using it in usage(). >>> >>> The error reporting is even harder to do if stderr is not available. >>> Windowing systems and even curses need to do lots more cleanup _before_ >>> exit() and it may be difficult to clean up enough to print error messages >>> using the windowing system. >> >> I agree with Bruce. Items like these should be ignored in the Coverity UI >> as false positives with reasoning, like “global variables; freed on exitâ€. >> >> As others have noted in past mailing threads, freeing variables on exit >> can cause applications to hang for a period of time, while the memory is >> being reclaimed. I think it’s best to ignore these kinds of allocations on >> exit to avoid introducing unnecessary complexity in the program, as they’re >> benign issues. >> > > > It's been a long running debate since 92 or so when purify came out and > this problem started to be found. In the last 25 years the question hasn't > been settled. I tend to think it's a waste of time, though I get that > issues like this create a lot of false positives. I'm +1 on Bruce's point on this. I find it similar to the recent spate of adding pointless '__dead2' annotations to usage functions that unconditionally call exit() (and thus are already inferred as __dead2 by any compiler written in this millenium) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Thu Feb 21 18:28:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CB414EB49C; Thu, 21 Feb 2019 18:28:31 +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 4A163871AE; Thu, 21 Feb 2019 18:28:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (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 A5445CBCE; Thu, 21 Feb 2019 18:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344099 - head/sys/net To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@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: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Date: Thu, 21 Feb 2019 10:28:02 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A163871AE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:28:32 -0000 On 2/21/19 7:29 AM, Randall Stewart wrote: > > >> On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >> >> On 2/13/19 10:03 AM, Randall Stewart wrote: >>> oh and one other thing.. >>> >>> It was *not* a random IFP.. it was the IFP to the lagg. >>> >>> I.e. an alloc() was done to the lagg.. and the free was >>> done back to the same IFP (that provided the allocate). >> >> Yes, that's wrong. Suppose the route changes so that my traffic is now over >> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you >> expect if_lagg_free to invoke em0's free routine? In your case it does, >> but only by accident. It doesn't work in the other case I described which >> is if you have non-lagg interfaces and a route moves from cc0 to em0. In >> that case your existing code that is using the wrong ifp will just panic. >> >> These aren't real alloc routines as the lagg and vlan ones don't allocate >> anything, they pass along the request to the child and the child allocates >> the tag. Only ifnet's that actually allocate tags should need to free them, >> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works. > > But thats what the lagg’s routine does, use the tag sent in > to find the real ifp (where the tag was allocated) and call > the if_snd_tag_free() on that. > > Its not an accident it works, it calls the free of the actual > interface where the allocation came from. > > I don’t see how it would panic. My point is that your calling code should do this. Suppose I have a socket over cc0. It allocates a send tag. Later, the connection is rerouted over em0 and em(4) doesn't support send tags at all. If you use the ifp from the route to free the tag, you will try to use em's if_snd_tag_free routine and that will be NULL and panic. The fix is that you shouldn't be using the route ifp to free the tag, only to note that the tag is stale, so something like: ifp = route.rt_ifp; if (ifp != m->m_snd_tag->ifp) { /* Need to free tag. */ tag = m->m_snd_tag; /* Free mbuf or clear tag or whatever */ tag->ifp->if_snd_tag_free(tag); } if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp that owns that tag and knows how to free it. Your patch happens to work for the case of the route going over a lagg and the connection switching between lagg ports only because you've made the lagg routine do what the calling code should be doing in the first place. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Thu Feb 21 18:41:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6394A14EC041; Thu, 21 Feb 2019 18:41: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 065DB87E64; Thu, 21 Feb 2019 18:41: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 EA31221889; Thu, 21 Feb 2019 18:41:42 +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 x1LIfgha085607; Thu, 21 Feb 2019 18:41:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LIfgw8085603; Thu, 21 Feb 2019 18:41:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902211841.x1LIfgw8085603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 18:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344444 - in head/contrib/llvm/tools/lld/ELF: . Arch X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm/tools/lld/ELF: . Arch X-SVN-Commit-Revision: 344444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 065DB87E64 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:41:43 -0000 Author: dim Date: Thu Feb 21 18:41:41 2019 New Revision: 344444 URL: https://svnweb.freebsd.org/changeset/base/344444 Log: Pull in r353299 from upstream lld trunk (by George Rimar): Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target." With the following changes: 1) Compilation fix: std::atomic HasStaticTlsModel = false; -> std::atomic HasStaticTlsModel{false}; 2) Adjusted the comment in code. Initial commit message: DF_STATIC_TLS flag indicates that the shared object or executable contains code using a static thread-local storage scheme. Patch checks if IE/LE relocations were used to check if the code uses a static model. If so it sets the DF_STATIC_TLS flag. Differential revision: https://reviews.llvm.org/D57749 Pull in r353378 from upstream lld trunk (by George Rimar): [LLD][ELF] - Set DF_STATIC_TLS flag for X64 target This is the same as D57749, but for x64 target. "ELF Handling For Thread-Local Storage" p41 says (https://www.akkadia.org/drepper/tls.pdf): R_X86_64_GOTTPOFF relocation is used for IE TLS models. Hence if linker sees this relocation we should add DF_STATIC_TLS flag. Differential revision: https://reviews.llvm.org/D57821 This adds support to lld for the DF_STATIC_TLS flag in shared objects, which signals to the dynamic linker that the shared object requires static thread local storage. See also: https://reviews.freebsd.org/D19072 MFC after: 1 week Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp head/contrib/llvm/tools/lld/ELF/Config.h head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -70,6 +70,14 @@ static bool hasBaseReg(uint8_t ModRM) { return (ModRM RelExpr X86::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { + // There are 4 different TLS variable models with varying degrees of + // flexibility and performance. LocalExec and InitialExec models are fast but + // less-flexible models. If they are in use, we set DF_STATIC_TLS flag in the + // dynamic section to let runtime know about that. + if (Type == R_386_TLS_LE || Type == R_386_TLS_LE_32 || Type == R_386_TLS_IE || + Type == R_386_TLS_GOTIE) + Config->HasStaticTlsModel = true; + switch (Type) { case R_386_8: case R_386_16: Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -76,6 +76,9 @@ template X86_64::X86_64() { template RelExpr X86_64::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { + if (Type == R_X86_64_GOTTPOFF) + Config->HasStaticTlsModel = true; + switch (Type) { case R_X86_64_8: case R_X86_64_16: Modified: head/contrib/llvm/tools/lld/ELF/Config.h ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Config.h Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Config.h Thu Feb 21 18:41:41 2019 (r344444) @@ -18,6 +18,7 @@ #include "llvm/Support/CachePruning.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Endian.h" +#include #include namespace lld { @@ -81,6 +82,7 @@ struct VersionDefinition { // and such fields have the same name as the corresponding options. // Most fields are initialized by the driver. struct Configuration { + std::atomic HasStaticTlsModel{false}; uint8_t OSABI = 0; llvm::CachePruningPolicy ThinLTOCachePolicy; llvm::StringMap SectionStartMap; Modified: head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -1282,6 +1282,8 @@ template void DynamicSection::final } if (!Config->ZText) DtFlags |= DF_TEXTREL; + if (Config->HasStaticTlsModel) + DtFlags |= DF_STATIC_TLS; if (DtFlags) addInt(DT_FLAGS, DtFlags); From owner-svn-src-head@freebsd.org Thu Feb 21 18:49:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5DE214EC36E; Thu, 21 Feb 2019 18:49:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 68A9E88347; Thu, 21 Feb 2019 18:49:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D0694260296; Thu, 21 Feb 2019 19:49:10 +0100 (CET) Subject: Re: svn commit: r344099 - head/sys/net To: John Baldwin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> From: Hans Petter Selasky Message-ID: <47882eda-b33c-9577-14b3-5cd2402af5e7@selasky.org> Date: Thu, 21 Feb 2019 19:46:44 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68A9E88347 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 18:49:14 -0000 Hi, On 2/21/19 7:28 PM, John Baldwin wrote: > On 2/21/19 7:29 AM, Randall Stewart wrote: >> >>> On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >>> >>> On 2/13/19 10:03 AM, Randall Stewart wrote: >>>> oh and one other thing.. >>>> >>>> It was*not* a random IFP.. it was the IFP to the lagg. >>>> >>>> I.e. an alloc() was done to the lagg.. and the free was >>>> done back to the same IFP (that provided the allocate). >>> Yes, that's wrong. Suppose the route changes so that my traffic is now over >>> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you >>> expect if_lagg_free to invoke em0's free routine? In your case it does, >>> but only by accident. It doesn't work in the other case I described which >>> is if you have non-lagg interfaces and a route moves from cc0 to em0. In >>> that case your existing code that is using the wrong ifp will just panic. >>> >>> These aren't real alloc routines as the lagg and vlan ones don't allocate >>> anything, they pass along the request to the child and the child allocates >>> the tag. Only ifnet's that actually allocate tags should need to free them, >>> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works. >> But thats what the lagg’s routine does, use the tag sent in >> to find the real ifp (where the tag was allocated) and call >> the if_snd_tag_free() on that. >> >> Its not an accident it works, it calls the free of the actual >> interface where the allocation came from. >> >> I don’t see how it would panic. > My point is that your calling code should do this. > > Suppose I have a socket over cc0. It allocates a send tag. Later, the > connection is rerouted over em0 and em(4) doesn't support send tags at all. > If you use the ifp from the route to free the tag, you will try to use > em's if_snd_tag_free routine and that will be NULL and panic. The fix is > that you shouldn't be using the route ifp to free the tag, only to note that > the tag is stale, so something like: > > ifp = route.rt_ifp; > if (ifp != m->m_snd_tag->ifp) { > /* Need to free tag. */ > tag = m->m_snd_tag; > > /* Free mbuf or clear tag or whatever */ > > tag->ifp->if_snd_tag_free(tag); > } > > if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp > that owns that tag and knows how to free it. > > Your patch happens to work for the case of the route going over a lagg and > the connection switching between lagg ports only because you've made the > lagg routine do what the calling code should be doing in the first place. I haven't seen Randall's code, but unless he is using the same ifp to free the send that that was used to allocate it, then John is right. The send tag already contains an interface pointer, that should be used when freeing it. --HPS From owner-svn-src-head@freebsd.org Thu Feb 21 19:19:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C27DC14ECF78; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA4389403; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA4721F2C; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LJJVJm005498; Thu, 21 Feb 2019 19:19:31 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LJJUiA005495; Thu, 21 Feb 2019 19:19:30 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902211919.x1LJJUiA005495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 19:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344445 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 344445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EA4389403 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 19:19:32 -0000 Author: bde Date: Thu Feb 21 19:19:30 2019 New Revision: 344445 URL: https://svnweb.freebsd.org/changeset/base/344445 Log: Fix the dumb and sc terminal emulators to compile and work. First remove ifdefs of the unsupported option SC_DUMB_TERMINAL which prevented building using both in the same kernel and broke regression tests. This option will be replaced by per-emulator supported options. The dumb emulator rotted with KSE in r83366, but usually compiled since it is ifdefed to nothing unless SC_DUMB_TERMINAL is defined. The type of an unused function parameter changed. Both emulators rotted when 2 new methods were added while the emulators were removed. Only null methods are needed, but null function pointers give panics instead. The wildcard in the default for the unsupported option SC_DFLT_TERM never really worked. It tends to prefer the dumb emulator when multiple emulators are configured. Change it to prefer scteken for compatibility. Modified: head/sys/dev/syscons/scterm-dumb.c head/sys/dev/syscons/scterm-sc.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scterm-dumb.c ============================================================================== --- head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 19:19:30 2019 (r344445) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #if defined(__sparc64__) || defined(__powerpc__) @@ -42,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SC_DUMB_TERMINAL - /* dumb terminal emulator */ static sc_term_init_t dumb_init; @@ -53,6 +53,8 @@ static sc_term_ioctl_t dumb_ioctl; static sc_term_clear_t dumb_clear; static sc_term_input_t dumb_input; static void dumb_nop(void); +static sc_term_fkeystr_t dumb_fkeystr; +static sc_term_sync_t dumb_sync; static sc_term_sw_t sc_term_dumb = { { NULL, NULL }, @@ -70,6 +72,8 @@ static sc_term_sw_t sc_term_dumb = { dumb_clear, (sc_term_notify_t *)dumb_nop, dumb_input, + dumb_fkeystr, + dumb_sync, }; SCTERM_MODULE(dumb, sc_term_dumb); @@ -108,7 +112,7 @@ dumb_puts(scr_stat *scp, u_char *buf, int len) static int dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, - int flag, struct proc *p) + struct thread *td) { vid_info_t *vi; @@ -146,10 +150,19 @@ dumb_input(scr_stat *scp, int c, struct tty *tp) return FALSE; } +static const char * +dumb_fkeystr(scr_stat *scp, int c) +{ + return (NULL); +} + static void +dumb_sync(scr_stat *scp) +{ +} + +static void dumb_nop(void) { /* nothing */ } - -#endif /* SC_DUMB_TERMINAL */ Modified: head/sys/dev/syscons/scterm-sc.c ============================================================================== --- head/sys/dev/syscons/scterm-sc.c Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/scterm-sc.c Thu Feb 21 19:19:30 2019 (r344445) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef SC_DUMB_TERMINAL - #define MAX_ESC_PAR 5 /* attribute flags */ @@ -89,6 +87,8 @@ static sc_term_default_attr_t scterm_default_attr; static sc_term_clear_t scterm_clear; static sc_term_notify_t scterm_notify; static sc_term_input_t scterm_input; +static sc_term_fkeystr_t scterm_fkeystr; +static sc_term_sync_t scterm_sync; static sc_term_sw_t sc_term_sc = { { NULL, NULL }, @@ -106,6 +106,8 @@ static sc_term_sw_t sc_term_sc = { scterm_clear, scterm_notify, scterm_input, + scterm_fkeystr, + scterm_sync, }; SCTERM_MODULE(sc, sc_term_sc); @@ -780,6 +782,17 @@ scterm_input(scr_stat *scp, int c, struct tty *tp) return FALSE; } +static const char * +scterm_fkeystr(scr_stat *scp, int c) +{ + return (NULL); +} + +static void +scterm_sync(scr_stat *scp) +{ +} + /* * Calculate hardware attributes word using logical attributes mask and * hardware colors @@ -807,5 +820,3 @@ mask2attr(term_stat *tcp) return (attr << 8); } - -#endif /* SC_DUMB_TERMINAL */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/syscons.h Thu Feb 21 19:19:30 2019 (r344445) @@ -378,7 +378,7 @@ typedef struct sc_ttysoftc { /* terminal emulator */ #ifndef SC_DFLT_TERM -#define SC_DFLT_TERM "*" /* any */ +#define SC_DFLT_TERM "scteken" #endif typedef int sc_term_init_t(scr_stat *scp, void **tcp, int code); From owner-svn-src-head@freebsd.org Thu Feb 21 21:15:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0C814F1369; Thu, 21 Feb 2019 21:15:50 +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 D4BEC8DE0A; Thu, 21 Feb 2019 21:15:49 +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 C093B2343B; Thu, 21 Feb 2019 21:15:49 +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 x1LLFnxm068322; Thu, 21 Feb 2019 21:15:49 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LLFnc0068321; Thu, 21 Feb 2019 21:15:49 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902212115.x1LLFnc0068321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Feb 2019 21:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344446 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 344446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4BEC8DE0A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:15:50 -0000 Author: jkim Date: Thu Feb 21 21:15:49 2019 New Revision: 344446 URL: https://svnweb.freebsd.org/changeset/base/344446 Log: Catch up with ACPICA 20190215. PR: 235922 Modified: head/usr.sbin/bhyve/acpi.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); EFPRINTF(fp, "\n"); } From owner-svn-src-head@freebsd.org Thu Feb 21 21:30:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F32514F1D47; Thu, 21 Feb 2019 21:30:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 70E0E8E8A3; Thu, 21 Feb 2019 21:30:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLUt6V022213; Thu, 21 Feb 2019 13:30:55 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLUtMq022212; Thu, 21 Feb 2019 13:30:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212130.x1LLUtMq022212@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212115.x1LLFnc0068321@repo.freebsd.org> To: Jung-uk Kim Date: Thu, 21 Feb 2019 13:30:54 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 70E0E8E8A3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:30:59 -0000 > Author: jkim > Date: Thu Feb 21 21:15:49 2019 > New Revision: 344446 > URL: https://svnweb.freebsd.org/changeset/base/344446 > > Log: > Catch up with ACPICA 20190215. > > PR: 235922 > > Modified: > head/usr.sbin/bhyve/acpi.c > > Modified: head/usr.sbin/bhyve/acpi.c > ============================================================================== > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > EFPRINTF(fp, "\n"); Hang on, acpi tables have version numbers, why is this needed, we did not change versions of acpi in bhyve. Isnt this a new item added by a new version? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Feb 21 21:33:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E412114F1F4F; Thu, 21 Feb 2019 21:33:28 +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 837F88EE02; Thu, 21 Feb 2019 21:33:28 +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 15F2E237AC; Thu, 21 Feb 2019 21:33:28 +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 x1LLXRGY078749; Thu, 21 Feb 2019 21:33:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LLXR62078748; Thu, 21 Feb 2019 21:33:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902212133.x1LLXR62078748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Feb 2019 21:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344448 - head/sys/contrib/dev/acpica/components/utilities X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/contrib/dev/acpica/components/utilities X-SVN-Commit-Revision: 344448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 837F88EE02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:33:29 -0000 Author: jkim Date: Thu Feb 21 21:33:27 2019 New Revision: 344448 URL: https://svnweb.freebsd.org/changeset/base/344448 Log: MFV: r344447 Fix missing comma in array declaration. Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 21:31:47 2019 (r344447) +++ head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 21:33:27 2019 (r344448) @@ -632,7 +632,7 @@ static const char *AcpiGbl_GenericNotify[ACP /* 0B */ "System Locality Update", /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update", - /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ + /* 0E */ "Heterogeneous Memory Attributes Update", /* ACPI 6.2 */ /* 0F */ "Error Disconnect Recover" /* ACPI 6.3 */ }; From owner-svn-src-head@freebsd.org Thu Feb 21 21:37:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA4914F21D7; Thu, 21 Feb 2019 21:37:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 52AFD8F161; Thu, 21 Feb 2019 21:37:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLawWb022262; Thu, 21 Feb 2019 13:36:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLaw2K022261; Thu, 21 Feb 2019 13:36:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212136.x1LLaw2K022261@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212115.x1LLFnc0068321@repo.freebsd.org> To: Jung-uk Kim Date: Thu, 21 Feb 2019 13:36:58 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 52AFD8F161 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.936,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:37:01 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: jkim > Date: Thu Feb 21 21:15:49 2019 > New Revision: 344446 > URL: https://svnweb.freebsd.org/changeset/base/344446 > > Log: > Catch up with ACPICA 20190215. > > PR: 235922 > > Modified: > head/usr.sbin/bhyve/acpi.c > > Modified: head/usr.sbin/bhyve/acpi.c > ============================================================================== > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > EFPRINTF(fp, "\n"); > } This is wrong, this is a version 1.0 MADT table, that version does NOT have this value. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Feb 21 21:42:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF8114F2509; Thu, 21 Feb 2019 21:42:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 667CF8F5D2; Thu, 21 Feb 2019 21:42:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLgq52022278; Thu, 21 Feb 2019 13:42:52 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLgqND022277; Thu, 21 Feb 2019 13:42:52 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212142.x1LLgqND022277@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212136.x1LLaw2K022261@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Thu, 21 Feb 2019 13:42:52 -0800 (PST) CC: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 667CF8F5D2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:42:55 -0000 > > Author: jkim > > Date: Thu Feb 21 21:15:49 2019 > > New Revision: 344446 > > URL: https://svnweb.freebsd.org/changeset/base/344446 > > > > Log: > > Catch up with ACPICA 20190215. > > > > PR: 235922 > > > > Modified: > > head/usr.sbin/bhyve/acpi.c > > > > Modified: head/usr.sbin/bhyve/acpi.c > > ============================================================================== > > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > > EFPRINTF(fp, "\n"); > > } > > This is wrong, this is a version 1.0 MADT table, > that version does NOT have this value. Let me guess.. this does not change the table generated, it only makes the iasl compiler happy about what we are feeding it? If so, just ignore my statement above, and sorry for the noise. If not how do we actually fix this so that the table is not changed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Feb 21 22:03:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0835D14F3029; Thu, 21 Feb 2019 22:03:54 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 996D1684A0; Thu, 21 Feb 2019 22:03:53 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.9] (p57BB46EC.dip0.t-ipconnect.de [87.187.70.236]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 835C8721E280C; Thu, 21 Feb 2019 23:03:50 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344368 - head/sys/netinet From: Michael Tuexen In-Reply-To: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 23:03:49 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <05B47F51-7016-4842-B8C3-36E533120DBE@freebsd.org> References: <201902201803.x1KI3haW078567@repo.freebsd.org> <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> To: "koobs@freebsd.org" X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 996D1684A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:03:54 -0000 > On 21. Feb 2019, at 09:32, Kubilay Kocak wrote: >=20 > On 21/02/2019 5:03 am, Michael Tuexen wrote: >> Author: tuexen >> Date: Wed Feb 20 18:03:43 2019 >> New Revision: 344368 >> URL: https://svnweb.freebsd.org/changeset/base/344368 >> Log: >> Reduce the TCP initial retransmission timeout from 3 seconds to >> 1 second as allowed by RFC 6298. >> Reviewed by: kbowling@, Richard Scheffenegger >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D18941 >> Modified: >> head/sys/netinet/tcp_syncache.c >> head/sys/netinet/tcp_timer.h >> Modified: head/sys/netinet/tcp_syncache.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/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -159,7 +159,7 @@ static int syncookie_cmp(struct = in_conninfo *inc, str >> * tcp_backoff[1] + >> * tcp_backoff[2] + >> * tcp_backoff[3]) + 3 * tcp_rexmit_slop, >> - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 45600 ms, >> + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 15600 ms, >> * the odds are that the user has given up attempting to connect by = then. >> */ >> #define SYNCACHE_MAXREXMTS 3 >> Modified: head/sys/netinet/tcp_timer.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -77,7 +77,7 @@ >> #define TCPTV_MSL ( 30*hz) /* max seg = lifetime (hah!) */ >> #define TCPTV_SRTTBASE 0 /* base = roundtrip time; >> if 0, no idea yet */ >> -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO = if no info */ >> +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO = if no info */ >> #define TCPTV_PERSMIN ( 5*hz) /* minimum = persist interval */ >> #define TCPTV_PERSMAX ( 60*hz) /* maximum = persist interval */ >> _______________________________________________ >=20 > Any way this can be a run-time tunable? Will implement this and add you to the review. Best regards Michael >=20 From owner-svn-src-head@freebsd.org Thu Feb 21 22:45:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6E3514F45FB; Thu, 21 Feb 2019 22:45: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 733C06B36E; Thu, 21 Feb 2019 22:45: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 6434924398; Thu, 21 Feb 2019 22:45:55 +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 x1LMjtHN015631; Thu, 21 Feb 2019 22:45:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMjtwI015629; Thu, 21 Feb 2019 22:45:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902212245.x1LMjtwI015629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Feb 2019 22:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344449 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 344449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 733C06B36E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:45:56 -0000 Author: emaste Date: Thu Feb 21 22:45:54 2019 New Revision: 344449 URL: https://svnweb.freebsd.org/changeset/base/344449 Log: scp: validate filenames provided by server against wildcard in client OpenSSH-portable commits: check in scp client that filenames sent during remote->local directory copies satisfy the wildcard specified by the user. This checking provides some protection against a malicious server sending unexpected filenames, but it comes at a risk of rejecting wanted files due to differences between client and server wildcard expansion rules. For this reason, this also adds a new -T flag to disable the check. reported by Harry Sintonen fix approach suggested by markus@; has been in snaps for ~1wk courtesy deraadt@ OpenBSD-Commit-ID: 00f44b50d2be8e321973f3c6d014260f8f7a8eda Minor patch conflict (getopt) resolved. Obtained from: OpenSSH-portable 391ffc4b9d31fa1f4ad566499fef9176ff8a07dc scp: add -T to usage(); OpenBSD-Commit-ID: a7ae14d9436c64e1bd05022329187ea3a0ce1899 Obtained from: OpenSSH-portable 2c21b75a7be6ebdcbceaebb43157c48dbb36f3d8 PR: 234965 Approved by: des MFC after: 3 days Obtained from: OpenSSH-portable 391ffc4b9d, 2c21b75a7b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19076 Modified: head/crypto/openssh/scp.1 head/crypto/openssh/scp.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/scp.1 ============================================================================== --- head/crypto/openssh/scp.1 Thu Feb 21 21:33:27 2019 (r344448) +++ head/crypto/openssh/scp.1 Thu Feb 21 22:45:54 2019 (r344449) @@ -18,7 +18,7 @@ .Nd secure copy (remote file copy program) .Sh SYNOPSIS .Nm scp -.Op Fl 346BCpqrv +.Op Fl 346BCpqrTv .Op Fl c Ar cipher .Op Fl F Ar ssh_config .Op Fl i Ar identity_file @@ -207,6 +207,16 @@ to use for the encrypted connection. The program must understand .Xr ssh 1 options. +.It Fl T +Disable strict filename checking. +By default when copying files from a remote host to a local directory +.Nm +checks that the received filenames match those requested on the command-line +to prevent the remote end from sending unexpected or unwanted files. +Because of differences in how various operating systems and shells interpret +filename wildcards, these checks may cause wanted files to be rejected. +This option disables these checks at the expense of fully trusting that +the server will not send unexpected filenames. .It Fl v Verbose mode. Causes Modified: head/crypto/openssh/scp.c ============================================================================== --- head/crypto/openssh/scp.c Thu Feb 21 21:33:27 2019 (r344448) +++ head/crypto/openssh/scp.c Thu Feb 21 22:45:54 2019 (r344449) @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */ +/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -94,6 +94,7 @@ #include #include #include +#include #include #include #include @@ -375,14 +376,14 @@ void verifydir(char *); struct passwd *pwd; uid_t userid; int errs, remin, remout; -int pflag, iamremote, iamrecursive, targetshouldbedirectory; +int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory; #define CMDNEEDS 64 char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ int response(void); void rsource(char *, struct stat *); -void sink(int, char *[]); +void sink(int, char *[], const char *); void source(int, char *[]); void tolocal(int, char *[]); void toremote(int, char *[]); @@ -421,8 +422,9 @@ main(int argc, char **argv) addargs(&args, "-oRemoteCommand=none"); addargs(&args, "-oRequestTTY=no"); - fflag = tflag = 0; - while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1) + fflag = Tflag = tflag = 0; + while ((ch = getopt(argc, argv, + "dfl:prtTvBCc:i:P:q12346S:o:F:")) != -1) { switch (ch) { /* User-visible flags. */ case '1': @@ -501,9 +503,13 @@ main(int argc, char **argv) setmode(0, O_BINARY); #endif break; + case 'T': + Tflag = 1; + break; default: usage(); } + } argc -= optind; argv += optind; @@ -534,7 +540,7 @@ main(int argc, char **argv) } if (tflag) { /* Receive data. */ - sink(argc, argv); + sink(argc, argv, NULL); exit(errs != 0); } if (argc < 2) @@ -791,7 +797,7 @@ tolocal(int argc, char **argv) continue; } free(bp); - sink(1, argv + argc - 1); + sink(1, argv + argc - 1, src); (void) close(remin); remin = remout = -1; } @@ -967,7 +973,7 @@ rsource(char *name, struct stat *statp) (sizeof(type) != 4 && sizeof(type) != 8)) void -sink(int argc, char **argv) +sink(int argc, char **argv, const char *src) { static BUF buffer; struct stat stb; @@ -983,6 +989,7 @@ sink(int argc, char **argv) unsigned long long ull; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; + char *src_copy = NULL, *restrict_pattern = NULL; struct timeval tv[2]; #define atime tv[0] @@ -1007,6 +1014,17 @@ sink(int argc, char **argv) (void) atomicio(vwrite, remout, "", 1); if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) targisdir = 1; + if (src != NULL && !iamrecursive && !Tflag) { + /* + * Prepare to try to restrict incoming filenames to match + * the requested destination file glob. + */ + if ((src_copy = strdup(src)) == NULL) + fatal("strdup failed"); + if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) { + *restrict_pattern++ = '\0'; + } + } for (first = 1;; first = 0) { cp = buf; if (atomicio(read, remin, cp, 1) != 1) @@ -1111,6 +1129,9 @@ sink(int argc, char **argv) run_err("error: unexpected filename: %s", cp); exit(1); } + if (restrict_pattern != NULL && + fnmatch(restrict_pattern, cp, 0) != 0) + SCREWUP("filename does not match request"); if (targisdir) { static char *namebuf; static size_t cursize; @@ -1148,7 +1169,7 @@ sink(int argc, char **argv) goto bad; } vect[0] = xstrdup(np); - sink(1, vect); + sink(1, vect, src); if (setimes) { setimes = 0; if (utimes(vect[0], tv) < 0) @@ -1316,7 +1337,7 @@ void usage(void) { (void) fprintf(stderr, - "usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n" + "usage: scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]\n" " [-l limit] [-o ssh_option] [-P port] [-S program] source ... target\n"); exit(1); } From owner-svn-src-head@freebsd.org Thu Feb 21 22:49:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5CE314F484A; Thu, 21 Feb 2019 22:49:21 +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 89F976B6BC; Thu, 21 Feb 2019 22:49:21 +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 7A974243B0; Thu, 21 Feb 2019 22:49:21 +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 x1LMnLiP015855; Thu, 21 Feb 2019 22:49:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMnLip015854; Thu, 21 Feb 2019 22:49:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212249.x1LMnLip015854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344450 - head/sys/modules/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/modules/dtrace X-SVN-Commit-Revision: 344450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89F976B6BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:49:22 -0000 Author: markj Date: Thu Feb 21 22:49:21 2019 New Revision: 344450 URL: https://svnweb.freebsd.org/changeset/base/344450 Log: Disconnect fasttrap from the 32-bit powerpc build. An upcoming bug fix requires 64-bit atomics, which aren't implemented on powerpc. The powerpc port of fasttrap is incomplete anyway and doesn't get loaded by dtraceall.ko on powerpc because of a missing dependency; it's presumed that it's effectively unused. Discussed with: jhibbits MFC after: 2 weeks Modified: head/sys/modules/dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Thu Feb 21 22:45:54 2019 (r344449) +++ head/sys/modules/dtrace/Makefile Thu Feb 21 22:49:21 2019 (r344450) @@ -19,9 +19,6 @@ SUBDIR+= fasttrap fbt systrace_linux .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= systrace_linux32 .endif -.if ${MACHINE_CPUARCH} == "powerpc" -SUBDIR+= fbt fasttrap -.endif .if ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "mips64" || \ @@ -31,7 +28,9 @@ SUBDIR+= systrace_freebsd32 .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "mips" || \ + ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "riscv" SUBDIR+= fbt .endif + .include From owner-svn-src-head@freebsd.org Thu Feb 21 22:49:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4124A14F488B; Thu, 21 Feb 2019 22:49:40 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D34D46B7DA; Thu, 21 Feb 2019 22:49:39 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C26A9243B1; Thu, 21 Feb 2019 22:49:39 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LMndke015917; Thu, 21 Feb 2019 22:49:39 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMndlW015916; Thu, 21 Feb 2019 22:49:39 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902212249.x1LMndlW015916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 21 Feb 2019 22:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344451 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 344451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D34D46B7DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:49:40 -0000 Author: sef Date: Thu Feb 21 22:49:39 2019 New Revision: 344451 URL: https://svnweb.freebsd.org/changeset/base/344451 Log: Fix the usage error I introduced in r344192. Specifically, I put the new option line in the wrong place, and then fixed up the rest without realizing it. This puts the usage statement back to what it was, with an additional line for the new -V option. Reported by: mav Sponsored by: iXsystems Inc. Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:21 2019 (r344450) +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:39 2019 (r344451) @@ -189,9 +189,9 @@ main(int argc, char **argv) "usage:\n" " nfsd [-ardtue] [-h bindip]\n" " [-n numservers] [--minthreads #] [--maxthreads #]\n" - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" - " [-V virtual_hostname]\n" - " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," + "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n" + " [-V virtual_hostname]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { From owner-svn-src-head@freebsd.org Thu Feb 21 22:54:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68F4714F4C01; Thu, 21 Feb 2019 22:54:18 +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 0B7B26BD0E; Thu, 21 Feb 2019 22:54:18 +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 ED1D02456C; Thu, 21 Feb 2019 22:54:17 +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 x1LMsH4x020673; Thu, 21 Feb 2019 22:54:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMsHo1020671; Thu, 21 Feb 2019 22:54:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212254.x1LMsHo1020671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Commit-Revision: 344452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7B26BD0E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:54:18 -0000 Author: markj Date: Thu Feb 21 22:54:17 2019 New Revision: 344452 URL: https://svnweb.freebsd.org/changeset/base/344452 Log: Fix a tracepoint lookup race in fasttrap_pid_probe(). fasttrap hooks the userspace breakpoint handler; the hook looks up the breakpoint address in a hash table of tracepoints. It is possible for the tracepoint to be removed by a different thread in between the breakpoint trap and the hash table lookup, in which case SIGTRAP gets delivered to the target process. Fix the problem by adding a per-process generation counter that gets incremented when a tracepoint belonging to that process is removed. Then, when a lookup fails, the trapping instruction is restarted if the thread's counter doesn't match that of the process. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19273 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/dev/dtrace/dtrace_cddl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Feb 21 22:54:17 2019 (r344452) @@ -1089,6 +1089,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_ ASSERT(p->p_proc_flag & P_PR_LOCK); #endif p->p_dtrace_count--; + + atomic_add_rel_64(&p->p_fasttrap_tp_gen, 1); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:54:17 2019 (r344452) @@ -967,6 +967,7 @@ fasttrap_pid_probe(struct trapframe *tf) struct reg reg, *rp; proc_t *p = curproc, *pp; struct rm_priotracker tracker; + uint64_t gen; uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1026,8 +1027,22 @@ fasttrap_pid_probe(struct trapframe *tf) while (pp->p_vmspace == pp->p_pptr->p_vmspace) pp = pp->p_pptr; pid = pp->p_pid; + if (pp != p) { + PROC_LOCK(pp); + if ((pp->p_flag & P_WEXIT) != 0) { + /* + * This can happen if the child was created with + * rfork(2). Userspace tracing cannot work reliably in + * such a scenario, but we can at least try. + */ + PROC_UNLOCK(pp); + sx_sunlock(&proctree_lock); + return (-1); + } + _PHOLD_LITE(pp); + PROC_UNLOCK(pp); + } sx_sunlock(&proctree_lock); - pp = NULL; rm_rlock(&fasttrap_tp_lock, &tracker); #endif @@ -1051,11 +1066,28 @@ fasttrap_pid_probe(struct trapframe *tf) if (tp == NULL) { #ifdef illumos mutex_exit(pid_mtx); + return (-1); #else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif + gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); + if (pp != p) + PRELE(pp); + if (curthread->t_fasttrap_tp_gen != gen) { + /* + * At least one tracepoint associated with this PID has + * been removed from the table since #BP was raised. + * Speculate that we hit a tracepoint that has since + * been removed, and retry the instruction. + */ + curthread->t_fasttrap_tp_gen = gen; + tf->tf_rip = pc; + return (0); + } return (-1); +#endif } + if (pp != p) + PRELE(pp); /* * Set the program counter to the address of the traced instruction Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Feb 21 22:54:17 2019 (r344452) @@ -37,7 +37,7 @@ typedef struct kdtrace_proc { u_int64_t p_dtrace_count; /* Number of DTrace tracepoints */ void *p_dtrace_helpers; /* DTrace helpers, if any */ int p_dtrace_model; - + uint64_t p_fasttrap_tp_gen; /* Tracepoint hash table gen */ } kdtrace_proc_t; /* @@ -86,6 +86,7 @@ typedef struct kdtrace_thread { u_int64_t td_hrtime; /* Last time on cpu. */ void *td_dtrace_sscr; /* Saved scratch space location. */ void *td_systrace_args; /* syscall probe arguments. */ + uint64_t td_fasttrap_tp_gen; /* Tracepoint hash table gen. */ } kdtrace_thread_t; /* @@ -113,10 +114,12 @@ typedef struct kdtrace_thread { #define t_dtrace_regv td_dtrace->td_dtrace_regv #define t_dtrace_sscr td_dtrace->td_dtrace_sscr #define t_dtrace_systrace_args td_dtrace->td_systrace_args +#define t_fasttrap_tp_gen td_dtrace->td_fasttrap_tp_gen #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes #define p_model p_dtrace->p_dtrace_model +#define p_fasttrap_tp_gen p_dtrace->p_fasttrap_tp_gen #define DATAMODEL_NATIVE 0 #ifdef __amd64__ From owner-svn-src-head@freebsd.org Thu Feb 21 22:56:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE3B14F4D5F; Thu, 21 Feb 2019 22:56:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 115296BF95; Thu, 21 Feb 2019 22:56:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0BCB24585; Thu, 21 Feb 2019 22:56:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LMusI9020860; Thu, 21 Feb 2019 22:56:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMusof020859; Thu, 21 Feb 2019 22:56:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212256.x1LMusof020859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344453 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 344453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 115296BF95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 22:56:55 -0000 Author: markj Date: Thu Feb 21 22:56:54 2019 New Revision: 344453 URL: https://svnweb.freebsd.org/changeset/base/344453 Log: Commit a missing piece of r344452. MFC with: r344452 Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:54:17 2019 (r344452) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:56:54 2019 (r344453) @@ -1080,7 +1080,11 @@ fasttrap_pid_probe(struct trapframe *tf) * been removed, and retry the instruction. */ curthread->t_fasttrap_tp_gen = gen; +#ifdef __amd64 tf->tf_rip = pc; +#else + tf->tf_eip = pc; +#endif return (0); } return (-1); From owner-svn-src-head@freebsd.org Fri Feb 22 02:16:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A96714FB10C; Fri, 22 Feb 2019 02:16:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DDF672B27; Fri, 22 Feb 2019 02:16:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id x131so985518itc.3; Thu, 21 Feb 2019 18:16:05 -0800 (PST) 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=utyy3LzZU1lyNCSnh/YtmuoMo97BPGom0mu1TI8aZWY=; b=dlDDXLA1TBuj6Fsd0tq6Ops18/xHLMtrhUzjSxjON+tdy0pW41b6avd4ASDAceLp0P m6B/k1g9q7Gjjl5Ig6lCyh4aFYT7tyXq0Tg8f4ou4WXyjgoU3NvlIT8ig63lY+wqf6BW WRICQbM8RSDtV++Z/lXKgvTMaEZgKouekPkQFTIJ1HZXcM9e2Xy1JwOvzKdqGnHaro5J IACqg5TEThqOtaDcghzp0iqDruJ7g+oIZqNdP1zGwBUdxb7XIJp3ZS/OvOtmxUNjrQgr DmfuN3YEm2OfrP7sd48LqNdvrql7OjAr2fRjgbBbzs4VwddplEK0dRl802k6RwCJUfQ8 R8zA== X-Gm-Message-State: AHQUAubqu6q89us0VsOiW/75ijCW0FdZI8a8PyvlYvzD0PP5b8Ez3u22 qCIdFs8YOyFPVvZOIUrxkr5Xu0Lo X-Google-Smtp-Source: AHgI3IZ9Tm8THaNBwQfPzhdng62Tte9Nb2Fkl8P2KGJnuiKkwFYw/y3s/ugOW8hx7PMYAU/qEJedbA== X-Received: by 2002:a05:660c:6cc:: with SMTP id z12mr1111049itk.65.1550801757862; Thu, 21 Feb 2019 18:15:57 -0800 (PST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id y190sm54827itb.26.2019.02.21.18.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 18:15:57 -0800 (PST) Received: by mail-io1-f48.google.com with SMTP id p17so578996iol.7; Thu, 21 Feb 2019 18:15:57 -0800 (PST) X-Received: by 2002:a6b:6007:: with SMTP id r7mr1031368iog.124.1550801757345; Thu, 21 Feb 2019 18:15:57 -0800 (PST) MIME-Version: 1.0 References: <201902212254.x1LMsHo1020671@repo.freebsd.org> In-Reply-To: <201902212254.x1LMsHo1020671@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 21 Feb 2019 18:15:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2DDF672B27 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 02:16:05 -0000 Thanks Mark! Prior to this change, if you used userspace dtrace enough, eventually you would get a spurious SIGTRAP on a process, which has the default behavior of dumping core. Perhaps understandably, people balk at random core files lying around. Or at dtrace killing their programs. This patch should address that long-standing problem. An easy repro scenario was described in the differential: > It's possible to reproduce this by, for example, calling strlen() > in a loop, probing every instruction in strlen(), and killing dtrace(1). On Thu, Feb 21, 2019 at 2:54 PM Mark Johnston wrote: > > Author: markj > Date: Thu Feb 21 22:54:17 2019 > New Revision: 344452 > URL: https://svnweb.freebsd.org/changeset/base/344452 > > Log: > Fix a tracepoint lookup race in fasttrap_pid_probe(). > > fasttrap hooks the userspace breakpoint handler; the hook looks up the > breakpoint address in a hash table of tracepoints. It is possible for > the tracepoint to be removed by a different thread in between the > breakpoint trap and the hash table lookup, in which case SIGTRAP gets > delivered to the target process. Fix the problem by adding a > per-process generation counter that gets incremented when a tracepoint > belonging to that process is removed. Then, when a lookup fails, the > trapping instruction is restarted if the thread's counter doesn't match > that of the process. From owner-svn-src-head@freebsd.org Fri Feb 22 03:11:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AE8314FCCB2; Fri, 22 Feb 2019 03:11:29 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E7367653C; Fri, 22 Feb 2019 03:11:28 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F8F227304; Fri, 22 Feb 2019 03:11:28 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M3BSA8058165; Fri, 22 Feb 2019 03:11:28 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M3BSxG058164; Fri, 22 Feb 2019 03:11:28 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902220311.x1M3BSxG058164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Fri, 22 Feb 2019 03:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344456 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E7367653C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 03:11:29 -0000 Author: ganbold Date: Fri Feb 22 03:11:27 2019 New Revision: 344456 URL: https://svnweb.freebsd.org/changeset/base/344456 Log: Add base to the warning threshold. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:10:24 2019 (r344455) +++ head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:11:27 2019 (r344456) @@ -195,8 +195,9 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_BAT_COULOMB_LO 0xe3 #define AXP_BAT_CAP_WARN 0xe6 -#define AXP_BAT_CAP_WARN_LV1 0xf0 /* Bits 4, 5, 6, 7 */ -#define AXP_BAT_CAP_WARN_LV2 0xf /* Bits 0, 1, 2, 3 */ +#define AXP_BAT_CAP_WARN_LV1 0xf0 /* Bits 4, 5, 6, 7 */ +#define AXP_BAP_CAP_WARN_LV1BASE 5 /* 5-20%, 1% per step */ +#define AXP_BAT_CAP_WARN_LV2 0xf /* Bits 0, 1, 2, 3 */ /* Sensor conversion macros */ #define AXP_SENSOR_BAT_H(hi) ((hi) << 4) @@ -1527,6 +1528,7 @@ axp8xx_attach(device_t dev) /* Get thresholds */ if (axp8xx_read(dev, AXP_BAT_CAP_WARN, &val, 1) == 0) { sc->warn_thres = (val & AXP_BAT_CAP_WARN_LV1) >> 4; + sc->warn_thres += AXP_BAP_CAP_WARN_LV1BASE; sc->shut_thres = (val & AXP_BAT_CAP_WARN_LV2); if (bootverbose) { device_printf(dev, From owner-svn-src-head@freebsd.org Fri Feb 22 04:26:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14BF214FEE90; Fri, 22 Feb 2019 04:26:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 57F2D8088E; Fri, 22 Feb 2019 04:26:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id D15183D79DF; Fri, 22 Feb 2019 15:26:10 +1100 (AEDT) Date: Fri, 22 Feb 2019 15:26:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Eric Fagan cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344451 - head/usr.sbin/nfsd In-Reply-To: <201902212249.x1LMndlW015916@repo.freebsd.org> Message-ID: <20190222131548.O1013@besplex.bde.org> References: <201902212249.x1LMndlW015916@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=UJetJGXy c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=SvWHm_VhSpC4oVs-_eoA:9 a=YVRJsE9b-wrcqvZu:21 a=VOkeM6AD56tJ1krA:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 57F2D8088E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 04:26:22 -0000 On Thu, 21 Feb 2019, Sean Eric Fagan wrote: > Log: > Fix the usage error I introduced in r344192. > > Specifically, I put the new option line in the wrong place, and then fixed > up the rest without realizing it. This puts the usage statement back to > what it was, with an additional line for the new -V option. This restores the misformatting of the output. Usage messages should have the same formatting as the man page. Not to mention they should have the same options. > Modified: head/usr.sbin/nfsd/nfsd.c > ============================================================================== > --- head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:21 2019 (r344450) > +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:39 2019 (r344451) > @@ -189,9 +189,9 @@ main(int argc, char **argv) > "usage:\n" > " nfsd [-ardtue] [-h bindip]\n" Misformatting starts here. man(1) output has a 5-column left margin without "usage: ". Normal usage messages use a 7-column left margin as needed to fit "usage: " before the command name on the same line. > " [-n numservers] [--minthreads #] [--maxthreads #]\n" > - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" > - " [-V virtual_hostname]\n" > - " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; > + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," > + "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n" This is the worst misformatting. > + " [-V virtual_hostname]\n"; > while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, > &longindex)) != -1) > switch (ch) { The man(1) output is: XX nfsd [-ardute] [-n num_servers] [-h bindip] [-p pnfs_setup] XX [-m mirror_level] [-V virtual_hostname] [--maxthreads max_threads] XX [--minthreads min_threads] This is missing the --pnfs and -V options. The usage messge is: XX usage: XX nfsd [-ardtue] [-h bindip] XX [-n numservers] [--minthreads #] [--maxthreads #] XX [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel] XX [-V virtual_hostname] Other bugs in the usage message: - the -n option is unsorted - the name of the arg for the -n option is different - the --minthreads and --maxthreads options are sorted backwards - the name of the arg for --minthreads and --maxthreads is different and unusual. Man pages cannot use the abbreviation '#' for a number since this is not unique. - the arg for the -p/--pnfs option is a description, not a name. This is also unsuitable for the synopsis in man pages - the description of the arg for the -p/--pnfs option is too long. man(1) would make a different mess of formatting a single long token. - the description for -p/-pnfs is not normally formatted. cp(1) gave an example of normal formatting for lists, but this was and is broken too. It was "src1 ... srcN directory" and is now "source_file ... target directory". The old version is apparently carefully abbreviated to fit on 1 line, but " srcN" is redundant if N > 1 and a syntax error if N == 1. nfsd has the same syntax error and this helps mess up the formatting. cp leaves a space between the arg names and the ellipsis. The commas in the nfsd arg are needed to give a single token, but are especially hard to format and to describe in a more formal syntax. nfsd's man page doesn't attempt to give a more formal syntax. The current version of cp(1) fixes the redundant/wrong srcN, but expands the arg names and misformats the resulting long line only in the usage message. The separate tokens allow man(1) to split the line at a bad place, but it somehow splits early so as to not split in the middle of related tokens. I found misformatting in man output in additions to vidcontrol(1) yesterday. It needs to start a new line for the -f arg after adding args before -f, but splits in between the option and the arg. This seems to be because the -f option has a complicated fairly formal syntax involving lots of square brackets and the man page source uses lots of markup to express this, and this confuses man(1). - there isn't even a newline after the long description for -p/--pnfs gives a too-long line - the -m option is unsorted - the name of the arg for the -m option is different. I seem to have lost my synopsis/usage checker. Here is a quick re-implementation: XX #!/bin/sh XX XX name=$1 XX XX IFS= synopsis=$(man $name | col -bx | awk '{ XX if (match($1, "SYNOPSIS")) { XX state = 1 XX next XX } else if (state == 0) XX next XX else if (length($0) == 0) XX exit XX if (state == 1) { XX print "usage: " substr($0, 6) XX state = 2 XX } else XX print " " $0 XX }') XX IFS= usage=$($name -? --help 2>&1 <>/dev/null | grep -v "illegal option") XX XX if test "$synopsis" = "$usage"; then XX echo "$name passed synopsis vs usage check" XX else XX echo "$name failed synopsis vs usage check" XX # XXX: should do a diff here. XX echo "synopsis:" XX echo "$synopsis" XX echo "usage:" XX echo "$usage" XX fi A reasonable number of files pass the strict lexical identity check (after minor edits to man(1) output). Pass/fail counts: FreeBSD-~5.2 FreeBSD-12.0-ALPHA10 /bin 11/32 15/28 # some improvements /sbin 20/78 20/116 # no improvements /usr/bin # failed (bugware doesn't check options and hangs) /usr/sbin # failed (bugware doesn't check options and hangs) /usr/libexec # failed (bugware as above, or man(1) spins on bad man page) Just found the old version. It uses sed instead of awk and edits the usage method instead of the man page, and removes 1 more line in the usage: XX sed -e '/Unrecognized switch/d' \ but is otherwise worse. Bruce From owner-svn-src-head@freebsd.org Fri Feb 22 06:41:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061CB14DBAFF; Fri, 22 Feb 2019 06:41:50 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5CB85126; Fri, 22 Feb 2019 06:41:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 942BF17C5; Fri, 22 Feb 2019 06:41:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M6fnKl068607; Fri, 22 Feb 2019 06:41:49 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M6fmJI068601; Fri, 22 Feb 2019 06:41:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220641.x1M6fmJI068601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 06:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344458 - in head: share/man/man4 sys/conf usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head: share/man/man4 sys/conf usr.sbin/vidcontrol X-SVN-Commit-Revision: 344458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E5CB85126 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 06:41:50 -0000 Author: bde Date: Fri Feb 22 06:41:47 2019 New Revision: 344458 URL: https://svnweb.freebsd.org/changeset/base/344458 Log: Connect the restored dumb and sc terminal emulators to the kernel build. Add or fix options to control static and dynamic configuration. Keep the default of scteken, but default to statically configuring all available emulators (now 3 instead of 1). The dumb emulator is almost usable. libedit and libreadline handle dumb terminals perfectly for at least shell history. less(1) works as well as possible except on exit. But curses programs make messes. The dumb emulator has strange color support, with 2 dumb colors for normal output but fancy colorization for the cursor, mouse pointer and (with a non-dumb initial emulator) for low-level console output. Using the sc emulator instead of the default of scteken fixes at least the following bugs: - NUL is a printing character in cons25 but not in teken - teken doesn't support fixed colors for "reverse" video. - The best versions of sc are about 10 times faster than scteken (for printing to the frame buffer). This version is only about 5 times faster. Fix configuration features: - make SC_DFLT_TERM (for setting the initial emulator) a normal option. Add configuration features: - negative options SC_NO_TERM_* for omitting emulators in the static config. Modules for emulators might work, but I don't know of any - vidcontrol -e shows the available emulators - vidcontrol -E sets the active emulator. Modified: head/share/man/man4/syscons.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/usr.sbin/vidcontrol/vidcontrol.1 head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Fri Feb 22 04:52:12 2019 (r344457) +++ head/share/man/man4/syscons.4 Fri Feb 22 06:41:47 2019 (r344458) @@ -38,6 +38,7 @@ .Cd "options SC_ALT_MOUSE_IMAGE" .Cd "options SC_CUT_SEPCHARS=_characters_" .Cd "options SC_CUT_SPACES2TABS" +.Cd "options SC_DFLT_TERM" .Cd "options SC_DISABLE_KDBKEY" .Cd "options SC_DISABLE_REBOOT" .Cd "options SC_HISTORY_SIZE=N" @@ -48,6 +49,9 @@ .Cd "options SC_NO_PALETTE_LOADING" .Cd "options SC_NO_SUSPEND_VTYSWITCH" .Cd "options SC_NO_SYSMOUSE" +.Cd "options SC_NO_TERM_DUMB" +.Cd "options SC_NO_TERM_SC" +.Cd "options SC_NO_TERM_SCTEKEN" .Cd "options SC_PIXEL_MODE" .Cd "options SC_TWOBUTTON_MOUSE" .Cd "options SC_NORM_ATTR=_attribute_" @@ -285,6 +289,8 @@ This options instructs the driver to convert leading s when copying data into cut buffer. This might be useful to preserve indentation when copying tab-indented text. +.It Dv SC_DFLT_TERM=_name_ +This option specifies the name of the preferred terminal emulator. .It Dv SC_DISABLE_KDBKEY This option disables the ``debug'' key combination (by default, it is .Dv Alt-Esc , @@ -409,6 +415,15 @@ will fail if this option is defined. This option implies the .Dv SC_NO_CUTPASTE option too. +.It Dv SC_NO_TERM_DUMB +.It Dv SC_NO_TERM_SC +.It Dv SC_NO_TERM_SCTEKEN +These options remove the +.Qq dumb , +.Qq sc , +and +.Qq scteken +terminal emulators, respectively. .El .Ss Driver Flags The following driver flags can be used to control the Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/NOTES Fri Feb 22 06:41:47 2019 (r344458) @@ -1488,6 +1488,7 @@ options MAXCONS=16 # number of virtual consoles options SC_ALT_MOUSE_IMAGE # simplified mouse cursor in text mode options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp850 +options SC_DFLT_TERM=\"sc\" # default terminal emulator options SC_DISABLE_KDBKEY # disable `debug' key options SC_DISABLE_REBOOT # disable reboot key sequence options SC_HISTORY_SIZE=200 # number of history buffer lines @@ -1518,6 +1519,9 @@ options SC_NO_HISTORY options SC_NO_MODE_CHANGE options SC_NO_SYSMOUSE options SC_NO_SUSPEND_VTYSWITCH +#!options SC_NO_TERM_DUMB +#!options SC_NO_TERM_SC +#!options SC_NO_TERM_SCTEKEN # `flags' for sc # 0x80 Put the video card in the VESA 800x600 dots, 16 color mode Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/files Fri Feb 22 06:41:47 2019 (r344458) @@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc -dev/syscons/scterm-teken.c optional sc +dev/syscons/scterm-dumb.c optional sc !SC_NO_TERM_DUMB +dev/syscons/scterm-sc.c optional sc !SC_NO_TERM_SC +dev/syscons/scterm-teken.c optional sc !SC_NO_TERM_TEKEN dev/syscons/scvidctl.c optional sc dev/syscons/scvtb.c optional sc dev/syscons/snake/snake_saver.c optional snake_saver @@ -4883,7 +4885,7 @@ security/mac_veriexec/mac_veriexec_sha1.c optional mac security/mac_veriexec/mac_veriexec_sha256.c optional mac_veriexec_sha256 security/mac_veriexec/mac_veriexec_sha384.c optional mac_veriexec_sha384 security/mac_veriexec/mac_veriexec_sha512.c optional mac_veriexec_sha512 -teken/teken.c optional sc | vt +teken/teken.c optional sc !SC_NO_TERM_TEKEN | vt ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs ufs/ffs/ffs_inode.c optional ffs Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/options Fri Feb 22 06:41:47 2019 (r344458) @@ -767,6 +767,7 @@ SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h +SC_DFLT_TERM opt_syscons.h SC_DISABLE_KDBKEY opt_syscons.h SC_DISABLE_REBOOT opt_syscons.h SC_HISTORY_SIZE opt_syscons.h @@ -780,6 +781,9 @@ SC_NO_HISTORY opt_syscons.h SC_NO_MODE_CHANGE opt_syscons.h SC_NO_SUSPEND_VTYSWITCH opt_syscons.h SC_NO_SYSMOUSE opt_syscons.h +SC_NO_TERM_DUMB opt_syscons.h +SC_NO_TERM_SC opt_syscons.h +SC_NO_TERM_TEKEN opt_syscons.h SC_NORM_ATTR opt_syscons.h SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h Modified: head/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.1 Fri Feb 22 04:52:12 2019 (r344457) +++ head/usr.sbin/vidcontrol/vidcontrol.1 Fri Feb 22 06:41:47 2019 (r344458) @@ -21,9 +21,10 @@ .Nd system console control and configuration utility .Sh SYNOPSIS .Nm -.Op Fl CdLHPpx +.Op Fl CdHLPpx .Op Fl b Ar color .Op Fl c Ar appearance +.Op Fl E Ar emulator .Oo .Fl f .Oo @@ -282,6 +283,11 @@ Show the current changes. .El .It Fl d Print out current output screen map. +.It Fl E Ar emulator +Set the terminal emulator to +.Ar emulator . +.It Fl e +Show the active and available terminal emulators. .It Xo .Fl f .Oo Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 04:52:12 2019 (r344457) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:41:47 2019 (r344458) @@ -204,11 +204,11 @@ usage(void) " [foreground [background]] [show]"); else fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", -" [-g geometry] [-h size] [-i active | adapter | mode]", -" [-l screen_map] [-M char] [-m on | off]", -" [-r foreground background] [-S on | off] [-s number]", -" [-T xterm | cons25] [-t N | off] [mode]", +"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-E emulator]", +" [-f [[size] file]] [-g geometry] [-h size]", +" [-i active | adapter | mode] [-l screen_map] [-M char]", +" [-m on | off] [-r foreground background] [-S on | off]", +" [-s number] [-T xterm | cons25] [-t N | off] [mode]", " [foreground [background]] [show]"); exit(1); } @@ -1384,7 +1384,46 @@ clear_history(void) } } +static int +get_terminal_emulator(int i, struct term_info *tip) +{ + tip->ti_index = i; + if (ioctl(0, CONS_GETTERM, tip) == 0) + return (1); + strlcpy(tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy(tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + return (0); +} + static void +get_terminal_emulators(void) +{ + struct term_info ti; + int i; + + for (i = 0; i < 10; i++) { + if (get_terminal_emulator(i, &ti) == 0) + break; + printf("%d: %s (%s)%s\n", i, ti.ti_name, ti.ti_desc, + i == 0 ? " (active)" : ""); + } +} + +static void +set_terminal_emulator(const char *name) +{ + struct term_info old_ti, ti; + + get_terminal_emulator(0, &old_ti); + strlcpy(ti.ti_name, name, sizeof(ti.ti_name)); + if (ioctl(0, CONS_SETTERM, &ti) != 0) + warn("SETTERM '%s'", name); + get_terminal_emulator(0, &ti); + printf("%s (%s) -> %s (%s)\n", old_ti.ti_name, old_ti.ti_desc, + ti.ti_name, ti.ti_desc); +} + +static void set_terminal_mode(char *arg) { @@ -1412,7 +1451,7 @@ main(int argc, char **argv) if (vt4_mode) opts = "b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x"; else - opts = "b:Cc:dfg:h:Hi:l:LM:m:pPr:S:s:T:t:x"; + opts = "b:Cc:deE:fg:h:Hi:l:LM:m:pPr:S:s:T:t:x"; while ((opt = getopt(argc, argv, opts)) != -1) switch(opt) { @@ -1429,6 +1468,16 @@ main(int argc, char **argv) if (vt4_mode) break; print_scrnmap(); + break; + case 'E': + if (vt4_mode) + break; + set_terminal_emulator(optarg); + break; + case 'e': + if (vt4_mode) + break; + get_terminal_emulators(); break; case 'f': optarg = nextarg(argc, argv, &optind, 'f', 0); From owner-svn-src-head@freebsd.org Fri Feb 22 06:57:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E4014DC5B4; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BE3885ADD; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0133519E9; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M6vkBA074629; Fri, 22 Feb 2019 06:57:46 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M6vkcY074628; Fri, 22 Feb 2019 06:57:46 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220657.x1M6vkcY074628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 06:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344459 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 344459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BE3885ADD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 06:57:47 -0000 Author: bde Date: Fri Feb 22 06:57:46 2019 New Revision: 344459 URL: https://svnweb.freebsd.org/changeset/base/344459 Log: Fix warnings from -Wpointer-sign. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:41:47 2019 (r344458) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:57:46 2019 (r344459) @@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip) tip->ti_index = i; if (ioctl(0, CONS_GETTERM, tip) == 0) return (1); - strlcpy(tip->ti_name, "unknown", sizeof(tip->ti_name)); - strlcpy(tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); return (0); } @@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name) struct term_info old_ti, ti; get_terminal_emulator(0, &old_ti); - strlcpy(ti.ti_name, name, sizeof(ti.ti_name)); + strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name)); if (ioctl(0, CONS_SETTERM, &ti) != 0) warn("SETTERM '%s'", name); get_terminal_emulator(0, &ti); From owner-svn-src-head@freebsd.org Fri Feb 22 07:00:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B9114DC800; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25F1785DDF; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AFA619F5; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M70NrV074971; Fri, 22 Feb 2019 07:00:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M70Nsb074970; Fri, 22 Feb 2019 07:00:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220700.x1M70Nsb074970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 07:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344460 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 344460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25F1785DDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 07:00:24 -0000 Author: bde Date: Fri Feb 22 07:00:23 2019 New Revision: 344460 URL: https://svnweb.freebsd.org/changeset/base/344460 Log: Oops, actually fix warnings from -Wpointer-sign. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:57:46 2019 (r344459) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 07:00:23 2019 (r344460) @@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip) tip->ti_index = i; if (ioctl(0, CONS_GETTERM, tip) == 0) return (1); - strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); - strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + strlcpy((char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy((char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); return (0); } @@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name) struct term_info old_ti, ti; get_terminal_emulator(0, &old_ti); - strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name)); + strlcpy((char *)ti.ti_name, name, sizeof(ti.ti_name)); if (ioctl(0, CONS_SETTERM, &ti) != 0) warn("SETTERM '%s'", name); get_terminal_emulator(0, &ti); From owner-svn-src-head@freebsd.org Fri Feb 22 11:52:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B2D14E7EFF; Fri, 22 Feb 2019 11:52:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C22C169ACF; Fri, 22 Feb 2019 11:52:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B75CA4F98; Fri, 22 Feb 2019 11:52:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MBqe3L032237; Fri, 22 Feb 2019 11:52:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MBqeNj032236; Fri, 22 Feb 2019 11:52:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902221152.x1MBqeNj032236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 11:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344464 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C22C169ACF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 11:52:41 -0000 Author: bde Date: Fri Feb 22 11:52:40 2019 New Revision: 344464 URL: https://svnweb.freebsd.org/changeset/base/344464 Log: Quick fix for building LINT on i386. A fix is needed on all arches and this one should also work on amd64 and sparc64. LINT was broken in r312910 with the removal of pc98 support, by changing the pathname in UKBD_DFLT_KEYBAP from a removed pc98 file to a nonexistent file. There are many bugs nearby. Some are: - the error is not properly detected and handled by make(1), because kbdcontrol(8) exits with status 0 after failing to find the keymap file - UKBD_DFLT_KEYBAP is supposed to be MI, and is in MI NOTES to try enforce this, but 5 out of 8 arches don't support it - LINT seems to have been broken by this in only 7 out of 8 arches. mips breaks test coverage instead, by killing this option in its MD NOTES. arm kills ukbd but that is not enough to configure an unsupported option used only by ukbd. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 22 10:06:34 2019 (r344463) +++ head/sys/conf/NOTES Fri Feb 22 11:52:40 2019 (r344464) @@ -2740,7 +2740,7 @@ options U3G_DEBUG # options for ukbd: options UKBD_DFLT_KEYMAP # specify the built-in keymap -makeoptions UKBD_DFLT_KEYMAP=jp +makeoptions UKBD_DFLT_KEYMAP=jp.106 # options for uplcom: options UPLCOM_INTR_INTERVAL=100 # interrupt pipe interval From owner-svn-src-head@freebsd.org Fri Feb 22 14:59:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA9E14EE9B5; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 863D26FEBB; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 797746DF6; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MExemk026300; Fri, 22 Feb 2019 14:59:40 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MExegD026299; Fri, 22 Feb 2019 14:59:40 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221459.x1MExegD026299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 14:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344468 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 863D26FEBB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 14:59:41 -0000 Author: dab Date: Fri Feb 22 14:59:40 2019 New Revision: 344468 URL: https://svnweb.freebsd.org/changeset/base/344468 Log: Revert r344389 & r343906 - Fix Coverity errors in newsyslog It was pointed out that a couple of the "memory leak" CIDs that I fixed were arguably Coverity errors rather than errors in the newsyslog code and the cure was worse than the disease. Revert both changes. The first change, which included fixes for other Coverity errors, will be re-worked to omit the troublesome changes and then re-committed with the remaining fixes. Reported by: bde Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 12:27:25 2019 (r344467) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 14:59:40 2019 (r344468) @@ -253,7 +253,7 @@ static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry **defconf, struct ilist *inclist); + struct conf_entry *defconf_p, struct ilist *inclist); static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); @@ -374,8 +374,6 @@ main(int argc, char **argv) while (wait(NULL) > 0 || errno == EINTR) ; - free(timefnamefmt); - free(requestor); return (0); } @@ -793,9 +791,6 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); - /* Free global dynamically-allocated storage. */ - free(timefnamefmt); - free(requestor); exit(1); } @@ -846,7 +841,7 @@ get_worklist(char **files) if (verbose) printf("Processing %s\n", inc->file); - parse_file(f, filelist, globlist, &defconf, &inclist); + parse_file(f, filelist, globlist, defconf, &inclist); (void) fclose(f); } @@ -863,6 +858,7 @@ get_worklist(char **files) if (defconf != NULL) free_entry(defconf); return (filelist); + /* NOTREACHED */ } /* @@ -919,7 +915,7 @@ get_worklist(char **files) * for a "glob" entry which does match. */ gmatch = 0; - if (verbose > 2) + if (verbose > 2 && globlist != NULL) printf("\t+ Checking globs for %s\n", *given); STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); @@ -1050,7 +1046,7 @@ expand_globs(struct cflist *work_p, struct cflist *glo */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry **defconf_p, struct ilist *inclist) + struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; @@ -1141,12 +1137,12 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (*defconf_p != NULL) { + if (defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - *defconf_p = working; + defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); @@ -1361,8 +1357,7 @@ no_trimat: q = NULL; else { q = parse = sob(parse + 1); /* Optional field */ - parse = son(parse); - *parse = '\0'; + *(parse = son(parse)) = '\0'; } working->sig = SIGHUP; @@ -2015,6 +2010,7 @@ do_zipwork(struct zipwork_entry *zwork) const char **args, *pgm_name, *pgm_path; char *zresult; + command = NULL; assert(zwork != NULL); assert(zwork->zw_conf != NULL); assert(zwork->zw_conf->compress > COMPRESS_NONE); @@ -2118,7 +2114,8 @@ do_zipwork(struct zipwork_entry *zwork) change_attrs(zresult, zwork->zw_conf); out: - sbuf_delete(command); + if (command != NULL) + sbuf_delete(command); free(args); free(zresult); } From owner-svn-src-head@freebsd.org Fri Feb 22 15:03:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DCDA14EEDF3; Fri, 22 Feb 2019 15:03:43 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFACB704EF; Fri, 22 Feb 2019 15:03:42 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: by mail-it1-x12b.google.com with SMTP id m137so3357292ita.0; Fri, 22 Feb 2019 07:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=GqIEBhx8C25T7neNHDFf07DbOxBxYPpOIUcZOEHSTYI=; b=hyu8U9Cw9I9VFxLTFH7FWjSo55g3TAvLIDkEe6CrzWoYO2m04yg0lZW4vXtStu1vUK 8LJndMYseraFj5QNmZ3BVPVyaRwTe4nQTppLZrjsbcuoeO5wzNvIu44ln4aLCOqWYJ9g W7kqmqhRUlirbHeY+L/uuhy9FRxdBKn49GwR5O6m01I1BPjp3rZpWjhwtOyoIM/CHCqG aNsOvWNRu48AVmojjPKQAlB55b28pdPzDXXMOg8aPmUzPs9pODYDl1wS4Tt0MXDXkRMd F6KGCJCcyr62CvOv9vbg/0t3whLyVi/tzm7vlvpBJlLc1ZejdQsCZR4J90aZMrlCWOG8 A8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=GqIEBhx8C25T7neNHDFf07DbOxBxYPpOIUcZOEHSTYI=; b=blbzC5Evop8KPHBCGtKZZbvdUpx1pjF6abTqecxNyWIhEYW8/bfIek0sOZ4RhW8t/l xpBBwo/4+LOqFO5nKFBxlT9Nwv7Ando5FOzM94vCJRbjy2ylQiC0ksDrBo8L4t2ROh58 OB8tEtU9C/HmaDPhmjgLMKYiYgNUnjs9agAwp7o8YemKUxzjyRv7z1nTm2Uqv3ZNNnOH PmlBPivRkIptpImA+IaXUoHvrNb0mBrp0aVqhvcpfqycasGjZ48ZpwGHQSGMOuLjlrLH hgxCjpsLtuD7uF2+aFHuyMV6ok0L6XXBAi8yp/SQEiJv1CM++yI2Pd8BtBCo9uyfWnHH 9gGQ== X-Gm-Message-State: AHQUAuaaKx28QlO2MhWCPKbCVupECdNeDK+z9jszw27+CWx3ymYzycCk 7rTvD5rqZ3S1Isrwa91EXV8JWDuF X-Google-Smtp-Source: AHgI3IY7AVJr/rZzFyWYoJShPXImLSvOq8K1XgvaiUvI5K68h+XGL7O9/zHZxX6F6GKTwaDMNJJRLQ== X-Received: by 2002:a24:4a95:: with SMTP id k143mr2397177itb.77.1550847821991; Fri, 22 Feb 2019 07:03:41 -0800 (PST) Received: from ?IPv6:2601:442:4580:3ee3:d1f4:bd82:e7a5:4239? ([2601:442:4580:3ee3:d1f4:bd82:e7a5:4239]) by smtp.gmail.com with ESMTPSA id w13sm793099itb.10.2019.02.22.07.03.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 07:03:41 -0800 (PST) Sender: David Bright From: David Bright X-Google-Original-From: David Bright Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog Date: Fri, 22 Feb 2019 09:03:39 -0600 In-Reply-To: Cc: Warner Losh , Garrett Cooper , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: John Baldwin References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: DFACB704EF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 15:03:43 -0000 [=E2=80=A6 other discussion omitted=E2=80=A6]=20 On Feb 21, 2019, at 12:22 PM, John Baldwin wrote: >=20 >=20 > I'm +1 on Bruce's point on this. I find it similar to the recent = spate of > adding pointless '__dead2' annotations to usage functions that = unconditionally > call exit() (and thus are already inferred as __dead2 by any compiler > written in this millenium) I=E2=80=99ve reverted (r344468) the two commits that contained the = memory leak fixes at issue.=20 Thanks for the feedback. --=20 David Bright dab@FreeBSD.org From owner-svn-src-head@freebsd.org Fri Feb 22 15:09:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80AB614EF088; Fri, 22 Feb 2019 15:09:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id E44B2707D3; Fri, 22 Feb 2019 15:09:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 7A752436F52; Sat, 23 Feb 2019 02:09:08 +1100 (AEDT) Date: Sat, 23 Feb 2019 02:09:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Bright cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344468 - head/usr.sbin/newsyslog In-Reply-To: <201902221459.x1MExegD026299@repo.freebsd.org> Message-ID: <20190223020739.H33323@besplex.bde.org> References: <201902221459.x1MExegD026299@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Mu5RLQuuxLdgbZ8lhckA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: E44B2707D3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 15:09:12 -0000 On Fri, 22 Feb 2019, David Bright wrote: > Log: > Revert r344389 & r343906 - Fix Coverity errors in newsyslog > > It was pointed out that a couple of the "memory leak" CIDs that I > fixed were arguably Coverity errors rather than errors in the > newsyslog code and the cure was worse than the disease. Revert both > changes. The first change, which included fixes for other Coverity > errors, will be re-worked to omit the troublesome changes and then > re-committed with the remaining fixes. > > Reported by: bde > Sponsored by: Dell EMC Isilon Thanks. The other changes look OK. Bruce From owner-svn-src-head@freebsd.org Fri Feb 22 15:15:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC2C14EF53C; Fri, 22 Feb 2019 15:15:37 +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 F3A8570E37; Fri, 22 Feb 2019 15:15: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 E7449715A; Fri, 22 Feb 2019 15:15:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MFFa9r036711; Fri, 22 Feb 2019 15:15:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MFFahU036709; Fri, 22 Feb 2019 15:15:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902221515.x1MFFahU036709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Feb 2019 15:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344469 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 344469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3A8570E37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 15:15:37 -0000 Author: imp Date: Fri Feb 22 15:15:36 2019 New Revision: 344469 URL: https://svnweb.freebsd.org/changeset/base/344469 Log: Rework logpage extensibility. Move from using a linker set to a constructor function that's called. This simplifies the code and is slightly more obvious. We now keep a list of page decoders rather than having an array we managed before. Commands will move to something similar in the future. Reviewed by: jhb@ Differential Revision: https://reviews.freebsd.org/D19275 Modified: head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/logpage.c Fri Feb 22 15:15:36 2019 (r344469) @@ -53,8 +53,15 @@ __FBSDID("$FreeBSD$"); #define MAX_FW_SLOTS (7) -SET_CONCAT_DEF(logpage, struct logpage_function); +static SLIST_HEAD(,logpage_function) logpages; +void +logpage_register(struct logpage_function *p) +{ + + SLIST_INSERT_HEAD(&logpages, p, link); +} + const char * kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key) { @@ -326,15 +333,15 @@ NVME_LOGPAGE(fw, static void logpage_help(void) { - const struct logpage_function * const *f; + const struct logpage_function *f; const char *v; fprintf(stderr, "\n"); fprintf(stderr, "%-8s %-10s %s\n", "Page", "Vendor","Page Name"); fprintf(stderr, "-------- ---------- ----------\n"); - for (f = logpage_begin(); f < logpage_limit(); f++) { - v = (*f)->vendor == NULL ? "-" : (*f)->vendor; - fprintf(stderr, "0x%02x %-10s %s\n", (*f)->log_page, v, (*f)->name); + SLIST_FOREACH(f, &logpages, link) { + v = f->vendor == NULL ? "-" : f->vendor; + fprintf(stderr, "0x%02x %-10s %s\n", f->log_page, v, f->name); } exit(1); @@ -352,7 +359,7 @@ logpage(const struct nvme_function *nf, int argc, char uint32_t nsid, size; void *buf; const char *vendor = NULL; - const struct logpage_function * const *f; + const struct logpage_function *f; struct nvme_controller_data cdata; print_fn_t print_fn; uint8_t ns_smart; @@ -438,14 +445,14 @@ logpage(const struct nvme_function *nf, int argc, char * the page is vendor specific, don't match the print function * unless the vendors match. */ - for (f = logpage_begin(); f < logpage_limit(); f++) { - if ((*f)->vendor != NULL && vendor != NULL && - strcmp((*f)->vendor, vendor) != 0) + SLIST_FOREACH(f, &logpages, link) { + if (f->vendor != NULL && vendor != NULL && + strcmp(f->vendor, vendor) != 0) continue; - if (log_page != (*f)->log_page) + if (log_page != f->log_page) continue; - print_fn = (*f)->print_fn; - size = (*f)->size; + print_fn = f->print_fn; + size = f->size; break; } } Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/nvmecontrol.c Fri Feb 22 15:15:36 2019 (r344469) @@ -312,19 +312,17 @@ load_dir(const char *dir) warnx("Can't load %s: %s", path, dlerror()); else { /* - * Add in the top (for cli commands) and logpage (for - * logpage parsing) linker sets. We have to do this by - * hand because linker sets aren't automatically merged. + * Add in the top (for cli commands)linker sets. We have + * to do this by hand because linker sets aren't + * automatically merged. */ void *begin, *limit; + begin = dlsym(h, "__start_set_top"); limit = dlsym(h, "__stop_set_top"); if (begin) add_to_top(begin, limit); - begin = dlsym(h, "__start_set_logpage"); - limit = dlsym(h, "__stop_set_logpage"); - if (begin) - add_to_logpage(begin, limit); + /* log pages use constructors so are done on load */ } free(path); path = NULL; @@ -337,7 +335,6 @@ main(int argc, char *argv[]) { add_to_top(NVME_CMD_BEGIN(top), NVME_CMD_LIMIT(top)); - add_to_logpage(NVME_LOGPAGE_BEGIN, NVME_LOGPAGE_LIMIT); load_dir("/lib/nvmecontrol"); load_dir("/usr/local/lib/nvmecontrol"); Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/nvmecontrol.h Fri Feb 22 15:15:36 2019 (r344469) @@ -32,6 +32,7 @@ #define __NVMECONTROL_H__ #include +#include #include struct nvme_function; @@ -56,6 +57,7 @@ struct nvme_function { typedef void (*print_fn_t)(const struct nvme_controller_data *cdata, void *buf, uint32_t size); struct logpage_function { + SLIST_ENTRY(logpage_function) link; uint8_t log_page; const char *vendor; const char *name; @@ -64,7 +66,6 @@ struct logpage_function { }; -#define NVME_LOGPAGESET(sym) DATA_SET(NVME_SETNAME(logpage), sym) #define NVME_LOGPAGE(unique, lp, vend, nam, fn, sz) \ static struct logpage_function unique ## _lpf = { \ .log_page = lp, \ @@ -73,10 +74,8 @@ struct logpage_function { .print_fn = fn, \ .size = sz, \ } ; \ - NVME_LOGPAGESET(unique ## _lpf) -#define NVME_LOGPAGE_BEGIN SET_BEGIN(NVME_SETNAME(logpage)) -#define NVME_LOGPAGE_LIMIT SET_LIMIT(NVME_SETNAME(logpage)) -#define NVME_LOGPAGE_DECLARE(t) SET_DECLARE(NVME_SETNAME(logpage), t) + static void logpage_reg_##unique(void) __attribute__((constructor)); \ + static void logpage_reg_##unique(void) { logpage_register(&unique##_lpf); } #define DEFAULT_SIZE (4096) struct kv_name { @@ -87,7 +86,7 @@ struct kv_name { const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); NVME_CMD_DECLARE(top, struct nvme_function); -NVME_LOGPAGE_DECLARE(struct logpage_function); +void logpage_register(struct logpage_function *p); struct set_concat { void **begin; @@ -105,7 +104,6 @@ void add_to_ ## set(t **b, t **e) \ #define SET_CONCAT_DECL(set, t) \ void add_to_ ## set(t **b, t **e) SET_CONCAT_DECL(top, struct nvme_function); -SET_CONCAT_DECL(logpage, struct logpage_function); #define NVME_CTRLR_PREFIX "nvme" #define NVME_NS_PREFIX "ns" From owner-svn-src-head@freebsd.org Fri Feb 22 15:31:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9CBD14F0036; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5881F71981; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AFF747B; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MFVpKU046081; Fri, 22 Feb 2019 15:31:51 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MFVpd4046080; Fri, 22 Feb 2019 15:31:51 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221531.x1MFVpd4046080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 15:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344470 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5881F71981 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 15:31:52 -0000 Author: dab Date: Fri Feb 22 15:31:50 2019 New Revision: 344470 URL: https://svnweb.freebsd.org/changeset/base/344470 Log: Fix several Coverity-detected issues in newsyslog. - CID 1394815, CID 1305673: Dereference before null check - memory was allocated and the allocation checked for NULL with a call to errx() if it failed. Code below that was guaranteed that the pointer was non-NULL, but there was another check for NULL at the exit of the function (after the memory had already been referenced). Eliminate the useless NULL check. - CID 1007452: Resource leak - Storage intended to be allocated and returned to the caller was never freed. This was the result of a regression in the function signature introduced in r208648 (2010) (thanks for that find, @cem!). Fixed by altering the function signature and passing the allocated memory to the caller as intended. This also fixes PR158794. - CID 1008620: Logically dead code in newsyslog.c - This was a direct result of CID 1007452. Since the memory allocated as described there was not returned to the caller, a subsequent check for the memory having been allocated was dead code. Returning the memory re-animates the code that is the subject of this CID. - CID 1006131: Unused value - in parsing a configuration file, a pointer to the end of the last field was saved, but not used after that. Rewrite to use the pointer value. This could have been fixed by avoiding the assignment altogether, but this solutions more closely follows the pattern used in the preceding code. PR: 158794 Reported by: Coverity, Ken-ichi EZURA (PR158794) Reviewed by: cem, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19105 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 15:15:36 2019 (r344469) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 15:31:50 2019 (r344470) @@ -253,7 +253,7 @@ static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p, struct ilist *inclist); + struct conf_entry **defconf, struct ilist *inclist); static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); @@ -841,7 +841,7 @@ get_worklist(char **files) if (verbose) printf("Processing %s\n", inc->file); - parse_file(f, filelist, globlist, defconf, &inclist); + parse_file(f, filelist, globlist, &defconf, &inclist); (void) fclose(f); } @@ -858,7 +858,6 @@ get_worklist(char **files) if (defconf != NULL) free_entry(defconf); return (filelist); - /* NOTREACHED */ } /* @@ -915,7 +914,7 @@ get_worklist(char **files) * for a "glob" entry which does match. */ gmatch = 0; - if (verbose > 2 && globlist != NULL) + if (verbose > 2) printf("\t+ Checking globs for %s\n", *given); STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); @@ -1046,7 +1045,7 @@ expand_globs(struct cflist *work_p, struct cflist *glo */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p, struct ilist *inclist) + struct conf_entry **defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; @@ -1137,12 +1136,12 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (defconf_p != NULL) { + if (*defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - defconf_p = working; + *defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); @@ -1357,7 +1356,8 @@ no_trimat: q = NULL; else { q = parse = sob(parse + 1); /* Optional field */ - *(parse = son(parse)) = '\0'; + parse = son(parse); + *parse = '\0'; } working->sig = SIGHUP; @@ -2010,7 +2010,6 @@ do_zipwork(struct zipwork_entry *zwork) const char **args, *pgm_name, *pgm_path; char *zresult; - command = NULL; assert(zwork != NULL); assert(zwork->zw_conf != NULL); assert(zwork->zw_conf->compress > COMPRESS_NONE); @@ -2114,8 +2113,7 @@ do_zipwork(struct zipwork_entry *zwork) change_attrs(zresult, zwork->zw_conf); out: - if (command != NULL) - sbuf_delete(command); + sbuf_delete(command); free(args); free(zresult); } From owner-svn-src-head@freebsd.org Fri Feb 22 16:50:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C4014F30F6; Fri, 22 Feb 2019 16:50:33 +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 DA87D752EC; Fri, 22 Feb 2019 16:50:32 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.183] (unknown [209.133.79.250]) (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 B313B27001A3; Fri, 22 Feb 2019 11:50:24 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu B313B27001A3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1550854225; bh=ZHmBPfZ+V4U+TkkgymRI0crZ+l71lc4Er4X2HWNGdeQ=; h=Subject:To:From:Date:From; b=tR+dTHjjPAcoEN34yxAxBpZgfTsKQr6zoePRlwali1CJKj6JXTRmyVh+clo9DId4E WCiuw8XJ+Nnbkv84C+COvsKxeQ8i/XIp9CE7OdUxvEHIg+E2cF37HOLsRUk+zsDj3b f3k0jmC73BhO8lvKOzWm6JcQAaPNIXZFLyS6oN7j2BI8XMmAJctZ4xkPKAphuoVvV5 QyFF3mU6xCajy2fmHLYBfk3rTUmjL01vFpxIjl1CKg9wNl4wyVbeUIQvXnrCuG0ZbD 8qgaE1Au7LMDMn9jxjhjp/nkyCzaDlw2bDPZ9aKb/IdIj9ZJmCHogIFK0pgpXgV8jt jkdEIfR/Ao2FA== Subject: Re: svn commit: r344099 - head/sys/net To: John Baldwin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> From: Andrew Gallatin Message-ID: <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> Date: Fri, 22 Feb 2019 11:50:23 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DA87D752EC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 16:50:33 -0000 I think the misunderstanding here is that I think he's not getting the ifp from the route. My recollection is that he is holding the ifps when he enables HW pacing in BBR. Due to limitations in different NIC hardware, you can only have N different rates, etc. So he goes ahead and allocates those N rates up front so that he knows he can reserve them & know that he can always get them. Then when the system reboots, BBR has an eventhandler that goes ahead and frees those reservations. I think that he's using the ifp that he's holding here. In the case that tripped him up, that ifp was lagg. Your workaround would also work, but Randall does have a point about symmetric alloc/free especially when viewed from his perspective, Drew From owner-svn-src-head@freebsd.org Fri Feb 22 17:09:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B0B14F3D2B; Fri, 22 Feb 2019 17:09:40 +0000 (UTC) (envelope-from jhb@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 1BD3C75F81; Fri, 22 Feb 2019 17:09:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (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 E59FA15FDA; Fri, 22 Feb 2019 17:09:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344099 - head/sys/net To: Andrew Gallatin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> 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: <5651b9ff-fb79-d606-841e-ceb63936afdf@FreeBSD.org> Date: Fri, 22 Feb 2019 09:08:58 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BD3C75F81 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 17:09:40 -0000 On 2/22/19 8:50 AM, Andrew Gallatin wrote: > I think the misunderstanding here is that I think he's not getting the > ifp from the route. > > My recollection is that he is holding the ifps when he enables HW pacing > in BBR. Due to limitations in different NIC hardware, you can only have > N different rates, etc. So he goes ahead and allocates those N rates up > front so that he knows he can reserve them & know that he can always get > them. > > Then when the system reboots, BBR has an eventhandler that goes ahead > and frees those reservations. I think that he's using the ifp that he's > holding here. > > In the case that tripped him up, that ifp was lagg. > > Your workaround would also work, but Randall does have a point about > symmetric alloc/free especially when viewed from his perspective, But it's not really an alloc. We have many other places in the kernel where an alloc routine is actually a "forward" to something else that allocates the real thing. For example, when you add a kevent on a file descriptor, that is routed to the 'file_filtops' in kern/kern_event.c, but that filtops only has an attach routine, it doesn't have a detach routine because it's attach routine is a forwarder to other filtops. It invokes the fo_kqfilter method that is responsible for setting up the right filtops to use. For sockets this routes to one of three filtops that all have detach methods but no attach methods. The way this is handled is that anytime a kevent is detached, the current filtops is used to find the detach event handler. We don't use the filter's type to get back to the original file_filtops and require that to forward the detach request on to the real filtops. Having the tag save the "real" ifp is similar to knote's storing the real filtops. Given your specific use case, it does seem that this commit is sufficient, but it's not the "always works" way to free a tag, and it might be used as a template that gets copied for use in another case where the extra guarantees of this specific use case don't hold. Given that I'd like to explore making lagg and vlan allocate real interposing tags to handle TLS, this may prove mostly academic as they would have "real" free routines then since their alloc routines would just be forwarders. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Feb 22 18:43:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A749914F6799; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45DE1819F7; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32768952E; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MIhSjx045449; Fri, 22 Feb 2019 18:43:28 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MIhSjr045448; Fri, 22 Feb 2019 18:43:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221843.x1MIhSjr045448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 18:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344473 - head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini X-SVN-Commit-Revision: 344473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45DE1819F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 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]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 18:43:28 -0000 Author: dab Date: Fri Feb 22 18:43:27 2019 New Revision: 344473 URL: https://svnweb.freebsd.org/changeset/base/344473 Log: CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c A pointer is first tested for NULL. If non-NULL, another pointer is set equal to the first. The second pointer is then checked for NULL and an error path taken if so. This second test and the associated path is dead code as the pointer value, having just been checked for NULL, cannot be NULL at this point. Remove the dead code. Reported by: Coverity Reviewed by: daniel.william.ryan_gmail.com, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19165 Modified: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Modified: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c ============================================================================== --- head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Fri Feb 22 18:24:57 2019 (r344472) +++ head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Fri Feb 22 18:43:27 2019 (r344473) @@ -1820,12 +1820,6 @@ tiNumOfLunIOCTLreq( break; } tdIORequestBody = (tdIORequestBody_t *)tiRequestBody; - - if(tdIORequestBody == agNULL) - { - status = IOCTL_CALL_FAIL; - break; - } tdIORequestBody->tiIORequest = tiIORequest; /* save context if we need to abort later */ From owner-svn-src-head@freebsd.org Fri Feb 22 19:54:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C058414F8BD8; Fri, 22 Feb 2019 19:54:24 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C19F28495C; Fri, 22 Feb 2019 19:54:23 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9AEFA120; Fri, 22 Feb 2019 19:54:21 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsLJu083123; Fri, 22 Feb 2019 19:54:21 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsLoK083122; Fri, 22 Feb 2019 19:54:21 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsLoK083122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344474 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 344474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C19F28495C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 19:54:25 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:21 2019 New Revision: 344474 URL: https://svnweb.freebsd.org/changeset/base/344474 Log: nvdimm: split spa dev into a separate entity Separate code for exposing a device backed by a system physical address range away from the NVDIMM spa code. This will allow a future patch to add support for NVDIMM namespaces while using the same device code. Submitted by: D Scott Phillips Reviewed by: bwidawsk MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18736 Modified: head/sys/dev/nvdimm/nvdimm_spa.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Fri Feb 22 18:43:27 2019 (r344473) +++ head/sys/dev/nvdimm/nvdimm_spa.c Fri Feb 22 19:54:21 2019 (r344474) @@ -143,31 +143,31 @@ nvdimm_spa_type_from_uuid(struct uuid *uuid) } static vm_memattr_t -nvdimm_spa_memattr(struct SPA_mapping *spa) +nvdimm_spa_memattr(struct nvdimm_spa_dev *dev) { vm_memattr_t mode; - if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WB) != 0) + if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WB) != 0) mode = VM_MEMATTR_WRITE_BACK; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WT) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WT) != 0) mode = VM_MEMATTR_WRITE_THROUGH; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WC) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WC) != 0) mode = VM_MEMATTR_WRITE_COMBINING; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WP) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WP) != 0) mode = VM_MEMATTR_WRITE_PROTECTED; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_UC) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_UC) != 0) mode = VM_MEMATTR_UNCACHEABLE; else { if (bootverbose) - printf("SPA%d mapping attr unsupported\n", - spa->spa_nfit_idx); + printf("SPA mapping attr %#lx unsupported\n", + dev->spa_efi_mem_flags); mode = VM_MEMATTR_UNCACHEABLE; } return (mode); } static int -nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *uio) +nvdimm_spa_uio(struct nvdimm_spa_dev *dev, struct uio *uio) { struct vm_page m, *ma; off_t off; @@ -175,14 +175,14 @@ nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *ui int error, n; error = 0; - if (spa->spa_kva == NULL) { - mattr = nvdimm_spa_memattr(spa); + if (dev->spa_kva == NULL) { + mattr = nvdimm_spa_memattr(dev); vm_page_initfake(&m, 0, mattr); ma = &m; while (uio->uio_resid > 0) { - if (uio->uio_offset >= spa->spa_len) + if (uio->uio_offset >= dev->spa_len) break; - off = spa->spa_phys_base + uio->uio_offset; + off = dev->spa_phys_base + uio->uio_offset; vm_page_updatefake(&m, trunc_page(off), mattr); n = PAGE_SIZE; if (n > uio->uio_resid) @@ -193,14 +193,14 @@ nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *ui } } else { while (uio->uio_resid > 0) { - if (uio->uio_offset >= spa->spa_len) + if (uio->uio_offset >= dev->spa_len) break; n = INT_MAX; if (n > uio->uio_resid) n = uio->uio_resid; - if (uio->uio_offset + n > spa->spa_len) - n = spa->spa_len - uio->uio_offset; - error = uiomove((char *)spa->spa_kva + uio->uio_offset, + if (uio->uio_offset + n > dev->spa_len) + n = dev->spa_len - uio->uio_offset; + error = uiomove((char *)dev->spa_kva + uio->uio_offset, n, uio); if (error != 0) break; @@ -217,20 +217,20 @@ nvdimm_spa_rw(struct cdev *dev, struct uio *uio, int i } static int -nvdimm_spa_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, +nvdimm_spa_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, struct thread *td) { - struct SPA_mapping *spa; + struct nvdimm_spa_dev *dev; int error; - spa = dev->si_drv1; + dev = cdev->si_drv1; error = 0; switch (cmd) { case DIOCGSECTORSIZE: *(u_int *)data = DEV_BSIZE; break; case DIOCGMEDIASIZE: - *(off_t *)data = spa->spa_len; + *(off_t *)data = dev->spa_len; break; default: error = ENOTTY; @@ -240,19 +240,19 @@ nvdimm_spa_ioctl(struct cdev *dev, u_long cmd, caddr_t } static int -nvdimm_spa_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, +nvdimm_spa_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, vm_size_t size, vm_object_t *objp, int nprot) { - struct SPA_mapping *spa; + struct nvdimm_spa_dev *dev; - spa = dev->si_drv1; - if (spa->spa_obj == NULL) + dev = cdev->si_drv1; + if (dev->spa_obj == NULL) return (ENXIO); - if (*offset >= spa->spa_len || *offset + size < *offset || - *offset + size > spa->spa_len) + if (*offset >= dev->spa_len || *offset + size < *offset || + *offset + size > dev->spa_len) return (EINVAL); - vm_object_reference(spa->spa_obj); - *objp = spa->spa_obj; + vm_object_reference(dev->spa_obj); + *objp = dev->spa_obj; return (0); } @@ -267,18 +267,17 @@ static struct cdevsw spa_cdevsw = { }; static void -nvdimm_spa_g_all_unmapped(struct SPA_mapping *spa, struct bio *bp, - int rw) +nvdimm_spa_g_all_unmapped(struct nvdimm_spa_dev *dev, struct bio *bp, int rw) { struct vm_page maa[bp->bio_ma_n]; vm_page_t ma[bp->bio_ma_n]; vm_memattr_t mattr; int i; - mattr = nvdimm_spa_memattr(spa); + mattr = nvdimm_spa_memattr(dev); for (i = 0; i < nitems(ma); i++) { maa[i].flags = 0; - vm_page_initfake(&maa[i], spa->spa_phys_base + + vm_page_initfake(&maa[i], dev->spa_phys_base + trunc_page(bp->bio_offset) + PAGE_SIZE * i, mattr); ma[i] = &maa[i]; } @@ -293,30 +292,30 @@ nvdimm_spa_g_all_unmapped(struct SPA_mapping *spa, str static void nvdimm_spa_g_thread(void *arg) { - struct SPA_mapping *spa; + struct g_spa *sc; struct bio *bp; struct uio auio; struct iovec aiovec; int error; - spa = arg; + sc = arg; for (;;) { - mtx_lock(&spa->spa_g_mtx); + mtx_lock(&sc->spa_g_mtx); for (;;) { - bp = bioq_takefirst(&spa->spa_g_queue); + bp = bioq_takefirst(&sc->spa_g_queue); if (bp != NULL) break; - msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, + msleep(&sc->spa_g_queue, &sc->spa_g_mtx, PRIBIO, "spa_g", 0); - if (!spa->spa_g_proc_run) { - spa->spa_g_proc_exiting = true; - wakeup(&spa->spa_g_queue); - mtx_unlock(&spa->spa_g_mtx); + if (!sc->spa_g_proc_run) { + sc->spa_g_proc_exiting = true; + wakeup(&sc->spa_g_queue); + mtx_unlock(&sc->spa_g_mtx); kproc_exit(0); } continue; } - mtx_unlock(&spa->spa_g_mtx); + mtx_unlock(&sc->spa_g_mtx); if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && bp->bio_cmd != BIO_FLUSH) { error = EOPNOTSUPP; @@ -325,13 +324,15 @@ nvdimm_spa_g_thread(void *arg) error = 0; if (bp->bio_cmd == BIO_FLUSH) { - if (spa->spa_kva != NULL) { - pmap_large_map_wb(spa->spa_kva, spa->spa_len); + if (sc->dev->spa_kva != NULL) { + pmap_large_map_wb(sc->dev->spa_kva, + sc->dev->spa_len); } else { pmap_flush_cache_phys_range( - (vm_paddr_t)spa->spa_phys_base, - (vm_paddr_t)spa->spa_phys_base + - spa->spa_len, nvdimm_spa_memattr(spa)); + (vm_paddr_t)sc->dev->spa_phys_base, + (vm_paddr_t)sc->dev->spa_phys_base + + sc->dev->spa_len, + nvdimm_spa_memattr(sc->dev)); } /* * XXX flush IMC @@ -340,8 +341,8 @@ nvdimm_spa_g_thread(void *arg) } if ((bp->bio_flags & BIO_UNMAPPED) != 0) { - if (spa->spa_kva != NULL) { - aiovec.iov_base = (char *)spa->spa_kva + + if (sc->dev->spa_kva != NULL) { + aiovec.iov_base = (char *)sc->dev->spa_kva + bp->bio_offset; aiovec.iov_len = bp->bio_length; auio.uio_iov = &aiovec; @@ -356,7 +357,8 @@ nvdimm_spa_g_thread(void *arg) bp->bio_ma_offset, bp->bio_length, &auio); bp->bio_resid = auio.uio_resid; } else { - nvdimm_spa_g_all_unmapped(spa, bp, bp->bio_cmd); + nvdimm_spa_g_all_unmapped(sc->dev, bp, + bp->bio_cmd); bp->bio_resid = bp->bio_length; error = 0; } @@ -371,11 +373,11 @@ nvdimm_spa_g_thread(void *arg) auio.uio_rw = bp->bio_cmd == BIO_READ ? UIO_READ : UIO_WRITE; auio.uio_td = curthread; - error = nvdimm_spa_uio(spa, &auio); + error = nvdimm_spa_uio(sc->dev, &auio); bp->bio_resid = auio.uio_resid; } bp->bio_bcount = bp->bio_length; - devstat_end_transaction_bio(spa->spa_g_devstat, bp); + devstat_end_transaction_bio(sc->spa_g_devstat, bp); completed: bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); @@ -385,18 +387,18 @@ completed: static void nvdimm_spa_g_start(struct bio *bp) { - struct SPA_mapping *spa; + struct g_spa *sc; - spa = bp->bio_to->geom->softc; + sc = bp->bio_to->geom->softc; if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - mtx_lock(&spa->spa_g_stat_mtx); - devstat_start_transaction_bio(spa->spa_g_devstat, bp); - mtx_unlock(&spa->spa_g_stat_mtx); + mtx_lock(&sc->spa_g_stat_mtx); + devstat_start_transaction_bio(sc->spa_g_devstat, bp); + mtx_unlock(&sc->spa_g_stat_mtx); } - mtx_lock(&spa->spa_g_mtx); - bioq_disksort(&spa->spa_g_queue, bp); - wakeup(&spa->spa_g_queue); - mtx_unlock(&spa->spa_g_mtx); + mtx_lock(&sc->spa_g_mtx); + bioq_disksort(&sc->spa_g_queue, bp); + wakeup(&sc->spa_g_queue); + mtx_unlock(&sc->spa_g_mtx); } static int @@ -406,11 +408,16 @@ nvdimm_spa_g_access(struct g_provider *pp, int r, int return (0); } +static struct g_geom * nvdimm_spa_g_create(struct nvdimm_spa_dev *dev, + const char *name); +static g_ctl_destroy_geom_t nvdimm_spa_g_destroy_geom; + struct g_class nvdimm_spa_g_class = { .name = "SPA", .version = G_VERSION, .start = nvdimm_spa_g_start, .access = nvdimm_spa_g_access, + .destroy_geom = nvdimm_spa_g_destroy_geom, }; DECLARE_GEOM_CLASS(nvdimm_spa_g_class, g_spa); @@ -418,49 +425,63 @@ int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, enum SPA_mapping_type spa_type) { - struct make_dev_args mda; - struct sglist *spa_sg; - int error, error1; + char *name; + int error; spa->spa_type = spa_type; - spa->spa_domain = ((nfitaddr->Flags & ACPI_NFIT_PROXIMITY_VALID) != 0) ? - nfitaddr->ProximityDomain : -1; spa->spa_nfit_idx = nfitaddr->RangeIndex; - spa->spa_phys_base = nfitaddr->Address; - spa->spa_len = nfitaddr->Length; - spa->spa_efi_mem_flags = nfitaddr->MemoryMapping; + spa->dev.spa_domain = + ((nfitaddr->Flags & ACPI_NFIT_PROXIMITY_VALID) != 0) ? + nfitaddr->ProximityDomain : -1; + spa->dev.spa_phys_base = nfitaddr->Address; + spa->dev.spa_len = nfitaddr->Length; + spa->dev.spa_efi_mem_flags = nfitaddr->MemoryMapping; if (bootverbose) { printf("NVDIMM SPA%d base %#016jx len %#016jx %s fl %#jx\n", spa->spa_nfit_idx, - (uintmax_t)spa->spa_phys_base, (uintmax_t)spa->spa_len, + (uintmax_t)spa->dev.spa_phys_base, + (uintmax_t)spa->dev.spa_len, nvdimm_SPA_uuid_list[spa_type].u_name, - spa->spa_efi_mem_flags); + spa->dev.spa_efi_mem_flags); } if (!nvdimm_SPA_uuid_list[spa_type].u_usr_acc) return (0); - error1 = pmap_large_map(spa->spa_phys_base, spa->spa_len, - &spa->spa_kva, nvdimm_spa_memattr(spa)); + asprintf(&name, M_NVDIMM, "spa%d", spa->spa_nfit_idx); + error = nvdimm_spa_dev_init(&spa->dev, name); + free(name, M_NVDIMM); + return (error); +} + +int +nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name) +{ + struct make_dev_args mda; + struct sglist *spa_sg; + char *devname; + int error, error1; + + error1 = pmap_large_map(dev->spa_phys_base, dev->spa_len, + &dev->spa_kva, nvdimm_spa_memattr(dev)); if (error1 != 0) { - printf("NVDIMM SPA%d cannot map into KVA, error %d\n", - spa->spa_nfit_idx, error1); - spa->spa_kva = NULL; + printf("NVDIMM %s cannot map into KVA, error %d\n", name, + error1); + dev->spa_kva = NULL; } spa_sg = sglist_alloc(1, M_WAITOK); - error = sglist_append_phys(spa_sg, spa->spa_phys_base, - spa->spa_len); + error = sglist_append_phys(spa_sg, dev->spa_phys_base, + dev->spa_len); if (error == 0) { - spa->spa_obj = vm_pager_allocate(OBJT_SG, spa_sg, spa->spa_len, + dev->spa_obj = vm_pager_allocate(OBJT_SG, spa_sg, dev->spa_len, VM_PROT_ALL, 0, NULL); - if (spa->spa_obj == NULL) { - printf("NVDIMM SPA%d failed to alloc vm object", - spa->spa_nfit_idx); + if (dev->spa_obj == NULL) { + printf("NVDIMM %s failed to alloc vm object", name); sglist_free(spa_sg); } } else { - printf("NVDIMM SPA%d failed to init sglist, error %d", - spa->spa_nfit_idx, error); + printf("NVDIMM %s failed to init sglist, error %d", name, + error); sglist_free(spa_sg); } @@ -471,78 +492,112 @@ nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYS mda.mda_uid = UID_ROOT; mda.mda_gid = GID_OPERATOR; mda.mda_mode = 0660; - mda.mda_si_drv1 = spa; - error = make_dev_s(&mda, &spa->spa_dev, "nvdimm_spa%d", - spa->spa_nfit_idx); + mda.mda_si_drv1 = dev; + asprintf(&devname, M_NVDIMM, "nvdimm_%s", name); + error = make_dev_s(&mda, &dev->spa_dev, "%s", devname); + free(devname, M_NVDIMM); if (error != 0) { - printf("NVDIMM SPA%d cannot create devfs node, error %d\n", - spa->spa_nfit_idx, error); + printf("NVDIMM %s cannot create devfs node, error %d\n", name, + error); if (error1 == 0) error1 = error; } + dev->spa_g = nvdimm_spa_g_create(dev, name); + if (dev->spa_g == NULL && error1 == 0) + error1 = ENXIO; + return (error1); +} - bioq_init(&spa->spa_g_queue); - mtx_init(&spa->spa_g_mtx, "spag", NULL, MTX_DEF); - mtx_init(&spa->spa_g_stat_mtx, "spagst", NULL, MTX_DEF); - spa->spa_g_proc_run = true; - spa->spa_g_proc_exiting = false; - error = kproc_create(nvdimm_spa_g_thread, spa, &spa->spa_g_proc, 0, 0, - "g_spa%d", spa->spa_nfit_idx); +static struct g_geom * +nvdimm_spa_g_create(struct nvdimm_spa_dev *dev, const char *name) +{ + struct g_geom *gp; + struct g_spa *sc; + int error; + + gp = NULL; + sc = malloc(sizeof(struct g_spa), M_NVDIMM, M_WAITOK | M_ZERO); + sc->dev = dev; + bioq_init(&sc->spa_g_queue); + mtx_init(&sc->spa_g_mtx, "spag", NULL, MTX_DEF); + mtx_init(&sc->spa_g_stat_mtx, "spagst", NULL, MTX_DEF); + sc->spa_g_proc_run = true; + sc->spa_g_proc_exiting = false; + error = kproc_create(nvdimm_spa_g_thread, sc, &sc->spa_g_proc, 0, 0, + "g_spa"); if (error != 0) { - printf("NVDIMM SPA%d cannot create geom worker, error %d\n", - spa->spa_nfit_idx, error); - if (error1 == 0) - error1 = error; + mtx_destroy(&sc->spa_g_mtx); + mtx_destroy(&sc->spa_g_stat_mtx); + free(sc, M_NVDIMM); + printf("NVDIMM %s cannot create geom worker, error %d\n", name, + error); } else { g_topology_lock(); - spa->spa_g = g_new_geomf(&nvdimm_spa_g_class, "spa%d", - spa->spa_nfit_idx); - spa->spa_g->softc = spa; - spa->spa_p = g_new_providerf(spa->spa_g, "spa%d", - spa->spa_nfit_idx); - spa->spa_p->mediasize = spa->spa_len; - spa->spa_p->sectorsize = DEV_BSIZE; - spa->spa_p->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | + gp = g_new_geomf(&nvdimm_spa_g_class, "%s", name); + gp->softc = sc; + sc->spa_p = g_new_providerf(gp, "%s", name); + sc->spa_p->mediasize = dev->spa_len; + sc->spa_p->sectorsize = DEV_BSIZE; + sc->spa_p->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | G_PF_ACCEPT_UNMAPPED; - g_error_provider(spa->spa_p, 0); - spa->spa_g_devstat = devstat_new_entry("spa", spa->spa_nfit_idx, - DEV_BSIZE, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, + g_error_provider(sc->spa_p, 0); + sc->spa_g_devstat = devstat_new_entry("spa", -1, DEV_BSIZE, + DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); g_topology_unlock(); } - return (error1); + return (gp); } void nvdimm_spa_fini(struct SPA_mapping *spa) { - mtx_lock(&spa->spa_g_mtx); - spa->spa_g_proc_run = false; - wakeup(&spa->spa_g_queue); - while (!spa->spa_g_proc_exiting) - msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, "spa_e", 0); - mtx_unlock(&spa->spa_g_mtx); - if (spa->spa_g != NULL) { + nvdimm_spa_dev_fini(&spa->dev); +} + +void +nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev) +{ + + if (dev->spa_g != NULL) { g_topology_lock(); - g_wither_geom(spa->spa_g, ENXIO); + nvdimm_spa_g_destroy_geom(NULL, dev->spa_g->class, dev->spa_g); g_topology_unlock(); - spa->spa_g = NULL; - spa->spa_p = NULL; } - if (spa->spa_g_devstat != NULL) { - devstat_remove_entry(spa->spa_g_devstat); - spa->spa_g_devstat = NULL; + if (dev->spa_dev != NULL) { + destroy_dev(dev->spa_dev); + dev->spa_dev = NULL; } - if (spa->spa_dev != NULL) { - destroy_dev(spa->spa_dev); - spa->spa_dev = NULL; + vm_object_deallocate(dev->spa_obj); + if (dev->spa_kva != NULL) { + pmap_large_unmap(dev->spa_kva, dev->spa_len); + dev->spa_kva = NULL; } - vm_object_deallocate(spa->spa_obj); - if (spa->spa_kva != NULL) { - pmap_large_unmap(spa->spa_kva, spa->spa_len); - spa->spa_kva = NULL; +} + +static int +nvdimm_spa_g_destroy_geom(struct gctl_req *req, struct g_class *cp, + struct g_geom *gp) +{ + struct g_spa *sc; + + sc = gp->softc; + mtx_lock(&sc->spa_g_mtx); + sc->spa_g_proc_run = false; + wakeup(&sc->spa_g_queue); + while (!sc->spa_g_proc_exiting) + msleep(&sc->spa_g_queue, &sc->spa_g_mtx, PRIBIO, "spa_e", 0); + mtx_unlock(&sc->spa_g_mtx); + g_topology_assert(); + g_wither_geom(gp, ENXIO); + sc->spa_p = NULL; + if (sc->spa_g_devstat != NULL) { + devstat_remove_entry(sc->spa_g_devstat); + sc->spa_g_devstat = NULL; } - mtx_destroy(&spa->spa_g_mtx); - mtx_destroy(&spa->spa_g_stat_mtx); + mtx_destroy(&sc->spa_g_mtx); + mtx_destroy(&sc->spa_g_stat_mtx); + free(sc, M_NVDIMM); + return (0); } Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 18:43:27 2019 (r344473) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:21 2019 (r344474) @@ -67,28 +67,36 @@ enum SPA_mapping_type { SPA_TYPE_UNKNOWN = 127, }; -struct SPA_mapping { - SLIST_ENTRY(SPA_mapping) link; - enum SPA_mapping_type spa_type; +struct nvdimm_spa_dev { int spa_domain; - int spa_nfit_idx; uint64_t spa_phys_base; uint64_t spa_len; uint64_t spa_efi_mem_flags; void *spa_kva; + struct vm_object *spa_obj; struct cdev *spa_dev; struct g_geom *spa_g; +}; + +struct g_spa { + struct nvdimm_spa_dev *dev; struct g_provider *spa_p; struct bio_queue_head spa_g_queue; struct mtx spa_g_mtx; struct mtx spa_g_stat_mtx; struct devstat *spa_g_devstat; struct proc *spa_g_proc; - struct vm_object *spa_obj; bool spa_g_proc_run; bool spa_g_proc_exiting; }; +struct SPA_mapping { + SLIST_ENTRY(SPA_mapping) link; + enum SPA_mapping_type spa_type; + int spa_nfit_idx; + struct nvdimm_spa_dev dev; +}; + MALLOC_DECLARE(M_NVDIMM); void acpi_nfit_get_dimm_ids(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t **listp, @@ -108,5 +116,7 @@ struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, enum SPA_mapping_type spa_type); void nvdimm_spa_fini(struct SPA_mapping *spa); +int nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name); +void nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev); #endif /* __DEV_NVDIMM_VAR_H__ */ From owner-svn-src-head@freebsd.org Fri Feb 22 19:54:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F4C614F8C4C; Fri, 22 Feb 2019 19:54:31 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0989684A10; Fri, 22 Feb 2019 19:54:31 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84032A124; Fri, 22 Feb 2019 19:54:29 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsTKO083466; Fri, 22 Feb 2019 19:54:29 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsSMq083440; Fri, 22 Feb 2019 19:54:28 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsSMq083440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344476 - in head/sys: dev/nvdimm modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules/nvdimm X-SVN-Commit-Revision: 344476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0989684A10 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 19:54:31 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:28 2019 New Revision: 344476 URL: https://svnweb.freebsd.org/changeset/base/344476 Log: nvdimm: Simple namespace support Add support for simple NVDIMM v1.2 namespaces from the UEFI version 2.7 specification. The combination of NVDIMM regions and labels can lead to a wide variety of namespace layouts. Here we support a simple subset of namespaces where each NVDIMM SPA range is composed of a single region per member dimm. Submitted by: D Scott Phillips Discussed with: kib MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18736 Added: head/sys/dev/nvdimm/nvdimm_ns.c (contents, props changed) Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h head/sys/modules/nvdimm/Makefile Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:28 2019 (r344476) @@ -462,6 +462,7 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, A free(spa, M_NVDIMM); break; } + nvdimm_create_namespaces(spa_mapping, nfitbl); SLIST_INSERT_HEAD(&dev->spas, spa_mapping, link); } free(spas, M_NVDIMM); @@ -519,6 +520,7 @@ nvdimm_root_detach(device_t dev) root = device_get_softc(dev); SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { + nvdimm_destroy_namespaces(spa); nvdimm_spa_fini(spa); SLIST_REMOVE_HEAD(&root->spas, link); free(spa, M_NVDIMM); Added: head/sys/dev/nvdimm/nvdimm_ns.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm_ns.c Fri Feb 22 19:54:28 2019 (r344476) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +int +nvdimm_create_namespaces(struct SPA_mapping *spa, ACPI_TABLE_NFIT *nfitbl) +{ + ACPI_NFIT_MEMORY_MAP **regions; + struct nvdimm_dev *nv; + struct nvdimm_label_entry *e; + struct nvdimm_namespace *ns; + nfit_handle_t dimm_handle; + char *name; + int i, error, num_regions; + + acpi_nfit_get_region_mappings_by_spa_range(nfitbl, spa->spa_nfit_idx, + ®ions, &num_regions); + if (num_regions == 0 || num_regions != regions[0]->InterleaveWays) { + free(regions, M_NVDIMM); + return (ENXIO); + } + dimm_handle = regions[0]->DeviceHandle; + nv = nvdimm_find_by_handle(dimm_handle); + if (nv == NULL) { + free(regions, M_NVDIMM); + return (ENXIO); + } + i = 0; + error = 0; + SLIST_FOREACH(e, &nv->labels, link) { + ns = malloc(sizeof(struct nvdimm_namespace), M_NVDIMM, + M_WAITOK | M_ZERO); + ns->dev.spa_domain = spa->dev.spa_domain; + ns->dev.spa_phys_base = spa->dev.spa_phys_base + + regions[0]->RegionOffset + + num_regions * + (e->label.dimm_phys_addr - regions[0]->Address); + ns->dev.spa_len = num_regions * e->label.raw_size; + ns->dev.spa_efi_mem_flags = spa->dev.spa_efi_mem_flags; + asprintf(&name, M_NVDIMM, "spa%dns%d", spa->spa_nfit_idx, i); + error = nvdimm_spa_dev_init(&ns->dev, name); + free(name, M_NVDIMM); + if (error != 0) + break; + SLIST_INSERT_HEAD(&spa->namespaces, ns, link); + i++; + } + free(regions, M_NVDIMM); + return (error); +} + +void +nvdimm_destroy_namespaces(struct SPA_mapping *spa) +{ + struct nvdimm_namespace *ns, *next; + + SLIST_FOREACH_SAFE(ns, &spa->namespaces, link, next) { + SLIST_REMOVE_HEAD(&spa->namespaces, link); + nvdimm_spa_dev_fini(&ns->dev); + free(ns, M_NVDIMM); + } +} Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:28 2019 (r344476) @@ -139,11 +139,18 @@ struct g_spa { bool spa_g_proc_exiting; }; +struct nvdimm_namespace { + SLIST_ENTRY(nvdimm_namespace) link; + struct SPA_mapping *spa; + struct nvdimm_spa_dev dev; +}; + struct SPA_mapping { SLIST_ENTRY(SPA_mapping) link; enum SPA_mapping_type spa_type; int spa_nfit_idx; struct nvdimm_spa_dev dev; + SLIST_HEAD(, nvdimm_namespace) namespaces; }; MALLOC_DECLARE(M_NVDIMM); @@ -167,5 +174,7 @@ int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT void nvdimm_spa_fini(struct SPA_mapping *spa); int nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name); void nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev); +int nvdimm_create_namespaces(struct SPA_mapping *spa, ACPI_TABLE_NFIT *nfitbl); +void nvdimm_destroy_namespaces(struct SPA_mapping *spa); #endif /* __DEV_NVDIMM_VAR_H__ */ Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/modules/nvdimm/Makefile Fri Feb 22 19:54:28 2019 (r344476) @@ -5,6 +5,7 @@ KMOD= nvdimm SRCS= nvdimm.c \ nvdimm_nfit.c \ + nvdimm_ns.c \ nvdimm_spa.c SRCS+= acpi_if.h bus_if.h device_if.h From owner-svn-src-head@freebsd.org Fri Feb 22 19:54:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B64EE14F8BEF; Fri, 22 Feb 2019 19:54:26 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5648F8498D; Fri, 22 Feb 2019 19:54:26 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3439BA122; Fri, 22 Feb 2019 19:54:25 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsPfP083293; Fri, 22 Feb 2019 19:54:25 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsOVU083291; Fri, 22 Feb 2019 19:54:24 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsOVU083291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344475 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 344475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5648F8498D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 19:54:27 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:24 2019 New Revision: 344475 URL: https://svnweb.freebsd.org/changeset/base/344475 Log: nvdimm: Read NVDIMM namespace labels When attaching to NVDIMM devices, read and verify the namespace labels from the special namespace label storage area. A later change will expose NVDIMM namespaces derived from this label data. Submitted by: D Scott Phillips Discussed with: kib MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18735 Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:21 2019 (r344474) +++ head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:24 2019 (r344475) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,10 +52,240 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("NVDIMM") +static struct uuid intel_nvdimm_dsm_uuid = + {0x4309AC30,0x0D11,0x11E4,0x91,0x91,{0x08,0x00,0x20,0x0C,0x9A,0x66}}; +#define INTEL_NVDIMM_DSM_REV 1 +#define INTEL_NVDIMM_DSM_GET_LABEL_SIZE 4 +#define INTEL_NVDIMM_DSM_GET_LABEL_DATA 5 + static devclass_t nvdimm_devclass; static devclass_t nvdimm_root_devclass; MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); +static int +read_label_area_size(struct nvdimm_dev *nv) +{ + ACPI_OBJECT *result_buffer; + ACPI_HANDLE handle; + ACPI_STATUS status; + ACPI_BUFFER result; + uint32_t *out; + int error; + + handle = nvdimm_root_get_acpi_handle(nv->nv_dev); + if (handle == NULL) + return (ENODEV); + result.Length = ACPI_ALLOCATE_BUFFER; + result.Pointer = NULL; + status = acpi_EvaluateDSM(handle, (uint8_t *)&intel_nvdimm_dsm_uuid, + INTEL_NVDIMM_DSM_REV, INTEL_NVDIMM_DSM_GET_LABEL_SIZE, NULL, + &result); + error = ENXIO; + if (ACPI_SUCCESS(status) && result.Pointer != NULL && + result.Length >= sizeof(ACPI_OBJECT)) { + result_buffer = result.Pointer; + if (result_buffer->Type == ACPI_TYPE_BUFFER && + result_buffer->Buffer.Length >= 12) { + out = (uint32_t *)result_buffer->Buffer.Pointer; + nv->label_area_size = out[1]; + nv->max_label_xfer = out[2]; + error = 0; + } + } + if (result.Pointer != NULL) + AcpiOsFree(result.Pointer); + return (error); +} + +static int +read_label_area(struct nvdimm_dev *nv, uint8_t *dest, off_t offset, + off_t length) +{ + ACPI_BUFFER result; + ACPI_HANDLE handle; + ACPI_OBJECT params_pkg, params_buf, *result_buf; + ACPI_STATUS status; + uint32_t params[2]; + off_t to_read; + int error; + + error = 0; + handle = nvdimm_root_get_acpi_handle(nv->nv_dev); + if (offset < 0 || length <= 0 || + offset + length > nv->label_area_size || + handle == NULL) + return (ENODEV); + params_pkg.Type = ACPI_TYPE_PACKAGE; + params_pkg.Package.Count = 1; + params_pkg.Package.Elements = ¶ms_buf; + params_buf.Type = ACPI_TYPE_BUFFER; + params_buf.Buffer.Length = sizeof(params); + params_buf.Buffer.Pointer = (UINT8 *)params; + while (length > 0) { + to_read = MIN(length, nv->max_label_xfer); + params[0] = offset; + params[1] = to_read; + result.Length = ACPI_ALLOCATE_BUFFER; + result.Pointer = NULL; + status = acpi_EvaluateDSM(handle, + (uint8_t *)&intel_nvdimm_dsm_uuid, INTEL_NVDIMM_DSM_REV, + INTEL_NVDIMM_DSM_GET_LABEL_DATA, ¶ms_pkg, &result); + if (ACPI_FAILURE(status) || + result.Length < sizeof(ACPI_OBJECT) || + result.Pointer == NULL) { + error = ENXIO; + break; + } + result_buf = (ACPI_OBJECT *)result.Pointer; + if (result_buf->Type != ACPI_TYPE_BUFFER || + result_buf->Buffer.Pointer == NULL || + result_buf->Buffer.Length != 4 + to_read || + ((uint16_t *)result_buf->Buffer.Pointer)[0] != 0) { + error = ENXIO; + break; + } + bcopy(result_buf->Buffer.Pointer + 4, dest, to_read); + dest += to_read; + offset += to_read; + length -= to_read; + if (result.Pointer != NULL) { + AcpiOsFree(result.Pointer); + result.Pointer = NULL; + } + } + if (result.Pointer != NULL) + AcpiOsFree(result.Pointer); + return (error); +} + +static uint64_t +fletcher64(const void *data, size_t length) +{ + size_t i; + uint32_t a, b; + const uint32_t *d; + + a = 0; + b = 0; + d = (const uint32_t *)data; + length = length / sizeof(uint32_t); + for (i = 0; i < length; i++) { + a += d[i]; + b += a; + } + return ((uint64_t)b << 32 | a); +} + +static bool +label_index_is_valid(struct nvdimm_label_index *index, uint32_t max_labels, + size_t size, size_t offset) +{ + uint64_t checksum; + + index = (struct nvdimm_label_index *)((uint8_t *)index + offset); + if (strcmp(index->signature, NVDIMM_INDEX_BLOCK_SIGNATURE) != 0) + return false; + checksum = index->checksum; + index->checksum = 0; + if (checksum != fletcher64(index, size) || + index->this_offset != size * offset || index->this_size != size || + index->other_offset != size * (offset == 0 ? 1 : 0) || + index->seq == 0 || index->seq > 3 || index->slot_cnt > max_labels || + index->label_size != 1) + return false; + return true; +} + +static int +read_label(struct nvdimm_dev *nv, int num) +{ + struct nvdimm_label_entry *entry, *i, *next; + uint64_t checksum; + off_t offset; + int error; + + offset = nv->label_index->label_offset + + num * (128 << nv->label_index->label_size); + entry = malloc(sizeof(*entry), M_NVDIMM, M_WAITOK); + error = read_label_area(nv, (uint8_t *)&entry->label, offset, + sizeof(struct nvdimm_label)); + if (error != 0) { + free(entry, M_NVDIMM); + return (error); + } + checksum = entry->label.checksum; + entry->label.checksum = 0; + if (checksum != fletcher64(&entry->label, sizeof(entry->label)) || + entry->label.slot != num) { + free(entry, M_NVDIMM); + return (ENXIO); + } + + /* Insertion ordered by dimm_phys_addr */ + if (SLIST_EMPTY(&nv->labels) || + entry->label.dimm_phys_addr <= + SLIST_FIRST(&nv->labels)->label.dimm_phys_addr) { + SLIST_INSERT_HEAD(&nv->labels, entry, link); + return (0); + } + SLIST_FOREACH_SAFE(i, &nv->labels, link, next) { + if (next == NULL || + entry->label.dimm_phys_addr <= next->label.dimm_phys_addr) { + SLIST_INSERT_AFTER(i, entry, link); + return (0); + } + } + __unreachable(); +} + +static int +read_labels(struct nvdimm_dev *nv) +{ + struct nvdimm_label_index *indices; + size_t bitfield_size, index_size, num_labels; + int error, n; + bool index_0_valid, index_1_valid; + + for (index_size = 256; ; index_size += 256) { + num_labels = 8 * (index_size - + sizeof(struct nvdimm_label_index)); + if (index_size + num_labels * sizeof(struct nvdimm_label) >= + nv->label_area_size) + break; + } + num_labels = (nv->label_area_size - index_size) / + sizeof(struct nvdimm_label); + bitfield_size = roundup2(num_labels, 8) / 8; + indices = malloc(2 * index_size, M_NVDIMM, M_WAITOK); + error = read_label_area(nv, (void *)indices, 0, 2 * index_size); + if (error != 0) { + free(indices, M_NVDIMM); + return (error); + } + index_0_valid = label_index_is_valid(indices, num_labels, index_size, + 0); + index_1_valid = label_index_is_valid(indices, num_labels, index_size, + 1); + if (!index_0_valid && !index_1_valid) { + free(indices, M_NVDIMM); + return (ENXIO); + } + if (index_0_valid && index_1_valid && + (indices[1].seq > indices[0].seq || + (indices[1].seq == 1 && indices[0].seq == 3))) + index_0_valid = false; + nv->label_index = malloc(index_size, M_NVDIMM, M_WAITOK); + bcopy(indices + (index_0_valid ? 0 : 1), nv->label_index, index_size); + free(indices, M_NVDIMM); + for (bit_ffc_at((bitstr_t *)nv->label_index->free, 0, num_labels, &n); + n >= 0; + bit_ffc_at((bitstr_t *)nv->label_index->free, n + 1, num_labels, + &n)) { + read_label(nv, n); + } + return (0); +} + struct nvdimm_dev * nvdimm_find_by_handle(nfit_handle_t nv_handle) { @@ -90,6 +321,7 @@ nvdimm_attach(device_t dev) ACPI_TABLE_NFIT *nfitbl; ACPI_HANDLE handle; ACPI_STATUS status; + int error; nv = device_get_softc(dev); handle = nvdimm_root_get_acpi_handle(dev); @@ -107,6 +339,14 @@ nvdimm_attach(device_t dev) acpi_nfit_get_flush_addrs(nfitbl, nv->nv_handle, &nv->nv_flush_addr, &nv->nv_flush_addr_cnt); AcpiPutTable(&nfitbl->Header); + error = read_label_area_size(nv); + if (error == 0) { + /* + * Ignoring errors reading labels. Not all NVDIMMs + * support labels and namespaces. + */ + read_labels(nv); + } return (0); } @@ -114,9 +354,15 @@ static int nvdimm_detach(device_t dev) { struct nvdimm_dev *nv; + struct nvdimm_label_entry *label, *next; nv = device_get_softc(dev); free(nv->nv_flush_addr, M_NVDIMM); + free(nv->label_index, M_NVDIMM); + SLIST_FOREACH_SAFE(label, &nv->labels, link, next) { + SLIST_REMOVE_HEAD(&nv->labels, link); + free(label, M_NVDIMM); + } return (0); } Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:21 2019 (r344474) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:24 2019 (r344475) @@ -33,6 +33,51 @@ #ifndef __DEV_NVDIMM_VAR_H__ #define __DEV_NVDIMM_VAR_H__ +#define NVDIMM_INDEX_BLOCK_SIGNATURE "NAMESPACE_INDEX" + +struct nvdimm_label_index { + char signature[16]; + uint8_t flags[3]; + uint8_t label_size; + uint32_t seq; + uint64_t this_offset; + uint64_t this_size; + uint64_t other_offset; + uint64_t label_offset; + uint32_t slot_cnt; + uint16_t rev_major; + uint16_t rev_minor; + uint64_t checksum; + uint8_t free[0]; +}; + +struct nvdimm_label { + struct uuid uuid; + char name[64]; + uint32_t flags; + uint16_t nlabel; + uint16_t position; + uint64_t set_cookie; + uint64_t lba_size; + uint64_t dimm_phys_addr; + uint64_t raw_size; + uint32_t slot; + uint8_t alignment; + uint8_t reserved[3]; + struct uuid type_guid; + struct uuid address_abstraction_guid; + uint8_t reserved1[88]; + uint64_t checksum; +}; + +struct nvdimm_label_entry { + SLIST_ENTRY(nvdimm_label_entry) link; + struct nvdimm_label label; +}; + +_Static_assert(sizeof(struct nvdimm_label_index) == 72, "Incorrect layout"); +_Static_assert(sizeof(struct nvdimm_label) == 256, "Incorrect layout"); + typedef uint32_t nfit_handle_t; enum nvdimm_root_ivar { @@ -53,6 +98,10 @@ struct nvdimm_dev { nfit_handle_t nv_handle; uint64_t **nv_flush_addr; int nv_flush_addr_cnt; + uint32_t label_area_size; + uint32_t max_label_xfer; + struct nvdimm_label_index *label_index; + SLIST_HEAD(, nvdimm_label_entry) labels; }; enum SPA_mapping_type { From owner-svn-src-head@freebsd.org Fri Feb 22 21:57:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3FF14FC3B6; Fri, 22 Feb 2019 21:57:28 +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 E0FC08A027; Fri, 22 Feb 2019 21:57:27 +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 D53B7B5FF; Fri, 22 Feb 2019 21:57:27 +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 x1MLvR5t048789; Fri, 22 Feb 2019 21:57:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MLvRJK048787; Fri, 22 Feb 2019 21:57:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201902222157.x1MLvRJK048787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Feb 2019 21:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344477 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 344477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0FC08A027 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 21:57:28 -0000 Author: hselasky Date: Fri Feb 22 21:57:27 2019 New Revision: 344477 URL: https://svnweb.freebsd.org/changeset/base/344477 Log: Add new USB quirk. PR: 235897 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Feb 22 19:54:28 2019 (r344476) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Feb 22 21:57:27 2019 (r344477) @@ -396,6 +396,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDCZ4_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SANDISK, SDCZ48_32, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, + UQ_MSC_NO_TEST_UNIT_READY), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Feb 22 19:54:28 2019 (r344476) +++ head/sys/dev/usb/usbdevs Fri Feb 22 21:57:27 2019 (r344477) @@ -4067,6 +4067,7 @@ product SANDISK SDCZ2_128 0x7100 Cruzer Mini 128MB product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK SDCZ48_32 0x5581 Ultra 32GB product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ From owner-svn-src-head@freebsd.org Fri Feb 22 23:15:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C34914FDE7A; Fri, 22 Feb 2019 23:15:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3BC8C834; Fri, 22 Feb 2019 23:15:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46AFEC57D; Fri, 22 Feb 2019 23:15:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MNFXpI090307; Fri, 22 Feb 2019 23:15:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MNFWrZ090303; Fri, 22 Feb 2019 23:15:32 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902222315.x1MNFWrZ090303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 22 Feb 2019 23:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344478 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src kern sys X-SVN-Commit-Revision: 344478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C3BC8C834 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 23:15:34 -0000 Author: mmacy Date: Fri Feb 22 23:15:32 2019 New Revision: 344478 URL: https://svnweb.freebsd.org/changeset/base/344478 Log: lkpi: allow late binding of linux_alloc_current Some consumers may be loosely coupled with the lkpi. This allows them to call linux_alloc_current without having a static dependency. Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19257 Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h head/sys/compat/linuxkpi/common/src/linux_current.c head/sys/kern/init_main.c head/sys/sys/systm.h Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compat.h Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/compat/linuxkpi/common/include/linux/compat.h Fri Feb 22 23:15:32 2019 (r344478) @@ -41,18 +41,19 @@ struct task_struct; extern int linux_alloc_current(struct thread *, int flags); extern void linux_free_current(struct task_struct *); + static inline void linux_set_current(struct thread *td) { if (__predict_false(td->td_lkpi_task == NULL)) - linux_alloc_current(td, M_WAITOK); + lkpi_alloc_current(td, M_WAITOK); } static inline int linux_set_current_flags(struct thread *td, int flags) { if (__predict_false(td->td_lkpi_task == NULL)) - return (linux_alloc_current(td, flags)); + return (lkpi_alloc_current(td, flags)); return (0); } Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Fri Feb 22 23:15:32 2019 (r344478) @@ -218,6 +218,7 @@ linux_get_pid_task(pid_t pid) static void linux_current_init(void *arg __unused) { + lkpi_alloc_current = linux_alloc_current; linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); } @@ -242,7 +243,7 @@ linux_current_uninit(void *arg __unused) PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); - EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); + lkpi_alloc_current = linux_alloc_current_noop; } SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/kern/init_main.c Fri Feb 22 23:15:32 2019 (r344478) @@ -107,6 +107,14 @@ struct thread0_storage thread0_st __aligned(32); struct vmspace vmspace0; struct proc *initproc; +int +linux_alloc_current_noop(struct thread *td __unused, int flags __unused) +{ + return (0); +} +int (*lkpi_alloc_current)(struct thread *, int) = linux_alloc_current_noop; + + #ifndef BOOTHOWTO #define BOOTHOWTO 0 #endif @@ -454,7 +462,7 @@ proc0_init(void *dummy __unused) GIANT_REQUIRED; p = &proc0; td = &thread0; - + /* * Initialize magic number and osrel. */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/sys/systm.h Fri Feb 22 23:15:32 2019 (r344478) @@ -237,6 +237,13 @@ void init_param2(long physpages); void init_static_kenv(char *, size_t); void tablefull(const char *); +/* + * Allocate per-thread "current" state in the linuxkpi + */ +extern int (*lkpi_alloc_current)(struct thread *, int); +int linux_alloc_current_noop(struct thread *, int); + + #if defined(KLD_MODULE) || defined(KTR_CRITICAL) || !defined(_KERNEL) || defined(GENOFFSET) #define critical_enter() critical_enter_KBI() #define critical_exit() critical_exit_KBI() From owner-svn-src-head@freebsd.org Sat Feb 23 00:00:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFB5C14FECE3; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9B08DCE6; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48C07CC73; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1N00pri011363; Sat, 23 Feb 2019 00:00:51 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N00o8R011357; Sat, 23 Feb 2019 00:00:50 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201902230000.x1N00o8R011357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Feb 2019 00:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344479 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 344479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F9B08DCE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 00:00:52 -0000 Author: sobomax Date: Sat Feb 23 00:00:49 2019 New Revision: 344479 URL: https://svnweb.freebsd.org/changeset/base/344479 Log: o Get rid of silly comment which seems to have got life of its own via copy-and-paste process; o Return geom_uzip(4) usage back to how manual page prescribes it to be used while I am here. Modified: head/sys/mips/conf/AP94 head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/ROUTERSTATION_MFS head/sys/mips/conf/RSPRO_MFS head/sys/mips/conf/WZR-300HP head/sys/mips/conf/WZR-HPAG300H Modified: head/sys/mips/conf/AP94 ============================================================================== --- head/sys/mips/conf/AP94 Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/AP94 Sat Feb 23 00:00:49 2019 (r344479) @@ -21,7 +21,6 @@ hints "AP94.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/DIR-825B1 Sat Feb 23 00:00:49 2019 (r344479) @@ -47,7 +47,6 @@ nooptions INET6 # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options GEOM_PART_GPT Modified: head/sys/mips/conf/ROUTERSTATION_MFS ============================================================================== --- head/sys/mips/conf/ROUTERSTATION_MFS Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/ROUTERSTATION_MFS Sat Feb 23 00:00:49 2019 (r344479) @@ -12,7 +12,6 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/RSPRO_MFS ============================================================================== --- head/sys/mips/conf/RSPRO_MFS Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/RSPRO_MFS Sat Feb 23 00:00:49 2019 (r344479) @@ -15,7 +15,6 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP # Boot from the first MFS uzip Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/WZR-300HP Sat Feb 23 00:00:49 2019 (r344479) @@ -26,7 +26,7 @@ options BOOTVERBOSE # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/WZR-HPAG300H ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/WZR-HPAG300H Sat Feb 23 00:00:49 2019 (r344479) @@ -25,7 +25,7 @@ options AR71XX_ENV_UBOOT options BOOTVERBOSE # GEOM modules -device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP device geom_map # to get access to the SPI flash partitions options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" From owner-svn-src-head@freebsd.org Sat Feb 23 03:05:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44F1D1503BDE; Sat, 23 Feb 2019 03:05:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 86F906E5B7; Sat, 23 Feb 2019 03:05:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 5C5A93D8C5B; Sat, 23 Feb 2019 14:05:25 +1100 (AEDT) Date: Sat, 23 Feb 2019 14:05:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344479 - head/sys/mips/conf In-Reply-To: <201902230000.x1N00o8R011357@repo.freebsd.org> Message-ID: <20190223125748.S909@besplex.bde.org> References: <201902230000.x1N00o8R011357@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=60YepAZSkRJpfBsUMC8A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 86F906E5B7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 03:05:29 -0000 On Sat, 23 Feb 2019, Maxim Sobolev wrote: > Log: > o Get rid of silly comment which seems to have got life of its own via > copy-and-paste process; It is perhaps better than no comment on a misformatted options line. > o Return geom_uzip(4) usage back to how manual page prescribes it to be > used while I am here. Section 4 man pages unfortunately don't usually have examples of comments on options line, and never have correct formatting. > Modified: head/sys/mips/conf/AP94 > ============================================================================== > --- head/sys/mips/conf/AP94 Fri Feb 22 23:15:32 2019 (r344478) > +++ head/sys/mips/conf/AP94 Sat Feb 23 00:00:49 2019 (r344479) > @@ -21,7 +21,6 @@ hints "AP94.hints" > > # GEOM modules > device geom_redboot # to get access to the SPI flash partitions > -device geom_uzip # compressed in-memory filesystem hackery! > options GEOM_UZIP > > options ROOTDEVNAME=\"ufs:md0.uzip\" Now there is no comment on the remaining GEOM_UZIP line. "device foo" is sometimes abused to access an unsupported option (an option that is not listed in conf/options*). "foo" is then not available as a macro, but it is available as a keyword for selecting files from conf/files. Also, if DEV_FOO is listed in conf/options, then this is a syntax error if "foo" is _not_ used as a keyword in conf/files, but if "foo" is so used then DEV_FOO is not a syntax error and a #define of it is generated. Everything seems to be case-sensitive, except there is no way to prevent the conversion of "foo" to "FOO" in DEV_FOO. "device loop" is an example of use of this. This just selects the file if_loop.c, and there are no messy ifdefs, so DEV_LOOP is not needed and is not an option and not generated. "device bpf" is a messier example which needs ifdefs on DEV_BPF, so DEV_BPF must be an option. "device gzip" is an example of abuse of this. gzip is very far from being a device. > Modified: head/sys/mips/conf/DIR-825B1 > Modified: head/sys/mips/conf/ROUTERSTATION_MFS > Modified: head/sys/mips/conf/RSPRO_MFS > Modified: head/sys/mips/conf/WZR-300HP 4 more removals leaving no comment. > ============================================================================== > --- head/sys/mips/conf/WZR-300HP Fri Feb 22 23:15:32 2019 (r344478) > +++ head/sys/mips/conf/WZR-300HP Sat Feb 23 00:00:49 2019 (r344479) > @@ -26,7 +26,7 @@ options BOOTVERBOSE > > # GEOM modules > device geom_map # to get access to the SPI flash partitions > -device geom_uzip # compressed in-memory filesystem hackery! > +options GEOM_UZIP > > options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" This is an addition with a misformatted options line and no comment. conf/NOTES provides an example with correct formatting. It even provides a comment suitable for copying. conf/NOTES has many misformatted options lines (27 with the keyword followed by 2 tabs and 1 with it followed by 1 tab), but all GEOM_FOO lines are formatted normally. */NOTES has too many lines not suitable for copying since they have no comment. NOTES tends to have more verbose comments written in separate paragraphs and lists. The lists are better made up of options lines with short comments. > Modified: head/sys/mips/conf/WZR-HPAG300H Another addition with a misformatted options line and no comment. Normal formatting of options lines lines things up nicely, but wastes 8 or 16 columns which would be better used for comments. Many options names are too long. GENERIC is more consistent than NOTES in wasting an extra 8 columns for short option names so as to line up the comments. device names are better, and not wasting an extra 8 columns to line up the comments for device directives gives another set of inconsistencies. Bruce From owner-svn-src-head@freebsd.org Sat Feb 23 04:24:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FDDD1505F48; Sat, 23 Feb 2019 04:24: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 A848270EEE; Sat, 23 Feb 2019 04:24: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 9BA28180D4; Sat, 23 Feb 2019 04:24: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 x1N4OjlM053235; Sat, 23 Feb 2019 04:24:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N4OiCv053232; Sat, 23 Feb 2019 04:24:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902230424.x1N4OiCv053232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 23 Feb 2019 04:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344480 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A848270EEE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 04:24:46 -0000 Author: mav Date: Sat Feb 23 04:24:44 2019 New Revision: 344480 URL: https://svnweb.freebsd.org/changeset/base/344480 Log: Remove disabled CTL_LEGACY_STATS support. It was not only disabled for quite a while, but also appeared to be broken at r325517, when maximum number of ports was made configurable. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 04:24:44 2019 (r344480) @@ -2743,39 +2743,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #endif /* CTL_IO_DELAY */ break; } -#ifdef CTL_LEGACY_STATS - case CTL_GETSTATS: { - struct ctl_stats *stats = (struct ctl_stats *)addr; - int i; - - /* - * XXX KDM no locking here. If the LUN list changes, - * things can blow up. - */ - i = 0; - stats->status = CTL_SS_OK; - stats->fill_len = 0; - STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (stats->fill_len + sizeof(lun->legacy_stats) > - stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - break; - } - retval = copyout(&lun->legacy_stats, &stats->lun_stats[i++], - sizeof(lun->legacy_stats)); - if (retval != 0) - break; - stats->fill_len += sizeof(lun->legacy_stats); - } - stats->num_luns = softc->num_luns; - stats->flags = CTL_STATS_FLAG_NONE; -#ifdef CTL_TIME_IO - stats->flags |= CTL_STATS_FLAG_TIME_VALID; -#endif - getnanouptime(&stats->timestamp); - break; - } -#endif /* CTL_LEGACY_STATS */ case CTL_ERROR_INJECT: { struct ctl_error_desc *err_desc, *new_err_desc; @@ -4758,17 +4725,6 @@ fail: ctl_init_log_page_index(lun); /* Setup statistics gathering */ -#ifdef CTL_LEGACY_STATS - lun->legacy_stats.device_type = be_lun->lun_type; - lun->legacy_stats.lun_number = lun_number; - lun->legacy_stats.blocksize = be_lun->blocksize; - if (be_lun->blocksize == 0) - lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * - ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < ctl_max_ports; len++) - lun->legacy_stats.ports[len].targ_port = len; -#endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; /* @@ -13078,21 +13034,6 @@ ctl_process_done(union ctl_io *io) type = CTL_STATS_WRITE; else type = CTL_STATS_NO_IO; - -#ifdef CTL_LEGACY_STATS - uint32_t targ_port = port->targ_port; - lun->legacy_stats.ports[targ_port].bytes[type] += - io->scsiio.kern_total_len; - lun->legacy_stats.ports[targ_port].operations[type] ++; - lun->legacy_stats.ports[targ_port].num_dmas[type] += - io->io_hdr.num_dmas; -#ifdef CTL_TIME_IO - bintime_add(&lun->legacy_stats.ports[targ_port].dma_time[type], - &io->io_hdr.dma_bt); - bintime_add(&lun->legacy_stats.ports[targ_port].time[type], - &bt); -#endif -#endif /* CTL_LEGACY_STATS */ lun->stats.bytes[type] += io->scsiio.kern_total_len; lun->stats.operations[type] ++; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl_ioctl.h Sat Feb 23 04:24:44 2019 (r344480) @@ -69,9 +69,6 @@ /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 -/* Legacy statistics accumulated for every port for every LU. */ -//#define CTL_LEGACY_STATS 1 - typedef enum { CTL_DELAY_TYPE_NONE, CTL_DELAY_TYPE_CONT, @@ -119,39 +116,6 @@ typedef enum { CTL_STATS_FLAG_TIME_VALID = 0x01 } ctl_stats_flags; -#ifdef CTL_LEGACY_STATS -typedef enum { - CTL_LUN_STATS_NO_BLOCKSIZE = 0x01 -} ctl_lun_stats_flags; - -struct ctl_lun_io_port_stats { - uint32_t targ_port; - uint64_t bytes[CTL_STATS_NUM_TYPES]; - uint64_t operations[CTL_STATS_NUM_TYPES]; - struct bintime time[CTL_STATS_NUM_TYPES]; - uint64_t num_dmas[CTL_STATS_NUM_TYPES]; - struct bintime dma_time[CTL_STATS_NUM_TYPES]; -}; - -struct ctl_lun_io_stats { - uint8_t device_type; - uint64_t lun_number; - uint32_t blocksize; - ctl_lun_stats_flags flags; - struct ctl_lun_io_port_stats *ports; -}; - -struct ctl_stats { - int alloc_len; /* passed to kernel */ - struct ctl_lun_io_stats *lun_stats; /* passed to/from kernel */ - int fill_len; /* passed to userland */ - int num_luns; /* passed to userland */ - ctl_stats_status status; /* passed to userland */ - ctl_stats_flags flags; /* passed to userland */ - struct timespec timestamp; /* passed to userland */ -}; -#endif /* CTL_LEGACY_STATS */ - struct ctl_io_stats { uint32_t item; uint64_t bytes[CTL_STATS_NUM_TYPES]; @@ -795,7 +759,6 @@ struct ctl_lun_map { #define CTL_ENABLE_PORT _IOW(CTL_MINOR, 0x04, struct ctl_port_entry) #define CTL_DISABLE_PORT _IOW(CTL_MINOR, 0x05, struct ctl_port_entry) #define CTL_DELAY_IO _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info) -#define CTL_GETSTATS _IOWR(CTL_MINOR, 0x15, struct ctl_stats) #define CTL_ERROR_INJECT _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc) #define CTL_GET_OOA _IOWR(CTL_MINOR, 0x18, struct ctl_ooa) #define CTL_DUMP_STRUCTS _IO(CTL_MINOR, 0x19) Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl_private.h Sat Feb 23 04:24:44 2019 (r344480) @@ -403,9 +403,6 @@ struct ctl_lun { struct callout ie_callout; /* INTERVAL TIMER */ struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; -#ifdef CTL_LEGACY_STATS - struct ctl_lun_io_stats legacy_stats; -#endif /* CTL_LEGACY_STATS */ struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation; From owner-svn-src-head@freebsd.org Sat Feb 23 06:03:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C371508809; Sat, 23 Feb 2019 06:03:19 +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 C08A7742C7; Sat, 23 Feb 2019 06:03:18 +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 ACBE5191D3; Sat, 23 Feb 2019 06:03:18 +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 x1N63IMl005735; Sat, 23 Feb 2019 06:03:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N63IUa005733; Sat, 23 Feb 2019 06:03:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902230603.x1N63IUa005733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 23 Feb 2019 06:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344481 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 344481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C08A7742C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 06:03:19 -0000 Author: glebius Date: Sat Feb 23 06:03:18 2019 New Revision: 344481 URL: https://svnweb.freebsd.org/changeset/base/344481 Log: Support struct ip_mreqn as argument for IP_ADD_MEMBERSHIP. Legacy support for struct ip_mreq remains in place. The struct ip_mreqn is Linux extension to classic BSD multicast API. It has extra field allowing to specify the interface index explicitly. In Linux it used as argument for IP_MULTICAST_IF and IP_ADD_MEMBERSHIP. FreeBSD kernel also declares this structure and supports it as argument to IP_MULTICAST_IF since r170613. So, we have structure declared but not fully supported, this confused third party application configure scripts. Code handling IP_ADD_MEMBERSHIP was mixed together with code for IP_ADD_SOURCE_MEMBERSHIP. Bringing legacy and new structure support into the mess would made the "argument switcharoo" intolerable, so code was separated into its own switch case clause. MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19276 Modified: head/share/man/man4/ip.4 head/sys/netinet/in_mcast.c Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Sat Feb 23 04:24:44 2019 (r344480) +++ head/share/man/man4/ip.4 Sat Feb 23 06:03:18 2019 (r344481) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd February 22, 2019 .Dt IP 4 .Os .Sh NAME @@ -571,32 +571,55 @@ To join a multicast group, use the .Dv IP_ADD_MEMBERSHIP option: .Bd -literal -struct ip_mreq mreq; -setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +struct ip_mreqn mreqn; +setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreqn, sizeof(mreqn)); .Ed .Pp where -.Fa mreq +.Fa mreqn is the following structure: .Bd -literal -struct ip_mreq { +struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ + int imr_ifindex; /* interface index */ } .Ed .Pp -.Va imr_interface -should be set to the -.Tn IP -address of a particular multicast-capable interface if +.Va imr_ifindex +should be set to the index of a particular multicast-capable interface if the host is multihomed. -It may be set to -.Dv INADDR_ANY -to choose the default interface, although this is not recommended; -this is considered to be the first interface corresponding -to the default route. -Otherwise, the first multicast-capable interface -configured in the system will be used. +If +.Va imr_ifindex +is non-zero, value of +.Va imr_interface +is ignored. +Otherwise, if +.Va imr_ifindex +is 0, kernel will use IP address from +.Va imr_interface +to lookup the interface. +Value of +.Va imr_interface +may be set to +.Va INADDR_ANY +to choose the default interface, although this is not recommended; this is +considered to be the first interface corresponding to the default route. +Otherwise, the first multicast-capable interface configured in the system +will be used. +.Pp +Legacy +.Vt "struct ip_mreq" , +that lacks +.Va imr_ifindex +field is also supported by +.Dv IP_ADD_MEMBERSHIP +setsockopt. +In this case kernel would behave as if +.Va imr_ifindex +was set to zero: +.Va imr_interface +will be used to lookup interface. .Pp Prior to .Fx 7.0 , Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat Feb 23 04:24:44 2019 (r344480) +++ head/sys/netinet/in_mcast.c Sat Feb 23 06:03:18 2019 (r344481) @@ -2049,40 +2049,49 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt ssa->ss.ss_family = AF_UNSPEC; switch (sopt->sopt_name) { - case IP_ADD_MEMBERSHIP: - case IP_ADD_SOURCE_MEMBERSHIP: { - struct ip_mreq_source mreqs; + case IP_ADD_MEMBERSHIP: { + struct ip_mreqn mreqn; - if (sopt->sopt_name == IP_ADD_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq), - sizeof(struct ip_mreq)); - /* - * Do argument switcharoo from ip_mreq into - * ip_mreq_source to avoid using two instances. - */ - mreqs.imr_interface = mreqs.imr_sourceaddr; - mreqs.imr_sourceaddr.s_addr = INADDR_ANY; - } else if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq_source), - sizeof(struct ip_mreq_source)); - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreqn), sizeof(struct ip_mreqn)); + else + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreq), sizeof(struct ip_mreq)); if (error) return (error); gsa->sin.sin_family = AF_INET; gsa->sin.sin_len = sizeof(struct sockaddr_in); - gsa->sin.sin_addr = mreqs.imr_multiaddr; + gsa->sin.sin_addr = mreqn.imr_multiaddr; + if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) + return (EINVAL); - if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - ssa->sin.sin_family = AF_INET; - ssa->sin.sin_len = sizeof(struct sockaddr_in); - ssa->sin.sin_addr = mreqs.imr_sourceaddr; - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn) && + mreqn.imr_ifindex != 0) + ifp = ifnet_byindex(mreqn.imr_ifindex); + else + ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, + mreqn.imr_address); + break; + } + case IP_ADD_SOURCE_MEMBERSHIP: { + struct ip_mreq_source mreqs; + error = sooptcopyin(sopt, &mreqs, sizeof(struct ip_mreq_source), + sizeof(struct ip_mreq_source)); + if (error) + return (error); + + gsa->sin.sin_family = ssa->sin.sin_family = AF_INET; + gsa->sin.sin_len = ssa->sin.sin_len = + sizeof(struct sockaddr_in); + + gsa->sin.sin_addr = mreqs.imr_multiaddr; if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + + ssa->sin.sin_addr = mreqs.imr_sourceaddr; ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); From owner-svn-src-head@freebsd.org Sat Feb 23 09:35:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57CB8150E75E; Sat, 23 Feb 2019 09:35:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCB6E82BF1; Sat, 23 Feb 2019 09:35:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9413F1B6DD; Sat, 23 Feb 2019 09:35:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1N9Z5OR015125; Sat, 23 Feb 2019 09:35:05 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N9YwMn015075; Sat, 23 Feb 2019 09:34:58 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201902230934.x1N9YwMn015075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sat, 23 Feb 2019 09:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344482 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: brueffer X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 344482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCB6E82BF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 09:35:06 -0000 Author: brueffer Date: Sat Feb 23 09:34:57 2019 New Revision: 344482 URL: https://svnweb.freebsd.org/changeset/base/344482 Log: Fix a slew of mdoc errors and warnings. MFC after: 1 week Modified: head/share/man/man4/cc_newreno.4 head/share/man/man4/ctl.4 head/share/man/man4/ehci.4 head/share/man/man4/em.4 head/share/man/man4/ena.4 head/share/man/man4/ips.4 head/share/man/man4/liquidio.4 head/share/man/man4/nda.4 head/share/man/man4/ng_nat.4 head/share/man/man4/ohci.4 head/share/man/man4/pci.4 head/share/man/man4/sctp.4 head/share/man/man4/ses.4 head/share/man/man4/siftr.4 head/share/man/man4/smartpqi.4 head/share/man/man4/sysmouse.4 head/share/man/man4/tcp.4 head/share/man/man4/uath.4 head/share/man/man4/ucom.4 head/share/man/man4/ugen.4 head/share/man/man4/uhci.4 head/share/man/man4/uhid.4 head/share/man/man4/ukbd.4 head/share/man/man4/umoscom.4 head/share/man/man4/ums.4 head/share/man/man4/uplcom.4 head/share/man/man4/usb.4 head/share/man/man4/uvscom.4 head/share/man/man4/vale.4 head/share/man/man4/vmci.4 head/share/man/man4/vmm.4 head/share/man/man4/wi.4 head/share/man/man4/xe.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/cc_newreno.4 ============================================================================== --- head/share/man/man4/cc_newreno.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/cc_newreno.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -75,6 +75,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * CC_NEWRENO_BETA_ECN) / 100. Default is 80. +.El .Sh MIB Variables The algorithm exposes these variables in the .Va net.inet.tcp.cc.newreno @@ -93,6 +94,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. +.El .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ctl.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -202,6 +202,7 @@ The default value is 1024. .It Va kern.cam.ctl.max_ports Specifies the maximum number of ports we support, must be a power of 2. The default value is 256. +.El .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ehci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -88,6 +88,7 @@ The default value is 0 (off). .It Va hw.usb.ehci.no_hs This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller. The default value is 0 (off). +.El .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/em.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -264,6 +264,7 @@ If .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. +.El .Sh FILES .Bl -tag -width /dev/led/em* .It Pa /dev/led/em* Modified: head/share/man/man4/ena.4 ============================================================================== --- head/share/man/man4/ena.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ena.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -239,6 +239,7 @@ for more details. .Pp Packet with unsupported number of segments was queued for sending to the device; packet will be dropped. +.El .Sh SUPPORT If an issue is identified with the released source code with a supported adapter email the specific information related to the issue to Modified: head/share/man/man4/ips.4 ============================================================================== --- head/share/man/man4/ips.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ips.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -114,7 +114,7 @@ Unable to obtain adapter or drive configuration. A buffer input/output error has occurred. .Bq Er ENXIO .El -.Ss General adapter errors: +.Ss General adapter errors : .Bl -diag .It Attaching bus failed .Pp @@ -146,7 +146,7 @@ The adapter is disabled. .Pp The driver was unable to allocate resources for the device. .El -.Ss Error messages due to DMA: +.Ss Error messages due to DMA : .Bl -diag .It can't alloc command dma tag .It can't alloc SG dma tag @@ -155,7 +155,7 @@ The driver was unable to allocate resources for the de .Pp Failure to map or allocate DMA resources. .El -.Ss Cache, buffer, and command errors: +.Ss Cache, buffer, and command errors : .Bl -diag .It failed to initialize command buffers .It no mem for command slots! Modified: head/share/man/man4/liquidio.4 ============================================================================== --- head/share/man/man4/liquidio.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/liquidio.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -110,6 +110,7 @@ To enable/disable driver RSS support .It Va hw.lio.hwlro .Pp To enable/disable hardware LRO +.El .Sh SUPPORT For general information and support, go to the Cavium support website at: Modified: head/share/man/man4/nda.4 ============================================================================== --- head/share/man/man4/nda.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/nda.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -70,14 +70,15 @@ It's value is hard coded to 0 indicating flash. This variable reports whether the .Nm driver accepts unmapped I/O for this unit. +.El .Sh FILES .Bl -tag -width ".Pa /dev/nda*" -compact .It Pa /dev/nda* NVMe storage device nodes .El .Sh SEE ALSO -.Xr nvme 4 , -.Xr nvd 4 +.Xr nvd 4 , +.Xr nvme 4 .Sh HISTORY The .Nm Modified: head/share/man/man4/ng_nat.4 ============================================================================== --- head/share/man/man4/ng_nat.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ng_nat.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -387,6 +387,7 @@ route add default x.y.0.1 msg igb0_NAT: setdlt 1 msg igb0_NAT: setaliasaddr x.y.8.35 SEQ +.Ed .Sh SEE ALSO .Xr libalias 3 , .Xr ng_ipfw 4 , Modified: head/share/man/man4/ohci.4 ============================================================================== --- head/share/man/man4/ohci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ohci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -70,6 +70,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr uhci 4 , Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/pci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -386,7 +386,7 @@ specified by the member, otherwise fail. .It PCIIO_BAR_MMAP_EXCL Must be used together with -.Vd PCIIO_BAR_MMAP_FIXED +.Dv PCIIO_BAR_MMAP_FIXED If the specified base contains already established mappings, the operation fails instead of implicitly unmapping them. .It PCIIO_BAR_MMAP_RW Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/sctp.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -176,7 +176,7 @@ and tested with .Xr getsockopt 2 or .Xr sctp_opt_info 3 : -.Bl -tag -indent +.Bl -tag -width indent .It Dv SCTP_NODELAY Under most circumstances, .Tn SCTP Modified: head/share/man/man4/ses.4 ============================================================================== --- head/share/man/man4/ses.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ses.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 05, 2015 +.Dd September 5, 2015 .Dt SES 4 .Os .Sh NAME Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/siftr.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -399,11 +399,15 @@ The summation of num_inbound_tcp_pkts and num_outbound .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc -Number of inbound packets that were not processed because of failed malloc() calls. +Number of inbound packets that were not processed because of failed +.Fn malloc +calls. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc -Number of outbound packets that were not processed because of failed malloc() calls. +Number of outbound packets that were not processed because of failed +.Fn malloc +calls. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx @@ -759,8 +763,10 @@ Ideally, .Nm should intercept packets after they have been processed by the TCP layer i.e. intercept packets coming up the stack after they have been processed by -tcp_input(), and intercept packets coming down the stack after they have been -processed by tcp_output(). +.Fn tcp_input , +and intercept packets coming down the stack after they have been +processed by +.Fn tcp_output . The current code still gives satisfactory granularity though, as inbound events tend to trigger outbound events, allowing the cause-and-effect to be observed indirectly by capturing the state on outbound events as well. Modified: head/share/man/man4/smartpqi.4 ============================================================================== --- head/share/man/man4/smartpqi.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/smartpqi.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ stable/10/share/man/man4/smartpqi.4 195614 2017-01-11 08:10:18Z jkim $ -.Dd April 06, 2018 +.Dd April 6, 2018 .Dt SMARTPQI 4 .Os .Sh NAME @@ -37,6 +37,7 @@ kernel configuration file: .Cd device pci .Cd device scbus .Cd device smartpqi +.Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in @@ -81,10 +82,10 @@ smartpqi management interface .Xr kld 4 , .Xr linux 4 , .Xr scsi 4 , -.Xr kldload 8 -.Xr pass 4 -.Xr xpt 4 -.Xr loader.conf 5 +.Xr kldload 8 , +.Xr pass 4 , +.Xr xpt 4 , +.Xr loader.conf 5 , .Xr camcontrol 8 .Rs .%T "Microsemi Website" @@ -95,7 +96,7 @@ The .Nm driver first appeared in .Fx 11.1 . -.Sh AUTHOR +.Sh AUTHORS .An Murthy Bhat .Aq murthy.bhat@microsemi.com .Sh BUGS Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/sysmouse.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -55,7 +55,6 @@ Make sure that .Xr moused 8 is running, otherwise the user process will not see any data coming from the mouse. -.Pp .Ss Operation Levels The .Nm Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/tcp.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -597,8 +597,7 @@ The default TCP function block (TCP stack). .It Va functions_inherit_listen_socket_stack Determines whether to inherit listen socket's tcp stack or use the current system default tcp stack, as defined by -.Va functions_default -.Pc . +.Va functions_default . Default is true. .It Va insecure_rst Use criteria defined in RFC793 instead of RFC5961 for accepting RST segments. Modified: head/share/man/man4/uath.4 ============================================================================== --- head/share/man/man4/uath.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uath.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -76,7 +76,7 @@ This is normally done by the utility that is launched by .Xr devd 8 when the device is inserted. -.Xr uathload +.Xr uathload 8 includes the firmware in the binary program. This firmware is licensed for general use and is included in the base system. .Sh HARDWARE Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ucom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -81,6 +81,7 @@ driver will mark terminals as console devices when ope Default is 1. .It Va hw.usb.ucom.pps_mode Enables and configure PPS capture mode as described below. +.El .Sh Pulse Per Second (PPS) Timing Interface The .Nm Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ugen.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -302,6 +302,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact .It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E Modified: head/share/man/man4/uhci.4 ============================================================================== --- head/share/man/man4/uhci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uhci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -60,6 +60,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uhid.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -155,6 +155,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/uhid?" .It Pa /dev/uhid? Modified: head/share/man/man4/ukbd.4 ============================================================================== --- head/share/man/man4/ukbd.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ukbd.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -147,6 +147,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/kbd*" -compact .It Pa /dev/kbd* Modified: head/share/man/man4/umoscom.4 ============================================================================== --- head/share/man/man4/umoscom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/umoscom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -77,4 +77,7 @@ corresponding callout initial-state and lock-state dev .Sh HISTORY The .Nm -driver appeared in OpenBSD and was ported to FreeBSD. +driver appeared in +.Ox +and was ported to +.Fx . Modified: head/share/man/man4/ums.4 ============================================================================== --- head/share/man/man4/ums.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ums.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -75,6 +75,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width /dev/ums0 -compact .It Pa /dev/ums0 Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uplcom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -191,6 +191,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/usb.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -142,6 +142,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO The .Tn USB @@ -173,7 +174,7 @@ specifications can be found at: .Xr uvscom 4 , .Xr xhci 4 .Xr usbconfig 8 , -.Xr usbdi 9 , +.Xr usbdi 9 .Sh STANDARDS The .Nm Modified: head/share/man/man4/uvscom.4 ============================================================================== --- head/share/man/man4/uvscom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uvscom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -90,6 +90,7 @@ for callout ports .It Pa /dev/cuaU*.init .It Pa /dev/cuaU*.lock corresponding callout initial-state and lock-state devices +.El .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , Modified: head/share/man/man4/vale.4 ============================================================================== --- head/share/man/man4/vale.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vale.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" $Id: $ .\" -.Dd Jan 9, 2019 +.Dd January 9, 2019 .Dt VALE 4 .Os .Sh NAME Modified: head/share/man/man4/vmci.4 ============================================================================== --- head/share/man/man4/vmci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vmci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -59,6 +59,7 @@ virtual machine itself. .Rs .%T "VMware vSockets Documentation" .%U https://www.vmware.com/support/developer/vmci-sdk/ +.Re .Sh HISTORY The .Nm Modified: head/share/man/man4/vmm.4 ============================================================================== --- head/share/man/man4/vmm.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vmm.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -31,7 +31,6 @@ .Nm vmm.ko .Nd "bhyve virtual machine monitor" .Sh SYNOPSIS -.Pp To load the driver as a module at boot, add this line to .Xr loader.conf 5 : .Bd -literal -offset indent @@ -47,7 +46,7 @@ kldload vmm .Nm provides the kernel portion of the .Xr bhyve 4 -hypervisor. +hypervisor. .Pp An Intel CPU with VT-x/EPT or AMD CPU with SVM support is required. .Pp Modified: head/share/man/man4/wi.4 ============================================================================== --- head/share/man/man4/wi.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/wi.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -316,7 +316,7 @@ command. .Xr wlan_xauth 4 , .Xr hostapd 8 , .Xr ifconfig 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Rs .%T HCF Light programming specification .%U http://web.archive.org/web/20040130141721/http://wavelan.com/ Modified: head/share/man/man4/xe.4 ============================================================================== --- head/share/man/man4/xe.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/xe.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24 2018 +.Dd October 24, 2018 .Dt XE 4 .Os .Sh NAME Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/xhci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -67,6 +67,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , From owner-svn-src-head@freebsd.org Sat Feb 23 10:30:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D1DA15102EC; Sat, 23 Feb 2019 10:30:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 62D1684D82; Sat, 23 Feb 2019 10:30:39 +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 x1NAUWgA022189 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Feb 2019 12:30:35 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1NAUWgA022189 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1NAUWop022188; Sat, 23 Feb 2019 12:30:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Feb 2019 12:30:32 +0200 From: Konstantin Belousov To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344479 - head/sys/mips/conf Message-ID: <20190223103032.GG2420@kib.kiev.ua> References: <201902230000.x1N00o8R011357@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902230000.x1N00o8R011357@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 10:30:40 -0000 On Sat, Feb 23, 2019 at 12:00:50AM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Sat Feb 23 00:00:49 2019 > New Revision: 344479 > URL: https://svnweb.freebsd.org/changeset/base/344479 > > Log: > o Get rid of silly comment which seems to have got life of its own via > copy-and-paste process; > > o Return geom_uzip(4) usage back to how manual page prescribes it to be > used while I am here. > > Modified: > head/sys/mips/conf/AP94 > head/sys/mips/conf/DIR-825B1 > head/sys/mips/conf/ROUTERSTATION_MFS > head/sys/mips/conf/RSPRO_MFS > head/sys/mips/conf/WZR-300HP > head/sys/mips/conf/WZR-HPAG300H To put this commit into some perspective: - removal of 'device geom_uzip' is the part of the still discussed https://reviews.freebsd.org/D19266; - of course the removal there conflicts with the uncommitted patch, requiring me to spend time handling the conflict; - as a happy coincidence the patch is incomplete leaving a lot more 'device geom_uzip' in sys/mips/conf files - I have to explain all of that to some people outside the svn-src@ (see the tag line in the review) and try to smooth out the naturally uprising attitude. I am curious, do you think that the rush to remove the comment worth the outcome ? From owner-svn-src-head@freebsd.org Sat Feb 23 20:45:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 004741505432; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 963BE6ECFF; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 845C4228BA; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NKjknu069913; Sat, 23 Feb 2019 20:45:46 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NKjkFO069911; Sat, 23 Feb 2019 20:45:46 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232045.x1NKjkFO069911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 20:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344484 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 344484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 963BE6ECFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 20:45:47 -0000 Author: mmacy Date: Sat Feb 23 20:45:45 2019 New Revision: 344484 URL: https://svnweb.freebsd.org/changeset/base/344484 Log: linux/fs: simplify interop and correct definition of loff_t - offsets can be negative, loff_t needs to be signed, it also simplifies interop with the rest of the code base to use off_t than the actual linux definition "long long" - don't rely on the defining "file" to "linux_file" in interface definitions as that causes heartache with includes Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19274 Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 14:27:09 2019 (r344483) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 20:45:45 2019 (r344484) @@ -129,25 +129,25 @@ do { \ pgsigio(*(queue), (sig), 0); \ } while (0) -typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); +typedef int (*filldir_t)(void *, const char *, int, off_t, u64, unsigned); struct file_operations { struct module *owner; - ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); - ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); - unsigned int (*poll) (struct file *, struct poll_table_struct *); - long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); - long (*compat_ioctl)(struct file *, unsigned int, unsigned long); - int (*mmap)(struct file *, struct vm_area_struct *); + ssize_t (*read)(struct linux_file *, char __user *, size_t, off_t *); + ssize_t (*write)(struct linux_file *, const char __user *, size_t, off_t *); + unsigned int (*poll) (struct linux_file *, struct poll_table_struct *); + long (*unlocked_ioctl)(struct linux_file *, unsigned int, unsigned long); + long (*compat_ioctl)(struct linux_file *, unsigned int, unsigned long); + int (*mmap)(struct linux_file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); - int (*release)(struct inode *, struct file *); - int (*fasync)(int, struct file *, int); + int (*release)(struct inode *, struct linux_file *); + int (*fasync)(int, struct linux_file *, int); /* Although not supported in FreeBSD, to align with Linux code * we are adding llseek() only when it is mapped to no_llseek which returns * an illegal seek error */ - loff_t (*llseek)(struct file *, loff_t, int); + off_t (*llseek)(struct linux_file *, off_t, int); #if 0 /* We do not support these methods. Don't permit them to compile. */ loff_t (*llseek)(struct file *, loff_t, int); Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 14:27:09 2019 (r344483) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 20:45:45 2019 (r344484) @@ -55,7 +55,7 @@ typedef uint64_t __be64; typedef unsigned int uint; typedef unsigned gfp_t; -typedef uint64_t loff_t; +typedef off_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; From owner-svn-src-head@freebsd.org Sat Feb 23 20:56:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DBF31505879; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DFA96F31F; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1134F22A65; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NKugPG075480; Sat, 23 Feb 2019 20:56:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NKufKt075476; Sat, 23 Feb 2019 20:56:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232056.x1NKufKt075476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 20:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344485 - in head/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Commit-Revision: 344485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DFA96F31F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 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]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 20:56:42 -0000 Author: mmacy Date: Sat Feb 23 20:56:41 2019 New Revision: 344485 URL: https://svnweb.freebsd.org/changeset/base/344485 Log: import linux debugfs support Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19258 Added: head/sys/compat/lindebugfs/ head/sys/compat/lindebugfs/lindebugfs.c (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/debugfs.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/seq_file.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_seq_file.c (contents, props changed) Added: head/sys/compat/lindebugfs/lindebugfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/lindebugfs/lindebugfs.c Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,309 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +MALLOC_DEFINE(M_DFSINT, "debugfsint", "Linux debugfs internal"); + +static struct pfs_node *debugfs_root; + +#define DM_SYMLINK 0x1 +#define DM_DIR 0x2 +#define DM_FILE 0x3 + +struct dentry_meta { + struct dentry dm_dnode; + const struct file_operations *dm_fops; + void *dm_data; + umode_t dm_mode; + int dm_type; +}; + +static int +debugfs_attr(PFS_ATTR_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + + vap->va_mode = dm->dm_mode; + return (0); +} + +static int +debugfs_destroy(PFS_DESTROY_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + if (dm->dm_type == DM_SYMLINK) + free(dm->dm_data, M_DFSINT); + + free(dm, M_DFSINT); + return (0); +} + +static int +debugfs_fill(PFS_FILL_ARGS) +{ + struct dentry_meta *d; + struct linux_file lf; + struct seq_file *sf; + struct vnode vn; + void *buf; + int rc; + size_t len; + off_t off; + + d = pn->pn_data; + + if ((rc = linux_set_current_flags(curthread, M_NOWAIT))) + return (rc); + vn.v_data = d->dm_data; + buf = uio->uio_iov[0].iov_base; + len = min(uio->uio_iov[0].iov_len, uio->uio_resid); + off = 0; + lf.private_data = NULL; + rc = d->dm_fops->open(&vn, &lf); + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d open failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + sf = lf.private_data; + sf->buf = sb; + if (uio->uio_rw == UIO_READ) + rc = d->dm_fops->read(&lf, NULL, len, &off); + else + rc = d->dm_fops->write(&lf, buf, len, &off); + if (d->dm_fops->release) + d->dm_fops->release(&vn, &lf); + else + single_release(&vn, &lf); + + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d read/write failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + return (0); +} + +static int +debugfs_fill_data(PFS_FILL_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + sbuf_printf(sb, "%s", (char *)dm->dm_data); + return (0); +} + +struct dentry * +debugfs_create_file(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + int flags; + + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + return (NULL); + dnode = &dm->dm_dnode; + dm->dm_fops = fops; + dm->dm_data = data; + dm->dm_mode = mode; + dm->dm_type = DM_FILE; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + flags = fops->write ? PFS_RDWR : PFS_RD; + dnode->d_pfs_node = pfs_create_file(pnode, name, debugfs_fill, + debugfs_attr, NULL, debugfs_destroy, flags | PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) { + free(dm, M_DFSINT); + return (NULL); + } + dnode->d_pfs_node->pn_data = dm; + + return (dnode); +} + +struct dentry * +debugfs_create_dir(const char *name, struct dentry *parent) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + return (NULL); + dnode = &dm->dm_dnode; + dm->dm_mode = 0700; + dm->dm_type = DM_DIR; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + dnode->d_pfs_node = pfs_create_dir(pnode, name, debugfs_attr, NULL, debugfs_destroy, PFS_RD | PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) { + free(dm, M_DFSINT); + return (NULL); + } + dnode->d_pfs_node->pn_data = dm; + return (dnode); +} + +struct dentry * +debugfs_create_symlink(const char *name, struct dentry *parent, + const char *dest) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + void *data; + + data = strdup_flags(dest, M_DFSINT, M_NOWAIT); + if (data == NULL) + return (NULL); + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + goto fail1; + dnode = &dm->dm_dnode; + dm->dm_mode = 0700; + dm->dm_type = DM_SYMLINK; + dm->dm_data = data; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + dnode->d_pfs_node = pfs_create_link(pnode, name, &debugfs_fill_data, NULL, NULL, NULL, PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) + goto fail; + dnode->d_pfs_node->pn_data = dm; + return (dnode); + fail: + free(dm, M_DFSINT); + fail1: + free(data, M_DFSINT); + return (NULL); +} + +void +debugfs_remove(struct dentry *dnode) +{ + if (dnode == NULL) + return; + + pfs_destroy(dnode->d_pfs_node); +} + +void +debugfs_remove_recursive(struct dentry *dnode) +{ + if (dnode == NULL) + return; + + pfs_destroy(dnode->d_pfs_node); +} + + +static int +debugfs_init(PFS_INIT_ARGS) +{ + + debugfs_root = pi->pi_root; + return (0); +} + +static int +debugfs_uninit(PFS_INIT_ARGS) +{ + return (0); +} + +#ifdef PR_ALLOW_MOUNT_LINSYSFS +PSEUDOFS(debugfs, 1, PR_ALLOW_MOUNT_LINSYSFS); +#else +PSEUDOFS(debugfs, 1, VFCF_JAIL); +#endif Added: head/sys/compat/linuxkpi/common/include/linux/debugfs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/debugfs.h Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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 _LINUX_DEBUGFS_H_ +#define _LINUX_DEBUGFS_H_ + +#include +#include + +#include + +void debugfs_remove(struct dentry *dentry); + +struct dentry *debugfs_create_file(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops); + +struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); + +struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, + const char *dest); + +void debugfs_remove_recursive(struct dentry *dentry); + +#endif Added: head/sys/compat/linuxkpi/common/include/linux/seq_file.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,71 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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 _LINUX_SEQ_FILE_H_ +#define _LINUX_SEQ_FILE_H_ + +#include + +struct seq_operations; +struct linux_file; + +#define inode vnode + +struct seq_file { + struct sbuf *buf; + + const struct seq_operations *op; + const struct linux_file *file; + void *private; +}; + +struct seq_operations { + void * (*start) (struct seq_file *m, off_t *pos); + void (*stop) (struct seq_file *m, void *v); + void * (*next) (struct seq_file *m, void *v, off_t *pos); + int (*show) (struct seq_file *m, void *v); +}; + +ssize_t seq_read(struct linux_file *, char *, size_t, off_t *); +int seq_write(struct seq_file *seq, const void *data, size_t len); + +int seq_open(struct linux_file *f, const struct seq_operations *op); +int seq_release(struct inode *inode, struct linux_file *file); + +off_t seq_lseek(struct linux_file *file, off_t offset, int whence); +int single_open(struct linux_file *, int (*)(struct seq_file *, void *), void *); +int single_release(struct inode *, struct linux_file *); + +#define seq_printf(m, fmt, ...) sbuf_printf((m)->buf, (fmt), ##__VA_ARGS__) + +#define seq_puts(m, str) sbuf_printf((m)->buf, str) +#define seq_putc(m, str) sbuf_putc((m)->buf, str) + + +#endif /* _LINUX_SEQ_FILE_H_ */ Added: head/sys/compat/linuxkpi/common/src/linux_seq_file.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/src/linux_seq_file.c Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#undef file +MALLOC_DEFINE(M_LSEQ, "seq_file", "seq_file"); + +ssize_t +seq_read(struct linux_file *f, char *ubuf, size_t size, off_t *ppos) +{ + struct seq_file *m = f->private_data; + void *p; + int rc; + off_t pos = 0; + + p = m->op->start(m, &pos); + rc = m->op->show(m, p); + if (rc) + return (rc); + return (size); +} + +int +seq_write(struct seq_file *seq, const void *data, size_t len) +{ + + return (sbuf_bcpy(seq->buf, data, len)); +} + +/* + * This only needs to be a valid address for lkpi + * drivers it should never actually be called + */ +off_t +seq_lseek(struct linux_file *file, off_t offset, int whence) +{ + + panic("%s not supported\n", __FUNCTION__); + return (0); +} + +static void * +single_start(struct seq_file *p, off_t *pos) +{ + + return ((void *)(uintptr_t)(*pos == 0)); +} + +static void * +single_next(struct seq_file *p, void *v, off_t *pos) +{ + + ++*pos; + return (NULL); +} + +static void +single_stop(struct seq_file *p, void *v) +{ +} + +int +seq_open(struct linux_file *f, const struct seq_operations *op) +{ + struct seq_file *p; + + if (f->private_data != NULL) + log(LOG_WARNING, "%s private_data not NULL", __func__); + + if ((p = malloc(sizeof(*p), M_LSEQ, M_NOWAIT|M_ZERO)) == NULL) + return (-ENOMEM); + + f->private_data = p; + p->op = op; + p->file = f; + return (0); +} + +int +single_open(struct linux_file *f, int (*show)(struct seq_file *, void *), void *d) +{ + struct seq_operations *op; + int rc = -ENOMEM; + + op = malloc(sizeof(*op), M_LSEQ, M_NOWAIT); + if (op) { + op->start = single_start; + op->next = single_next; + op->stop = single_stop; + op->show = show; + rc = seq_open(f, op); + if (rc) + free(op, M_LSEQ); + else + ((struct seq_file *)f->private_data)->private = d; + + } + return (rc); +} + +int +seq_release(struct inode *inode __unused, struct linux_file *file) +{ + struct seq_file *m; + + m = file->private_data; + free(m, M_LSEQ); + return (0); +} + +int +single_release(struct vnode *v, struct linux_file *f) +{ + const struct seq_operations *op = ((struct seq_file *)f->private_data)->op; + int rc; + + rc = seq_release(v, f); + free(__DECONST(void *, op), M_LSEQ); + return (rc); +} From owner-svn-src-head@freebsd.org Sat Feb 23 21:04:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78B371505AD5; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 179126F7E9; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0806822C0F; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NL4m4Z080372; Sat, 23 Feb 2019 21:04:48 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NL4m68080370; Sat, 23 Feb 2019 21:04:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232104.x1NL4m68080370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 21:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344486 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 344486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 179126F7E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 21:04:49 -0000 Author: mmacy Date: Sat Feb 23 21:04:48 2019 New Revision: 344486 URL: https://svnweb.freebsd.org/changeset/base/344486 Log: Change seq_read to seq_load to avoid namespace conflicts with lkpi MFC after: 1 week Sponsored by: iX Systems Modified: head/sys/kern/kern_descrip.c head/sys/sys/seq.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 23 20:56:41 2019 (r344485) +++ head/sys/kern/kern_descrip.c Sat Feb 23 21:04:48 2019 (r344486) @@ -2629,7 +2629,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ for (;;) { #ifdef CAPABILITIES - seq = seq_read(fd_seq(fdt, fd)); + seq = seq_load(fd_seq(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; Modified: head/sys/sys/seq.h ============================================================================== --- head/sys/sys/seq.h Sat Feb 23 20:56:41 2019 (r344485) +++ head/sys/sys/seq.h Sat Feb 23 21:04:48 2019 (r344486) @@ -121,7 +121,7 @@ seq_write_end(seq_t *seqp) } static __inline seq_t -seq_read(const seq_t *seqp) +seq_load(const seq_t *seqp) { seq_t ret; From owner-svn-src-head@freebsd.org Sat Feb 23 21:14:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8014E1505CCC; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1146FD95; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2176C22DC6; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NLE25e085355; Sat, 23 Feb 2019 21:14:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NLE0cH085345; Sat, 23 Feb 2019 21:14:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232114.x1NLE0cH085345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 21:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344487 - in head/sys: conf gnu/gcov X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf gnu/gcov X-SVN-Commit-Revision: 344487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E1146FD95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 21:14:02 -0000 Author: mmacy Date: Sat Feb 23 21:14:00 2019 New Revision: 344487 URL: https://svnweb.freebsd.org/changeset/base/344487 Log: gcov support add gcov support and export results as files in debugfs Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19260 Added: head/sys/gnu/gcov/ head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) head/sys/gnu/gcov/gcov.h (contents, props changed) head/sys/gnu/gcov/gcov_fs.c (contents, props changed) head/sys/gnu/gcov/gcov_subr.c (contents, props changed) Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 fs/cd9660/cd9660_vfsops.c optional cd9660 fs/cd9660/cd9660_vnops.c optional cd9660 fs/cd9660/cd9660_iconv.c optional cd9660_iconv +gnu/gcov/gcc_4_7.c optional gcov +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ + compile-with "${LINUXKPI_C}" +gnu/gcov/gcov_subr.c optional gcov + kern/bus_if.m standard kern/clock_if.m standard kern/cpufreq_if.m standard @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" + +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ + compile-with "${LINUXKPI_C}" + +compat/lindebugfs/lindebugfs.c optional lindebugfs \ compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=maybe-uninitialized \ -Wno-error=overflow \ -Wno-error=sequence-point \ - -Wno-error=unused-but-set-variable + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >= 60100 CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" .endif +.if defined(GCOV_CFLAGS) +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" +.endif + # Allow overriding the kernel debug directory, so kernel and user debug may be # installed in different directories. Setting it to "" restores the historical # behavior of installing debug files in the kernel directory. Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc CFLAGS+= ${SAN_CFLAGS} +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + # Put configuration-specific C flags last (except for ${PROF}) so that they # can override the others. CFLAGS+= ${CONF_CFLAGS} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -380,6 +380,9 @@ ${_src}: # Add the sanitizer C flags CFLAGS+= ${SAN_CFLAGS} +# Add the gcov flags +CFLAGS+= ${GCOV_CFLAGS} + # Respect configuration-specific C flags. CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h # amdsbwd options AMDSBWD_DEBUG opt_amdsbwd.h + +# gcov support +GCOV opt_global.h +LINDEBUGFS Added: head/sys/gnu/gcov/gcc_4_7.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,597 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This code provides functions to handle gcc's profiling data format + * introduced with gcc 4.7. + * + * This file is based heavily on gcc_3_4.c file. + * + * For a better understanding, refer to gcc source: + * gcc/gcov-io.h + * libgcc/libgcov.c + * + * Uses gcc-internal data definitions. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + + +#if (__GNUC__ >= 7) +#define GCOV_COUNTERS 9 +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) +#define GCOV_COUNTERS 10 +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +#define GCOV_COUNTERS 9 +#else +#define GCOV_COUNTERS 8 +#endif + +#define GCOV_TAG_FUNCTION_LENGTH 3 + +static struct gcov_info *gcov_info_head; + +/** + * struct gcov_ctr_info - information about counters for a single function + * @num: number of counter values for this type + * @values: array of counter values for this type + * + * This data is generated by gcc during compilation and doesn't change + * at run-time with the exception of the values array. + */ +struct gcov_ctr_info { + unsigned int num; + gcov_type *values; +}; + +/** + * struct gcov_fn_info - profiling meta data per function + * @key: comdat key + * @ident: unique ident of function + * @lineno_checksum: function lineo_checksum + * @cfg_checksum: function cfg checksum + * @ctrs: instrumented counters + * + * This data is generated by gcc during compilation and doesn't change + * at run-time. + * + * Information about a single function. This uses the trailing array + * idiom. The number of counters is determined from the merge pointer + * array in gcov_info. The key is used to detect which of a set of + * comdat functions was selected -- it points to the gcov_info object + * of the object file containing the selected comdat function. + */ +struct gcov_fn_info { + const struct gcov_info *key; + unsigned int ident; + unsigned int lineno_checksum; + unsigned int cfg_checksum; + struct gcov_ctr_info ctrs[0]; +}; + +/** + * struct gcov_info - profiling data per object file + * @version: gcov version magic indicating the gcc version used for compilation + * @next: list head for a singly-linked list + * @stamp: uniquifying time stamp + * @filename: name of the associated gcov data file + * @merge: merge functions (null for unused counter type) + * @n_functions: number of instrumented functions + * @functions: pointer to pointers to function information + * + * This data is generated by gcc during compilation and doesn't change + * at run-time with the exception of the next pointer. + */ +struct gcov_info { + unsigned int version; + struct gcov_info *next; + unsigned int stamp; + const char *filename; + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); + unsigned int n_functions; + struct gcov_fn_info **functions; +}; + +/** + * gcov_info_filename - return info filename + * @info: profiling data set + */ +const char * +gcov_info_filename(struct gcov_info *info) +{ + return (info->filename); +} + +/** + * gcov_info_version - return info version + * @info: profiling data set + */ +unsigned int +gcov_info_version(struct gcov_info *info) +{ + return (info->version); +} + +/** + * gcov_info_next - return next profiling data set + * @info: profiling data set + * + * Returns next gcov_info following @info or first gcov_info in the chain if + * @info is %NULL. + */ +struct gcov_info * +gcov_info_next(struct gcov_info *info) +{ + if (!info) + return gcov_info_head; + + return (info->next); +} + +/** + * gcov_info_link - link/add profiling data set to the list + * @info: profiling data set + */ +void +gcov_info_link(struct gcov_info *info) +{ + info->next = gcov_info_head; + gcov_info_head = info; +} + +/** + * gcov_info_unlink - unlink/remove profiling data set from the list + * @prev: previous profiling data set + * @info: profiling data set + */ +void +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) +{ + if (prev) + prev->next = info->next; + else + gcov_info_head = info->next; +} + +/* Symbolic links to be created for each profiling data file. */ +const struct gcov_link gcov_link[] = { + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ + { 0, NULL}, +}; + +/* + * Determine whether a counter is active. Doesn't change at run-time. + */ +static int +counter_active(struct gcov_info *info, unsigned int type) +{ + return (info->merge[type] ? 1 : 0); +} + +/* Determine number of active counters. Based on gcc magic. */ +static unsigned int +num_counter_active(struct gcov_info *info) +{ + unsigned int i; + unsigned int result = 0; + + for (i = 0; i < GCOV_COUNTERS; i++) { + if (counter_active(info, i)) + result++; + } + return (result); +} + +/** + * gcov_info_reset - reset profiling data to zero + * @info: profiling data set + */ +void +gcov_info_reset(struct gcov_info *info) +{ + struct gcov_ctr_info *ci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + ci_ptr = info->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(info, ct_idx)) + continue; + + memset(ci_ptr->values, 0, + sizeof(gcov_type) * ci_ptr->num); + ci_ptr++; + } + } +} + +/** + * gcov_info_is_compatible - check if profiling data can be added + * @info1: first profiling data set + * @info2: second profiling data set + * + * Returns non-zero if profiling data can be added, zero otherwise. + */ +int +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) +{ + return (info1->stamp == info2->stamp); +} + +/** + * gcov_info_add - add up profiling data + * @dest: profiling data set to which data is added + * @source: profiling data set which is added + * + * Adds profiling counts of @source to @dest. + */ +void +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) +{ + struct gcov_ctr_info *dci_ptr; + struct gcov_ctr_info *sci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + unsigned int val_idx; + + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { + dci_ptr = dst->functions[fi_idx]->ctrs; + sci_ptr = src->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(src, ct_idx)) + continue; + + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) + dci_ptr->values[val_idx] += + sci_ptr->values[val_idx]; + + dci_ptr++; + sci_ptr++; + } + } +} + +/** + * gcov_info_dup - duplicate profiling data set + * @info: profiling data set to duplicate + * + * Return newly allocated duplicate on success, %NULL on error. + */ +struct gcov_info * +gcov_info_dup(struct gcov_info *info) +{ + struct gcov_info *dup; + struct gcov_ctr_info *dci_ptr; /* dst counter info */ + struct gcov_ctr_info *sci_ptr; /* src counter info */ + unsigned int active; + unsigned int fi_idx; /* function info idx */ + unsigned int ct_idx; /* counter type idx */ + size_t fi_size; /* function info size */ + size_t cv_size; /* counter values size */ + + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) + return (NULL); + memcpy(dup, info, sizeof(*dup)); + + dup->next = NULL; + dup->filename = NULL; + dup->functions = NULL; + + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); + if (dup->filename == NULL) + goto err_free; + + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); + if (dup->functions == NULL) + goto err_free; + active = num_counter_active(info); + fi_size = sizeof(struct gcov_fn_info); + fi_size += sizeof(struct gcov_ctr_info) * active; + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); + if (!dup->functions[fi_idx]) + goto err_free; + + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); + + sci_ptr = info->functions[fi_idx]->ctrs; + dci_ptr = dup->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < active; ct_idx++) { + + cv_size = sizeof(gcov_type) * sci_ptr->num; + + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); + + if (!dci_ptr->values) + goto err_free; + + dci_ptr->num = sci_ptr->num; + memcpy(dci_ptr->values, sci_ptr->values, cv_size); + + sci_ptr++; + dci_ptr++; + } + } + + return (dup); +err_free: + gcov_info_free(dup); + return (NULL); +} + +/** + * gcov_info_free - release memory for profiling data set duplicate + * @info: profiling data set duplicate to free + */ +void +gcov_info_free(struct gcov_info *info) +{ + unsigned int active; + unsigned int fi_idx; + unsigned int ct_idx; + struct gcov_ctr_info *ci_ptr; + + if (!info->functions) + goto free_info; + + active = num_counter_active(info); + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + if (!info->functions[fi_idx]) + continue; + + ci_ptr = info->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) + free(ci_ptr->values, M_GCOV); + + free(info->functions[fi_idx], M_GCOV); + } + +free_info: + free(info->functions, M_GCOV); + free(__DECONST(char *, info->filename), M_GCOV); + free(info, M_GCOV); + } + +#define ITER_STRIDE PAGE_SIZE + +/** + * struct gcov_iterator - specifies current file position in logical records + * @info: associated profiling data + * @buffer: buffer containing file data + * @size: size of buffer + * @pos: current position in file + */ +struct gcov_iterator { + struct gcov_info *info; + caddr_t buffer; + size_t size; + off_t pos; +}; + +/** + * store_gcov_uint32 - store 32 bit number in gcov format to buffer + * @buffer: target buffer or NULL + * @off: offset into the buffer + * @v: value to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't + * store anything. + */ +static size_t +store_gcov_uint32(void *buffer, size_t off, uint32_t v) +{ + uint32_t *data; + + if (buffer) { + data = (void*)((caddr_t)buffer + off); + *data = v; + } + + return sizeof(*data); +} + +/** + * store_gcov_uint64 - store 64 bit number in gcov format to buffer + * @buffer: target buffer or NULL + * @off: offset into the buffer + * @v: value to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. 64 bit numbers are stored as two 32 bit numbers, the low part + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store + * anything. + */ + +static size_t +store_gcov_uint64(void *buffer, size_t off, uint64_t v) +{ + uint32_t *data; + + if (buffer) { + data = (void*)((caddr_t)buffer + off); + + data[0] = (v & 0xffffffffUL); + data[1] = (v >> 32); + } + + return sizeof(*data) * 2; +} + +/** + * convert_to_gcda - convert profiling data set to gcda file format + * @buffer: the buffer to store file data or %NULL if no data should be stored + * @info: profiling data set to be converted + * + * Returns the number of bytes that were/would have been stored into the buffer. + */ +static size_t +convert_to_gcda(char *buffer, struct gcov_info *info) +{ + struct gcov_fn_info *fi_ptr; + struct gcov_ctr_info *ci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + unsigned int cv_idx; + size_t pos = 0; + + /* File header. */ + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); + pos += store_gcov_uint32(buffer, pos, info->version); + pos += store_gcov_uint32(buffer, pos, info->stamp); + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + fi_ptr = info->functions[fi_idx]; + + /* Function record. */ + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); + + ci_ptr = fi_ptr->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(info, ct_idx)) + continue; + + /* Counter record. */ + pos += store_gcov_uint32(buffer, pos, + GCOV_TAG_FOR_COUNTER(ct_idx)); + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); + + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { + pos += store_gcov_uint64(buffer, pos, + ci_ptr->values[cv_idx]); + } + + ci_ptr++; + } + } + + return (pos); +} + +/** + * gcov_iter_new - allocate and initialize profiling data iterator + * @info: profiling data set to be iterated + * + * Return file iterator on success, %NULL otherwise. + */ +struct gcov_iterator * +gcov_iter_new(struct gcov_info *info) +{ + struct gcov_iterator *iter; + + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); + if (iter == NULL) + goto err_free; + + iter->info = info; + /* Dry-run to get the actual buffer size. */ + iter->size = convert_to_gcda(NULL, info); + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); + if (!iter->buffer) + goto err_free; + + convert_to_gcda(iter->buffer, info); + + return iter; + +err_free: + free(iter, M_GCOV); + return (NULL); +} + + +/** + * gcov_iter_get_info - return profiling data set for given file iterator + * @iter: file iterator + */ +void +gcov_iter_free(struct gcov_iterator *iter) +{ + free(iter->buffer, M_GCOV); + free(iter, M_GCOV); +} + +/** + * gcov_iter_get_info - return profiling data set for given file iterator + * @iter: file iterator + */ +struct gcov_info * +gcov_iter_get_info(struct gcov_iterator *iter) +{ + return (iter->info); +} + +/** + * gcov_iter_start - reset file iterator to starting position + * @iter: file iterator + */ +void +gcov_iter_start(struct gcov_iterator *iter) +{ + iter->pos = 0; +} + +/** + * gcov_iter_next - advance file iterator to next logical record + * @iter: file iterator + * + * Return zero if new position is valid, non-zero if iterator has reached end. + */ +int +gcov_iter_next(struct gcov_iterator *iter) +{ + if (iter->pos < iter->size) + iter->pos += ITER_STRIDE; + + if (iter->pos >= iter->size) + return (EINVAL); + + return 0; +} + +/** + * gcov_iter_write - write data for current pos to seq_file + * @iter: file iterator + * @seq: seq_file handle + * + * Return zero on success, non-zero otherwise. + */ +int +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) +{ + size_t len; + + if (iter->pos >= iter->size) + return (EINVAL); + + len = ITER_STRIDE; + if (iter->pos + len > iter->size) + len = iter->size - iter->pos; + + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); + + return (0); +} Added: head/sys/gnu/gcov/gcov.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019, Matthew Macy + * + * 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 _SYS_GCOV_H_ +#define _SYS_GCOV_H_ + +MALLOC_DECLARE(M_GCOV); + +/* + * Profiling data types used for gcc 3.4 and above - these are defined by + * gcc and need to be kept as close to the original definition as possible to + * remain compatible. + */ +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) +#define GCOV_TAG_FOR_COUNTER(count) \ + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) + +typedef uint64_t gcov_type; + +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so + * we cannot use full definition here and they need to be placed in gcc specific + * implementation of gcov. This also means no direct access to the members in + * generic code and usage of the interface below.*/ +struct gcov_info; + +/* Interface to access gcov_info data */ +const char *gcov_info_filename(struct gcov_info *info); +unsigned int gcov_info_version(struct gcov_info *info); +struct gcov_info *gcov_info_next(struct gcov_info *info); +void gcov_info_link(struct gcov_info *info); +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); + +/* Base interface. */ +enum gcov_action { + GCOV_ADD, + GCOV_REMOVE, +}; + +/* Iterator control. */ +struct gcov_iterator; + +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); +void gcov_iter_free(struct gcov_iterator *iter); +void gcov_iter_start(struct gcov_iterator *iter); +int gcov_iter_next(struct gcov_iterator *iter); +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); + +/* gcov_info control. */ +void gcov_info_reset(struct gcov_info *info); +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); +struct gcov_info *gcov_info_dup(struct gcov_info *info); +void gcov_info_free(struct gcov_info *info); +void gcov_stats_reset(void); +void gcov_enable_events(void); +void gcov_module_unload(void *, module_t); +void gcov_fs_init(void); + +int within_module(vm_offset_t addr, module_t mod); + +struct gcov_link { + enum { + OBJ_TREE, + SRC_TREE, + } dir; + const char *ext; +}; +extern const struct gcov_link gcov_link[]; +#endif Added: head/sys/gnu/gcov/gcov_fs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,945 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This code exports profiling data as debugfs files to userspace. + * + * Copyright IBM Corp. 2009 + * Author(s): Peter Oberparleiter + * + * Uses gcc-internal data definitions. + * Based on the gcov-kernel patch by: + * Hubertus Franke + * Nigel Hinds + * Rajan Ravindran + * Peter Oberparleiter + * Paul Larson + * Yi CDL Yang + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +extern int gcov_events_enabled; +static int gcov_persist; +static struct mtx gcov_mtx; +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); + +void __gcov_init(struct gcov_info *info); +void __gcov_flush(void); +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); +void __gcov_exit(void); + +static void gcov_event(enum gcov_action action, struct gcov_info *info); + + +/* + * Private copy taken from libc + */ +static char * +(basename)(char *path) +{ + char *ptr; + + /* + * If path is a null pointer or points to an empty string, + * basename() shall return a pointer to the string ".". + */ + if (path == NULL || *path == '\0') + return (__DECONST(char *, ".")); + + /* Find end of last pathname component and null terminate it. */ + ptr = path + strlen(path); + while (ptr > path + 1 && *(ptr - 1) == '/') + --ptr; + *ptr-- = '\0'; + + /* Find beginning of last pathname component. */ + while (ptr > path && *(ptr - 1) != '/') + --ptr; + return (ptr); +} + +/* + * __gcov_init is called by gcc-generated constructor code for each object + * file compiled with -fprofile-arcs. + */ +void +__gcov_init(struct gcov_info *info) +{ + static unsigned int gcov_version; + + mtx_lock(&gcov_mtx); + if (gcov_version == 0) { + gcov_version = gcov_info_version(info); + /* + * Printing gcc's version magic may prove useful for debugging + * incompatibility reports. + */ + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); + } + /* + * Add new profiling data structure to list and inform event + * listener. + */ + gcov_info_link(info); + if (gcov_events_enabled) + gcov_event(GCOV_ADD, info); + mtx_unlock(&gcov_mtx); +} + +/* + * These functions may be referenced by gcc-generated profiling code but serve + * no function for kernel profiling. + */ +void +__gcov_flush(void) +{ + /* Unused. */ +} + +void +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_exit(void) +{ + /* Unused. */ +} + + +/** + * struct gcov_node - represents a debugfs entry + * @entry: list entry for parent's child node list + * @children: child nodes + * @all_entry: list entry for list of all nodes + * @parent: parent node + * @loaded_info: array of pointers to profiling data sets for loaded object + * files. + * @num_loaded: number of profiling data sets for loaded object files. + * @unloaded_info: accumulated copy of profiling data sets for unloaded + * object files. Used only when gcov_persist=1. + * @dentry: main debugfs entry, either a directory or data file + * @links: associated symbolic links + * @name: data file basename + * + * struct gcov_node represents an entity within the gcov/ subdirectory + * of debugfs. There are directory and data file nodes. The latter represent + * the actual synthesized data file plus any associated symbolic links which + * are needed by the gcov tool to work correctly. + */ +struct gcov_node { + LIST_ENTRY(gcov_node) children_entry; + LIST_ENTRY(gcov_node) all_entry; + struct { + struct gcov_node *lh_first; + } children; + struct gcov_node *parent; + struct gcov_info **loaded_info; + struct gcov_info *unloaded_info; + struct dentry *dentry; + struct dentry **links; + int num_loaded; + char name[0]; +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Feb 23 21:50:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACF61506706; Sat, 23 Feb 2019 21:50:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 E987970D67; Sat, 23 Feb 2019 21:49:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1NLnuLd032112; Sat, 23 Feb 2019 13:49:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1NLnute032111; Sat, 23 Feb 2019 13:49:56 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902232149.x1NLnute032111@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <201902232114.x1NLE0cH085345@repo.freebsd.org> To: Matt Macy Date: Sat, 23 Feb 2019 13:49:56 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: E987970D67 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 21:50:01 -0000 > Author: mmacy > Date: Sat Feb 23 21:14:00 2019 > New Revision: 344487 > URL: https://svnweb.freebsd.org/changeset/base/344487 > > Log: > gcov support > > add gcov support and export results as files in debugfs > > Reviewed by: hps@ > MFC after: 1 week > Sponsored by: iX Systems > Differential Revision: https://reviews.freebsd.org/D19260 > > Added: > head/sys/gnu/gcov/ > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > head/sys/gnu/gcov/gcov.h (contents, props changed) > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/conf/options > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 > fs/cd9660/cd9660_vfsops.c optional cd9660 > fs/cd9660/cd9660_vnops.c optional cd9660 > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > +gnu/gcov/gcc_4_7.c optional gcov > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > + compile-with "${LINUXKPI_C}" > +gnu/gcov/gcov_subr.c optional gcov > + > kern/bus_if.m standard > kern/clock_if.m standard > kern/cpufreq_if.m standard > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp > compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ > compile-with "${LINUXKPI_C}" > compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ > + compile-with "${LINUXKPI_C}" > + > +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ > + compile-with "${LINUXKPI_C}" > + > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > compile-with "${LINUXKPI_C}" > > # OpenFabrics Enterprise Distribution (Infiniband) > > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ > -Wno-error=maybe-uninitialized \ > -Wno-error=overflow \ > -Wno-error=sequence-point \ > - -Wno-error=unused-but-set-variable > + -Wno-unused-but-set-variable > .if ${COMPILER_VERSION} >= 60100 > CWARNEXTRA+= -Wno-error=misleading-indentation \ > -Wno-error=nonnull-compare \ > > Modified: head/sys/conf/kern.post.mk > ============================================================================== > --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > .endif > > +.if defined(GCOV_CFLAGS) > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > +.endif > + > # Allow overriding the kernel debug directory, so kernel and user debug may be > # installed in different directories. Setting it to "" restores the historical > # behavior of installing debug files in the kernel directory. > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > CFLAGS+= ${SAN_CFLAGS} > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > +.if !empty(GCOV_ENABLED) > +.if ${COMPILER_TYPE} == "gcc" > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > +.endif > +.endif > + > +CFLAGS+= ${GCOV_CFLAGS} > + > # Put configuration-specific C flags last (except for ${PROF}) so that they > # can override the others. > CFLAGS+= ${CONF_CFLAGS} > > Modified: head/sys/conf/kmod.mk > ============================================================================== > --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -380,6 +380,9 @@ ${_src}: > # Add the sanitizer C flags > CFLAGS+= ${SAN_CFLAGS} > > +# Add the gcov flags > +CFLAGS+= ${GCOV_CFLAGS} > + > # Respect configuration-specific C flags. > CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} > > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) > @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h > > # amdsbwd options > AMDSBWD_DEBUG opt_amdsbwd.h > + > +# gcov support > +GCOV opt_global.h > +LINDEBUGFS > > Added: head/sys/gnu/gcov/gcc_4_7.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,597 @@ > +// SPDX-License-Identifier: GPL-2.0 The open item on the SPDX only use needs to be dealt with on a repository of local tag to file location, etc. I still feel very uncorftable with most of that, especially given the GPL 2 itsel clearly says to place "this body of text" in your file. I do not know that you can modify that aspect of it and have it still be called gpl 2.0. > +/* > + * This code provides functions to handle gcc's profiling data format > + * introduced with gcc 4.7. > + * > + * This file is based heavily on gcc_3_4.c file. > + * > + * For a better understanding, refer to gcc source: > + * gcc/gcov-io.h > + * libgcc/libgcov.c > + * > + * Uses gcc-internal data definitions. > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +#if (__GNUC__ >= 7) > +#define GCOV_COUNTERS 9 > +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) > +#define GCOV_COUNTERS 10 > +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 > +#define GCOV_COUNTERS 9 > +#else > +#define GCOV_COUNTERS 8 > +#endif > + > +#define GCOV_TAG_FUNCTION_LENGTH 3 > + > +static struct gcov_info *gcov_info_head; > + > +/** > + * struct gcov_ctr_info - information about counters for a single function > + * @num: number of counter values for this type > + * @values: array of counter values for this type > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time with the exception of the values array. > + */ > +struct gcov_ctr_info { > + unsigned int num; > + gcov_type *values; > +}; > + > +/** > + * struct gcov_fn_info - profiling meta data per function > + * @key: comdat key > + * @ident: unique ident of function > + * @lineno_checksum: function lineo_checksum > + * @cfg_checksum: function cfg checksum > + * @ctrs: instrumented counters > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time. > + * > + * Information about a single function. This uses the trailing array > + * idiom. The number of counters is determined from the merge pointer > + * array in gcov_info. The key is used to detect which of a set of > + * comdat functions was selected -- it points to the gcov_info object > + * of the object file containing the selected comdat function. > + */ > +struct gcov_fn_info { > + const struct gcov_info *key; > + unsigned int ident; > + unsigned int lineno_checksum; > + unsigned int cfg_checksum; > + struct gcov_ctr_info ctrs[0]; > +}; > + > +/** > + * struct gcov_info - profiling data per object file > + * @version: gcov version magic indicating the gcc version used for compilation > + * @next: list head for a singly-linked list > + * @stamp: uniquifying time stamp > + * @filename: name of the associated gcov data file > + * @merge: merge functions (null for unused counter type) > + * @n_functions: number of instrumented functions > + * @functions: pointer to pointers to function information > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time with the exception of the next pointer. > + */ > +struct gcov_info { > + unsigned int version; > + struct gcov_info *next; > + unsigned int stamp; > + const char *filename; > + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); > + unsigned int n_functions; > + struct gcov_fn_info **functions; > +}; > + > +/** > + * gcov_info_filename - return info filename > + * @info: profiling data set > + */ > +const char * > +gcov_info_filename(struct gcov_info *info) > +{ > + return (info->filename); > +} > + > +/** > + * gcov_info_version - return info version > + * @info: profiling data set > + */ > +unsigned int > +gcov_info_version(struct gcov_info *info) > +{ > + return (info->version); > +} > + > +/** > + * gcov_info_next - return next profiling data set > + * @info: profiling data set > + * > + * Returns next gcov_info following @info or first gcov_info in the chain if > + * @info is %NULL. > + */ > +struct gcov_info * > +gcov_info_next(struct gcov_info *info) > +{ > + if (!info) > + return gcov_info_head; > + > + return (info->next); > +} > + > +/** > + * gcov_info_link - link/add profiling data set to the list > + * @info: profiling data set > + */ > +void > +gcov_info_link(struct gcov_info *info) > +{ > + info->next = gcov_info_head; > + gcov_info_head = info; > +} > + > +/** > + * gcov_info_unlink - unlink/remove profiling data set from the list > + * @prev: previous profiling data set > + * @info: profiling data set > + */ > +void > +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) > +{ > + if (prev) > + prev->next = info->next; > + else > + gcov_info_head = info->next; > +} > + > +/* Symbolic links to be created for each profiling data file. */ > +const struct gcov_link gcov_link[] = { > + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ > + { 0, NULL}, > +}; > + > +/* > + * Determine whether a counter is active. Doesn't change at run-time. > + */ > +static int > +counter_active(struct gcov_info *info, unsigned int type) > +{ > + return (info->merge[type] ? 1 : 0); > +} > + > +/* Determine number of active counters. Based on gcc magic. */ > +static unsigned int > +num_counter_active(struct gcov_info *info) > +{ > + unsigned int i; > + unsigned int result = 0; > + > + for (i = 0; i < GCOV_COUNTERS; i++) { > + if (counter_active(info, i)) > + result++; > + } > + return (result); > +} > + > +/** > + * gcov_info_reset - reset profiling data to zero > + * @info: profiling data set > + */ > +void > +gcov_info_reset(struct gcov_info *info) > +{ > + struct gcov_ctr_info *ci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + ci_ptr = info->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(info, ct_idx)) > + continue; > + > + memset(ci_ptr->values, 0, > + sizeof(gcov_type) * ci_ptr->num); > + ci_ptr++; > + } > + } > +} > + > +/** > + * gcov_info_is_compatible - check if profiling data can be added > + * @info1: first profiling data set > + * @info2: second profiling data set > + * > + * Returns non-zero if profiling data can be added, zero otherwise. > + */ > +int > +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) > +{ > + return (info1->stamp == info2->stamp); > +} > + > +/** > + * gcov_info_add - add up profiling data > + * @dest: profiling data set to which data is added > + * @source: profiling data set which is added > + * > + * Adds profiling counts of @source to @dest. > + */ > +void > +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) > +{ > + struct gcov_ctr_info *dci_ptr; > + struct gcov_ctr_info *sci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + unsigned int val_idx; > + > + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { > + dci_ptr = dst->functions[fi_idx]->ctrs; > + sci_ptr = src->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(src, ct_idx)) > + continue; > + > + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) > + dci_ptr->values[val_idx] += > + sci_ptr->values[val_idx]; > + > + dci_ptr++; > + sci_ptr++; > + } > + } > +} > + > +/** > + * gcov_info_dup - duplicate profiling data set > + * @info: profiling data set to duplicate > + * > + * Return newly allocated duplicate on success, %NULL on error. > + */ > +struct gcov_info * > +gcov_info_dup(struct gcov_info *info) > +{ > + struct gcov_info *dup; > + struct gcov_ctr_info *dci_ptr; /* dst counter info */ > + struct gcov_ctr_info *sci_ptr; /* src counter info */ > + unsigned int active; > + unsigned int fi_idx; /* function info idx */ > + unsigned int ct_idx; /* counter type idx */ > + size_t fi_size; /* function info size */ > + size_t cv_size; /* counter values size */ > + > + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) > + return (NULL); > + memcpy(dup, info, sizeof(*dup)); > + > + dup->next = NULL; > + dup->filename = NULL; > + dup->functions = NULL; > + > + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); > + if (dup->filename == NULL) > + goto err_free; > + > + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); > + if (dup->functions == NULL) > + goto err_free; > + active = num_counter_active(info); > + fi_size = sizeof(struct gcov_fn_info); > + fi_size += sizeof(struct gcov_ctr_info) * active; > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); > + if (!dup->functions[fi_idx]) > + goto err_free; > + > + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); > + > + sci_ptr = info->functions[fi_idx]->ctrs; > + dci_ptr = dup->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < active; ct_idx++) { > + > + cv_size = sizeof(gcov_type) * sci_ptr->num; > + > + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); > + > + if (!dci_ptr->values) > + goto err_free; > + > + dci_ptr->num = sci_ptr->num; > + memcpy(dci_ptr->values, sci_ptr->values, cv_size); > + > + sci_ptr++; > + dci_ptr++; > + } > + } > + > + return (dup); > +err_free: > + gcov_info_free(dup); > + return (NULL); > +} > + > +/** > + * gcov_info_free - release memory for profiling data set duplicate > + * @info: profiling data set duplicate to free > + */ > +void > +gcov_info_free(struct gcov_info *info) > +{ > + unsigned int active; > + unsigned int fi_idx; > + unsigned int ct_idx; > + struct gcov_ctr_info *ci_ptr; > + > + if (!info->functions) > + goto free_info; > + > + active = num_counter_active(info); > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + if (!info->functions[fi_idx]) > + continue; > + > + ci_ptr = info->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) > + free(ci_ptr->values, M_GCOV); > + > + free(info->functions[fi_idx], M_GCOV); > + } > + > +free_info: > + free(info->functions, M_GCOV); > + free(__DECONST(char *, info->filename), M_GCOV); > + free(info, M_GCOV); > + } > + > +#define ITER_STRIDE PAGE_SIZE > + > +/** > + * struct gcov_iterator - specifies current file position in logical records > + * @info: associated profiling data > + * @buffer: buffer containing file data > + * @size: size of buffer > + * @pos: current position in file > + */ > +struct gcov_iterator { > + struct gcov_info *info; > + caddr_t buffer; > + size_t size; > + off_t pos; > +}; > + > +/** > + * store_gcov_uint32 - store 32 bit number in gcov format to buffer > + * @buffer: target buffer or NULL > + * @off: offset into the buffer > + * @v: value to be stored > + * > + * Number format defined by gcc: numbers are recorded in the 32 bit > + * unsigned binary form of the endianness of the machine generating the > + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't > + * store anything. > + */ > +static size_t > +store_gcov_uint32(void *buffer, size_t off, uint32_t v) > +{ > + uint32_t *data; > + > + if (buffer) { > + data = (void*)((caddr_t)buffer + off); > + *data = v; > + } > + > + return sizeof(*data); > +} > + > +/** > + * store_gcov_uint64 - store 64 bit number in gcov format to buffer > + * @buffer: target buffer or NULL > + * @off: offset into the buffer > + * @v: value to be stored > + * > + * Number format defined by gcc: numbers are recorded in the 32 bit > + * unsigned binary form of the endianness of the machine generating the > + * file. 64 bit numbers are stored as two 32 bit numbers, the low part > + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store > + * anything. > + */ > + > +static size_t > +store_gcov_uint64(void *buffer, size_t off, uint64_t v) > +{ > + uint32_t *data; > + > + if (buffer) { > + data = (void*)((caddr_t)buffer + off); > + > + data[0] = (v & 0xffffffffUL); > + data[1] = (v >> 32); > + } > + > + return sizeof(*data) * 2; > +} > + > +/** > + * convert_to_gcda - convert profiling data set to gcda file format > + * @buffer: the buffer to store file data or %NULL if no data should be stored > + * @info: profiling data set to be converted > + * > + * Returns the number of bytes that were/would have been stored into the buffer. > + */ > +static size_t > +convert_to_gcda(char *buffer, struct gcov_info *info) > +{ > + struct gcov_fn_info *fi_ptr; > + struct gcov_ctr_info *ci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + unsigned int cv_idx; > + size_t pos = 0; > + > + /* File header. */ > + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); > + pos += store_gcov_uint32(buffer, pos, info->version); > + pos += store_gcov_uint32(buffer, pos, info->stamp); > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + fi_ptr = info->functions[fi_idx]; > + > + /* Function record. */ > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); > + > + ci_ptr = fi_ptr->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(info, ct_idx)) > + continue; > + > + /* Counter record. */ > + pos += store_gcov_uint32(buffer, pos, > + GCOV_TAG_FOR_COUNTER(ct_idx)); > + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); > + > + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { > + pos += store_gcov_uint64(buffer, pos, > + ci_ptr->values[cv_idx]); > + } > + > + ci_ptr++; > + } > + } > + > + return (pos); > +} > + > +/** > + * gcov_iter_new - allocate and initialize profiling data iterator > + * @info: profiling data set to be iterated > + * > + * Return file iterator on success, %NULL otherwise. > + */ > +struct gcov_iterator * > +gcov_iter_new(struct gcov_info *info) > +{ > + struct gcov_iterator *iter; > + > + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); > + if (iter == NULL) > + goto err_free; > + > + iter->info = info; > + /* Dry-run to get the actual buffer size. */ > + iter->size = convert_to_gcda(NULL, info); > + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); > + if (!iter->buffer) > + goto err_free; > + > + convert_to_gcda(iter->buffer, info); > + > + return iter; > + > +err_free: > + free(iter, M_GCOV); > + return (NULL); > +} > + > + > +/** > + * gcov_iter_get_info - return profiling data set for given file iterator > + * @iter: file iterator > + */ > +void > +gcov_iter_free(struct gcov_iterator *iter) > +{ > + free(iter->buffer, M_GCOV); > + free(iter, M_GCOV); > +} > + > +/** > + * gcov_iter_get_info - return profiling data set for given file iterator > + * @iter: file iterator > + */ > +struct gcov_info * > +gcov_iter_get_info(struct gcov_iterator *iter) > +{ > + return (iter->info); > +} > + > +/** > + * gcov_iter_start - reset file iterator to starting position > + * @iter: file iterator > + */ > +void > +gcov_iter_start(struct gcov_iterator *iter) > +{ > + iter->pos = 0; > +} > + > +/** > + * gcov_iter_next - advance file iterator to next logical record > + * @iter: file iterator > + * > + * Return zero if new position is valid, non-zero if iterator has reached end. > + */ > +int > +gcov_iter_next(struct gcov_iterator *iter) > +{ > + if (iter->pos < iter->size) > + iter->pos += ITER_STRIDE; > + > + if (iter->pos >= iter->size) > + return (EINVAL); > + > + return 0; > +} > + > +/** > + * gcov_iter_write - write data for current pos to seq_file > + * @iter: file iterator > + * @seq: seq_file handle > + * > + * Return zero on success, non-zero otherwise. > + */ > +int > +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) > +{ > + size_t len; > + > + if (iter->pos >= iter->size) > + return (EINVAL); > + > + len = ITER_STRIDE; > + if (iter->pos + len > iter->size) > + len = iter->size - iter->pos; > + > + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); > + > + return (0); > +} > > Added: head/sys/gnu/gcov/gcov.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,99 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2019, Matthew Macy > + * > + * 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 _SYS_GCOV_H_ > +#define _SYS_GCOV_H_ > + > +MALLOC_DECLARE(M_GCOV); > + > +/* > + * Profiling data types used for gcc 3.4 and above - these are defined by > + * gcc and need to be kept as close to the original definition as possible to > + * remain compatible. > + */ > +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) > +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) > +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) > +#define GCOV_TAG_FOR_COUNTER(count) \ > + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) > + > +typedef uint64_t gcov_type; > + > +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so > + * we cannot use full definition here and they need to be placed in gcc specific > + * implementation of gcov. This also means no direct access to the members in > + * generic code and usage of the interface below.*/ > +struct gcov_info; > + > +/* Interface to access gcov_info data */ > +const char *gcov_info_filename(struct gcov_info *info); > +unsigned int gcov_info_version(struct gcov_info *info); > +struct gcov_info *gcov_info_next(struct gcov_info *info); > +void gcov_info_link(struct gcov_info *info); > +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); > + > +/* Base interface. */ > +enum gcov_action { > + GCOV_ADD, > + GCOV_REMOVE, > +}; > + > +/* Iterator control. */ > +struct gcov_iterator; > + > +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); > +void gcov_iter_free(struct gcov_iterator *iter); > +void gcov_iter_start(struct gcov_iterator *iter); > +int gcov_iter_next(struct gcov_iterator *iter); > +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); > +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); > + > +/* gcov_info control. */ > +void gcov_info_reset(struct gcov_info *info); > +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); > +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); > +struct gcov_info *gcov_info_dup(struct gcov_info *info); > +void gcov_info_free(struct gcov_info *info); > +void gcov_stats_reset(void); > +void gcov_enable_events(void); > +void gcov_module_unload(void *, module_t); > +void gcov_fs_init(void); > + > +int within_module(vm_offset_t addr, module_t mod); > + > +struct gcov_link { > + enum { > + OBJ_TREE, > + SRC_TREE, > + } dir; > + const char *ext; > +}; > +extern const struct gcov_link gcov_link[]; > +#endif > > Added: head/sys/gnu/gcov/gcov_fs.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,945 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * This code exports profiling data as debugfs files to userspace. > + * > + * Copyright IBM Corp. 2009 > + * Author(s): Peter Oberparleiter > + * > + * Uses gcc-internal data definitions. > + * Based on the gcov-kernel patch by: > + * Hubertus Franke > + * Nigel Hinds > + * Rajan Ravindran > + * Peter Oberparleiter > + * Paul Larson > + * Yi CDL Yang > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +extern int gcov_events_enabled; > +static int gcov_persist; > +static struct mtx gcov_mtx; > +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); > +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); > + > +void __gcov_init(struct gcov_info *info); > +void __gcov_flush(void); > +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); > +void __gcov_exit(void); > + > +static void gcov_event(enum gcov_action action, struct gcov_info *info); > + > + > +/* > + * Private copy taken from libc > + */ > +static char * > +(basename)(char *path) > +{ > + char *ptr; > + > + /* > + * If path is a null pointer or points to an empty string, > + * basename() shall return a pointer to the string ".". > + */ > + if (path == NULL || *path == '\0') > + return (__DECONST(char *, ".")); > + > + /* Find end of last pathname component and null terminate it. */ > + ptr = path + strlen(path); > + while (ptr > path + 1 && *(ptr - 1) == '/') > + --ptr; > + *ptr-- = '\0'; > + > + /* Find beginning of last pathname component. */ > + while (ptr > path && *(ptr - 1) != '/') > + --ptr; > + return (ptr); > +} > + > +/* > + * __gcov_init is called by gcc-generated constructor code for each object > + * file compiled with -fprofile-arcs. > + */ > +void > +__gcov_init(struct gcov_info *info) > +{ > + static unsigned int gcov_version; > + > + mtx_lock(&gcov_mtx); > + if (gcov_version == 0) { > + gcov_version = gcov_info_version(info); > + /* > + * Printing gcc's version magic may prove useful for debugging > + * incompatibility reports. > + */ > + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); > + } > + /* > + * Add new profiling data structure to list and inform event > + * listener. > + */ > + gcov_info_link(info); > + if (gcov_events_enabled) > + gcov_event(GCOV_ADD, info); > + mtx_unlock(&gcov_mtx); > +} > + > +/* > + * These functions may be referenced by gcc-generated profiling code but serve > + * no function for kernel profiling. > + */ > +void > +__gcov_flush(void) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_exit(void) > +{ > + /* Unused. */ > +} > + > + > +/** > + * struct gcov_node - represents a debugfs entry > + * @entry: list entry for parent's child node list > + * @children: child nodes > + * @all_entry: list entry for list of all nodes > + * @parent: parent node > + * @loaded_info: array of pointers to profiling data sets for loaded object > + * files. > + * @num_loaded: number of profiling data sets for loaded object files. > + * @unloaded_info: accumulated copy of profiling data sets for unloaded > + * object files. Used only when gcov_persist=1. > + * @dentry: main debugfs entry, either a directory or data file > + * @links: associated symbolic links > + * @name: data file basename > + * > + * struct gcov_node represents an entity within the gcov/ subdirectory > + * of debugfs. There are directory and data file nodes. The latter represent > + * the actual synthesized data file plus any associated symbolic links which > + * are needed by the gcov tool to work correctly. > + */ > +struct gcov_node { > + LIST_ENTRY(gcov_node) children_entry; > + LIST_ENTRY(gcov_node) all_entry; > + struct { > + struct gcov_node *lh_first; > + } children; > + struct gcov_node *parent; > + struct gcov_info **loaded_info; > + struct gcov_info *unloaded_info; > + struct dentry *dentry; > + struct dentry **links; > + int num_loaded; > + char name[0]; > +}; > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 23 21:52:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47A91506A04; Sat, 23 Feb 2019 21:52:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 F07DA711F1; Sat, 23 Feb 2019 21:52:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1NLqjLc032129; Sat, 23 Feb 2019 13:52:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1NLqjKG032128; Sat, 23 Feb 2019 13:52:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <201902232149.x1NLnute032111@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Sat, 23 Feb 2019 13:52:45 -0800 (PST) CC: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: F07DA711F1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 21:52:49 -0000 > > Author: mmacy > > Date: Sat Feb 23 21:14:00 2019 > > New Revision: 344487 > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > Log: > > gcov support > > > > add gcov support and export results as files in debugfs > > > > Reviewed by: hps@ > > MFC after: 1 week > > Sponsored by: iX Systems > > Differential Revision: https://reviews.freebsd.org/D19260 And an additional nit, we can never becomre GPL free if we continue to add GPL code to the system. > > > > Added: > > head/sys/gnu/gcov/ > > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > > head/sys/gnu/gcov/gcov.h (contents, props changed) > > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > > Modified: > > head/sys/conf/files > > head/sys/conf/kern.mk > > head/sys/conf/kern.post.mk > > head/sys/conf/kern.pre.mk > > head/sys/conf/kmod.mk > > head/sys/conf/options > > > > Modified: head/sys/conf/files > > ============================================================================== > > --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) > > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 > > fs/cd9660/cd9660_vfsops.c optional cd9660 > > fs/cd9660/cd9660_vnops.c optional cd9660 > > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > > +gnu/gcov/gcc_4_7.c optional gcov > > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > +gnu/gcov/gcov_subr.c optional gcov > > + > > kern/bus_if.m standard > > kern/clock_if.m standard > > kern/cpufreq_if.m standard > > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp > > compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ > > compile-with "${LINUXKPI_C}" > > compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > > compile-with "${LINUXKPI_C}" > > > > # OpenFabrics Enterprise Distribution (Infiniband) > > > > Modified: head/sys/conf/kern.mk > > ============================================================================== > > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ > > -Wno-error=maybe-uninitialized \ > > -Wno-error=overflow \ > > -Wno-error=sequence-point \ > > - -Wno-error=unused-but-set-variable > > + -Wno-unused-but-set-variable > > .if ${COMPILER_VERSION} >= 60100 > > CWARNEXTRA+= -Wno-error=misleading-indentation \ > > -Wno-error=nonnull-compare \ > > > > Modified: head/sys/conf/kern.post.mk > > ============================================================================== > > --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > > .endif > > > > +.if defined(GCOV_CFLAGS) > > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > > +.endif > > + > > # Allow overriding the kernel debug directory, so kernel and user debug may be > > # installed in different directories. Setting it to "" restores the historical > > # behavior of installing debug files in the kernel directory. > > > > Modified: head/sys/conf/kern.pre.mk > > ============================================================================== > > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > > > CFLAGS+= ${SAN_CFLAGS} > > > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > > +.if !empty(GCOV_ENABLED) > > +.if ${COMPILER_TYPE} == "gcc" > > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > > +.endif > > +.endif > > + > > +CFLAGS+= ${GCOV_CFLAGS} > > + > > # Put configuration-specific C flags last (except for ${PROF}) so that they > > # can override the others. > > CFLAGS+= ${CONF_CFLAGS} > > > > Modified: head/sys/conf/kmod.mk > > ============================================================================== > > --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -380,6 +380,9 @@ ${_src}: > > # Add the sanitizer C flags > > CFLAGS+= ${SAN_CFLAGS} > > > > +# Add the gcov flags > > +CFLAGS+= ${GCOV_CFLAGS} > > + > > # Respect configuration-specific C flags. > > CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} > > > > > > Modified: head/sys/conf/options > > ============================================================================== > > --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) > > @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h > > > > # amdsbwd options > > AMDSBWD_DEBUG opt_amdsbwd.h > > + > > +# gcov support > > +GCOV opt_global.h > > +LINDEBUGFS > > > > Added: head/sys/gnu/gcov/gcc_4_7.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,597 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > The open item on the SPDX only use needs to be dealt with on a repository > of local tag to file location, etc. I still feel very uncorftable with > most of that, especially given the GPL 2 itsel clearly says to place > "this body of text" in your file. I do not know that you can modify that > aspect of it and have it still be called gpl 2.0. > > > +/* > > + * This code provides functions to handle gcc's profiling data format > > + * introduced with gcc 4.7. > > + * > > + * This file is based heavily on gcc_3_4.c file. > > + * > > + * For a better understanding, refer to gcc source: > > + * gcc/gcov-io.h > > + * libgcc/libgcov.c > > + * > > + * Uses gcc-internal data definitions. > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > + > > +#if (__GNUC__ >= 7) > > +#define GCOV_COUNTERS 9 > > +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) > > +#define GCOV_COUNTERS 10 > > +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 > > +#define GCOV_COUNTERS 9 > > +#else > > +#define GCOV_COUNTERS 8 > > +#endif > > + > > +#define GCOV_TAG_FUNCTION_LENGTH 3 > > + > > +static struct gcov_info *gcov_info_head; > > + > > +/** > > + * struct gcov_ctr_info - information about counters for a single function > > + * @num: number of counter values for this type > > + * @values: array of counter values for this type > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time with the exception of the values array. > > + */ > > +struct gcov_ctr_info { > > + unsigned int num; > > + gcov_type *values; > > +}; > > + > > +/** > > + * struct gcov_fn_info - profiling meta data per function > > + * @key: comdat key > > + * @ident: unique ident of function > > + * @lineno_checksum: function lineo_checksum > > + * @cfg_checksum: function cfg checksum > > + * @ctrs: instrumented counters > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time. > > + * > > + * Information about a single function. This uses the trailing array > > + * idiom. The number of counters is determined from the merge pointer > > + * array in gcov_info. The key is used to detect which of a set of > > + * comdat functions was selected -- it points to the gcov_info object > > + * of the object file containing the selected comdat function. > > + */ > > +struct gcov_fn_info { > > + const struct gcov_info *key; > > + unsigned int ident; > > + unsigned int lineno_checksum; > > + unsigned int cfg_checksum; > > + struct gcov_ctr_info ctrs[0]; > > +}; > > + > > +/** > > + * struct gcov_info - profiling data per object file > > + * @version: gcov version magic indicating the gcc version used for compilation > > + * @next: list head for a singly-linked list > > + * @stamp: uniquifying time stamp > > + * @filename: name of the associated gcov data file > > + * @merge: merge functions (null for unused counter type) > > + * @n_functions: number of instrumented functions > > + * @functions: pointer to pointers to function information > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time with the exception of the next pointer. > > + */ > > +struct gcov_info { > > + unsigned int version; > > + struct gcov_info *next; > > + unsigned int stamp; > > + const char *filename; > > + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); > > + unsigned int n_functions; > > + struct gcov_fn_info **functions; > > +}; > > + > > +/** > > + * gcov_info_filename - return info filename > > + * @info: profiling data set > > + */ > > +const char * > > +gcov_info_filename(struct gcov_info *info) > > +{ > > + return (info->filename); > > +} > > + > > +/** > > + * gcov_info_version - return info version > > + * @info: profiling data set > > + */ > > +unsigned int > > +gcov_info_version(struct gcov_info *info) > > +{ > > + return (info->version); > > +} > > + > > +/** > > + * gcov_info_next - return next profiling data set > > + * @info: profiling data set > > + * > > + * Returns next gcov_info following @info or first gcov_info in the chain if > > + * @info is %NULL. > > + */ > > +struct gcov_info * > > +gcov_info_next(struct gcov_info *info) > > +{ > > + if (!info) > > + return gcov_info_head; > > + > > + return (info->next); > > +} > > + > > +/** > > + * gcov_info_link - link/add profiling data set to the list > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_link(struct gcov_info *info) > > +{ > > + info->next = gcov_info_head; > > + gcov_info_head = info; > > +} > > + > > +/** > > + * gcov_info_unlink - unlink/remove profiling data set from the list > > + * @prev: previous profiling data set > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) > > +{ > > + if (prev) > > + prev->next = info->next; > > + else > > + gcov_info_head = info->next; > > +} > > + > > +/* Symbolic links to be created for each profiling data file. */ > > +const struct gcov_link gcov_link[] = { > > + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ > > + { 0, NULL}, > > +}; > > + > > +/* > > + * Determine whether a counter is active. Doesn't change at run-time. > > + */ > > +static int > > +counter_active(struct gcov_info *info, unsigned int type) > > +{ > > + return (info->merge[type] ? 1 : 0); > > +} > > + > > +/* Determine number of active counters. Based on gcc magic. */ > > +static unsigned int > > +num_counter_active(struct gcov_info *info) > > +{ > > + unsigned int i; > > + unsigned int result = 0; > > + > > + for (i = 0; i < GCOV_COUNTERS; i++) { > > + if (counter_active(info, i)) > > + result++; > > + } > > + return (result); > > +} > > + > > +/** > > + * gcov_info_reset - reset profiling data to zero > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_reset(struct gcov_info *info) > > +{ > > + struct gcov_ctr_info *ci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + ci_ptr = info->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(info, ct_idx)) > > + continue; > > + > > + memset(ci_ptr->values, 0, > > + sizeof(gcov_type) * ci_ptr->num); > > + ci_ptr++; > > + } > > + } > > +} > > + > > +/** > > + * gcov_info_is_compatible - check if profiling data can be added > > + * @info1: first profiling data set > > + * @info2: second profiling data set > > + * > > + * Returns non-zero if profiling data can be added, zero otherwise. > > + */ > > +int > > +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) > > +{ > > + return (info1->stamp == info2->stamp); > > +} > > + > > +/** > > + * gcov_info_add - add up profiling data > > + * @dest: profiling data set to which data is added > > + * @source: profiling data set which is added > > + * > > + * Adds profiling counts of @source to @dest. > > + */ > > +void > > +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) > > +{ > > + struct gcov_ctr_info *dci_ptr; > > + struct gcov_ctr_info *sci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + unsigned int val_idx; > > + > > + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { > > + dci_ptr = dst->functions[fi_idx]->ctrs; > > + sci_ptr = src->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(src, ct_idx)) > > + continue; > > + > > + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) > > + dci_ptr->values[val_idx] += > > + sci_ptr->values[val_idx]; > > + > > + dci_ptr++; > > + sci_ptr++; > > + } > > + } > > +} > > + > > +/** > > + * gcov_info_dup - duplicate profiling data set > > + * @info: profiling data set to duplicate > > + * > > + * Return newly allocated duplicate on success, %NULL on error. > > + */ > > +struct gcov_info * > > +gcov_info_dup(struct gcov_info *info) > > +{ > > + struct gcov_info *dup; > > + struct gcov_ctr_info *dci_ptr; /* dst counter info */ > > + struct gcov_ctr_info *sci_ptr; /* src counter info */ > > + unsigned int active; > > + unsigned int fi_idx; /* function info idx */ > > + unsigned int ct_idx; /* counter type idx */ > > + size_t fi_size; /* function info size */ > > + size_t cv_size; /* counter values size */ > > + > > + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) > > + return (NULL); > > + memcpy(dup, info, sizeof(*dup)); > > + > > + dup->next = NULL; > > + dup->filename = NULL; > > + dup->functions = NULL; > > + > > + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); > > + if (dup->filename == NULL) > > + goto err_free; > > + > > + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); > > + if (dup->functions == NULL) > > + goto err_free; > > + active = num_counter_active(info); > > + fi_size = sizeof(struct gcov_fn_info); > > + fi_size += sizeof(struct gcov_ctr_info) * active; > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); > > + if (!dup->functions[fi_idx]) > > + goto err_free; > > + > > + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); > > + > > + sci_ptr = info->functions[fi_idx]->ctrs; > > + dci_ptr = dup->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < active; ct_idx++) { > > + > > + cv_size = sizeof(gcov_type) * sci_ptr->num; > > + > > + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); > > + > > + if (!dci_ptr->values) > > + goto err_free; > > + > > + dci_ptr->num = sci_ptr->num; > > + memcpy(dci_ptr->values, sci_ptr->values, cv_size); > > + > > + sci_ptr++; > > + dci_ptr++; > > + } > > + } > > + > > + return (dup); > > +err_free: > > + gcov_info_free(dup); > > + return (NULL); > > +} > > + > > +/** > > + * gcov_info_free - release memory for profiling data set duplicate > > + * @info: profiling data set duplicate to free > > + */ > > +void > > +gcov_info_free(struct gcov_info *info) > > +{ > > + unsigned int active; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + struct gcov_ctr_info *ci_ptr; > > + > > + if (!info->functions) > > + goto free_info; > > + > > + active = num_counter_active(info); > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + if (!info->functions[fi_idx]) > > + continue; > > + > > + ci_ptr = info->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) > > + free(ci_ptr->values, M_GCOV); > > + > > + free(info->functions[fi_idx], M_GCOV); > > + } > > + > > +free_info: > > + free(info->functions, M_GCOV); > > + free(__DECONST(char *, info->filename), M_GCOV); > > + free(info, M_GCOV); > > + } > > + > > +#define ITER_STRIDE PAGE_SIZE > > + > > +/** > > + * struct gcov_iterator - specifies current file position in logical records > > + * @info: associated profiling data > > + * @buffer: buffer containing file data > > + * @size: size of buffer > > + * @pos: current position in file > > + */ > > +struct gcov_iterator { > > + struct gcov_info *info; > > + caddr_t buffer; > > + size_t size; > > + off_t pos; > > +}; > > + > > +/** > > + * store_gcov_uint32 - store 32 bit number in gcov format to buffer > > + * @buffer: target buffer or NULL > > + * @off: offset into the buffer > > + * @v: value to be stored > > + * > > + * Number format defined by gcc: numbers are recorded in the 32 bit > > + * unsigned binary form of the endianness of the machine generating the > > + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't > > + * store anything. > > + */ > > +static size_t > > +store_gcov_uint32(void *buffer, size_t off, uint32_t v) > > +{ > > + uint32_t *data; > > + > > + if (buffer) { > > + data = (void*)((caddr_t)buffer + off); > > + *data = v; > > + } > > + > > + return sizeof(*data); > > +} > > + > > +/** > > + * store_gcov_uint64 - store 64 bit number in gcov format to buffer > > + * @buffer: target buffer or NULL > > + * @off: offset into the buffer > > + * @v: value to be stored > > + * > > + * Number format defined by gcc: numbers are recorded in the 32 bit > > + * unsigned binary form of the endianness of the machine generating the > > + * file. 64 bit numbers are stored as two 32 bit numbers, the low part > > + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store > > + * anything. > > + */ > > + > > +static size_t > > +store_gcov_uint64(void *buffer, size_t off, uint64_t v) > > +{ > > + uint32_t *data; > > + > > + if (buffer) { > > + data = (void*)((caddr_t)buffer + off); > > + > > + data[0] = (v & 0xffffffffUL); > > + data[1] = (v >> 32); > > + } > > + > > + return sizeof(*data) * 2; > > +} > > + > > +/** > > + * convert_to_gcda - convert profiling data set to gcda file format > > + * @buffer: the buffer to store file data or %NULL if no data should be stored > > + * @info: profiling data set to be converted > > + * > > + * Returns the number of bytes that were/would have been stored into the buffer. > > + */ > > +static size_t > > +convert_to_gcda(char *buffer, struct gcov_info *info) > > +{ > > + struct gcov_fn_info *fi_ptr; > > + struct gcov_ctr_info *ci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + unsigned int cv_idx; > > + size_t pos = 0; > > + > > + /* File header. */ > > + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); > > + pos += store_gcov_uint32(buffer, pos, info->version); > > + pos += store_gcov_uint32(buffer, pos, info->stamp); > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + fi_ptr = info->functions[fi_idx]; > > + > > + /* Function record. */ > > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); > > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); > > + > > + ci_ptr = fi_ptr->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(info, ct_idx)) > > + continue; > > + > > + /* Counter record. */ > > + pos += store_gcov_uint32(buffer, pos, > > + GCOV_TAG_FOR_COUNTER(ct_idx)); > > + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); > > + > > + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { > > + pos += store_gcov_uint64(buffer, pos, > > + ci_ptr->values[cv_idx]); > > + } > > + > > + ci_ptr++; > > + } > > + } > > + > > + return (pos); > > +} > > + > > +/** > > + * gcov_iter_new - allocate and initialize profiling data iterator > > + * @info: profiling data set to be iterated > > + * > > + * Return file iterator on success, %NULL otherwise. > > + */ > > +struct gcov_iterator * > > +gcov_iter_new(struct gcov_info *info) > > +{ > > + struct gcov_iterator *iter; > > + > > + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); > > + if (iter == NULL) > > + goto err_free; > > + > > + iter->info = info; > > + /* Dry-run to get the actual buffer size. */ > > + iter->size = convert_to_gcda(NULL, info); > > + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); > > + if (!iter->buffer) > > + goto err_free; > > + > > + convert_to_gcda(iter->buffer, info); > > + > > + return iter; > > + > > +err_free: > > + free(iter, M_GCOV); > > + return (NULL); > > +} > > + > > + > > +/** > > + * gcov_iter_get_info - return profiling data set for given file iterator > > + * @iter: file iterator > > + */ > > +void > > +gcov_iter_free(struct gcov_iterator *iter) > > +{ > > + free(iter->buffer, M_GCOV); > > + free(iter, M_GCOV); > > +} > > + > > +/** > > + * gcov_iter_get_info - return profiling data set for given file iterator > > + * @iter: file iterator > > + */ > > +struct gcov_info * > > +gcov_iter_get_info(struct gcov_iterator *iter) > > +{ > > + return (iter->info); > > +} > > + > > +/** > > + * gcov_iter_start - reset file iterator to starting position > > + * @iter: file iterator > > + */ > > +void > > +gcov_iter_start(struct gcov_iterator *iter) > > +{ > > + iter->pos = 0; > > +} > > + > > +/** > > + * gcov_iter_next - advance file iterator to next logical record > > + * @iter: file iterator > > + * > > + * Return zero if new position is valid, non-zero if iterator has reached end. > > + */ > > +int > > +gcov_iter_next(struct gcov_iterator *iter) > > +{ > > + if (iter->pos < iter->size) > > + iter->pos += ITER_STRIDE; > > + > > + if (iter->pos >= iter->size) > > + return (EINVAL); > > + > > + return 0; > > +} > > + > > +/** > > + * gcov_iter_write - write data for current pos to seq_file > > + * @iter: file iterator > > + * @seq: seq_file handle > > + * > > + * Return zero on success, non-zero otherwise. > > + */ > > +int > > +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) > > +{ > > + size_t len; > > + > > + if (iter->pos >= iter->size) > > + return (EINVAL); > > + > > + len = ITER_STRIDE; > > + if (iter->pos + len > iter->size) > > + len = iter->size - iter->pos; > > + > > + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); > > + > > + return (0); > > +} > > > > Added: head/sys/gnu/gcov/gcov.h > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,99 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2019, Matthew Macy > > + * > > + * 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 _SYS_GCOV_H_ > > +#define _SYS_GCOV_H_ > > + > > +MALLOC_DECLARE(M_GCOV); > > + > > +/* > > + * Profiling data types used for gcc 3.4 and above - these are defined by > > + * gcc and need to be kept as close to the original definition as possible to > > + * remain compatible. > > + */ > > +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) > > +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) > > +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) > > +#define GCOV_TAG_FOR_COUNTER(count) \ > > + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) > > + > > +typedef uint64_t gcov_type; > > + > > +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so > > + * we cannot use full definition here and they need to be placed in gcc specific > > + * implementation of gcov. This also means no direct access to the members in > > + * generic code and usage of the interface below.*/ > > +struct gcov_info; > > + > > +/* Interface to access gcov_info data */ > > +const char *gcov_info_filename(struct gcov_info *info); > > +unsigned int gcov_info_version(struct gcov_info *info); > > +struct gcov_info *gcov_info_next(struct gcov_info *info); > > +void gcov_info_link(struct gcov_info *info); > > +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); > > + > > +/* Base interface. */ > > +enum gcov_action { > > + GCOV_ADD, > > + GCOV_REMOVE, > > +}; > > + > > +/* Iterator control. */ > > +struct gcov_iterator; > > + > > +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); > > +void gcov_iter_free(struct gcov_iterator *iter); > > +void gcov_iter_start(struct gcov_iterator *iter); > > +int gcov_iter_next(struct gcov_iterator *iter); > > +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); > > +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); > > + > > +/* gcov_info control. */ > > +void gcov_info_reset(struct gcov_info *info); > > +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); > > +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); > > +struct gcov_info *gcov_info_dup(struct gcov_info *info); > > +void gcov_info_free(struct gcov_info *info); > > +void gcov_stats_reset(void); > > +void gcov_enable_events(void); > > +void gcov_module_unload(void *, module_t); > > +void gcov_fs_init(void); > > + > > +int within_module(vm_offset_t addr, module_t mod); > > + > > +struct gcov_link { > > + enum { > > + OBJ_TREE, > > + SRC_TREE, > > + } dir; > > + const char *ext; > > +}; > > +extern const struct gcov_link gcov_link[]; > > +#endif > > > > Added: head/sys/gnu/gcov/gcov_fs.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,945 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * This code exports profiling data as debugfs files to userspace. > > + * > > + * Copyright IBM Corp. 2009 > > + * Author(s): Peter Oberparleiter > > + * > > + * Uses gcc-internal data definitions. > > + * Based on the gcov-kernel patch by: > > + * Hubertus Franke > > + * Nigel Hinds > > + * Rajan Ravindran > > + * Peter Oberparleiter > > + * Paul Larson > > + * Yi CDL Yang > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +extern int gcov_events_enabled; > > +static int gcov_persist; > > +static struct mtx gcov_mtx; > > +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); > > +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); > > + > > +void __gcov_init(struct gcov_info *info); > > +void __gcov_flush(void); > > +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); > > +void __gcov_exit(void); > > + > > +static void gcov_event(enum gcov_action action, struct gcov_info *info); > > + > > + > > +/* > > + * Private copy taken from libc > > + */ > > +static char * > > +(basename)(char *path) > > +{ > > + char *ptr; > > + > > + /* > > + * If path is a null pointer or points to an empty string, > > + * basename() shall return a pointer to the string ".". > > + */ > > + if (path == NULL || *path == '\0') > > + return (__DECONST(char *, ".")); > > + > > + /* Find end of last pathname component and null terminate it. */ > > + ptr = path + strlen(path); > > + while (ptr > path + 1 && *(ptr - 1) == '/') > > + --ptr; > > + *ptr-- = '\0'; > > + > > + /* Find beginning of last pathname component. */ > > + while (ptr > path && *(ptr - 1) != '/') > > + --ptr; > > + return (ptr); > > +} > > + > > +/* > > + * __gcov_init is called by gcc-generated constructor code for each object > > + * file compiled with -fprofile-arcs. > > + */ > > +void > > +__gcov_init(struct gcov_info *info) > > +{ > > + static unsigned int gcov_version; > > + > > + mtx_lock(&gcov_mtx); > > + if (gcov_version == 0) { > > + gcov_version = gcov_info_version(info); > > + /* > > + * Printing gcc's version magic may prove useful for debugging > > + * incompatibility reports. > > + */ > > + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); > > + } > > + /* > > + * Add new profiling data structure to list and inform event > > + * listener. > > + */ > > + gcov_info_link(info); > > + if (gcov_events_enabled) > > + gcov_event(GCOV_ADD, info); > > + mtx_unlock(&gcov_mtx); > > +} > > + > > +/* > > + * These functions may be referenced by gcc-generated profiling code but serve > > + * no function for kernel profiling. > > + */ > > +void > > +__gcov_flush(void) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_exit(void) > > +{ > > + /* Unused. */ > > +} > > + > > + > > +/** > > + * struct gcov_node - represents a debugfs entry > > + * @entry: list entry for parent's child node list > > + * @children: child nodes > > + * @all_entry: list entry for list of all nodes > > + * @parent: parent node > > + * @loaded_info: array of pointers to profiling data sets for loaded object > > + * files. > > + * @num_loaded: number of profiling data sets for loaded object files. > > + * @unloaded_info: accumulated copy of profiling data sets for unloaded > > + * object files. Used only when gcov_persist=1. > > + * @dentry: main debugfs entry, either a directory or data file > > + * @links: associated symbolic links > > + * @name: data file basename > > + * > > + * struct gcov_node represents an entity within the gcov/ subdirectory > > + * of debugfs. There are directory and data file nodes. The latter represent > > + * the actual synthesized data file plus any associated symbolic links which > > + * are needed by the gcov tool to work correctly. > > + */ > > +struct gcov_node { > > + LIST_ENTRY(gcov_node) children_entry; > > + LIST_ENTRY(gcov_node) all_entry; > > + struct { > > + struct gcov_node *lh_first; > > + } children; > > + struct gcov_node *parent; > > + struct gcov_info **loaded_info; > > + struct gcov_info *unloaded_info; > > + struct dentry *dentry; > > + struct dentry **links; > > + int num_loaded; > > + char name[0]; > > +}; > > + > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > > > > -- > Rod Grimes rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 23 23:17:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE331507E70; Sat, 23 Feb 2019 23:17:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F0F73097; Sat, 23 Feb 2019 23:17:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id xgXOgHMhAHbf8xgXPgQX2p; Sat, 23 Feb 2019 16:16:56 -0700 X-Authority-Analysis: v=2.3 cv=MKgeZ/Rl c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=ax2tO9aOw4QCizSa25QA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E75971DA; Sat, 23 Feb 2019 15:16:53 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1NNGrEP089742; Sat, 23 Feb 2019 15:16:53 -0800 (PST) (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 x1NNGrhD089735; Sat, 23 Feb 2019 15:16:53 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902232316.x1NNGrhD089735@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: rgrimes@freebsd.org cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: Message from "Rodney W. Grimes" of "Sat, 23 Feb 2019 13:52:45 -0800." <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 23 Feb 2019 15:16:53 -0800 X-CMAE-Envelope: MS4wfMi0a6oHBH6fgiOmqiyZ2AjpocISjGkt3MBoScRVTycwQi8faNGNZ3SAotMy49RnWcOExWqE4XRxnHyXiz78xnyhBv1on12HtkZnDz+LGrq2AdR8hbvR RUqkBuXVaD5Hog42Cf5iWlHrFKoWjpffsWaMz1/0BsYj78v4QHSN8pDSA2hmq/NM00LPixmUe2NLBX+P6fL2YhYll18yubaIio+P9C8+npGI4t0Ot5Px7/pN pGsW71PHee9IDUb14v5Vr0OVWo1LLNM2xwkryKy+ehhrBZCSrBz1bX2JT6eWUKqTiTYwdrNDzKM0IDwirvYuXA== X-Rspamd-Queue-Id: 82F0F73097 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.58 / 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)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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)[]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.89)[-0.887,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:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-1.98)[ip: (-5.19), ipnet: 64.59.128.0/20(-2.61), asn: 6327(-2.04), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 23:17:05 -0000 In message <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > > Author: mmacy > > > Date: Sat Feb 23 21:14:00 2019 > > > New Revision: 344487 > > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > > > Log: > > > gcov support > > > > > > add gcov support and export results as files in debugfs > > > > > > Reviewed by: hps@ > > > MFC after: 1 week > > > Sponsored by: iX Systems > > > Differential Revision: https://reviews.freebsd.org/D19260 > > And an additional nit, we can never becomre GPL free > if we continue to add GPL code to the system. +1 on adding GPL code to the system. The thing that comes to mind with this commit is that we generally try to commit to the vendor branch externally obtained code and merge. That this was committed directly suggests that we will be the maintainers of this code, also suggesting that this GPL code is here to stay. Or, are there plans to replace this with BSD licensed code. As this is external, obtained from should have been documented in the commit message. Ccould this not be put into ports? Those wishing to use this feature could install it as desired. Not to heap it on, just a bunch of questions coming to mind as I write this: What about DTrace, can't we do the same with it? Which once again argues against GPL in base, especially the kernel. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Feb 23 23:31:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F9E5150812E; Sat, 23 Feb 2019 23:31:14 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B363E73611; Sat, 23 Feb 2019 23:31:13 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B55C244EE; Sat, 23 Feb 2019 23:31:13 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NNVD9K059333; Sat, 23 Feb 2019 23:31:13 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NNVDdm059332; Sat, 23 Feb 2019 23:31:13 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201902232331.x1NNVDdm059332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Feb 2019 23:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344488 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 344488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B363E73611 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 23:31:14 -0000 Author: sobomax Date: Sat Feb 23 23:31:13 2019 New Revision: 344488 URL: https://svnweb.freebsd.org/changeset/base/344488 Log: Further refine r336195: do not even attempt to verify/update interface's MTU if we've set it once and there were no changes on the DHCP server side since the last refresh. This is consistent I believe with how dhclient handles other settings like IP address, mask etc. Approved by: cem, eugen Differential Revision: https://reviews.freebsd.org/D18546 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Sat Feb 23 21:14:00 2019 (r344487) +++ head/sbin/dhclient/dhclient.c Sat Feb 23 23:31:13 2019 (r344488) @@ -863,6 +863,7 @@ bind_lease(struct interface_info *ip) opt = &ip->client->new->options[DHO_INTERFACE_MTU]; if (opt->len == sizeof(u_int16_t)) { u_int16_t mtu = 0; + u_int16_t old_mtu = 0; bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] == ACTION_SUPERSEDE); @@ -871,12 +872,19 @@ bind_lease(struct interface_info *ip) else mtu = be16dec(opt->data); + if (ip->client->active) { + opt = &ip->client->active->options[DHO_INTERFACE_MTU]; + if (opt->len == sizeof(u_int16_t)) { + old_mtu = be16dec(opt->data); + } + } + if (mtu < MIN_MTU) { /* Treat 0 like a user intentionally doesn't want to change MTU and, * therefore, warning is not needed */ if (!supersede || mtu != 0) warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); - } else { + } else if (ip->client->state != S_RENEWING || mtu != old_mtu) { interface_set_mtu_unpriv(privfd, mtu); } } From owner-svn-src-head@freebsd.org Sat Feb 23 23:35:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB9C415082E7; Sat, 23 Feb 2019 23:35:53 +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 59561739DC; Sat, 23 Feb 2019 23:35:53 +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 469F324576; Sat, 23 Feb 2019 23:35:53 +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 x1NNZrA1061019; Sat, 23 Feb 2019 23:35:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NNZqDW061017; Sat, 23 Feb 2019 23:35:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902232335.x1NNZqDW061017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 23 Feb 2019 23:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344489 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59561739DC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 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]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2019 23:35:54 -0000 Author: mav Date: Sat Feb 23 23:35:52 2019 New Revision: 344489 URL: https://svnweb.freebsd.org/changeset/base/344489 Log: Free some space in struct ctl_io_hdr for better use. - Collapse original_sc and serializing_sc fields into one, since they are never used simultanously, we have only one local I/O and one remote. - Move remote_sglist and local_sglist fields into CTL_PRIV_BACKEND, since they are used only on Originating SC in XFER mode, where requests don't ever reach backends, so we can reuse backend's private storage. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Feb 23 23:31:13 2019 (r344488) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 23:35:52 2019 (r344489) @@ -651,7 +651,7 @@ ctl_ha_datamove(union ctl_io *io) memset(&msg.dt, 0, sizeof(msg.dt)); msg.hdr.msg_type = CTL_MSG_DATAMOVE; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.serializing_sc = io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; @@ -766,7 +766,7 @@ ctl_ha_done(union ctl_io *io) if (io->io_hdr.io_type == CTL_IO_SCSI) { memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_FINISH_IO; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; msg.scsi.scsi_status = io->scsiio.scsi_status; @@ -1439,7 +1439,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e // populate ctsio from msg io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.msg_type = CTL_MSG_SERIALIZE; - io->io_hdr.original_sc = msg->hdr.original_sc; + io->io_hdr.remote_io = msg->hdr.original_sc; io->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC | CTL_FLAG_IO_ACTIVE; /* @@ -1495,7 +1495,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e * Keep track of this, we need to send it back over * when the datamove is complete. */ - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; if (msg->hdr.status == CTL_SUCCESS) io->io_hdr.status = msg->hdr.status; @@ -1508,9 +1508,8 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e CTL_HA_DATAMOVE_SEGMENT + 1; sgl = malloc(sizeof(*sgl) * i, M_CTL, M_WAITOK | M_ZERO); - io->io_hdr.remote_sglist = sgl; - io->io_hdr.local_sglist = - &sgl[msg->dt.kern_sg_entries]; + CTL_RSGL(io) = sgl; + CTL_LSGL(io) = &sgl[msg->dt.kern_sg_entries]; io->scsiio.kern_data_ptr = (uint8_t *)sgl; @@ -1597,7 +1596,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e } io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; io->io_hdr.msg_type = CTL_MSG_R2R; - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; ctl_enqueue_isc(io); break; @@ -2369,7 +2368,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) mtx_unlock(&lun->lun_lock); /* send msg back to other side */ - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = (union ctl_io *)ctsio; msg_info.hdr.msg_type = CTL_MSG_R2R; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -2395,7 +2394,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) /*retry_count*/ 0); badjuju: ctl_copy_sense_data_back((union ctl_io *)ctsio, &msg_info); - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = NULL; msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -11043,7 +11042,7 @@ ctl_check_blocked(struct ctl_lun *lun) cur_blocked->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; msg_info.hdr.original_sc = - cur_blocked->io_hdr.original_sc; + cur_blocked->io_hdr.remote_io; msg_info.hdr.serializing_sc = cur_blocked; msg_info.hdr.msg_type = CTL_MSG_R2R; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -12480,7 +12479,7 @@ ctl_send_datamove_done(union ctl_io *io, int have_lock memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_DATAMOVE_DONE; msg.hdr.original_sc = io; - msg.hdr.serializing_sc = io->io_hdr.serializing_sc; + msg.hdr.serializing_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; msg.scsi.kern_data_resid = io->scsiio.kern_data_resid; @@ -12531,10 +12530,10 @@ ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq) ctl_dt_req_free(rq); for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; /* * The data is in local and remote memory, so now we need to send @@ -12574,7 +12573,7 @@ ctl_datamove_remote_write(union ctl_io *io) return; /* Switch the pointer over so the FETD knows what to do */ - io->scsiio.kern_data_ptr = (uint8_t *)io->io_hdr.local_sglist; + io->scsiio.kern_data_ptr = (uint8_t *)CTL_LSGL(io); /* * Use a custom move done callback, since we need to send completion @@ -12597,10 +12596,10 @@ ctl_datamove_remote_dm_read_cb(union ctl_io *io) uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; #if 0 scsi_path_string(io, path_str, sizeof(path_str)); @@ -12647,7 +12646,7 @@ ctl_datamove_remote_read_cb(struct ctl_ha_dt_req *rq) ctl_dt_req_free(rq); /* Switch the pointer over so the FETD knows what to do */ - io->scsiio.kern_data_ptr = (uint8_t *)io->io_hdr.local_sglist; + io->scsiio.kern_data_ptr = (uint8_t *)CTL_LSGL(io); /* * Use a custom move done callback, since we need to send completion @@ -12670,7 +12669,7 @@ ctl_datamove_remote_sgl_setup(union ctl_io *io) int i; retval = 0; - local_sglist = io->io_hdr.local_sglist; + local_sglist = CTL_LSGL(io); len_to_go = io->scsiio.kern_data_len; /* @@ -12741,8 +12740,8 @@ ctl_datamove_remote_xfer(union ctl_io *io, unsigned co return (1); } - local_sglist = io->io_hdr.local_sglist; - remote_sglist = io->io_hdr.remote_sglist; + local_sglist = CTL_LSGL(io); + remote_sglist = CTL_RSGL(io); local_used = 0; remote_used = 0; total_used = 0; @@ -12855,10 +12854,10 @@ ctl_datamove_remote_read(union ctl_io *io) * error if there is a problem. */ for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; } } @@ -13106,7 +13105,7 @@ bailout: (io->io_hdr.flags & CTL_FLAG_SENT_2OTHER_SC)) { memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_FINISH_IO; - msg.hdr.serializing_sc = io->io_hdr.serializing_sc; + msg.hdr.serializing_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, sizeof(msg.scsi) - sizeof(msg.scsi.sense_data), Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sat Feb 23 23:31:13 2019 (r344488) +++ head/sys/cam/ctl/ctl_io.h Sat Feb 23 23:35:52 2019 (r344489) @@ -167,6 +167,15 @@ union ctl_priv { #define CTL_PORT(io) (((struct ctl_softc *)CTL_SOFTC(io))-> \ ctl_ports[(io)->io_hdr.nexus.targ_port]) +/* + * These are used only on Originating SC in XFER mode, where requests don't + * ever reach backends, so we can reuse backend's private storage. + */ +#define CTL_RSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[0]) +#define CTL_LSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[1]) +#define CTL_RSGLT(io) ((struct ctl_sg_entry *)CTL_RSGL(io)) +#define CTL_LSGLT(io) ((struct ctl_sg_entry *)CTL_LSGL(io)) + #define CTL_INVALID_PORTNAME 0xFF #define CTL_UNMAPPED_IID 0xFF @@ -229,12 +238,12 @@ struct ctl_io_hdr { struct bintime dma_bt; /* DMA total ticks */ #endif /* CTL_TIME_IO */ uint32_t num_dmas; /* Number of DMAs */ - union ctl_io *original_sc; - union ctl_io *serializing_sc; + union ctl_io *remote_io; /* I/O counterpart on remote HA side */ + void *pad1; void *pool; /* I/O pool */ union ctl_priv ctl_private[CTL_NUM_PRIV];/* CTL private area */ - struct ctl_sg_entry *remote_sglist; - struct ctl_sg_entry *local_sglist; + void *pad2; + void *pad3; STAILQ_ENTRY(ctl_io_hdr) links; /* linked list pointer */ TAILQ_ENTRY(ctl_io_hdr) ooa_links; TAILQ_ENTRY(ctl_io_hdr) blocked_links;