From owner-svn-src-all@freebsd.org Sun Oct 8 05:18:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BBD4E27398; Sun, 8 Oct 2017 05:18:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C94782FFD; Sun, 8 Oct 2017 05:18:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id m63so11285142pfk.7; Sat, 07 Oct 2017 22:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Y5Q7Do7NLrSLRXOeBPoMMghC8nxIRsxnHBCkrbp+Zak=; b=fdRNOdtX+G5sDuxZbPnf1qB+nnEw/rNq266aTH3UUEuqcat5Fb1L6xIsYM4FuaQhpX JGGzpyejvgxBuP4Lu8ufrG6DABUFdEZXnP4iqJkRklgeCV4gcoNcrTU/eN0NTnNcHS8c bE1yZsp6vK/Lxoahiw4V+y6Za/OZMGClYGyrv08busOGJtYt9FMlYqj8aybk2R5kJ6+R j9L3biAuCLT61d2xnGDlJavDrjNOox8BKSZSRYeEU8r4H4iAkokqq7czLiQjp8aXG0if QmnOhZ1fcqOeTzvHcTamT1Hy+PfAEGmlkvLpOyb4qVSWznJyiIB+fEou1OHwy79y6J8E TkIQ== 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=Y5Q7Do7NLrSLRXOeBPoMMghC8nxIRsxnHBCkrbp+Zak=; b=VREhClHZaQ/WZf83rcUlhmxFx4TR97smpu14J6OAlkfivd1m0RR+xpEdHtWeioE2Bg +ILcY7A+eNKuCAk8OcTuJMvPqmlyEXMai9FEUusqZWks4vow/ksmhnPuh3qoxwXd1Idl S2/+h24bKLtuQrMnHc0sNd/tmrRjx6ym45+gLpLC4r+kBdX6Tdr4NfVpcc+T47tyz7fB jEDFduZ0reZ53KJbGaZ+ng2aIzCvco2eYJJdeSOhCxgGFLRZx1agjI/8Px5lYv3JpDVP TBAXA8nYl1woXX/hrLRLgNFWv99ad2u5zyQGfETJgSxFjVdljbDF8EUpDTL9yH6jn134 HTeQ== X-Gm-Message-State: AMCzsaW+JX/JbfpWgP0LVIaCGLuOOx74erB7k1fhkg9JjIESlRFZ/FrH cigmQmIISgWkZh3Ir+ToGkudlaJo X-Google-Smtp-Source: AOwi7QDLUhpvZr7gPLfPa4IIa4YkJ5XfzO/Ci0VV+6kxeRuWAFRGPkiv7KP/WfI63/CUkt19+XpR8A== X-Received: by 10.99.95.145 with SMTP id t139mr6325349pgb.344.1507439922406; Sat, 07 Oct 2017 22:18:42 -0700 (PDT) Received: from ?IPv6:2607:fb90:8120:cf90:2069:3ba:b5d:6cb7? ([2607:fb90:8120:cf90:2069:3ba:b5d:6cb7]) by smtp.gmail.com with ESMTPSA id q13sm927723pfi.166.2017.10.07.22.18.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Oct 2017 22:18:41 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324406 - head/sys/modules/em From: Ngie Cooper X-Mailer: iPhone Mail (15A421) In-Reply-To: <201710072333.v97NXE6E044433@repo.freebsd.org> Date: Sat, 7 Oct 2017 22:18:40 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> References: <201710072333.v97NXE6E044433@repo.freebsd.org> To: Sean Bruno X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 05:18:44 -0000 > On Oct 7, 2017, at 16:33, Sean Bruno wrote: >=20 > Author: sbruno > Date: Sat Oct 7 23:33:14 2017 > New Revision: 324406 > URL: https://svnweb.freebsd.org/changeset/base/324406 >=20 > Log: > Fix symlink if_igb.ko in -current such that its relative and doesn't > end up with non-standard DESTDIR information in its symlink. This > can happen very trivially if the release scripts are used. >=20 > Sponsored by: Limelight Networks >=20 > Modified: > head/sys/modules/em/Makefile >=20 > Modified: head/sys/modules/em/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324405) > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324406) > @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 > #CFLAGS +=3D -DDEVICE_POLLING >=20 > afterinstall: > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_igb.ko= > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko While this is definitely better, the same thing could be achieved via: ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko= From owner-svn-src-all@freebsd.org Sun Oct 8 07:20:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA16E2AC7E; Sun, 8 Oct 2017 07:20:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68127C410; Sun, 8 Oct 2017 07:20:00 +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 v987Jxfv033675; Sun, 8 Oct 2017 07:19:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v987JxOf033674; Sun, 8 Oct 2017 07:19:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710080719.v987JxOf033674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Oct 2017 07:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324407 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 324407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 07:20:01 -0000 Author: mav Date: Sun Oct 8 07:19:59 2017 New Revision: 324407 URL: https://svnweb.freebsd.org/changeset/base/324407 Log: MFC r324155: Add initial support for Address Lookup Table (A-LUT). When enabled by EEPROM, use it to relax translation address/size alignment requirements for BAR2 window by 128 or 256 times. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sat Oct 7 23:33:14 2017 (r324406) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sun Oct 8 07:19:59 2017 (r324407) @@ -80,6 +80,7 @@ struct ntb_plx_softc { u_int ntx; /* NTx number within chip. */ u_int link; /* Link v/s Virtual side. */ u_int port; /* Port number within chip. */ + u_int alut; /* A-LUT is enabled for NTx */ int int_rid; struct resource *int_res; @@ -197,6 +198,10 @@ ntb_plx_init(device_t dev) } } + /* Make sure Virtual to Link A-LUT is disabled. */ + if (sc->alut) + PNTX_WRITE(sc, 0xc94, 0); + /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ PNTX_WRITE(sc, 0xdb4, 0x00090001); } @@ -329,6 +334,12 @@ ntb_plx_attach(device_t dev) val = bus_read_4(sc->conf_res, 0x360); sc->port = (val >> ((sc->ntx == 0) ? 8 : 16)) & 0x1f; + /* Detect A-LUT enable and size. */ + val >>= 30; + sc->alut = (val == 0x3) ? 1 : ((val & (1 << sc->ntx)) ? 2 : 0); + if (sc->alut) + device_printf(dev, "%u A-LUT entries\n", 128 * sc->alut); + /* Find configured memory windows at BAR2-5. */ sc->mw_count = 0; for (i = 2; i <= 5; i++) { @@ -561,22 +572,31 @@ ntb_plx_mw_get_range(device_t dev, unsigned mw_idx, vm /* * Remote to local memory window translation address alignment. - * XXX: In B2B mode we can change window size (and so alignmet) - * live, but there is no way to report it, so report safe value. + * Translation address has to be aligned to the BAR size, but A-LUT + * entries re-map addresses can be aligned to 1/128 or 1/256 of it. + * XXX: In B2B mode we can change BAR size (and so alignmet) live, + * but there is no way to report it here, so report safe value. */ - if (align != NULL) - *align = mw->mw_size - off; + if (align != NULL) { + if (sc->alut && mw->mw_bar == 2) + *align = (mw->mw_size - off) / 128 / sc->alut; + else + *align = mw->mw_size - off; + } /* * Remote to local memory window size alignment. - * XXX: The chip has no limit registers. In B2B case size must be - * power of 2 (since we can reprogram BAR size), but there is no way - * to report it, so report 1MB -- minimal BAR size. In non-B2B case - * there is no control at all, so report the precofigured BAR size. + * The chip has no limit registers, but A-LUT, when available, allows + * access control with granularity of 1/128 or 1/256 of the BAR size. + * XXX: In B2B case we can change BAR size live, but there is no way + * to report it, so report half of the BAR size, that should be safe. + * In non-B2B case there is no control at all, so report the BAR size. */ if (align_size != NULL) { - if (sc->b2b_mw >= 0) - *align_size = 1024 * 1024; + if (sc->alut && mw->mw_bar == 2) + *align_size = (mw->mw_size - off) / 128 / sc->alut; + else if (sc->b2b_mw >= 0) + *align_size = (mw->mw_size - off) / 2; else *align_size = mw->mw_size - off; } @@ -593,8 +613,9 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; - uint64_t addr, off, size, val64; + uint64_t addr, eaddr, off, size, bsize, esize, val64; uint32_t val; + int i; mw = &sc->mw_info[mw_idx]; addr = mw->mw_xlat_addr; @@ -615,22 +636,29 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m if (size > 0) { /* Round BAR size to next power of 2 or at least 1MB. */ - if (!powerof2(size)) - size = 1LL << flsll(size); - if (size < 1024 * 1024) - size = 1024 * 1024; + bsize = size; + if (!powerof2(bsize)) + bsize = 1LL << flsll(bsize); + if (bsize < 1024 * 1024) + bsize = 1024 * 1024; - /* Hardware requires addr aligned to BAR size. */ - if ((addr & (size - 1)) != 0) + /* A-LUT has 128 or 256 times better granularity. */ + esize = bsize; + if (sc->alut && mw->mw_bar == 2) + esize /= 128 * sc->alut; + + /* addr should be aligned to BAR or A-LUT element size. */ + if ((addr & (esize - 1)) != 0) return (EINVAL); - } + } else + esize = bsize = 0; if (mw->mw_64bit) { if (sc->b2b_mw >= 0) { /* Set Link Interface BAR size and enable/disable it. */ val64 = 0; - if (size > 0) - val64 = (~(size - 1) & ~0xfffff); + if (bsize > 0) + val64 = (~(bsize - 1) & ~0xfffff); val64 |= 0xc; PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val64); PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4 + 4, val64 >> 32); @@ -648,14 +676,14 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m /* Make sure we fit into 32-bit address space. */ if ((addr & UINT32_MAX) != addr) return (ERANGE); - if (((addr + size) & UINT32_MAX) != (addr + size)) + if (((addr + bsize) & UINT32_MAX) != (addr + bsize)) return (ERANGE); if (sc->b2b_mw >= 0) { /* Set Link Interface BAR size and enable/disable it. */ val = 0; - if (size > 0) - val = (~(size - 1) & ~0xfffff); + if (bsize > 0) + val = (~(bsize - 1) & ~0xfffff); PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val); /* Set Link Interface BAR address. */ @@ -666,6 +694,27 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m /* Set Virtual Interface BARs address translation */ PNTX_WRITE(sc, 0xc3c + (mw->mw_bar - 2) * 4, addr); } + + /* Configure and enable Link to Virtual A-LUT if we need it. */ + if (sc->alut && mw->mw_bar == 2 && + ((addr & (bsize - 1)) != 0 || size != bsize)) { + eaddr = addr; + for (i = 0; i < 128 * sc->alut; i++) { + val = sc->link ? 0 : 1; + if (sc->alut == 1) + val += 2 * sc->ntx; + val *= 0x1000 * sc->alut; + val += 0x38000 + i * 4 + (i >= 128 ? 0x0e00 : 0); + bus_write_4(sc->conf_res, val, eaddr); + bus_write_4(sc->conf_res, val + 0x400, eaddr >> 32); + bus_write_4(sc->conf_res, val + 0x800, + (eaddr < addr + size) ? 0x3 : 0); + eaddr += esize; + } + NTX_WRITE(sc, 0xc94, 0x10000000); + } else if (sc->alut && mw->mw_bar == 2) + NTX_WRITE(sc, 0xc94, 0); + return (0); } From owner-svn-src-all@freebsd.org Sun Oct 8 07:20:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C62FE2AC9C; Sun, 8 Oct 2017 07:20:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA287C6EC; Sun, 8 Oct 2017 07:20:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v987KlPY034461; Sun, 8 Oct 2017 07:20:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v987Kll8034460; Sun, 8 Oct 2017 07:20:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710080720.v987Kll8034460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Oct 2017 07:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324408 - stable/11/usr.sbin/diskinfo X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/diskinfo X-SVN-Commit-Revision: 324408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 07:20:48 -0000 Author: mav Date: Sun Oct 8 07:20:47 2017 New Revision: 324408 URL: https://svnweb.freebsd.org/changeset/base/324408 Log: MFC r324172: Align test I/O buffer to page boundary. This is more alike to typical kernel behavior, that can be useful from benchmarking point of view. Modified: stable/11/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.c Sun Oct 8 07:19:59 2017 (r324407) +++ stable/11/usr.sbin/diskinfo/diskinfo.c Sun Oct 8 07:20:47 2017 (r324408) @@ -50,6 +50,8 @@ #include #define NAIO 128 +#define MAXTX (8*1024*1024) +#define MEGATX (1024*1024) static void usage(void) @@ -67,12 +69,14 @@ static void slogbench(int fd, int isreg, off_t mediasi static int zonecheck(int fd, uint32_t *zone_mode, char *zone_str, size_t zone_str_len); +static uint8_t *buf; + int main(int argc, char **argv) { struct stat sb; int i, ch, fd, error, exitval = 0; - char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; + char tstr[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; char zone_desc[64]; struct diocgattr_arg arg; off_t mediasize, stripesize, stripeoffset; @@ -129,11 +133,13 @@ main(int argc, char **argv) usage(); } + if (posix_memalign((void **)&buf, PAGE_SIZE, MAXTX)) + errx(1, "Can't allocate memory buffer"); for (i = 0; i < argc; i++) { fd = open(argv[i], (opt_w ? O_RDWR : O_RDONLY) | O_DIRECT); if (fd < 0 && errno == ENOENT && *argv[i] != '/') { - snprintf(buf, BUFSIZ, "%s%s", _PATH_DEV, argv[i]); - fd = open(buf, O_RDONLY); + snprintf(tstr, sizeof(tstr), "%s%s", _PATH_DEV, argv[i]); + fd = open(tstr, O_RDONLY); } if (fd < 0) { warn("%s", argv[i]); @@ -216,12 +222,12 @@ main(int argc, char **argv) printf("\t%u", fwsectors); } } else { - humanize_number(buf, 5, (int64_t)mediasize, "", + humanize_number(tstr, 5, (int64_t)mediasize, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%s\n", argv[i]); printf("\t%-12u\t# sectorsize\n", sectorsize); printf("\t%-12jd\t# mediasize in bytes (%s)\n", - (intmax_t)mediasize, buf); + (intmax_t)mediasize, tstr); printf("\t%-12jd\t# mediasize in sectors\n", (intmax_t)mediasize/sectorsize); printf("\t%-12jd\t# stripesize\n", stripesize); @@ -255,12 +261,9 @@ main(int argc, char **argv) out: close(fd); } + free(buf); exit (exitval); } - -#define MAXTX (8*1024*1024) -#define MEGATX (1024*1024) -static uint8_t buf[MAXTX]; static void rdsect(int fd, off_t blockno, u_int sectorsize) From owner-svn-src-all@freebsd.org Sun Oct 8 08:02:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D56E2C6AB; Sun, 8 Oct 2017 08:02:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD28109A; Sun, 8 Oct 2017 08:02:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9882QPU055207; Sun, 8 Oct 2017 08:02:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9882QHW055206; Sun, 8 Oct 2017 08:02:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710080802.v9882QHW055206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Oct 2017 08:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324410 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 324410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 08:02:27 -0000 Author: kib Date: Sun Oct 8 08:02:26 2017 New Revision: 324410 URL: https://svnweb.freebsd.org/changeset/base/324410 Log: MFC r324301: Update comment. Modified: stable/11/sys/amd64/amd64/cpu_switch.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/11/sys/amd64/amd64/cpu_switch.S Sun Oct 8 08:01:24 2017 (r324409) +++ stable/11/sys/amd64/amd64/cpu_switch.S Sun Oct 8 08:02:26 2017 (r324410) @@ -172,7 +172,7 @@ sw1: * to load up the rest of the next context. */ - /* Skip loading user fsbase/gsbase for kthreads */ + /* Skip loading LDT and user fsbase/gsbase for kthreads */ testl $TDP_KTHREAD,TD_PFLAGS(%r12) jnz do_kthread From owner-svn-src-all@freebsd.org Sun Oct 8 08:33:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52993E2DDED; Sun, 8 Oct 2017 08:33:14 +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 4E6A167B2F; Sun, 8 Oct 2017 08:33:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v988X7uS019017 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 8 Oct 2017 11:33:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v988X7uS019017 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v988X7Ux019015; Sun, 8 Oct 2017 11:33:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Oct 2017 11:33:07 +0300 From: Konstantin Belousov To: Don Lewis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 Message-ID: <20171008083307.GG95911@kib.kiev.ua> References: <20171007201142.GE95911@kib.kiev.ua> <201710072054.v97Ks5nX062548@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710072054.v97Ks5nX062548@gw.catspoiler.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 08:33:14 -0000 On Sat, Oct 07, 2017 at 01:54:05PM -0700, Don Lewis wrote: > On 7 Oct, Konstantin Belousov wrote: > > On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: > >> On 5 Oct, Konstantin Belousov wrote: > >> > Author: kib > >> > Date: Thu Oct 5 12:50:03 2017 > >> > New Revision: 324313 > >> > URL: https://svnweb.freebsd.org/changeset/base/324313 > >> > > >> > Log: > >> > Avoid a race betweem freeing LDT and context switches. > >> > > >> > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating > >> > presence of the process LDT. The flag is checked and then ldt segment > >> > descriptor is copied into the CPU' GDT slot. > >> > > >> > Disallow context switches around clearing of the curproc LDT state by > >> > performing the cleanup in critical section. Ensure that the md_ldt > >> > flag is cleared before md_ldt_sd descriptor content is destroyed by > >> > inserting fence between the operations. > >> > > >> > We depend on the x86 memory model strong ordering guarantees, in > >> > particular, that cpu_switch.S observes the writes to md_ldt and > >> > md_ldt_sd in the expected order. > >> > >> I don't know which of this series of commits is responsible, but I think > >> that it fixed the build of lang/ghc on Ryzen. > >> > >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 > > > > Does ghc use LDT on amd64 ? This sounds unbelievable. > > I have no idea, but ghc would reliably fail to build on my Ryzen machine > up through r323398, and at r324367 it seems to reliably build. Could you try to bisect ? I reviewed all kernel changes and do not see anything which could be marked as possible fix for whatever kernel issue causing usermode fault. From owner-svn-src-all@freebsd.org Sun Oct 8 08:01:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4F10E2C526; Sun, 8 Oct 2017 08:01: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 mx1.freebsd.org (Postfix) with ESMTPS id 6268EB19; Sun, 8 Oct 2017 08:01: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 v9881OZX050549; Sun, 8 Oct 2017 08:01:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9881OBi050548; Sun, 8 Oct 2017 08:01:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710080801.v9881OBi050548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Oct 2017 08:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324409 - stable/11/sys/dev/smbus X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/smbus X-SVN-Commit-Revision: 324409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 08:01:26 -0000 Author: kib Date: Sun Oct 8 08:01:24 2017 New Revision: 324409 URL: https://svnweb.freebsd.org/changeset/base/324409 Log: MFC r324174: FIx include guard name. Modified: stable/11/sys/dev/smbus/smbconf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/smbus/smbconf.h ============================================================================== --- stable/11/sys/dev/smbus/smbconf.h Sun Oct 8 07:20:47 2017 (r324408) +++ stable/11/sys/dev/smbus/smbconf.h Sun Oct 8 08:01:24 2017 (r324409) @@ -25,8 +25,8 @@ * * $FreeBSD$ */ -#ifndef __SMBONF_H -#define __SMBONF_H +#ifndef __DEV_SMBUS_SMBCONF_H +#define __DEV_SMBUS_SMBCONF_H #include @@ -124,4 +124,4 @@ extern devclass_t smbus_devclass; #define SMBUS_MAXVER 1 #define SMBUS_PREFVER SMBUS_MODVER -#endif +#endif /* __DEV_SMBUS_SMBCONF_H */ From owner-svn-src-all@freebsd.org Sun Oct 8 15:42:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0896AE38BDB; Sun, 8 Oct 2017 15:42:46 +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 A10F264A46; Sun, 8 Oct 2017 15:42:45 +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 v98FgZ1c074040; Sun, 8 Oct 2017 08:42:35 -0700 (PDT) (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 v98FgZ5f074039; Sun, 8 Oct 2017 08:42:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r324406 - head/sys/modules/em In-Reply-To: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> To: Ngie Cooper Date: Sun, 8 Oct 2017 08:42:35 -0700 (PDT) CC: Sean Bruno , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 15:42:46 -0000 > > > On Oct 7, 2017, at 16:33, Sean Bruno wrote: > > > > Author: sbruno > > Date: Sat Oct 7 23:33:14 2017 > > New Revision: 324406 > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > > > Log: > > Fix symlink if_igb.ko in -current such that its relative and doesn't > > end up with non-standard DESTDIR information in its symlink. This > > can happen very trivially if the release scripts are used. > > > > Sponsored by: Limelight Networks > > > > Modified: > > head/sys/modules/em/Makefile > > > > Modified: head/sys/modules/em/Makefile > > ============================================================================== > > --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324405) > > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324406) > > @@ -23,6 +23,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 > > #CFLAGS += -DDEVICE_POLLING > > > > afterinstall: > > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_igb.ko > > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > > While this is definitely better, the same thing could be achieved via: > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko Should this be using SYMLINK+= as I thought using ln -sf was a breakage for meta mode stuff? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Oct 8 16:54:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63898E3A2ED; Sun, 8 Oct 2017 16:54:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA07574A96; Sun, 8 Oct 2017 16:54:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98Gsgn9077964; Sun, 8 Oct 2017 16:54:42 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98GsghJ077963; Sun, 8 Oct 2017 16:54:42 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710081654.v98GsghJ077963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Oct 2017 16:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324411 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 16:54:44 -0000 Author: alc Date: Sun Oct 8 16:54:42 2017 New Revision: 324411 URL: https://svnweb.freebsd.org/changeset/base/324411 Log: Replace an unnecessary call to vm_page_activate() by an assertion that the page is already wired or queued. Prior to the elimination of PG_CACHED pages, vm_page_grab() might have returned a valid, previously PG_CACHED page, in which case enqueueing the page was necessary. Now, that can't happen. Moreover, activating the page is a dubious choice, since the page is not being accessed. Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Oct 8 08:02:26 2017 (r324410) +++ head/sys/vm/swap_pager.c Sun Oct 8 16:54:42 2017 (r324411) @@ -1635,9 +1635,12 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_wakeup(object); vm_page_dirty(m); +#ifdef INVARIANTS vm_page_lock(m); - vm_page_activate(m); + if (m->wire_count == 0 && m->queue == PQ_NONE) + panic("page %p is neither wired nor queued", m); vm_page_unlock(m); +#endif vm_page_xunbusy(m); vm_pager_page_unswapped(m); return; From owner-svn-src-all@freebsd.org Sun Oct 8 17:14:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766DFE3AE33; Sun, 8 Oct 2017 17:14:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 169EA7D2F5; Sun, 8 Oct 2017 17:14:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98HEkcH086618; Sun, 8 Oct 2017 17:14:46 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HEk1H086617; Sun, 8 Oct 2017 17:14:46 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710081714.v98HEk1H086617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Oct 2017 17:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324412 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 324412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:14:47 -0000 Author: alc Date: Sun Oct 8 17:14:45 2017 New Revision: 324412 URL: https://svnweb.freebsd.org/changeset/base/324412 Log: MFC r324173 When an I/O error occurs on page out, there is no need to dirty the page, because it is already dirty. Instead, assert that the page is dirty. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Sun Oct 8 16:54:42 2017 (r324411) +++ stable/11/sys/vm/swap_pager.c Sun Oct 8 17:14:45 2017 (r324412) @@ -1523,7 +1523,7 @@ swp_pager_async_iodone(struct buf *bp) * so it doesn't clog the inactive list, * then finish the I/O. */ - vm_page_dirty(m); + MPASS(m->dirty == VM_PAGE_BITS_ALL); vm_page_lock(m); vm_page_activate(m); vm_page_unlock(m); From owner-svn-src-all@freebsd.org Sun Oct 8 17:21:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03E0EE3B05D; Sun, 8 Oct 2017 17:21:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id B44C37E950; Sun, 8 Oct 2017 17:21: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 v98HLGCI086892; Sun, 8 Oct 2017 17:21:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HLGlT086889; Sun, 8 Oct 2017 17:21:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081721.v98HLGlT086889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 17:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324413 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 324413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:21:18 -0000 Author: ian Date: Sun Oct 8 17:21:16 2017 New Revision: 324413 URL: https://svnweb.freebsd.org/changeset/base/324413 Log: Restore the ability to deregister an eventhandler from within the callback. When the EVENTHANDLER(9) subsystem was created, it was a documented feature that an eventhandler callback function could safely deregister itself. In r200652 that feature was inadvertantly broken by adding drain-wait logic to eventhandler_deregister(), so that it would be safe to unload a module upon return from deregistering its event handlers. There are now 145 callers of EVENTHANDLER_DEREGISTER(), and it's likely many of them are depending on the drain-wait logic that has been in place for 8 years. So instead of creating a separate eventhandler_drain() and adding it to some or all of those 145 call sites, this creates a separate eventhandler_drain_nowait() function for the specific purpose of deregistering a callback from within the running callback. Differential Revision: https://reviews.freebsd.org/D12561 Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/kern/subr_eventhandler.c head/sys/sys/eventhandler.h Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Sun Oct 8 17:14:45 2017 (r324412) +++ head/share/man/man9/EVENTHANDLER.9 Sun Oct 8 17:21:16 2017 (r324413) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd March 27, 2017 +.Dd October 1, 2017 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -37,6 +37,7 @@ .Ft eventhandler_tag .Fn EVENTHANDLER_REGISTER name func arg priority .Fn EVENTHANDLER_DEREGISTER name tag +.Fn EVENTHANDLER_DEREGISTER_NOWAIT name tag .Ft eventhandler_tag .Fo eventhandler_register .Fa "struct eventhandler_list *list" @@ -50,6 +51,11 @@ .Fa "struct eventhandler_list *list" .Fa "eventhandler_tag tag" .Fc +.Ft void +.Fo eventhandler_deregister_nowait +.Fa "struct eventhandler_list *list" +.Fa "eventhandler_tag tag" +.Fc .Ft "struct eventhandler_list *" .Fn eventhandler_find_list "const char *name" .Ft void @@ -121,6 +127,18 @@ This macro removes a previously registered callback as .Fa tag from the event handler named by argument .Fa name . +It waits until no threads are running handlers for this event before +returning, making it safe to unload a module immediately upon return +from this function. +.It Fn EVENTHANDLER_DEREGISTER_NOWAIT +This macro removes a previously registered callback associated with tag +.Fa tag +from the event handler named by argument +.Fa name . +Upon return, one or more threads could still be running the removed +function(s), but no new calls will be made. +To remove a handler function from within that function, use this +version of deregister, to avoid a deadlock. .It Fn EVENTHANDLER_INVOKE This macro is used to invoke all the callbacks associated with event handler @@ -176,6 +194,21 @@ that can later be used with .Fn eventhandler_deregister to remove the particular callback function. .It Fn eventhandler_deregister +The +.Fn eventhandler_deregister +function removes the callback associated with tag +.Fa tag +from the event handler list pointed to by +.Fa list . +If +.Fa tag +is +.Va NULL , +all callback functions for the event are removed. +This function will not return until all threads have exited from the +removed handler callback function(s). +This function is not safe to call from inside an event handler callback. +.It Fn eventhandler_deregister_nowait The .Fn eventhandler_deregister function removes the callback associated with tag Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Sun Oct 8 17:14:45 2017 (r324412) +++ head/sys/kern/subr_eventhandler.c Sun Oct 8 17:21:16 2017 (r324413) @@ -180,8 +180,9 @@ vimage_eventhandler_register(struct eventhandler_list } #endif -void -eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag) +static void +_eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag, + bool wait) { struct eventhandler_entry *ep = tag; @@ -215,9 +216,24 @@ eventhandler_deregister(struct eventhandler_list *list ep->ee_priority = EHE_DEAD_PRIORITY; } } - while (list->el_runcount > 0) + while (wait && list->el_runcount > 0) mtx_sleep(list, &list->el_lock, 0, "evhrm", 0); EHL_UNLOCK(list); +} + +void +eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag) +{ + + _eventhandler_deregister(list, tag, true); +} + +void +eventhandler_deregister_nowait(struct eventhandler_list *list, + eventhandler_tag tag) +{ + + _eventhandler_deregister(list, tag, false); } /* Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Sun Oct 8 17:14:45 2017 (r324412) +++ head/sys/sys/eventhandler.h Sun Oct 8 17:21:16 2017 (r324413) @@ -141,11 +141,20 @@ do { \ if ((_el = eventhandler_find_list(#name)) != NULL) \ eventhandler_deregister(_el, tag); \ } while(0) - +#define EVENTHANDLER_DEREGISTER_NOWAIT(name, tag) \ +do { \ + struct eventhandler_list *_el; \ + \ + if ((_el = eventhandler_find_list(#name)) != NULL) \ + eventhandler_deregister_nowait(_el, tag); \ +} while(0) + eventhandler_tag eventhandler_register(struct eventhandler_list *list, const char *name, void *func, void *arg, int priority); void eventhandler_deregister(struct eventhandler_list *list, + eventhandler_tag tag); +void eventhandler_deregister_nowait(struct eventhandler_list *list, eventhandler_tag tag); struct eventhandler_list *eventhandler_find_list(const char *name); void eventhandler_prune_list(struct eventhandler_list *list); From owner-svn-src-all@freebsd.org Sun Oct 8 17:29:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2767E3B2E3; Sun, 8 Oct 2017 17:29:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5FA9E8061E; Sun, 8 Oct 2017 17:29:44 +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 v98HTh5w090883; Sun, 8 Oct 2017 17:29:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HThrx090882; Sun, 8 Oct 2017 17:29:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710081729.v98HThrx090882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Oct 2017 17:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324414 - head/lib/libcapsicum X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libcapsicum X-SVN-Commit-Revision: 324414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:29:45 -0000 Author: trasz Date: Sun Oct 8 17:29:43 2017 New Revision: 324414 URL: https://svnweb.freebsd.org/changeset/base/324414 Log: capsicum_helpers: Add EVENT to default stdio rights set Without it, calling caph_limit_stdio(3) breaks Irssi. Reviewed by: oshogbo MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12622 Modified: head/lib/libcapsicum/capsicum_helpers.h Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Sun Oct 8 17:21:16 2017 (r324413) +++ head/lib/libcapsicum/capsicum_helpers.h Sun Oct 8 17:29:43 2017 (r324414) @@ -50,7 +50,8 @@ caph_limit_stream(int fd, int flags) cap_rights_t rights; unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ, FIODTYPE }; - cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_SEEK); + cap_rights_init(&rights, CAP_EVENT, CAP_FCNTL, CAP_FSTAT, + CAP_IOCTL, CAP_SEEK); if ((flags & CAPH_READ) != 0) cap_rights_set(&rights, CAP_READ); From owner-svn-src-all@freebsd.org Sun Oct 8 17:33:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF71E3B53B; Sun, 8 Oct 2017 17:33:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FBD2815F1; Sun, 8 Oct 2017 17:33:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98HXnCQ094647; Sun, 8 Oct 2017 17:33:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HXnu1094645; Sun, 8 Oct 2017 17:33:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081733.v98HXnu1094645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 17:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324415 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:33:51 -0000 Author: ian Date: Sun Oct 8 17:33:49 2017 New Revision: 324415 URL: https://svnweb.freebsd.org/changeset/base/324415 Log: Add eventhandler notifications for newbus device attach/detach. The detach case is slightly complicated by the fact that some in-kernel consumers may want to know before a device detaches (so they can release related resources, stop using the device, etc), but the detach can fail. So there are pre- and post-detach notifications for those consumers who need to handle all cases. A couple salient comments from the review, they amount to some helpful documentation about these events, but there's currently no good place for such documentation... Note that in the current newbus locking model, DETACH_BEGIN and DETACH_COMPLETE/FAILED sequence of event handler invocation might interweave with other attach/detach events arbitrarily. The handlers should be prepared for such situations. Also should note that detach may be called after the parent bus knows the hardware has left the building. In-kernel consumers have to be prepared to cope with this race. Differential Revision: https://reviews.freebsd.org/D12557 Modified: head/sys/kern/subr_bus.c head/sys/sys/eventhandler.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Oct 8 17:29:43 2017 (r324414) +++ head/sys/kern/subr_bus.c Sun Oct 8 17:33:49 2017 (r324415) @@ -2936,6 +2936,7 @@ device_attach(device_t dev) else dev->state = DS_ATTACHED; dev->flags &= ~DF_DONENOMATCH; + EVENTHANDLER_INVOKE(device_attach, dev); devadded(dev); return (0); } @@ -2969,8 +2970,13 @@ device_detach(device_t dev) if (dev->state != DS_ATTACHED) return (0); - if ((error = DEVICE_DETACH(dev)) != 0) + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_BEGIN); + if ((error = DEVICE_DETACH(dev)) != 0) { + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_FAILED); return (error); + } else { + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_COMPLETE); + } devremoved(dev); if (!device_is_quiet(dev)) device_printf(dev, "detached\n"); Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Sun Oct 8 17:29:43 2017 (r324414) +++ head/sys/sys/eventhandler.h Sun Oct 8 17:33:49 2017 (r324415) @@ -293,4 +293,15 @@ typedef void (*swapoff_fn)(void *, struct swdevt *); EVENTHANDLER_DECLARE(swapon, swapon_fn); EVENTHANDLER_DECLARE(swapoff, swapoff_fn); +/* newbus device events */ +enum evhdev_detach { + EVHDEV_DETACH_BEGIN, /* Before detach() is called */ + EVHDEV_DETACH_COMPLETE, /* After detach() returns 0 */ + EVHDEV_DETACH_FAILED /* After detach() returns err */ +}; +typedef void (*device_attach_fn)(void *, device_t); +typedef void (*device_detach_fn)(void *, device_t, enum evhdev_detach); +EVENTHANDLER_DECLARE(device_attach, device_attach_fn); +EVENTHANDLER_DECLARE(device_detach, device_detach_fn); + #endif /* _SYS_EVENTHANDLER_H_ */ From owner-svn-src-all@freebsd.org Sun Oct 8 17:56:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DB28E3BDD3 for ; Sun, 8 Oct 2017 17:56:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 E468C2DA7 for ; Sun, 8 Oct 2017 17:56:43 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0518bb5d-ac52-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 0518bb5d-ac52-11e7-a893-25625093991c; Sun, 08 Oct 2017 17:56:34 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v98HuUXN001560; Sun, 8 Oct 2017 11:56:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507485390.86205.323.camel@freebsd.org> Subject: Re: svn commit: r324415 - in head/sys: kern sys From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 08 Oct 2017 11:56:30 -0600 In-Reply-To: <201710081733.v98HXnu1094645@repo.freebsd.org> References: <201710081733.v98HXnu1094645@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:56:45 -0000 On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > Author: ian > Date: Sun Oct  8 17:33:49 2017 > New Revision: 324415 > URL: https://svnweb.freebsd.org/changeset/base/324415 > > Log: >   Add eventhandler notifications for newbus device attach/detach. >    > [...] >    >   A couple salient comments from the review, they amount to some helpful >   documentation about these events, but there's currently no good place for >   such documentation... About this last point... sys/eventhandler.h is now an ever-growing list of EVENTHANDLER_DECLARE() statements for events that are unrelated to each other.  I think we are at the point where it's no longer a few well-known "standard system event queues", it's turning into a mess. My first thought was to add these to bus.h because they're bus events.  But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, and I didn't want to pull it (and its dependencies) into bus.h. Now I'm thinking maybe we need a handful of separate header files, like bus_events.h, proc_events.h, thread_events.h, etc.  Maybe we could have a kern_events.h as a catch-all for a few misc ones like low-memory, root-mounted, etc.  Having a few subsystem-focused header files would provide a good place to put some comment blocks describing quirks and other nice-to-know information about using/handling the events. Or we could go with full-on manpages for describing each event, or each group of related events.  In that case we'd need some sort of naming convention that makes it easy to find the page for the events you care about.  My gut tells me comment blocks at the point of the DECLARE statements are more likely to get written than manpages. Thoughts? -- Ian From owner-svn-src-all@freebsd.org Sun Oct 8 18:38:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC51E3CBAD; Sun, 8 Oct 2017 18:38:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 76C2F6B8A6; Sun, 8 Oct 2017 18:38:23 +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 v98IcMfU019623; Sun, 8 Oct 2017 18:38:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98IcMlY019622; Sun, 8 Oct 2017 18:38:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081838.v98IcMlY019622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 18:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324416 - 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: 324416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 18:38:24 -0000 Author: ian Date: Sun Oct 8 18:38:22 2017 New Revision: 324416 URL: https://svnweb.freebsd.org/changeset/base/324416 Log: Fix imx6 hdmi init after r323553, which used a config_intrhook to defer the attachment of i2c devices needed by hdmi. The hdmi init also uses an intrhook callback to defer initialization, and if the hdmi callback runs first, the i2c devices will not yet have registered their device_t in association with their FDT phandle, which allows cross- device references on FDT systems. Now the hdmi deferred init checks for the i2c device registration, and if it's not complete yet, it registers as an eventhandler watching for newbus attach events. When the i2c device eventually attaches, the hdmi driver unregisters from watching further events, and continues with the hdmi init. Because the function signatures for an intrhook callback and an event handler callback are the same, a single function is used for both callbacks. Reported by: Russell Haley Modified: head/sys/arm/freescale/imx/imx6_hdmi.c Modified: head/sys/arm/freescale/imx/imx6_hdmi.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_hdmi.c Sun Oct 8 17:33:49 2017 (r324415) +++ head/sys/arm/freescale/imx/imx6_hdmi.c Sun Oct 8 18:38:22 2017 (r324416) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); struct imx_hdmi_softc { struct dwc_hdmi_softc base; phandle_t i2c_xref; + eventhandler_tag eh_tag; }; static struct ofw_compat_data compat_data[] = { @@ -78,6 +80,48 @@ imx_hdmi_get_i2c_dev(device_t dev) return (OF_device_from_xref(sc->i2c_xref)); } +/* + * Deferred HDMI init. dwc_hdmi_init() does i2c transfers for DDC/EDID. The imx + * i2c devices also use a config_intrhook function to finish their init, because + * they require interrupts to perform transfers. There is no way to control + * whether the i2c or our hdmi intrhook function runs first. If we go first we + * have to continue waiting until after the i2c driver is ready to do transfers + * and has registered its phandle. + * + * This function is used as both a config_intrhook function and after that as an + * eventhandler callback function (if necessary), to see if our i2c device is + * ready yet. When it is, continue with hdmi init. When first called as an + * intrhook function the i2c devices might be ready, in which case we never + * register as an eventhandler at all. Otherwise we register to see newbus + * attach events, and as each device attaches we check to see whether it was the + * i2c device we care about. Once we have our i2c device we unregister from + * seeing further attach events. + */ +static void +imx_hdmi_init(void *dev) +{ + struct imx_hdmi_softc *sc; + + sc = device_get_softc((device_t)dev); + + if (OF_device_from_xref(sc->i2c_xref) != NULL) { + if (sc->eh_tag != NULL) { + EVENTHANDLER_DEREGISTER_NOWAIT(device_attach, + sc->eh_tag); + } + dwc_hdmi_init(dev); + return; + } + + if (bootverbose) + device_printf((device_t)dev, "Waiting for DDC i2c device\n"); + + if (sc->eh_tag == NULL) { + sc->eh_tag = EVENTHANDLER_REGISTER(device_attach, + imx_hdmi_init, dev, EVENTHANDLER_PRI_ANY); + } +} + static int imx_hdmi_detach(device_t dev) { @@ -128,7 +172,9 @@ imx_hdmi_attach(device_t dev) gpr3 |= IOMUXC_GPR3_HDMI_IPU1_DI0; imx_iomux_gpr_set(IOMUXC_GPR3, gpr3); - return (dwc_hdmi_init(dev)); + /* Further HDMI init requires interrupts for i2c transfers. */ + config_intrhook_oneshot(imx_hdmi_init, dev); + return (0); out: imx_hdmi_detach(dev); From owner-svn-src-all@freebsd.org Sun Oct 8 20:54:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63DE1E3FD69; Sun, 8 Oct 2017 20:54:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBFA168867; Sun, 8 Oct 2017 20:54:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98KsvKK079098; Sun, 8 Oct 2017 20:54:57 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98Ksr4N079065; Sun, 8 Oct 2017 20:54:53 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201710082054.v98Ksr4N079065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 8 Oct 2017 20:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324417 - in stable/11: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarch... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchiv... X-SVN-Commit-Revision: 324417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 20:54:58 -0000 Author: mm Date: Sun Oct 8 20:54:53 2017 New Revision: 324417 URL: https://svnweb.freebsd.org/changeset/base/324417 Log: MFH r324148: Sync libarchive with vendor. Relevant vendor changes: PR #905: Support for Zstandard read and write filters PR #922: Avoid overflow when reading corrupt cpio archive Issue #935: heap-based buffer overflow in xml_data (CVE-2017-14166) OSS-Fuzz 2936: Place a limit on the mtree line length OSS-Fuzz 2394: Ensure that the ZIP AES extension header is large enough OSS-Fuzz 573: Read off-by-one error in RAR archives (CVE-2017-14502) Security: CVE-2017-14166, CVE-2017-14502 Added: stable/11/contrib/libarchive/cat/test/test_empty.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu stable/11/contrib/libarchive/cat/test/test_empty_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c stable/11/contrib/libarchive/cat/test/test_expand.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu stable/11/contrib/libarchive/cat/test/test_expand_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c stable/11/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu stable/11/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c stable/11/contrib/libarchive/cpio/test/test_option_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c stable/11/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c stable/11/contrib/libarchive/libarchive/test/test_compat_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_compat_zstd.c stable/11/contrib/libarchive/libarchive/test/test_compat_zstd_1.tar.zst.uu - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_compat_zstd_1.tar.zst.uu stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/11/contrib/libarchive/tar/test/test_extract.tar.zst.uu - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_extract.tar.zst.uu stable/11/contrib/libarchive/tar/test/test_extract_tar_zstd.c - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_extract_tar_zstd.c stable/11/contrib/libarchive/tar/test/test_option_zstd.c - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_option_zstd.c Modified: stable/11/contrib/libarchive/cpio/bsdcpio.1 stable/11/contrib/libarchive/cpio/cmdline.c stable/11/contrib/libarchive/cpio/cpio.c stable/11/contrib/libarchive/cpio/cpio.h stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_cmdline.c stable/11/contrib/libarchive/libarchive/archive_platform.h stable/11/contrib/libarchive/libarchive/archive_read_append_filter.c stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/11/contrib/libarchive/libarchive/archive_read_filter.3 stable/11/contrib/libarchive/libarchive/archive_read_support_filter_all.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_cpio.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/11/contrib/libarchive/libarchive/archive_string.c stable/11/contrib/libarchive/libarchive/archive_version_details.c stable/11/contrib/libarchive/libarchive/archive_write.3 stable/11/contrib/libarchive/libarchive/archive_write_add_filter.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c stable/11/contrib/libarchive/libarchive/archive_write_filter.3 stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/11/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c stable/11/contrib/libarchive/libarchive/test/test_fuzz.c stable/11/contrib/libarchive/tar/bsdtar.1 stable/11/contrib/libarchive/tar/bsdtar.c stable/11/contrib/libarchive/tar/bsdtar.h stable/11/contrib/libarchive/tar/cmdline.c stable/11/contrib/libarchive/tar/creation_set.c stable/11/contrib/libarchive/tar/test/test_option_acls.c stable/11/contrib/libarchive/test_utils/test_common.h stable/11/contrib/libarchive/test_utils/test_main.c stable/11/lib/libarchive/Makefile stable/11/lib/libarchive/tests/Makefile stable/11/usr.bin/bsdcat/tests/Makefile stable/11/usr.bin/cpio/tests/Makefile stable/11/usr.bin/tar/tests/Makefile Directory Properties: stable/11/ (props changed) Copied: stable/11/contrib/libarchive/cat/test/test_empty.zst.uu (from r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cat/test/test_empty.zst.uu Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_empty.zst +-*+4O_010`0``F>G840`` +` +end Copied: stable/11/contrib/libarchive/cat/test/test_empty_zstd.c (from r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cat/test/test_empty_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" + +DEFINE_TEST(test_empty_zstd) +{ + const char *reffile = "test_empty.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: stable/11/contrib/libarchive/cat/test/test_expand.zst.uu (from r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cat/test/test_expand.zst.uu Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_expand.zst +J*+4O_010Z0``8V]N=&5N=',@;V8@=&5S=%]E>'!A;F0N>G-T+@J;23#F +` +end Copied: stable/11/contrib/libarchive/cat/test/test_expand_zstd.c (from r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cat/test/test_expand_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" + +DEFINE_TEST(test_expand_zstd) +{ + const char *reffile = "test_expand.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertTextFileContents("contents of test_expand.zst.\n", "test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Modified: stable/11/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/11/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 8 20:54:53 2017 (r324417) @@ -187,6 +187,11 @@ In input mode, this option is ignored. Compress the archive with lz4-compatible compression before writing it. In input mode, this option is ignored; lz4 compression is recognized automatically on input. +.It Fl Fl zstd +(o mode only) +Compress the archive with zstd-compatible compression before writing it. +In input mode, this option is ignored; zstd compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. Modified: stable/11/contrib/libarchive/cpio/cmdline.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cmdline.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/cpio/cmdline.c Sun Oct 8 20:54:53 2017 (r324417) @@ -92,6 +92,7 @@ static const struct option { { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, + { "zstd", 0, OPTION_ZSTD }, { NULL, 0, 0 } }; Modified: stable/11/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cpio.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/cpio/cpio.c Sun Oct 8 20:54:53 2017 (r324417) @@ -269,6 +269,7 @@ main(int argc, char *argv[]) case OPTION_LZ4: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ + case OPTION_ZSTD: cpio->compress = opt; break; case 'm': /* POSIX 1997 */ @@ -545,6 +546,9 @@ mode_out(struct cpio *cpio) break; case OPTION_LZOP: r = archive_write_add_filter_lzop(cpio->archive); + break; + case OPTION_ZSTD: + r = archive_write_add_filter_zstd(cpio->archive); break; case 'j': case 'y': r = archive_write_add_filter_bzip2(cpio->archive); Modified: stable/11/contrib/libarchive/cpio/cpio.h ============================================================================== --- stable/11/contrib/libarchive/cpio/cpio.h Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/cpio/cpio.h Sun Oct 8 20:54:53 2017 (r324417) @@ -111,7 +111,8 @@ enum { OPTION_PRESERVE_OWNER, OPTION_QUIET, OPTION_UUENCODE, - OPTION_VERSION + OPTION_VERSION, + OPTION_ZSTD, }; int cpio_getopt(struct cpio *cpio); Copied: stable/11/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu (from r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu) @@ -0,0 +1,6 @@ +begin 644 test_extract.cpio.zst +M*+4O_01090,`,@41%X")&@#'G6T\K16_MR)#=DK)5:.1,2J0HY2"!(1!`!7R +M$(UB`2"*D41;J2UF&)<0!Y7X'TU<%W.\W^R]GO-WW^OO^QX0`%P<]30-!#U` +?!KD!`#XP,_`U4`HT3+RF:#!7Y\V@R)5"7P"^;WEUK@`` +` +end Copied: stable/11/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c (from r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_zstd) +{ + const char *reffile = "test_extract.cpio.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: stable/11/contrib/libarchive/cpio/test/test_option_zstd.c (from r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/cpio/test/test_option_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_zstd) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with zstd compression. */ + r = systemf("echo f | %s -o --zstd >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "Unsupported compression") != NULL) { + skipping("This version of bsdcpio was compiled " + "without zstd support"); + goto done; + } + /* POSIX permits different handling of the spawnp + * system call used to launch the subsidiary + * program: */ + /* Some systems fail immediately to spawn the new process. */ + if (strstr(p, "Can't launch") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* Some systems successfully spawn the new process, + * but fail to exec a program within that process. + * This results in failure at the first attempt to + * write. */ + if (strstr(p, "Can't write") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* On some systems the error won't be detected until closing + time, by a 127 exit error returned by waitpid. */ + if (strstr(p, "Error closing") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + return; + } + failure("--zstd option is broken: %s", p); + assertEqualInt(r, 0); + goto done; + } + free(p); + /* Check that the archive file has an zstd signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x28\xb5\x2f\xfd", 4); + +done: + free(p); +} Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive.h Sun Oct 8 20:54:53 2017 (r324417) @@ -177,6 +177,7 @@ __LA_DECL const char * archive_zlib_version(void); __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); +__LA_DECL const char * archive_libzstd_version(void); /* Declare our basic types. */ struct archive; @@ -276,6 +277,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FILTER_LZOP 11 #define ARCHIVE_FILTER_GRZIP 12 #define ARCHIVE_FILTER_LZ4 13 +#define ARCHIVE_FILTER_ZSTD 14 #if ARCHIVE_VERSION_NUMBER < 4000000 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE @@ -433,6 +435,7 @@ __LA_DECL int archive_read_support_filter_program_sign __LA_DECL int archive_read_support_filter_rpm(struct archive *); __LA_DECL int archive_read_support_filter_uu(struct archive *); __LA_DECL int archive_read_support_filter_xz(struct archive *); +__LA_DECL int archive_read_support_filter_zstd(struct archive *); __LA_DECL int archive_read_support_format_7zip(struct archive *); __LA_DECL int archive_read_support_format_all(struct archive *); @@ -778,6 +781,7 @@ __LA_DECL int archive_write_add_filter_program(struct const char *cmd); __LA_DECL int archive_write_add_filter_uuencode(struct archive *); __LA_DECL int archive_write_add_filter_xz(struct archive *); +__LA_DECL int archive_write_add_filter_zstd(struct archive *); /* A convenience function to set the format based on the code or name. */ Modified: stable/11/contrib/libarchive/libarchive/archive_cmdline.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 8 20:54:53 2017 (r324417) @@ -100,10 +100,10 @@ get_argument(struct archive_string *as, const char *p) /* * Set up command line arguments. - * Returns ARChIVE_OK if everything okey. - * Returns ARChIVE_FAILED if there is a lack of the `"' terminator or an + * Returns ARCHIVE_OK if everything okey. + * Returns ARCHIVE_FAILED if there is a lack of the `"' terminator or an * empty command line. - * Returns ARChIVE_FATAL if no memory. + * Returns ARCHIVE_FATAL if no memory. */ int __archive_cmdline_parse(struct archive_cmdline *data, const char *cmd) Modified: stable/11/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_platform.h Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_platform.h Sun Oct 8 20:54:53 2017 (r324417) @@ -52,6 +52,17 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* On macOS check for some symbols based on the deployment target version. */ +#if defined(__APPLE__) +# undef HAVE_FUTIMENS +# undef HAVE_UTIMENSAT +# include +# if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 +# define HAVE_FUTIMENS 1 +# define HAVE_UTIMENSAT 1 +# endif +#endif + /* It should be possible to get rid of this by extending the feature-test * macros to cover Windows API functions, probably along with non-trivial * refactoring of code to find structures that sit more cleanly on top of Modified: stable/11/contrib/libarchive/libarchive/archive_read_append_filter.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 8 20:54:53 2017 (r324417) @@ -89,6 +89,10 @@ archive_read_append_filter(struct archive *_a, int cod strcpy(str, "lz4"); r1 = archive_read_support_filter_lz4(_a); break; + case ARCHIVE_FILTER_ZSTD: + strcpy(str, "zstd"); + r1 = archive_read_support_filter_zstd(_a); + break; case ARCHIVE_FILTER_LZIP: strcpy(str, "lzip"); r1 = archive_read_support_filter_lzip(_a); Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 8 20:54:53 2017 (r324417) @@ -127,7 +127,7 @@ archive_read_disk_entry_setup_acls(struct archive_read /* * Enter working directory and return working pathname of archive_entry. * If a pointer to an integer is provided and its value is below zero - * open a file descriptor on this pahtname. + * open a file descriptor on this pathname. */ const char * archive_read_disk_entry_setup_path(struct archive_read_disk *a, Modified: stable/11/contrib/libarchive/libarchive/archive_read_filter.3 ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 8 20:54:53 2017 (r324417) @@ -38,6 +38,7 @@ .Nm archive_read_support_filter_rpm , .Nm archive_read_support_filter_uu , .Nm archive_read_support_filter_xz , +.Nm archive_read_support_filter_zstd , .Nm archive_read_support_filter_program , .Nm archive_read_support_filter_program_signature .Nd functions for reading streaming archives @@ -73,6 +74,8 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_xz "struct archive *" .Ft int +.Fn archive_read_support_filter_zstd "struct archive *" +.Ft int .Fo archive_read_support_filter_program .Fa "struct archive *" .Fa "const char *cmd" @@ -99,7 +102,8 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_read_support_filter_none , .Fn archive_read_support_filter_rpm , .Fn archive_read_support_filter_uu , -.Fn archive_read_support_filter_xz +.Fn archive_read_support_filter_xz , +.Fn archive_read_support_filter_zstd , .Xc Enables auto-detection code and decompression support for the specified compression. Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_filter_all.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 8 20:54:53 2017 (r324417) @@ -71,6 +71,8 @@ archive_read_support_filter_all(struct archive *a) archive_read_support_filter_grzip(a); /* Lz4 falls back to "lz4 -d" command-line program. */ archive_read_support_filter_lz4(a); + /* Zstd falls back to "zstd -d" command-line program. */ + archive_read_support_filter_zstd(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable Copied: stable/11/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c (from r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c) @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 2009-2011 Sean Purcell + * 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(S) ``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(S) 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 "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#if HAVE_ZSTD_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#if HAVE_ZSTD_H && HAVE_LIBZSTD + +struct private_data { + ZSTD_DStream *dstream; + unsigned char *out_block; + size_t out_block_size; + int64_t total_out; + char in_frame; /* True = in the middle of a zstd frame. */ + char eof; /* True = found end of compressed data. */ +}; + +/* Zstd Filter. */ +static ssize_t zstd_filter_read(struct archive_read_filter *, const void**); +static int zstd_filter_close(struct archive_read_filter *); +#endif + +/* + * Note that we can detect zstd compressed files even if we can't decompress + * them. (In fact, we like detecting them because we can give better error + * messages.) So the bid framework here gets compiled even if no zstd library + * is available. + */ +static int zstd_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int zstd_bidder_init(struct archive_read_filter *); + +int +archive_read_support_filter_zstd(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *bidder; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_zstd"); + + if (__archive_read_get_bidder(a, &bidder) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + bidder->data = NULL; + bidder->name = "zstd"; + bidder->bid = zstd_bidder_bid; + bidder->init = zstd_bidder_init; + bidder->options = NULL; + bidder->free = NULL; +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return (ARCHIVE_OK); +#else + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external zstd program for zstd decompression"); + return (ARCHIVE_WARN); +#endif +} + +/* + * Test whether we can handle this data. + */ +static int +zstd_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *buffer; + ssize_t avail; + unsigned prefix; + + /* Zstd frame magic values */ + const unsigned zstd_magic = 0xFD2FB528U; + + (void) self; /* UNUSED */ + + buffer = __archive_read_filter_ahead(filter, 4, &avail); + if (buffer == NULL) + return (0); + + prefix = archive_le32dec(buffer); + if (prefix == zstd_magic) + return (32); + + return (0); +} + +#if !(HAVE_ZSTD_H && HAVE_LIBZSTD) + +/* + * If we don't have the library on this system, we can't do the + * decompression directly. We can, however, try to run "zstd -d" + * in case that's available. + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "zstd -d -qq"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + return (r); +} + +#else + +/* + * Initialize the filter object + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + struct private_data *state; + const size_t out_block_size = ZSTD_DStreamOutSize(); + void *out_block; + ZSTD_DStream *dstream; + + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + + state = (struct private_data *)calloc(sizeof(*state), 1); + out_block = (unsigned char *)malloc(out_block_size); + dstream = ZSTD_createDStream(); + + if (state == NULL || out_block == NULL || dstream == NULL) { + free(out_block); + free(state); + ZSTD_freeDStream(dstream); /* supports free on NULL */ + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for zstd decompression"); + return (ARCHIVE_FATAL); + } + + self->data = state; + + state->out_block_size = out_block_size; + state->out_block = out_block; + state->dstream = dstream; + self->read = zstd_filter_read; + self->skip = NULL; /* not supported */ + self->close = zstd_filter_close; + + state->eof = 0; + state->in_frame = 0; + + return (ARCHIVE_OK); +} + +static ssize_t +zstd_filter_read(struct archive_read_filter *self, const void **p) +{ + struct private_data *state; + size_t decompressed; + ssize_t avail_in; + ZSTD_outBuffer out; + ZSTD_inBuffer in; + + state = (struct private_data *)self->data; + + out = (ZSTD_outBuffer) { state->out_block, state->out_block_size, 0 }; + + /* Try to fill the output buffer. */ + while (out.pos < out.size && !state->eof) { + if (!state->in_frame) { + const size_t ret = ZSTD_initDStream(state->dstream); + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Error initializing zstd decompressor: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + } + in.src = __archive_read_filter_ahead(self->upstream, 1, + &avail_in); + if (avail_in < 0) { + return avail_in; + } + if (in.src == NULL && avail_in == 0) { + if (!state->in_frame) { + /* end of stream */ + state->eof = 1; + break; + } else { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Truncated zstd input"); + return (ARCHIVE_FATAL); + } + } + in.size = avail_in; + in.pos = 0; + + { + const size_t ret = + ZSTD_decompressStream(state->dstream, &out, &in); + + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Zstd decompression failed: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + + /* Decompressor made some progress */ + __archive_read_filter_consume(self->upstream, in.pos); + + /* ret guaranteed to be > 0 if frame isn't done yet */ + state->in_frame = (ret != 0); + } + } + + decompressed = out.pos; + state->total_out += decompressed; + if (decompressed == 0) + *p = NULL; + else + *p = state->out_block; + return (decompressed); +} + +/* + * Clean up the decompressor. + */ +static int +zstd_filter_close(struct archive_read_filter *self) +{ + struct private_data *state; + + state = (struct private_data *)self->data; + + ZSTD_freeDStream(state->dstream); + free(state->out_block); + free(state); + + return (ARCHIVE_OK); +} + +#endif /* HAVE_ZLIB_H && HAVE_LIBZSTD */ Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 8 20:54:53 2017 (r324417) @@ -633,6 +633,13 @@ header_newc(struct archive_read *a, struct cpio *cpio, /* Pad name to 2 more than a multiple of 4. */ *name_pad = (2 - *namelength) & 3; + /* Make sure that the padded name length fits into size_t. */ + if (*name_pad > SIZE_MAX - *namelength) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "cpio archive has invalid namelength"); + return (ARCHIVE_FATAL); + } + /* * Note: entry_bytes_remaining is at least 64 bits and * therefore guaranteed to be big enough for a 33-bit file Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 8 20:54:53 2017 (r324417) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HASHTABLE_SIZE 1024 +#define MAX_LINE_LEN (1024 * 1024) + struct mtree_option { struct mtree_option *next; char *value; @@ -333,6 +335,14 @@ next_line(struct archive_read *a, ssize_t diff = *ravail - *avail; size_t nbytes_req = (*ravail+1023) & ~1023U; ssize_t tested; + + /* + * Place an arbitrary limit on the line length. + * mtree is almost free-form input and without line length limits, + * it can consume a lot of memory. + */ + if (len >= MAX_LINE_LEN) + return (-1); /* Increase reading bytes if it is not enough to at least * new two lines. */ Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 8 20:54:53 2017 (r324417) @@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_ent return (ARCHIVE_FATAL); } filename[filename_size++] = '\0'; - filename[filename_size++] = '\0'; + /* + * Do not increment filename_size here as the computations below + * add the space for the terminating NUL explicitly. + */ + filename[filename_size] = '\0'; /* Decoded unicode form is UTF-16BE, so we have to update a string * conversion object for it. */ Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 8 20:54:53 2017 (r324417) @@ -2243,7 +2243,7 @@ gnu_add_sparse_entry(struct archive_read *a, struct ta else tar->sparse_list = p; tar->sparse_last = p; - if (remaining < 0 || offset < 0) { + if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data"); return (ARCHIVE_FATAL); } Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 8 20:54:53 2017 (r324417) @@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt) uint64_t l; int digit; + if (char_cnt == 0) + return (0); + l = 0; digit = *p - '0'; while (digit >= 0 && digit < 10 && char_cnt-- > 0) { @@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt) { int64_t l; int digit; - + + if (char_cnt == 0) + return (0); + l = 0; while (char_cnt-- > 0) { if (*p >= '0' && *p <= '7') @@ -2623,6 +2629,14 @@ strappend_base64(struct xar *xar, archive_strncat(as, (const char *)buff, len); } +static int +is_string(const char *known, const char *data, size_t len) +{ + if (strlen(known) != len) + return -1; + return memcmp(data, known, len); +} + static void xml_data(void *userData, const char *s, int len) { @@ -2674,26 +2688,26 @@ xml_data(void *userData, const char *s, int len) archive_strncpy(&(xar->file->symlink), s, len); break; case FILE_TYPE: - if (strncmp("file", s, len) == 0 || - strncmp("hardlink", s, len) == 0) + if (is_string("file", s, len) == 0 || + is_string("hardlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFREG; - if (strncmp("directory", s, len) == 0) + if (is_string("directory", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFDIR; - if (strncmp("symlink", s, len) == 0) + if (is_string("symlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFLNK; - if (strncmp("character special", s, len) == 0) + if (is_string("character special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFCHR; - if (strncmp("block special", s, len) == 0) + if (is_string("block special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFBLK; - if (strncmp("socket", s, len) == 0) + if (is_string("socket", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFSOCK; - if (strncmp("fifo", s, len) == 0) + if (is_string("fifo", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFIFO; xar->file->has |= HAS_TYPE; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 8 20:54:53 2017 (r324417) @@ -723,6 +723,11 @@ process_extra(struct archive_read *a, const char *p, s } case 0x9901: /* WinZip AES extra data field. */ + if (datasize < 6) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Incomplete AES field"); + return ARCHIVE_FAILED; + } if (p[offset + 2] == 'A' && p[offset + 3] == 'E') { /* Vendor version. */ zip_entry->aes_extra.vendor = Modified: stable/11/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_string.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_string.c Sun Oct 8 20:54:53 2017 (r324417) @@ -214,7 +214,8 @@ archive_wstring_append(struct archive_wstring *as, con { if (archive_wstring_ensure(as, as->length + s + 1) == NULL) return (NULL); - wmemmove(as->s + as->length, p, s); + if (s) + wmemmove(as->s + as->length, p, s); as->length += s; as->s[as->length] = 0; return (as); Modified: stable/11/contrib/libarchive/libarchive/archive_version_details.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 8 20:54:53 2017 (r324417) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_LZ4_H #include #endif +#ifdef HAVE_ZSTD_H +#include +#endif #include "archive.h" #include "archive_private.h" @@ -59,6 +62,7 @@ archive_version_details(void) const char *liblzma = archive_liblzma_version(); const char *bzlib = archive_bzlib_version(); const char *liblz4 = archive_liblz4_version(); + const char *libzstd = archive_libzstd_version(); if (!init) { archive_string_init(&str); @@ -84,6 +88,10 @@ archive_version_details(void) archive_strcat(&str, " liblz4/"); archive_strcat(&str, liblz4); } + if (libzstd) { + archive_strcat(&str, " libzstd/"); + archive_strcat(&str, libzstd); + } } return str.s; } @@ -127,6 +135,16 @@ archive_liblz4_version(void) return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE); #undef NUMBER #undef str +#else + return NULL; +#endif +} + +const char * +archive_libzstd_version(void) +{ +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return ZSTD_VERSION_STRING; #else return NULL; #endif Modified: stable/11/contrib/libarchive/libarchive/archive_write.3 ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write.3 Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_write.3 Sun Oct 8 20:54:53 2017 (r324417) @@ -71,7 +71,7 @@ support. .\" .Ss Set options See -.Xr archive_read_set_options 3 . +.Xr archive_write_set_options 3 . .\" .Ss Open archive See Modified: stable/11/contrib/libarchive/libarchive/archive_write_add_filter.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 8 20:54:53 2017 (r324417) @@ -53,6 +53,7 @@ struct { int code; int (*setter)(struct archive *); } { ARCHIVE_FILTER_LZOP, archive_write_add_filter_lzip }, { ARCHIVE_FILTER_UU, archive_write_add_filter_uuencode }, { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, + { ARCHIVE_FILTER_ZSTD, archive_write_add_filter_zstd }, { -1, NULL } }; Modified: stable/11/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 8 18:38:22 2017 (r324416) +++ stable/11/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 8 20:54:53 2017 (r324417) @@ -57,6 +57,7 @@ struct { const char *name; int (*setter)(struct archiv { "lzop", archive_write_add_filter_lzop }, { "uuencode", archive_write_add_filter_uuencode }, { "xz", archive_write_add_filter_xz }, + { "zstd", archive_write_add_filter_zstd }, { NULL, NULL } }; Copied: stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c (from r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c Sun Oct 8 20:54:53 2017 (r324417, copy of r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Oct 8 20:55:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0A2E3FDD8; Sun, 8 Oct 2017 20:55:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89FC668B01; Sun, 8 Oct 2017 20:55:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98Ktm3G079223; Sun, 8 Oct 2017 20:55:48 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98Ktj9O079189; Sun, 8 Oct 2017 20:55:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201710082055.v98Ktj9O079189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 8 Oct 2017 20:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324418 - in stable/10: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarch... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchiv... X-SVN-Commit-Revision: 324418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 20:55:50 -0000 Author: mm Date: Sun Oct 8 20:55:45 2017 New Revision: 324418 URL: https://svnweb.freebsd.org/changeset/base/324418 Log: MFH r324148: Sync libarchive with vendor. Relevant vendor changes: PR #905: Support for Zstandard read and write filters PR #922: Avoid overflow when reading corrupt cpio archive Issue #935: heap-based buffer overflow in xml_data (CVE-2017-14166) OSS-Fuzz 2936: Place a limit on the mtree line length OSS-Fuzz 2394: Ensure that the ZIP AES extension header is large enough OSS-Fuzz 573: Read off-by-one error in RAR archives (CVE-2017-14502) Security: CVE-2017-14166, CVE-2017-14502 Added: stable/10/contrib/libarchive/cat/test/test_empty.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu stable/10/contrib/libarchive/cat/test/test_empty_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c stable/10/contrib/libarchive/cat/test/test_expand.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu stable/10/contrib/libarchive/cat/test/test_expand_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c stable/10/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu stable/10/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c stable/10/contrib/libarchive/cpio/test/test_option_zstd.c - copied unchanged from r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c stable/10/contrib/libarchive/libarchive/test/test_compat_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_compat_zstd.c stable/10/contrib/libarchive/libarchive/test/test_compat_zstd_1.tar.zst.uu - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_compat_zstd_1.tar.zst.uu stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c - copied unchanged from r324148, head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/10/contrib/libarchive/tar/test/test_extract.tar.zst.uu - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_extract.tar.zst.uu stable/10/contrib/libarchive/tar/test/test_extract_tar_zstd.c - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_extract_tar_zstd.c stable/10/contrib/libarchive/tar/test/test_option_zstd.c - copied unchanged from r324148, head/contrib/libarchive/tar/test/test_option_zstd.c Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 stable/10/contrib/libarchive/cpio/cmdline.c stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/cpio/cpio.h stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_cmdline.c stable/10/contrib/libarchive/libarchive/archive_platform.h stable/10/contrib/libarchive/libarchive/archive_read_append_filter.c stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_filter.3 stable/10/contrib/libarchive/libarchive/archive_read_support_filter_all.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_string.c stable/10/contrib/libarchive/libarchive/archive_version_details.c stable/10/contrib/libarchive/libarchive/archive_write.3 stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c stable/10/contrib/libarchive/libarchive/archive_write_filter.3 stable/10/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/10/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c stable/10/contrib/libarchive/libarchive/test/test_fuzz.c stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/contrib/libarchive/tar/bsdtar.c stable/10/contrib/libarchive/tar/bsdtar.h stable/10/contrib/libarchive/tar/cmdline.c stable/10/contrib/libarchive/tar/creation_set.c stable/10/contrib/libarchive/tar/test/test_option_acls.c stable/10/contrib/libarchive/test_utils/test_common.h stable/10/contrib/libarchive/test_utils/test_main.c stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/bsdcat/tests/Makefile stable/10/usr.bin/cpio/tests/Makefile stable/10/usr.bin/tar/tests/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/libarchive/cat/test/test_empty.zst.uu (from r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cat/test/test_empty.zst.uu Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cat/test/test_empty.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_empty.zst +-*+4O_010`0``F>G840`` +` +end Copied: stable/10/contrib/libarchive/cat/test/test_empty_zstd.c (from r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cat/test/test_empty_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cat/test/test_empty_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" + +DEFINE_TEST(test_empty_zstd) +{ + const char *reffile = "test_empty.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: stable/10/contrib/libarchive/cat/test/test_expand.zst.uu (from r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cat/test/test_expand.zst.uu Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cat/test/test_expand.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_expand.zst +J*+4O_010Z0``8V]N=&5N=',@;V8@=&5S=%]E>'!A;F0N>G-T+@J;23#F +` +end Copied: stable/10/contrib/libarchive/cat/test/test_expand_zstd.c (from r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cat/test/test_expand_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cat/test/test_expand_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" + +DEFINE_TEST(test_expand_zstd) +{ + const char *reffile = "test_expand.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertTextFileContents("contents of test_expand.zst.\n", "test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/10/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 8 20:55:45 2017 (r324418) @@ -187,6 +187,11 @@ In input mode, this option is ignored. Compress the archive with lz4-compatible compression before writing it. In input mode, this option is ignored; lz4 compression is recognized automatically on input. +.It Fl Fl zstd +(o mode only) +Compress the archive with zstd-compatible compression before writing it. +In input mode, this option is ignored; zstd compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. Modified: stable/10/contrib/libarchive/cpio/cmdline.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cmdline.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/cpio/cmdline.c Sun Oct 8 20:55:45 2017 (r324418) @@ -92,6 +92,7 @@ static const struct option { { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, + { "zstd", 0, OPTION_ZSTD }, { NULL, 0, 0 } }; Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/cpio/cpio.c Sun Oct 8 20:55:45 2017 (r324418) @@ -269,6 +269,7 @@ main(int argc, char *argv[]) case OPTION_LZ4: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ + case OPTION_ZSTD: cpio->compress = opt; break; case 'm': /* POSIX 1997 */ @@ -545,6 +546,9 @@ mode_out(struct cpio *cpio) break; case OPTION_LZOP: r = archive_write_add_filter_lzop(cpio->archive); + break; + case OPTION_ZSTD: + r = archive_write_add_filter_zstd(cpio->archive); break; case 'j': case 'y': r = archive_write_add_filter_bzip2(cpio->archive); Modified: stable/10/contrib/libarchive/cpio/cpio.h ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.h Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/cpio/cpio.h Sun Oct 8 20:55:45 2017 (r324418) @@ -111,7 +111,8 @@ enum { OPTION_PRESERVE_OWNER, OPTION_QUIET, OPTION_UUENCODE, - OPTION_VERSION + OPTION_VERSION, + OPTION_ZSTD, }; int cpio_getopt(struct cpio *cpio); Copied: stable/10/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu (from r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu) @@ -0,0 +1,6 @@ +begin 644 test_extract.cpio.zst +M*+4O_01090,`,@41%X")&@#'G6T\K16_MR)#=DK)5:.1,2J0HY2"!(1!`!7R +M$(UB`2"*D41;J2UF&)<0!Y7X'TU<%W.\W^R]GO-WW^OO^QX0`%P<]30-!#U` +?!KD!`#XP,_`U4`HT3+RF:#!7Y\V@R)5"7P"^;WEUK@`` +` +end Copied: stable/10/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c (from r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_zstd) +{ + const char *reffile = "test_extract.cpio.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: stable/10/contrib/libarchive/cpio/test/test_option_zstd.c (from r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cpio/test/test_option_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/cpio/test/test_option_zstd.c) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_zstd) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with zstd compression. */ + r = systemf("echo f | %s -o --zstd >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "Unsupported compression") != NULL) { + skipping("This version of bsdcpio was compiled " + "without zstd support"); + goto done; + } + /* POSIX permits different handling of the spawnp + * system call used to launch the subsidiary + * program: */ + /* Some systems fail immediately to spawn the new process. */ + if (strstr(p, "Can't launch") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* Some systems successfully spawn the new process, + * but fail to exec a program within that process. + * This results in failure at the first attempt to + * write. */ + if (strstr(p, "Can't write") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* On some systems the error won't be detected until closing + time, by a 127 exit error returned by waitpid. */ + if (strstr(p, "Error closing") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + return; + } + failure("--zstd option is broken: %s", p); + assertEqualInt(r, 0); + goto done; + } + free(p); + /* Check that the archive file has an zstd signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x28\xb5\x2f\xfd", 4); + +done: + free(p); +} Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive.h Sun Oct 8 20:55:45 2017 (r324418) @@ -177,6 +177,7 @@ __LA_DECL const char * archive_zlib_version(void); __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); +__LA_DECL const char * archive_libzstd_version(void); /* Declare our basic types. */ struct archive; @@ -276,6 +277,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FILTER_LZOP 11 #define ARCHIVE_FILTER_GRZIP 12 #define ARCHIVE_FILTER_LZ4 13 +#define ARCHIVE_FILTER_ZSTD 14 #if ARCHIVE_VERSION_NUMBER < 4000000 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE @@ -433,6 +435,7 @@ __LA_DECL int archive_read_support_filter_program_sign __LA_DECL int archive_read_support_filter_rpm(struct archive *); __LA_DECL int archive_read_support_filter_uu(struct archive *); __LA_DECL int archive_read_support_filter_xz(struct archive *); +__LA_DECL int archive_read_support_filter_zstd(struct archive *); __LA_DECL int archive_read_support_format_7zip(struct archive *); __LA_DECL int archive_read_support_format_all(struct archive *); @@ -778,6 +781,7 @@ __LA_DECL int archive_write_add_filter_program(struct const char *cmd); __LA_DECL int archive_write_add_filter_uuencode(struct archive *); __LA_DECL int archive_write_add_filter_xz(struct archive *); +__LA_DECL int archive_write_add_filter_zstd(struct archive *); /* A convenience function to set the format based on the code or name. */ Modified: stable/10/contrib/libarchive/libarchive/archive_cmdline.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 8 20:55:45 2017 (r324418) @@ -100,10 +100,10 @@ get_argument(struct archive_string *as, const char *p) /* * Set up command line arguments. - * Returns ARChIVE_OK if everything okey. - * Returns ARChIVE_FAILED if there is a lack of the `"' terminator or an + * Returns ARCHIVE_OK if everything okey. + * Returns ARCHIVE_FAILED if there is a lack of the `"' terminator or an * empty command line. - * Returns ARChIVE_FATAL if no memory. + * Returns ARCHIVE_FATAL if no memory. */ int __archive_cmdline_parse(struct archive_cmdline *data, const char *cmd) Modified: stable/10/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_platform.h Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_platform.h Sun Oct 8 20:55:45 2017 (r324418) @@ -52,6 +52,17 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* On macOS check for some symbols based on the deployment target version. */ +#if defined(__APPLE__) +# undef HAVE_FUTIMENS +# undef HAVE_UTIMENSAT +# include +# if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 +# define HAVE_FUTIMENS 1 +# define HAVE_UTIMENSAT 1 +# endif +#endif + /* It should be possible to get rid of this by extending the feature-test * macros to cover Windows API functions, probably along with non-trivial * refactoring of code to find structures that sit more cleanly on top of Modified: stable/10/contrib/libarchive/libarchive/archive_read_append_filter.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 8 20:55:45 2017 (r324418) @@ -89,6 +89,10 @@ archive_read_append_filter(struct archive *_a, int cod strcpy(str, "lz4"); r1 = archive_read_support_filter_lz4(_a); break; + case ARCHIVE_FILTER_ZSTD: + strcpy(str, "zstd"); + r1 = archive_read_support_filter_zstd(_a); + break; case ARCHIVE_FILTER_LZIP: strcpy(str, "lzip"); r1 = archive_read_support_filter_lzip(_a); Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 8 20:55:45 2017 (r324418) @@ -127,7 +127,7 @@ archive_read_disk_entry_setup_acls(struct archive_read /* * Enter working directory and return working pathname of archive_entry. * If a pointer to an integer is provided and its value is below zero - * open a file descriptor on this pahtname. + * open a file descriptor on this pathname. */ const char * archive_read_disk_entry_setup_path(struct archive_read_disk *a, Modified: stable/10/contrib/libarchive/libarchive/archive_read_filter.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 8 20:55:45 2017 (r324418) @@ -38,6 +38,7 @@ .Nm archive_read_support_filter_rpm , .Nm archive_read_support_filter_uu , .Nm archive_read_support_filter_xz , +.Nm archive_read_support_filter_zstd , .Nm archive_read_support_filter_program , .Nm archive_read_support_filter_program_signature .Nd functions for reading streaming archives @@ -73,6 +74,8 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_xz "struct archive *" .Ft int +.Fn archive_read_support_filter_zstd "struct archive *" +.Ft int .Fo archive_read_support_filter_program .Fa "struct archive *" .Fa "const char *cmd" @@ -99,7 +102,8 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_read_support_filter_none , .Fn archive_read_support_filter_rpm , .Fn archive_read_support_filter_uu , -.Fn archive_read_support_filter_xz +.Fn archive_read_support_filter_xz , +.Fn archive_read_support_filter_zstd , .Xc Enables auto-detection code and decompression support for the specified compression. Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_filter_all.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 8 20:55:45 2017 (r324418) @@ -71,6 +71,8 @@ archive_read_support_filter_all(struct archive *a) archive_read_support_filter_grzip(a); /* Lz4 falls back to "lz4 -d" command-line program. */ archive_read_support_filter_lz4(a); + /* Zstd falls back to "zstd -d" command-line program. */ + archive_read_support_filter_zstd(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable Copied: stable/10/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c (from r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c) @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 2009-2011 Sean Purcell + * 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(S) ``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(S) 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 "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#if HAVE_ZSTD_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#if HAVE_ZSTD_H && HAVE_LIBZSTD + +struct private_data { + ZSTD_DStream *dstream; + unsigned char *out_block; + size_t out_block_size; + int64_t total_out; + char in_frame; /* True = in the middle of a zstd frame. */ + char eof; /* True = found end of compressed data. */ +}; + +/* Zstd Filter. */ +static ssize_t zstd_filter_read(struct archive_read_filter *, const void**); +static int zstd_filter_close(struct archive_read_filter *); +#endif + +/* + * Note that we can detect zstd compressed files even if we can't decompress + * them. (In fact, we like detecting them because we can give better error + * messages.) So the bid framework here gets compiled even if no zstd library + * is available. + */ +static int zstd_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int zstd_bidder_init(struct archive_read_filter *); + +int +archive_read_support_filter_zstd(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *bidder; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_zstd"); + + if (__archive_read_get_bidder(a, &bidder) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + bidder->data = NULL; + bidder->name = "zstd"; + bidder->bid = zstd_bidder_bid; + bidder->init = zstd_bidder_init; + bidder->options = NULL; + bidder->free = NULL; +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return (ARCHIVE_OK); +#else + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external zstd program for zstd decompression"); + return (ARCHIVE_WARN); +#endif +} + +/* + * Test whether we can handle this data. + */ +static int +zstd_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *buffer; + ssize_t avail; + unsigned prefix; + + /* Zstd frame magic values */ + const unsigned zstd_magic = 0xFD2FB528U; + + (void) self; /* UNUSED */ + + buffer = __archive_read_filter_ahead(filter, 4, &avail); + if (buffer == NULL) + return (0); + + prefix = archive_le32dec(buffer); + if (prefix == zstd_magic) + return (32); + + return (0); +} + +#if !(HAVE_ZSTD_H && HAVE_LIBZSTD) + +/* + * If we don't have the library on this system, we can't do the + * decompression directly. We can, however, try to run "zstd -d" + * in case that's available. + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "zstd -d -qq"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + return (r); +} + +#else + +/* + * Initialize the filter object + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + struct private_data *state; + const size_t out_block_size = ZSTD_DStreamOutSize(); + void *out_block; + ZSTD_DStream *dstream; + + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + + state = (struct private_data *)calloc(sizeof(*state), 1); + out_block = (unsigned char *)malloc(out_block_size); + dstream = ZSTD_createDStream(); + + if (state == NULL || out_block == NULL || dstream == NULL) { + free(out_block); + free(state); + ZSTD_freeDStream(dstream); /* supports free on NULL */ + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for zstd decompression"); + return (ARCHIVE_FATAL); + } + + self->data = state; + + state->out_block_size = out_block_size; + state->out_block = out_block; + state->dstream = dstream; + self->read = zstd_filter_read; + self->skip = NULL; /* not supported */ + self->close = zstd_filter_close; + + state->eof = 0; + state->in_frame = 0; + + return (ARCHIVE_OK); +} + +static ssize_t +zstd_filter_read(struct archive_read_filter *self, const void **p) +{ + struct private_data *state; + size_t decompressed; + ssize_t avail_in; + ZSTD_outBuffer out; + ZSTD_inBuffer in; + + state = (struct private_data *)self->data; + + out = (ZSTD_outBuffer) { state->out_block, state->out_block_size, 0 }; + + /* Try to fill the output buffer. */ + while (out.pos < out.size && !state->eof) { + if (!state->in_frame) { + const size_t ret = ZSTD_initDStream(state->dstream); + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Error initializing zstd decompressor: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + } + in.src = __archive_read_filter_ahead(self->upstream, 1, + &avail_in); + if (avail_in < 0) { + return avail_in; + } + if (in.src == NULL && avail_in == 0) { + if (!state->in_frame) { + /* end of stream */ + state->eof = 1; + break; + } else { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Truncated zstd input"); + return (ARCHIVE_FATAL); + } + } + in.size = avail_in; + in.pos = 0; + + { + const size_t ret = + ZSTD_decompressStream(state->dstream, &out, &in); + + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Zstd decompression failed: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + + /* Decompressor made some progress */ + __archive_read_filter_consume(self->upstream, in.pos); + + /* ret guaranteed to be > 0 if frame isn't done yet */ + state->in_frame = (ret != 0); + } + } + + decompressed = out.pos; + state->total_out += decompressed; + if (decompressed == 0) + *p = NULL; + else + *p = state->out_block; + return (decompressed); +} + +/* + * Clean up the decompressor. + */ +static int +zstd_filter_close(struct archive_read_filter *self) +{ + struct private_data *state; + + state = (struct private_data *)self->data; + + ZSTD_freeDStream(state->dstream); + free(state->out_block); + free(state); + + return (ARCHIVE_OK); +} + +#endif /* HAVE_ZLIB_H && HAVE_LIBZSTD */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 8 20:55:45 2017 (r324418) @@ -633,6 +633,13 @@ header_newc(struct archive_read *a, struct cpio *cpio, /* Pad name to 2 more than a multiple of 4. */ *name_pad = (2 - *namelength) & 3; + /* Make sure that the padded name length fits into size_t. */ + if (*name_pad > SIZE_MAX - *namelength) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "cpio archive has invalid namelength"); + return (ARCHIVE_FATAL); + } + /* * Note: entry_bytes_remaining is at least 64 bits and * therefore guaranteed to be big enough for a 33-bit file Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 8 20:55:45 2017 (r324418) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HASHTABLE_SIZE 1024 +#define MAX_LINE_LEN (1024 * 1024) + struct mtree_option { struct mtree_option *next; char *value; @@ -333,6 +335,14 @@ next_line(struct archive_read *a, ssize_t diff = *ravail - *avail; size_t nbytes_req = (*ravail+1023) & ~1023U; ssize_t tested; + + /* + * Place an arbitrary limit on the line length. + * mtree is almost free-form input and without line length limits, + * it can consume a lot of memory. + */ + if (len >= MAX_LINE_LEN) + return (-1); /* Increase reading bytes if it is not enough to at least * new two lines. */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 8 20:55:45 2017 (r324418) @@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_ent return (ARCHIVE_FATAL); } filename[filename_size++] = '\0'; - filename[filename_size++] = '\0'; + /* + * Do not increment filename_size here as the computations below + * add the space for the terminating NUL explicitly. + */ + filename[filename_size] = '\0'; /* Decoded unicode form is UTF-16BE, so we have to update a string * conversion object for it. */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 8 20:55:45 2017 (r324418) @@ -2243,7 +2243,7 @@ gnu_add_sparse_entry(struct archive_read *a, struct ta else tar->sparse_list = p; tar->sparse_last = p; - if (remaining < 0 || offset < 0) { + if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data"); return (ARCHIVE_FATAL); } Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 8 20:55:45 2017 (r324418) @@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt) uint64_t l; int digit; + if (char_cnt == 0) + return (0); + l = 0; digit = *p - '0'; while (digit >= 0 && digit < 10 && char_cnt-- > 0) { @@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt) { int64_t l; int digit; - + + if (char_cnt == 0) + return (0); + l = 0; while (char_cnt-- > 0) { if (*p >= '0' && *p <= '7') @@ -2623,6 +2629,14 @@ strappend_base64(struct xar *xar, archive_strncat(as, (const char *)buff, len); } +static int +is_string(const char *known, const char *data, size_t len) +{ + if (strlen(known) != len) + return -1; + return memcmp(data, known, len); +} + static void xml_data(void *userData, const char *s, int len) { @@ -2674,26 +2688,26 @@ xml_data(void *userData, const char *s, int len) archive_strncpy(&(xar->file->symlink), s, len); break; case FILE_TYPE: - if (strncmp("file", s, len) == 0 || - strncmp("hardlink", s, len) == 0) + if (is_string("file", s, len) == 0 || + is_string("hardlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFREG; - if (strncmp("directory", s, len) == 0) + if (is_string("directory", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFDIR; - if (strncmp("symlink", s, len) == 0) + if (is_string("symlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFLNK; - if (strncmp("character special", s, len) == 0) + if (is_string("character special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFCHR; - if (strncmp("block special", s, len) == 0) + if (is_string("block special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFBLK; - if (strncmp("socket", s, len) == 0) + if (is_string("socket", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFSOCK; - if (strncmp("fifo", s, len) == 0) + if (is_string("fifo", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFIFO; xar->file->has |= HAS_TYPE; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 8 20:55:45 2017 (r324418) @@ -723,6 +723,11 @@ process_extra(struct archive_read *a, const char *p, s } case 0x9901: /* WinZip AES extra data field. */ + if (datasize < 6) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Incomplete AES field"); + return ARCHIVE_FAILED; + } if (p[offset + 2] == 'A' && p[offset + 3] == 'E') { /* Vendor version. */ zip_entry->aes_extra.vendor = Modified: stable/10/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_string.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_string.c Sun Oct 8 20:55:45 2017 (r324418) @@ -214,7 +214,8 @@ archive_wstring_append(struct archive_wstring *as, con { if (archive_wstring_ensure(as, as->length + s + 1) == NULL) return (NULL); - wmemmove(as->s + as->length, p, s); + if (s) + wmemmove(as->s + as->length, p, s); as->length += s; as->s[as->length] = 0; return (as); Modified: stable/10/contrib/libarchive/libarchive/archive_version_details.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 8 20:55:45 2017 (r324418) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_LZ4_H #include #endif +#ifdef HAVE_ZSTD_H +#include +#endif #include "archive.h" #include "archive_private.h" @@ -59,6 +62,7 @@ archive_version_details(void) const char *liblzma = archive_liblzma_version(); const char *bzlib = archive_bzlib_version(); const char *liblz4 = archive_liblz4_version(); + const char *libzstd = archive_libzstd_version(); if (!init) { archive_string_init(&str); @@ -84,6 +88,10 @@ archive_version_details(void) archive_strcat(&str, " liblz4/"); archive_strcat(&str, liblz4); } + if (libzstd) { + archive_strcat(&str, " libzstd/"); + archive_strcat(&str, libzstd); + } } return str.s; } @@ -127,6 +135,16 @@ archive_liblz4_version(void) return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE); #undef NUMBER #undef str +#else + return NULL; +#endif +} + +const char * +archive_libzstd_version(void) +{ +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return ZSTD_VERSION_STRING; #else return NULL; #endif Modified: stable/10/contrib/libarchive/libarchive/archive_write.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write.3 Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_write.3 Sun Oct 8 20:55:45 2017 (r324418) @@ -71,7 +71,7 @@ support. .\" .Ss Set options See -.Xr archive_read_set_options 3 . +.Xr archive_write_set_options 3 . .\" .Ss Open archive See Modified: stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 8 20:55:45 2017 (r324418) @@ -53,6 +53,7 @@ struct { int code; int (*setter)(struct archive *); } { ARCHIVE_FILTER_LZOP, archive_write_add_filter_lzip }, { ARCHIVE_FILTER_UU, archive_write_add_filter_uuencode }, { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, + { ARCHIVE_FILTER_ZSTD, archive_write_add_filter_zstd }, { -1, NULL } }; Modified: stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 8 20:54:53 2017 (r324417) +++ stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 8 20:55:45 2017 (r324418) @@ -57,6 +57,7 @@ struct { const char *name; int (*setter)(struct archiv { "lzop", archive_write_add_filter_lzop }, { "uuencode", archive_write_add_filter_uuencode }, { "xz", archive_write_add_filter_xz }, + { "zstd", archive_write_add_filter_zstd }, { NULL, NULL } }; Copied: stable/10/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c (from r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c Sun Oct 8 20:55:45 2017 (r324418, copy of r324148, head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * 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(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Oct 8 21:20:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68BC0E4053D; Sun, 8 Oct 2017 21:20:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0738D6E7DC; Sun, 8 Oct 2017 21:20:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98LKQ84087749; Sun, 8 Oct 2017 21:20:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98LKQ2u087748; Sun, 8 Oct 2017 21:20:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710082120.v98LKQ2u087748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 8 Oct 2017 21:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324419 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 324419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 21:20:27 -0000 Author: rmacklem Date: Sun Oct 8 21:20:25 2017 New Revision: 324419 URL: https://svnweb.freebsd.org/changeset/base/324419 Log: MFC: r323978 Change a panic to an error return. There was a panic() in the NFS server's write operation that didn't need to be a panic() and could just be an error return. This patch makes that change. Found by code inspection during development of the pNFS service. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Sun Oct 8 20:55:45 2017 (r324418) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Sun Oct 8 21:20:25 2017 (r324419) @@ -921,7 +921,7 @@ nfsrvd_write(struct nfsrv_descript *nd, __unused int i nd->nd_md, nd->nd_dpos, nd->nd_cred, p); error = nfsm_advance(nd, NFSM_RNDUP(retlen), -1); if (error) - panic("nfsrv_write mbuf"); + goto nfsmout; } if (nd->nd_flag & ND_NFSV4) aftat_ret = 0; From owner-svn-src-all@freebsd.org Sun Oct 8 22:17:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28EB1E41430; Sun, 8 Oct 2017 22:17:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F217F0D7; Sun, 8 Oct 2017 22:17:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98MHd61012274; Sun, 8 Oct 2017 22:17:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98MHdNI012272; Sun, 8 Oct 2017 22:17:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710082217.v98MHdNI012272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Oct 2017 22:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324420 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 22:17:41 -0000 Author: alc Date: Sun Oct 8 22:17:39 2017 New Revision: 324420 URL: https://svnweb.freebsd.org/changeset/base/324420 Log: The blst_radix_init function has two purposes - to compute the number of nodes to allocate for the blist, and to initialize them. The computation can be done much more quickly by identifying the terminating node, if any, at every level of the tree and then summing the number of nodes at each level that precedes the topmost terminator. The initialization can also be done quickly, since settings at the root mark the tree as all-allocated, and only a few terminator nodes need to be marked in the rest of the tree. Eliminate blst_radix_init, and perform its two functions more simply in blist_create. The allocation of the blist takes places in two pieces, but there's no good reason to do so, when a single allocation is sufficient, and simpler. Allocate the blist struct, and the array of nodes associated with it, with a single allocation. Submitted by: Doug Moore Reviewed by: markj (an earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11968 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r324419) +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r324420) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix); -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count); #ifndef _KERNEL static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab); @@ -218,30 +218,69 @@ blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; - daddr_t nodes, radix; + daddr_t i, last_block; + u_daddr_t nodes, radix, skip; + int digit; /* - * Calculate the radix field used for scanning. + * Calculate the radix and node count used for scanning. Find the last + * block that is followed by a terminator. */ + last_block = blocks - 1; radix = BLIST_BMAP_RADIX; while (radix < blocks) { + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) + /* + * A terminator will be added. Update last_block to the + * position just before that terminator. + */ + last_block |= radix - 1; radix *= BLIST_META_RADIX; } - nodes = 1 + blst_radix_init(NULL, radix, blocks); - bl = malloc(sizeof(struct blist), M_SWAP, flags); + /* + * Count the meta-nodes in the expanded tree, including the final + * terminator, from the bottom level up to the root. + */ + nodes = (last_block >= blocks) ? 2 : 1; + last_block /= BLIST_BMAP_RADIX; + while (last_block > 0) { + nodes += last_block + 1; + last_block /= BLIST_META_RADIX; + } + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); if (bl == NULL) return (NULL); bl->bl_blocks = blocks; bl->bl_radix = radix; bl->bl_cursor = 0; - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); - if (bl->bl_root == NULL) { - free(bl, M_SWAP); - return (NULL); + + /* + * Initialize the empty tree by filling in root values, then initialize + * just the terminators in the rest of the tree. + */ + bl->bl_root[0].bm_bighint = 0; + if (radix == BLIST_BMAP_RADIX) + bl->bl_root[0].u.bmu_bitmap = 0; + else + bl->bl_root[0].u.bmu_avail = 0; + last_block = blocks - 1; + i = 0; + while (radix > BLIST_BMAP_RADIX) { + radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); + digit = last_block / radix; + i += 1 + digit * skip; + if (digit != BLIST_META_MASK) { + /* + * Add a terminator. + */ + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; + bl->bl_root[i + skip].u.bmu_bitmap = 0; + } + last_block %= radix; } - blst_radix_init(bl->bl_root, radix, blocks); #if defined(BLIST_DEBUG) printf( @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) void blist_destroy(blist_t bl) { - free(bl->bl_root, M_SWAP); + free(bl, M_SWAP); } @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr } scan->u.bmu_avail -= nblks; return (nblks); -} - -/* - * BLST_RADIX_INIT() - initialize radix tree - * - * Initialize our meta structures and bitmaps and calculate the exact - * amount of space required to manage 'count' blocks - this space may - * be considerably less than the calculated radix due to the large - * RADIX values we use. - */ -static daddr_t -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) -{ - daddr_t i, memindex, next_skip, skip; - - memindex = 0; - - /* - * Leaf node - */ - - if (radix == BLIST_BMAP_RADIX) { - if (scan) { - scan->bm_bighint = 0; - scan->u.bmu_bitmap = 0; - } - return (memindex); - } - - /* - * Meta node. If allocating the entire object we can special - * case it. However, we need to figure out how much memory - * is required to manage 'count' blocks, so we continue on anyway. - */ - - if (scan) { - scan->bm_bighint = 0; - scan->u.bmu_avail = 0; - } - - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; - radix /= BLIST_META_RADIX; - - for (i = 1; i < skip; i += next_skip) { - if (count >= radix) { - /* - * Allocate the entire object - */ - memindex = i + - blst_radix_init(((scan) ? &scan[i] : NULL), radix, - radix); - count -= radix; - } else if (count > 0) { - /* - * Allocate a partial object - */ - memindex = i + - blst_radix_init(((scan) ? &scan[i] : NULL), radix, - count); - count = 0; - } else { - /* - * Add terminator and break out. Make terminator bitmap - * zero to avoid a spanning leaf allocation that - * includes the terminator. - */ - if (scan) { - scan[i].bm_bighint = (daddr_t)-1; - scan[i].u.bmu_bitmap = 0; - } - break; - } - } - if (memindex < i) - memindex = i; - return (memindex); } #ifdef BLIST_DEBUG Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) @@ -82,7 +82,7 @@ typedef struct blist { daddr_t bl_blocks; /* area of coverage */ u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ - blmeta_t *bl_root; /* root of radix tree */ + blmeta_t bl_root[1]; /* root of radix tree */ } *blist_t; #define BLIST_META_RADIX 16 From owner-svn-src-all@freebsd.org Mon Oct 9 04:43:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356D5E24E32; Mon, 9 Oct 2017 04:43:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85FF6C6B5; Mon, 9 Oct 2017 04:43:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v994h5Tp072031; Mon, 9 Oct 2017 04:43:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v994h5Jf072030; Mon, 9 Oct 2017 04:43:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090443.v994h5Jf072030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 04:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324422 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 04:43:07 -0000 Author: eadler Date: Mon Oct 9 04:43:05 2017 New Revision: 324422 URL: https://svnweb.freebsd.org/changeset/base/324422 Log: Add macOS 10.13 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Oct 9 01:17:12 2017 (r324421) +++ head/share/misc/bsd-family-tree Mon Oct 9 04:43:05 2017 (r324422) @@ -339,7 +339,7 @@ FreeBSD 5.2 | | | | | | | | DragonFly 4.2.0 | FreeBSD | | | | | 10.2 | | | | - | | OS X NetBSD 7.0 | | + | | macOS NetBSD 7.0 | | | | 10.11 | OpenBSD 5.8 | | | | | | DragonFly 4.4.1 | FreeBSD | | OpenBSD 5.9 | @@ -355,8 +355,8 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 6.1 | | FreeBSD | | | | | | 11.1 FreeBSD | | | | - | | 10.4 | | | | - | v | | | | + | | 10.4 macOS | | | + | v 10.13 | | | | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -717,6 +717,7 @@ NetBSD 7.1 2017-03-11 [NBD] DragonFly 4.8.0 2017-03-27 [DFB] OpenBSD 6.1 2017-04-11 [OBD] FreeBSD 11.1 2017-07-26 [FBD] +macOS 10.13 2017-09-25 [APL] FreeBSD 10.4 2017-10-03 [FBD] Bibliography From owner-svn-src-all@freebsd.org Mon Oct 9 05:01:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52640E25250; Mon, 9 Oct 2017 05:01:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDE68708A2; Mon, 9 Oct 2017 05:01:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9951q7C079522; Mon, 9 Oct 2017 05:01:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9951qcF079521; Mon, 9 Oct 2017 05:01:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090501.v9951qcF079521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 05:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324423 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:01:53 -0000 Author: eadler Date: Mon Oct 9 05:01:51 2017 New Revision: 324423 URL: https://svnweb.freebsd.org/changeset/base/324423 Log: Update iso3166 codes Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv and hand massaged. Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Mon Oct 9 04:43:05 2017 (r324422) +++ head/share/misc/iso3166 Mon Oct 9 05:01:51 2017 (r324423) @@ -21,7 +21,7 @@ # two three number name AF AFG 004 Afghanistan AL ALB 008 Albania -AX ALA 248 Aland Islands +AX ALA 248 Ã…land Islands DZ DZA 012 Algeria AS ASM 016 American Samoa AD AND 020 Andorra @@ -59,7 +59,7 @@ BI BDI 108 Burundi KH KHM 116 Cambodia CM CMR 120 Cameroon CA CAN 124 Canada -CV CPV 132 Cape Verde +CV CPV 132 Cabo Verde KY CYM 136 Cayman Islands CF CAF 140 Central African Republic TD TCD 148 Chad @@ -70,20 +70,19 @@ CC CCK 166 Cocos (Keeling) Islands CO COL 170 Colombia KM COM 174 Comoros CG COG 178 Congo -CD COD 180 Congo, the Democratic Republic of the +CD COD 180 Congo, Democratic Republic of the CK COK 184 Cook Islands CR CRI 188 Costa Rica -CI CIV 384 Cote d'Ivoire +CI CIV 384 Côte d'Ivoire HR HRV 191 Croatia CU CUB 192 Cuba -CW CUW 531 Curacao +CW CUW 531 Curaçao CY CYP 196 Cyprus CZ CZE 203 Czech Republic DK DNK 208 Denmark DJ DJI 262 Djibouti DM DMA 212 Dominica DO DOM 214 Dominican Republic -TL TLS 626 Timor-Leste EC ECU 218 Ecuador EG EGY 818 Egypt SV SLV 222 El Salvador @@ -117,13 +116,14 @@ GW GNB 624 Guinea-Bissau GY GUY 328 Guyana HT HTI 332 Haiti HM HMD 334 Heard Island and McDonald Islands +VA VAT 336 Holy See HN HND 340 Honduras HK HKG 344 Hong Kong HU HUN 348 Hungary IS ISL 352 Iceland IN IND 356 India ID IDN 360 Indonesia -IR IRN 364 Iran, Islamic Republic of +IR IRN 364 Iran (Islamic Republic of) IQ IRQ 368 Iraq IE IRL 372 Ireland IM IMN 833 Isle of Man @@ -136,8 +136,8 @@ JO JOR 400 Jordan KZ KAZ 398 Kazakhstan KE KEN 404 Kenya KI KIR 296 Kiribati -KP PRK 408 Korea, Democratic People's Republic of -KR KOR 410 Korea, Republic of +KP PRK 408 Korea (Democratic People's Republic of) +KR KOR 410 Korea (Republic of) KW KWT 414 Kuwait KG KGZ 417 Kyrgyzstan LA LAO 418 Lao People's Democratic Republic @@ -145,12 +145,12 @@ LV LVA 428 Latvia LB LBN 422 Lebanon LS LSO 426 Lesotho LR LBR 430 Liberia -LY LBY 434 Libyan Arab Jamahiriya +LY LBY 434 Libya LI LIE 438 Liechtenstein LT LTU 440 Lithuania LU LUX 442 Luxembourg MO MAC 446 Macao -MK MKD 807 Macedonia, the Former Yugoslav Republic of +MK MKD 807 Macedonia (the former Yugoslav Republic of) MG MDG 450 Madagascar MW MWI 454 Malawi MY MYS 458 Malaysia @@ -163,8 +163,8 @@ MR MRT 478 Mauritania MU MUS 480 Mauritius YT MYT 175 Mayotte MX MEX 484 Mexico -FM FSM 583 Micronesia, Federated States of -MD MDA 498 Moldova, Republic of +FM FSM 583 Micronesia (Federated States of) +MD MDA 498 Moldova (Republic of) MC MCO 492 Monaco MN MNG 496 Mongolia ME MNE 499 Montenegro @@ -188,7 +188,7 @@ NO NOR 578 Norway OM OMN 512 Oman PK PAK 586 Pakistan PW PLW 585 Palau -PS PSE 275 Palestinian Territory, Occupied +PS PSE 275 Palestine, State of PA PAN 591 Panama PG PNG 598 Papua New Guinea PY PRY 600 Paraguay @@ -199,14 +199,16 @@ PL POL 616 Poland PT PRT 620 Portugal PR PRI 630 Puerto Rico QA QAT 634 Qatar -RE REU 638 Reunion +RE REU 638 Réunion RO ROU 642 Romania RU RUS 643 Russian Federation RW RWA 646 Rwanda -BL BLM 652 Saint Barthelemy +BL BLM 652 Saint Barthélemy +SH SHN 654 Saint Helena Ascension and Tristan da Cunha KN KNA 659 Saint Kitts and Nevis LC LCA 662 Saint Lucia -MF MAF 663 Saint Martin (French Part) +MF MAF 663 Saint Martin (French part) +PM SPM 666 Saint Pierre and Miquelon VC VCT 670 Saint Vincent and the Grenadines WS WSM 882 Samoa SM SMR 674 San Marino @@ -227,8 +229,6 @@ GS SGS 239 South Georgia and the South Sandwich Island SS SSD 728 South Sudan ES ESP 724 Spain LK LKA 144 Sri Lanka -SH SHN 654 Saint Helena, Ascension and Tristan da Cunha -PM SPM 666 Saint Pierre and Miquelon SD SDN 729 Sudan SR SUR 740 Suriname SJ SJM 744 Svalbard and Jan Mayen @@ -236,10 +236,11 @@ SZ SWZ 748 Swaziland SE SWE 752 Sweden CH CHE 756 Switzerland SY SYR 760 Syrian Arab Republic -TW TWN 158 Taiwan +TW TWN 158 Taiwan, Province of China TJ TJK 762 Tajikistan -TZ TZA 834 Tanzania, United Republic of +TZ TZA 834 Tanzania United Republic of TH THA 764 Thailand +TL TLS 626 Timor-Leste TG TGO 768 Togo TK TKL 772 Tokelau TO TON 776 Tonga @@ -252,17 +253,16 @@ TV TUV 798 Tuvalu UG UGA 800 Uganda UA UKR 804 Ukraine AE ARE 784 United Arab Emirates -GB GBR 826 United Kingdom -US USA 840 United States +GB GBR 826 United Kingdom of Great Britain and Northern Ireland +US USA 840 United States of America UM UMI 581 United States Minor Outlying Islands UY URY 858 Uruguay UZ UZB 860 Uzbekistan VU VUT 548 Vanuatu -VA VAT 336 Holy See (Vatican City State) VE VEN 862 Venezuela, Bolivarian Republic of VN VNM 704 Viet Nam -VG VGB 092 Virgin Islands, British -VI VIR 850 Virgin Islands, U.S. +VG VGB 092 Virgin Islands (British) +VI VIR 850 Virgin Islands (U.S.) WF WLF 876 Wallis and Futuna EH ESH 732 Western Sahara YE YEM 887 Yemen From owner-svn-src-all@freebsd.org Mon Oct 9 05:16:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DABE255F4; Mon, 9 Oct 2017 05:16:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDADE73B96; Mon, 9 Oct 2017 05:16:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v995GYPH084480; Mon, 9 Oct 2017 05:16:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v995GYdC084479; Mon, 9 Oct 2017 05:16:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090516.v995GYdC084479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 05:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324424 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:16:36 -0000 Author: eadler Date: Mon Oct 9 05:16:34 2017 New Revision: 324424 URL: https://svnweb.freebsd.org/changeset/base/324424 Log: Remove CVS - we don't run that infrastructure anymore Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Mon Oct 9 05:01:51 2017 (r324423) +++ head/share/misc/organization.dot Mon Oct 9 05:16:34 2017 (r324424) @@ -45,10 +45,8 @@ accounts [label="Accounts Team\naccounts@FreeBSD.org\n backups [label="Backup Administrators\nbackups@FreeBSD.org\nsimon, kensmith,\ndhw"] bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo"] clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nallanjude, brd,\ndhw, gavin,\ngjb, peter,\nsbruno, simon,\nzi"] -cvsupmaster [label="CVSup Mirror Site Coordinators\ncvsup-master@FreeBSD.org\nkuriyama, jdp,\nkensmith"] dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nbillf, dg, ps,\nkensmith, peter"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"] -ncvs [label="CVS src Repository Managers\nncvs@FreeBSD.org\njoe, kuriyama, markm,\nsimon, peter"] perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, ler, pi, rea, remko, zi"] refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] @@ -68,8 +66,6 @@ _admin -> accounts _admin -> backups _admin -> bugmeister _admin -> clusteradm -_admin -> ncvs -_admin -> cvsupmaster _admin -> dnsadm _admin -> mirroradmin _admin -> perforceadmin From owner-svn-src-all@freebsd.org Mon Oct 9 05:47:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF58EE2616B; Mon, 9 Oct 2017 05:47:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B1F7EB1A; Mon, 9 Oct 2017 05:47:38 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id v995lRso069094; Sun, 8 Oct 2017 22:47:31 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201710090547.v995lRso069094@gw.catspoiler.org> Date: Sun, 8 Oct 2017 22:47:27 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 To: kostikbel@gmail.com cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20171008083307.GG95911@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:47:40 -0000 On 8 Oct, Konstantin Belousov wrote: > On Sat, Oct 07, 2017 at 01:54:05PM -0700, Don Lewis wrote: >> On 7 Oct, Konstantin Belousov wrote: >> > On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: >> >> On 5 Oct, Konstantin Belousov wrote: >> >> > Author: kib >> >> > Date: Thu Oct 5 12:50:03 2017 >> >> > New Revision: 324313 >> >> > URL: https://svnweb.freebsd.org/changeset/base/324313 >> >> > >> >> > Log: >> >> > Avoid a race betweem freeing LDT and context switches. >> >> > >> >> > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating >> >> > presence of the process LDT. The flag is checked and then ldt segment >> >> > descriptor is copied into the CPU' GDT slot. >> >> > >> >> > Disallow context switches around clearing of the curproc LDT state by >> >> > performing the cleanup in critical section. Ensure that the md_ldt >> >> > flag is cleared before md_ldt_sd descriptor content is destroyed by >> >> > inserting fence between the operations. >> >> > >> >> > We depend on the x86 memory model strong ordering guarantees, in >> >> > particular, that cpu_switch.S observes the writes to md_ldt and >> >> > md_ldt_sd in the expected order. >> >> >> >> I don't know which of this series of commits is responsible, but I think >> >> that it fixed the build of lang/ghc on Ryzen. >> >> >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 >> > >> > Does ghc use LDT on amd64 ? This sounds unbelievable. >> >> I have no idea, but ghc would reliably fail to build on my Ryzen machine >> up through r323398, and at r324367 it seems to reliably build. > Could you try to bisect ? > > I reviewed all kernel changes and do not see anything which could be > marked as possible fix for whatever kernel issue causing usermode > fault. I need to bisect at least userland for another reason. I've recently been seeing sporadic build runaways when using poudriere to build ports. This has happened both on my replacement Ryzen CPU and also on my AMD FX-8320E, more frequently on the Ryzen. My reason for suspecting a userland problem is that I've only seen this when building ports in a 12.0-CURRENT jail, and not 10.4 or 11.1. I first started seeing this a couple weeks ago. This will be slow going because even on the Ryzen, my full package set builds take about nine hours and I don't see the failure every time. I'll also see if ghc is affected by the userland version. From owner-svn-src-all@freebsd.org Mon Oct 9 07:44:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE50E284F1; Mon, 9 Oct 2017 07:44:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76AFB72E67; Mon, 9 Oct 2017 07:44:10 +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 v997i9B7045361; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v997i977045360; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710090744.v997i977045360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 9 Oct 2017 07:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324425 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 324425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 07:44:11 -0000 Author: avg Date: Mon Oct 9 07:44:09 2017 New Revision: 324425 URL: https://svnweb.freebsd.org/changeset/base/324425 Log: illumos mutex_init: use SX_NEW instead of bzero There should be no functional change, but SX_NEW seems to be more idiomatic to the use-case. MFC after: 2 weeks X-MFC note: stable/11 only Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 05:16:34 2017 (r324424) +++ head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 07:44:09 2017 (r324425) @@ -47,9 +47,9 @@ typedef enum { typedef struct sx kmutex_t; #ifndef OPENSOLARIS_WITNESS -#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS) #else -#define MUTEX_FLAGS (SX_DUPOK) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW) #endif #define mutex_init(lock, desc, type, arg) do { \ @@ -57,7 +57,6 @@ typedef struct sx kmutex_t; ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \ KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ LO_EXPECTED, ("lock %s already initialized", #lock)); \ - bzero((lock), sizeof(struct sx)); \ for (_name = #lock; *_name != '\0'; _name++) { \ if (*_name >= 'a' && *_name <= 'z') \ break; \ From owner-svn-src-all@freebsd.org Mon Oct 9 08:50:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B77FAE29BB2; Mon, 9 Oct 2017 08:50:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB121A88; Mon, 9 Oct 2017 08:50:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v998o448070190; Mon, 9 Oct 2017 08:50:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v998o4CP070189; Mon, 9 Oct 2017 08:50:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201710090850.v998o4CP070189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 9 Oct 2017 08:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324426 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 324426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 08:50:06 -0000 Author: ae Date: Mon Oct 9 08:50:03 2017 New Revision: 324426 URL: https://svnweb.freebsd.org/changeset/base/324426 Log: MFC r324098: Some mbuf related fixes in icmp_error() * check mbuf length before doing mtod() and accessing to IP header; * update oip pointer and all depending pointers after m_pullup(); * remove extra checks and extra parentheses, wrap long lines; PR: 222670 Modified: stable/11/sys/netinet/ip_icmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_icmp.c ============================================================================== --- stable/11/sys/netinet/ip_icmp.c Mon Oct 9 07:44:09 2017 (r324425) +++ stable/11/sys/netinet/ip_icmp.c Mon Oct 9 08:50:03 2017 (r324426) @@ -185,17 +185,14 @@ kmod_icmpstat_inc(int statnum) void icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) { - register struct ip *oip = mtod(n, struct ip *), *nip; - register unsigned oiphlen = oip->ip_hl << 2; - register struct icmp *icp; - register struct mbuf *m; - unsigned icmplen, icmpelen, nlen; + struct ip *oip, *nip; + struct icmp *icp; + struct mbuf *m; + unsigned icmplen, icmpelen, nlen, oiphlen; - KASSERT((u_int)type <= ICMP_MAXTYPE, ("%s: illegal ICMP type", __func__)); -#ifdef ICMPPRINTFS - if (icmpprintfs) - printf("icmp_error(%p, %x, %d)\n", oip, type, code); -#endif + KASSERT((u_int)type <= ICMP_MAXTYPE, ("%s: illegal ICMP type", + __func__)); + if (type != ICMP_REDIRECT) ICMPSTAT_INC(icps_error); /* @@ -207,19 +204,28 @@ icmp_error(struct mbuf *n, int type, int code, uint32_ */ if (n->m_flags & M_DECRYPTED) goto freeit; - if (oip->ip_off & htons(~(IP_MF|IP_DF))) - goto freeit; if (n->m_flags & (M_BCAST|M_MCAST)) goto freeit; + + /* Drop if IP header plus 8 bytes is not contiguous in first mbuf. */ + if (n->m_len < sizeof(struct ip) + ICMP_MINLEN) + goto freeit; + oip = mtod(n, struct ip *); + oiphlen = oip->ip_hl << 2; + if (n->m_len < oiphlen + ICMP_MINLEN) + goto freeit; +#ifdef ICMPPRINTFS + if (icmpprintfs) + printf("icmp_error(%p, %x, %d)\n", oip, type, code); +#endif + if (oip->ip_off & htons(~(IP_MF|IP_DF))) + goto freeit; if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT && - n->m_len >= oiphlen + ICMP_MINLEN && - !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiphlen))->icmp_type)) { + !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + + oiphlen))->icmp_type)) { ICMPSTAT_INC(icps_oldicmp); goto freeit; } - /* Drop if IP header plus 8 bytes is not contignous in first mbuf. */ - if (oiphlen + 8 > n->m_len) - goto freeit; /* * Calculate length to quote from original packet and * prevent the ICMP mbuf from overflowing. @@ -235,9 +241,10 @@ icmp_error(struct mbuf *n, int type, int code, uint32_ n->m_next == NULL) goto stdreply; if (n->m_len < oiphlen + sizeof(struct tcphdr) && - ((n = m_pullup(n, oiphlen + sizeof(struct tcphdr))) == NULL)) + (n = m_pullup(n, oiphlen + sizeof(struct tcphdr))) == NULL) goto freeit; - th = (struct tcphdr *)((caddr_t)oip + oiphlen); + oip = mtod(n, struct ip *); + th = mtodo(n, oiphlen); tcphlen = th->th_off << 2; if (tcphlen < sizeof(struct tcphdr)) goto freeit; @@ -245,8 +252,8 @@ icmp_error(struct mbuf *n, int type, int code, uint32_ goto freeit; if (oiphlen + tcphlen > n->m_len && n->m_next == NULL) goto stdreply; - if (n->m_len < oiphlen + tcphlen && - ((n = m_pullup(n, oiphlen + tcphlen)) == NULL)) + if (n->m_len < oiphlen + tcphlen && + (n = m_pullup(n, oiphlen + tcphlen)) == NULL) goto freeit; icmpelen = max(tcphlen, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); @@ -262,24 +269,31 @@ icmp_error(struct mbuf *n, int type, int code, uint32_ if (n->m_len < oiphlen + sizeof(struct sctphdr) && (n = m_pullup(n, oiphlen + sizeof(struct sctphdr))) == NULL) goto freeit; + oip = mtod(n, struct ip *); icmpelen = max(sizeof(struct sctphdr), min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); - sh = (struct sctphdr *)((caddr_t)oip + oiphlen); + sh = mtodo(n, oiphlen); if (ntohl(sh->v_tag) == 0 && - ntohs(oip->ip_len) >= oiphlen + sizeof(struct sctphdr) + 8 && + ntohs(oip->ip_len) >= oiphlen + + sizeof(struct sctphdr) + 8 && (n->m_len >= oiphlen + sizeof(struct sctphdr) + 8 || n->m_next != NULL)) { if (n->m_len < oiphlen + sizeof(struct sctphdr) + 8 && - (n = m_pullup(n, oiphlen + sizeof(struct sctphdr) + 8)) == NULL) + (n = m_pullup(n, oiphlen + + sizeof(struct sctphdr) + 8)) == NULL) goto freeit; + oip = mtod(n, struct ip *); + sh = mtodo(n, oiphlen); ch = (struct sctp_chunkhdr *)(sh + 1); if (ch->chunk_type == SCTP_INITIATION) { icmpelen = max(sizeof(struct sctphdr) + 8, - min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); + min(V_icmp_quotelen, ntohs(oip->ip_len) - + oiphlen)); } } } else -stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); +stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) - + oiphlen)); icmplen = min(oiphlen + icmpelen, nlen); if (icmplen < sizeof(struct ip)) @@ -294,7 +308,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs #ifdef MAC mac_netinet_icmp_reply(n, m); #endif - icmplen = min(icmplen, M_TRAILINGSPACE(m) - sizeof(struct ip) - ICMP_MINLEN); + icmplen = min(icmplen, M_TRAILINGSPACE(m) - + sizeof(struct ip) - ICMP_MINLEN); m_align(m, ICMP_MINLEN + icmplen); m->m_len = ICMP_MINLEN + icmplen; From owner-svn-src-all@freebsd.org Mon Oct 9 10:24:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CA7E2C287; Mon, 9 Oct 2017 10:24:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5FA1D764BA; Mon, 9 Oct 2017 10:24:07 +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 v99AO6uN011674; Mon, 9 Oct 2017 10:24:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99AO6pt011672; Mon, 9 Oct 2017 10:24:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091024.v99AO6pt011672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 10:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324427 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 10:24:08 -0000 Author: trasz Date: Mon Oct 9 10:24:06 2017 New Revision: 324427 URL: https://svnweb.freebsd.org/changeset/base/324427 Log: Document "tdnam" keyword to ps(1), and add "tdname" alias. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) @@ -201,6 +201,7 @@ static VAR var[] = { {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Mon Oct 9 08:50:03 2017 (r324426) +++ head/bin/ps/ps.1 Mon Oct 9 10:24:06 2017 (r324427) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 7, 2017 +.Dd October 9, 2017 .Dt PS 1 .Os .Sh NAME @@ -675,6 +675,9 @@ saved UID from a setuid executable accumulated system CPU time .It Cm tdaddr thread address +.It Cm tdnam +thread name (alias +.Cm tdname ) .It Cm tdev control terminal device number .It Cm time From owner-svn-src-all@freebsd.org Mon Oct 9 11:46:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474AFE2DC01; Mon, 9 Oct 2017 11:46:27 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6379E673CA; Mon, 9 Oct 2017 11:46:26 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id l196so27015169lfl.1; Mon, 09 Oct 2017 04:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EtYjeEJQb9bsd7/Es2hQQVauZrdNJX7uhF8eCQ169iQ=; b=m8BtkcSwfEZUPvMwul75W/MOMzXGF6oWMNHm8GHUBvhD9dWn/puwvoa3AHU9mqpCHk iKqvsh9xiSaxc1uCNSZ+fSlrffwVpAsvI0AmLH7KLqmyvyolI2voDivTJpXMPxeo086t 2gxE4QhCUS8rtPmEMx4aUPl6GbzMBWufnOT1Rh+hrcJh47cDzQeASVEm/AguPZ332AFq wQZTWgPdrtiV9M503uMgpbYNiHe5KZjI1ZJqM288dx5xNVHN6+KeaBRfSBMo3PM4DUcN abGEtoaCWN06LaC54g8EhNUhEqOpBnZ3NVusWeCPRW20DSr1XaSTOywT7lumCYl5GrfR aFJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EtYjeEJQb9bsd7/Es2hQQVauZrdNJX7uhF8eCQ169iQ=; b=TlCDdaVayGq+278MnDSQa679K2+JkRSr3uaSOd4Zn9aG981JR1a7DBzr1c+Dqh1x8R pJ99Pd3nBdW02wu+nFdDVVMayHch1dFOtuDeOuJuwDW528arpNkPuBmXnph3RCu3OMc1 BmK85rlqy0z6ioV8BTo4aAzkF/a9JJOhvyRH/Mq3qmeYL+QbTTgb8pQk92SvOxSLh+9r zIqqqC3ZBdBm51F0ZTHBDrhb6QupbNTHmbFbcBEWryZTbITibaTsXlyC4PrYaIq6y4Fg uN6V3c7fam+WhZKVvMtJRo2ZurvlRAg0pmo6q+ylhRAjhm7o0TexxYBAgfIY/q9s+X7e /XYA== X-Gm-Message-State: AMCzsaX/ZihELWLDpnYNr/Gi7AuXmKV7y/SzZP2mpTYMs7ZapXa87ces zRcSfNfB7GfaEBSkwe/LgQdubmyfO+glvZyLIzpn1CMr X-Google-Smtp-Source: AOwi7QAcEmH07jCclpI9IOpNtvgnvh5WUPvsxsTEk3bc+IY5IB1rLWpHJHOn98tMPGPk3iSJruc4QS2J7DR9SG0mCCg= X-Received: by 10.46.85.145 with SMTP id g17mr4272421lje.84.1507549584442; Mon, 09 Oct 2017 04:46:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.81.73 with HTTP; Mon, 9 Oct 2017 04:46:24 -0700 (PDT) In-Reply-To: <201710091024.v99AO6pt011672@repo.freebsd.org> References: <201710091024.v99AO6pt011672@repo.freebsd.org> From: Sergey Kandaurov Date: Mon, 9 Oct 2017 14:46:24 +0300 Message-ID: Subject: Re: svn commit: r324427 - head/bin/ps To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 11:46:27 -0000 On 9 October 2017 at 13:24, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Oct 9 10:24:06 2017 > New Revision: 324427 > URL: https://svnweb.freebsd.org/changeset/base/324427 > > Log: > Document "tdnam" keyword to ps(1), and add "tdname" alias. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/bin/ps/keyword.c > head/bin/ps/ps.1 > > Modified: head/bin/ps/keyword.c > ============================================================ > ================== > --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) > +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) > @@ -201,6 +201,7 @@ static VAR var[] = { > {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, > 0}, > {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, > CHAR, > NULL, 0}, > Hello, could you please fix this ^^ "tdnam" description as well? fwiw, looks like it's only used in libxo as a field name. [..] -- wbr, pluknet From owner-svn-src-all@freebsd.org Mon Oct 9 11:47:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DB4E2DCB1; Mon, 9 Oct 2017 11:47:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13732678F9; Mon, 9 Oct 2017 11:47:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id p1so5119778qtg.2; Mon, 09 Oct 2017 04:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sizWMiZ/5L81S5G2VMX94ofubsQDK9tZVGi5DFVlNOE=; b=S6sNnrVGljANA56DFP53QPrtfncNAnx06XX6RMa66YuC8r5jF6DJymClJyViBVlVYU Ha3lY6uJ3u/e69/zxOisMV3btImqLnU4F9C1N1wtxI55eTK2s0QO7EGWCd81HSZCMruF nhoLRK+vimiKj0VvAvhDWrFevbii9bkarPnT8zMgO89lQp8n1ymK5ny0jJJ07PUMrmVI PCa2DOM3AvKcng4QkDaYI46h2X9Un0pmqgAz4dKHrfc296hP844jp4L7OFaMVERZTPRw Jk3tOxyzazxA108fTNdQgPHtdPzCqTVgA3zKmt6wuv1DXrH19qOm9D4MwmyePvYizg2/ FE0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sizWMiZ/5L81S5G2VMX94ofubsQDK9tZVGi5DFVlNOE=; b=uhEL/YZYRajEM3WWNRTvOwTdTEKf3Ldg07dUmsmE2v9QuY97KY2nw/kwk1qms8daBa Yker+YWNSzxmIHh+pkTs4P/Ha7WvYuPwKizCelgw2u2KrHKv+WmrWISKcWTNiK8ko5nw awwNzwFoyWZoSsr5NXrxZaA6mo6KpOxVDVeokqGlmY7fXAN0EI3h7WrvleSy4aKI7127 /1G3Dk0wlWrd+AI1Oy/9ptw6pa8tDxu1ahd+yA4uhfqTm+Cuc9ZRJyeGR2V39wmtgSoc ZVnNMxOgHyF2rPoJ7dymKIJ8LF1ZRwz+/azH0On9M7axj2fMzYVsSwnTIbxXmnOboWqs oIpw== X-Gm-Message-State: AMCzsaUp6T7tSrX5YPLdAXB8fxeKVYFV8v8Jw4FT0ME5BYM6jyOwOvji wOlSSpw/B+LieNXCUm2xUaCtqko+er82KTXOZF/Jrw== X-Google-Smtp-Source: AOwi7QCzPt3+Is44XGV4sob9/S5oCHM8NKFNJnm7Zkwmv4MXJIvblzVFHzhuJLY535eUnW5HSWM9Z5DuJte9uy0pnIM= X-Received: by 10.200.27.221 with SMTP id m29mr2457294qtk.152.1507549665824; Mon, 09 Oct 2017 04:47:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.46.33 with HTTP; Mon, 9 Oct 2017 04:47:45 -0700 (PDT) In-Reply-To: <1507485390.86205.323.camel@freebsd.org> References: <201710081733.v98HXnu1094645@repo.freebsd.org> <1507485390.86205.323.camel@freebsd.org> From: Mateusz Guzik Date: Mon, 9 Oct 2017 13:47:45 +0200 Message-ID: Subject: Re: svn commit: r324415 - in head/sys: kern sys To: Ian Lepore Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 11:47:47 -0000 On Sun, Oct 08, 2017 at 11:56:30AM -0600, Ian Lepore wrote: > On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun Oct 8 17:33:49 2017 > > New Revision: 324415 > > URL: https://svnweb.freebsd.org/changeset/base/324415 > > > > Log: > > Add eventhandler notifications for newbus device attach/detach. > > > > [...] > > > > A couple salient comments from the review, they amount to some helpful > > documentation about these events, but there's currently no good place for > > such documentation... > > About this last point... sys/eventhandler.h is now an ever-growing list > of EVENTHANDLER_DECLARE() statements for events that are unrelated to > each other. I think we are at the point where it's no longer a few > well-known "standard system event queues", it's turning into a mess. > > My first thought was to add these to bus.h because they're bus events. > But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, > and I didn't want to pull it (and its dependencies) into bus.h. > The current implementation has to be retired and significant tinkering with it is imho a waste of time. It is weirdly inefficient both single and multithreaded. Vast majority (if not all) lists are statically defined. And yet invocing the handlers starts with following a linked list and strcmping to find the instance. All this under a global eventhanadler lock which starts showing up. Most registered handlers for any paritcular event are never going to get unregistered. The current code locks the list do the traversal, which again is slow and starts showing up in lock profiles. So the proposal is to partially unscrew the current code so that it largely gets out of the way and then implement something new and migrate evertyhing on head to use it. A new set of eventhnadler declarations can be added (_STATIC?) which provides a known at compilation time symbol. Then a paired invocation macro to just lock the handler list without the need to look it up. As for the new mechanism, I don't have anything fleshed out, but in general it would do away with excessive macro use. handlers which once registered never get removed get a lockless treatment for traveral. say they also get implemented as a linked list. Invocations would do a lockless traversal of the list. If there is an entry, it is fully installed and never goes away. Registrations would lock the list and add an entry in traversal-friendly manner updating the '->next' pointer at the lsat step. Later this can be made even nicer with a table, but that will require a little bit of trickery to make it freeable. With this in place there will be no central "here are the handlers" header. That said, I have no immediate plans working on this, but I'll eventually get around to it unless someone beats me or has a better idea. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Mon Oct 9 12:10:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94678E2EB46; Mon, 9 Oct 2017 12:10:58 +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 2FAE66D293; Mon, 9 Oct 2017 12:10:56 +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 DE2D93C57F7; Mon, 9 Oct 2017 23:10:54 +1100 (AEDT) Date: Mon, 9 Oct 2017 23:10:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324427 - head/bin/ps In-Reply-To: Message-ID: <20171009231026.M2645@besplex.bde.org> References: <201710091024.v99AO6pt011672@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=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=GYZi_WjK67zS3PyEqQcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 12:10:58 -0000 On Mon, 9 Oct 2017, Sergey Kandaurov wrote: > On 9 October 2017 at 13:24, Edward Tomasz Napierala > wrote: > >> Author: trasz >> Date: Mon Oct 9 10:24:06 2017 >> New Revision: 324427 >> URL: https://svnweb.freebsd.org/changeset/base/324427 >> >> Log: >> Document "tdnam" keyword to ps(1), and add "tdname" alias. >> >> MFC after: 2 weeks >> Sponsored by: DARPA, AFRL >> >> Modified: >> head/bin/ps/keyword.c >> head/bin/ps/ps.1 >> >> Modified: head/bin/ps/keyword.c >> ============================================================ >> ================== >> --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) >> +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) >> @@ -201,6 +201,7 @@ static VAR var[] = { >> {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, >> 0}, >> {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, >> CHAR, >> NULL, 0}, >> > > > Hello, > could you please fix this ^^ "tdnam" description as well? > fwiw, looks like it's only used in libxo as a field name. > > [..] > > -- > wbr, > pluknet > From owner-svn-src-all@freebsd.org Mon Oct 9 12:54:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E732E2FD21; Mon, 9 Oct 2017 12:54:36 +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 E5E3576B7A; Mon, 9 Oct 2017 12:54:35 +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 A8ABB3C579D; Mon, 9 Oct 2017 23:54:32 +1100 (AEDT) Date: Mon, 9 Oct 2017 23:53:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324427 - head/bin/ps In-Reply-To: Message-ID: <20171009231134.P2645@besplex.bde.org> References: <201710091024.v99AO6pt011672@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=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=UyfP_cosPN9UB4uMd_gA:9 a=tpJOXtjAOTdNX3We:21 a=mCOBi_0y4SuvmJo5:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 12:54:36 -0000 {Please ignore my previous null reply] On Mon, 9 Oct 2017, Sergey Kandaurov wrote: > On 9 October 2017 at 13:24, Edward Tomasz Napierala > wrote: > >> Author: trasz >> Date: Mon Oct 9 10:24:06 2017 >> New Revision: 324427 >> URL: https://svnweb.freebsd.org/changeset/base/324427 >> >> Log: >> Document "tdnam" keyword to ps(1), and add "tdname" alias. >> Modified: head/bin/ps/keyword.c >> ============================================================ >> ================== >> --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) >> +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) >> @@ -201,6 +201,7 @@ static VAR var[] = { >> {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, >> 0}, >> {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, >> CHAR, >> NULL, 0}, > > Hello, > could you please fix this ^^ "tdnam" description as well? > fwiw, looks like it's only used in libxo as a field name. Since it is badly designed and implemented, 2 names for it are worse than for any other keyword. Perhaps since it was undocumented in the man page and misdocumented in the screen, nothing uses it and you can rename it without anything noticing it. (Design errors start with splitting thread and proc names in a way that is difficult for applications to untangle. Implementation errors start with abusing the space reserved for the old command name (ki_ocomm) for ki_tdname. This helps break old applications that only understand ki_ocomm. TDNAMLEN = OCOMMLEN = 16 is also too small, and its name is spelled without an E, unlike all other *NAMELEN names in . This is too short. It is only 3 shorter than COMMLEN, but should probably be longer, depending on how thread and proc names are split. The last bug has been partly fixed. There is now ki_moretdname[]. This has length just 3 (plus 1 for a NUL) to make allow expansion of thread names to the same length as proc names (19). ps and top actually understand this (except the update to use it is missing in ps/ps.c; it is only in ps/print.c). Thread names are also printed for the comm and command keywords in ps. They are essentially appended to ki_comm. This is too simple of ki_comm already contains some thread info. A negative amount of space is available for expansion. if the user uses tdnam then it is even more difficult to get a good combination of proc and thread info. Bruce From owner-svn-src-all@freebsd.org Mon Oct 9 13:48:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F3CE30CB2; Mon, 9 Oct 2017 13:48:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id B1AC21FD7; Mon, 9 Oct 2017 13:48:11 +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 v99DmATN096179; Mon, 9 Oct 2017 13:48:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99DmAn2096178; Mon, 9 Oct 2017 13:48:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091348.v99DmAn2096178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 13:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324429 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 13:48:12 -0000 Author: trasz Date: Mon Oct 9 13:48:10 2017 New Revision: 324429 URL: https://svnweb.freebsd.org/changeset/base/324429 Log: Fix long name (used by libxo) for the "tdnam" ps(1) keyword. Reported by: pluknet MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 13:28:08 2017 (r324428) +++ head/bin/ps/keyword.c Mon Oct 9 13:48:10 2017 (r324429) @@ -199,7 +199,7 @@ static VAR var[] = { {"tdaddr", "TDADDR", NULL, "thread-address", 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, CHAR, + {"tdnam", "TDNAM", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, From owner-svn-src-all@freebsd.org Mon Oct 9 13:53:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0485EE30EDE; Mon, 9 Oct 2017 13:53:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7C8533759; Mon, 9 Oct 2017 13:53:42 +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 v99DrfRM000174; Mon, 9 Oct 2017 13:53:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99DrfsI000172; Mon, 9 Oct 2017 13:53:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091353.v99DrfsI000172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 13:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324430 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 13:53:43 -0000 Author: trasz Date: Mon Oct 9 13:53:41 2017 New Revision: 324430 URL: https://svnweb.freebsd.org/changeset/base/324430 Log: Undocument "tdnam" (leaving it as an alias), and rename the column to TDNAME. Suggested by: bde MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 13:48:10 2017 (r324429) +++ head/bin/ps/keyword.c Mon Oct 9 13:53:41 2017 (r324430) @@ -199,9 +199,9 @@ static VAR var[] = { {"tdaddr", "TDADDR", NULL, "thread-address", 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, "thread-name", LJUST, tdnam, 0, CHAR, + {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, + {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, - {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Mon Oct 9 13:48:10 2017 (r324429) +++ head/bin/ps/ps.1 Mon Oct 9 13:53:41 2017 (r324430) @@ -675,9 +675,8 @@ saved UID from a setuid executable accumulated system CPU time .It Cm tdaddr thread address -.It Cm tdnam -thread name (alias -.Cm tdname ) +.It Cm tdname +thread name .It Cm tdev control terminal device number .It Cm time From owner-svn-src-all@freebsd.org Mon Oct 9 14:48:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 081D0E32243; Mon, 9 Oct 2017 14:48:05 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF026F1A8; Mon, 9 Oct 2017 14:48:04 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1129) id F0D7210A1C; Mon, 9 Oct 2017 14:47:28 +0000 (UTC) Date: Mon, 9 Oct 2017 14:47:28 +0000 From: Li-Wen Hsu To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324423 - head/share/misc Message-ID: <20171009144728.GA93977@freefall.freebsd.org> References: <201710090501.v9951qcF079521@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710090501.v9951qcF079521@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 14:48:05 -0000 On Mon, Oct 09, 2017 at 05:01:52 +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Oct 9 05:01:51 2017 > New Revision: 324423 > URL: https://svnweb.freebsd.org/changeset/base/324423 > > Log: > Update iso3166 codes > > Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv > and hand massaged. > > Modified: > head/share/misc/iso3166 > > Modified: head/share/misc/iso3166 > ============================================================================== > --- head/share/misc/iso3166 Mon Oct 9 04:43:05 2017 (r324422) > +++ head/share/misc/iso3166 Mon Oct 9 05:01:51 2017 (r324423) > @@ -236,10 +236,11 @@ SZ SWZ 748 Swaziland > SE SWE 752 Sweden > CH CHE 756 Switzerland > SY SYR 760 Syrian Arab Republic > -TW TWN 158 Taiwan > +TW TWN 158 Taiwan, Province of China Hi Eitan, Plase revert this line, "Taiwan" is how we call ourself. Also please refer to previous commit: https://svnweb.freebsd.org/changeset/base/198948 Thanks, Li-Wen -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-all@freebsd.org Mon Oct 9 14:50:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C2BE32406; Mon, 9 Oct 2017 14:50:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6C8C6FB08; Mon, 9 Oct 2017 14:50:03 +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 v99Eo2TY021216; Mon, 9 Oct 2017 14:50:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Eo20W021215; Mon, 9 Oct 2017 14:50:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201710091450.v99Eo20W021215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Oct 2017 14:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324431 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 324431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 14:50:05 -0000 Author: kevans Date: Mon Oct 9 14:50:02 2017 New Revision: 324431 URL: https://svnweb.freebsd.org/changeset/base/324431 Log: patch(1): Don't overrun line buffer in some cases Patches like file.txt attached to PR 190195 with a final line formed like ">(EOL)" could cause a copy past the end of the current line buffer. In the case of PR 191641, this caused a duplicate line to be copied into the resulting file. Instead of running past the end, treat it as if it were a blank line. PR: 191641 Reviewed by: cem, emaste, pfg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12609 Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Mon Oct 9 13:53:41 2017 (r324430) +++ head/usr.bin/patch/pch.c Mon Oct 9 14:50:02 2017 (r324431) @@ -1135,7 +1135,12 @@ hunk_done: if (*buf != '>') fatal("> expected at line %ld of patch\n", p_input_line); - p_line[i] = savestr(buf + 2); + /* Don't overrun if we don't have enough line */ + if (len > 2) + p_line[i] = savestr(buf + 2); + else + p_line[i] = savestr(""); + if (out_of_mem) { p_end = i - 1; return false; From owner-svn-src-all@freebsd.org Mon Oct 9 15:24:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F181E3319C; Mon, 9 Oct 2017 15:24: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 mx1.freebsd.org (Postfix) with ESMTPS id D306E77923; Mon, 9 Oct 2017 15:24:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99FOIK6037689; Mon, 9 Oct 2017 15:24:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99FOIVR037688; Mon, 9 Oct 2017 15:24:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091524.v99FOIVR037688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 15:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324432 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:24:20 -0000 Author: kib Date: Mon Oct 9 15:24:18 2017 New Revision: 324432 URL: https://svnweb.freebsd.org/changeset/base/324432 Log: More style. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 14:50:02 2017 (r324431) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:24:18 2017 (r324432) @@ -717,10 +717,10 @@ i386_set_ldt_data(struct thread *td, int start, int nu static int i386_ldt_grow(struct thread *td, int len) { - struct mdproc *mdp = &td->td_proc->p_md; + struct mdproc *mdp; struct proc_ldt *new_ldt, *pldt; - caddr_t old_ldt_base = NULL_LDT_BASE; - int old_ldt_len = 0; + caddr_t old_ldt_base; + int old_ldt_len; mtx_assert(&dt_lock, MA_OWNED); @@ -728,6 +728,10 @@ i386_ldt_grow(struct thread *td, int len) return (ENOMEM); if (len < NLDT + 1) len = NLDT + 1; + + mdp = &td->td_proc->p_md; + old_ldt_base = NULL_LDT_BASE; + old_ldt_len = 0; /* Allocate a user ldt. */ if ((pldt = mdp->md_ldt) == NULL || len > pldt->ldt_len) { From owner-svn-src-all@freebsd.org Mon Oct 9 15:39:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8EBEE33819; Mon, 9 Oct 2017 15:39:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 956F97F085; Mon, 9 Oct 2017 15:39:44 +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 v99FdhO5042227; Mon, 9 Oct 2017 15:39:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Fdh4m042224; Mon, 9 Oct 2017 15:39:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091539.v99Fdh4m042224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 15:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324433 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 324433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:39:45 -0000 Author: kib Date: Mon Oct 9 15:39:43 2017 New Revision: 324433 URL: https://svnweb.freebsd.org/changeset/base/324433 Log: Reset the fs and gs bases on exec(2). The values from the old address space do not make sense for the new program. In particular, gsbase might be the TLS base for the old program but the new program has no TLS now. amd64 already handles this correctly. Reported and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/sys_machdep.c head/sys/i386/include/md_var.h Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/i386/machdep.c Mon Oct 9 15:39:43 2017 (r324433) @@ -1132,6 +1132,15 @@ exec_setregs(struct thread *td, struct image_params *i else mtx_unlock_spin(&dt_lock); + /* + * Reset the fs and gs bases. The values from the old address + * space do not make sense for the new program. In particular, + * gsbase might be the TLS base for the old program but the new + * program has no TLS now. + */ + set_fsbase(td, 0); + set_gsbase(td, 0); + bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = imgp->entry_addr; regs->tf_esp = stack; Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:39:43 2017 (r324433) @@ -91,6 +91,37 @@ fill_based_sd(struct segment_descriptor *sdp, uint32_t sdp->sd_gran = 1; } +/* + * Construct special descriptors for "base" selectors. Store them in + * the PCB for later use by cpu_switch(). Store them in the GDT for + * more immediate use. The GDT entries are part of the current + * context. Callers must load related segment registers to complete + * setting up the current context. + */ +void +set_fsbase(struct thread *td, uint32_t base) +{ + struct segment_descriptor sd; + + fill_based_sd(&sd, base); + critical_enter(); + td->td_pcb->pcb_fsd = sd; + PCPU_GET(fsgs_gdt)[0] = sd; + critical_exit(); +} + +void +set_gsbase(struct thread *td, uint32_t base) +{ + struct segment_descriptor sd; + + fill_based_sd(&sd, base); + critical_enter(); + td->td_pcb->pcb_gsd = sd; + PCPU_GET(fsgs_gdt)[1] = sd; + critical_exit(); +} + #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { int op; @@ -109,7 +140,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) struct i386_get_xfpustate xfpu; } kargs; uint32_t base; - struct segment_descriptor sd, *sdp; + struct segment_descriptor *sdp; AUDIT_ARG_CMD(uap->op); @@ -204,16 +235,11 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = copyin(uap->parms, &base, sizeof(base)); if (error == 0) { /* - * Construct a descriptor and store it in the pcb for - * the next context switch. Also store it in the gdt - * so that the load of tf_fs into %fs will activate it - * at return to userland. + * Construct the special descriptor for fsbase + * and arrange for doreti to load its selector + * soon enough. */ - fill_based_sd(&sd, base); - critical_enter(); - td->td_pcb->pcb_fsd = sd; - PCPU_GET(fsgs_gdt)[0] = sd; - critical_exit(); + set_fsbase(td, base); td->td_frame->tf_fs = GSEL(GUFS_SEL, SEL_UPL); } break; @@ -226,15 +252,11 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = copyin(uap->parms, &base, sizeof(base)); if (error == 0) { /* - * Construct a descriptor and store it in the pcb for - * the next context switch. Also store it in the gdt - * because we have to do a load_gs() right now. + * Construct the special descriptor for gsbase. + * The selector is loaded immediately, since we + * normally only reload %gs on context switches. */ - fill_based_sd(&sd, base); - critical_enter(); - td->td_pcb->pcb_gsd = sd; - PCPU_GET(fsgs_gdt)[1] = sd; - critical_exit(); + set_gsbase(td, base); load_gs(GSEL(GUGS_SEL, SEL_UPL)); } break; Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/include/md_var.h Mon Oct 9 15:39:43 2017 (r324433) @@ -66,6 +66,8 @@ void init_AMD_Elan_sc520(void); vm_paddr_t kvtop(void *addr); void panicifcpuunsupported(void); void ppro_reenable_apic(void); +void set_fsbase(struct thread *td, uint32_t base); +void set_gsbase(struct thread *td, uint32_t base); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); From owner-svn-src-all@freebsd.org Mon Oct 9 15:48:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944C3E33B5F; Mon, 9 Oct 2017 15:48:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41FF8813EE; Mon, 9 Oct 2017 15:48:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99Fmvrr046505; Mon, 9 Oct 2017 15:48:57 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99FmuuT046501; Mon, 9 Oct 2017 15:48:56 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201710091548.v99FmuuT046501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 9 Oct 2017 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324434 - in head/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: in head/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Commit-Revision: 324434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:48:58 -0000 Author: gnn Date: Mon Oct 9 15:48:56 2017 New Revision: 324434 URL: https://svnweb.freebsd.org/changeset/base/324434 Log: Add support for Intel 8265 WiFi Obtained from: OpenBSD MFC after: 1 month Added: head/sys/modules/iwmfw/iwm8265fw/ head/sys/modules/iwmfw/iwm8265fw/Makefile (contents, props changed) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_8000.c head/sys/dev/iwm/if_iwm_config.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:48:56 2017 (r324434) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -5690,6 +5690,7 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_7265_2 0x095b #define PCI_PRODUCT_INTEL_WL_8260_1 0x24f3 #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 +#define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd static const struct iwm_devices { uint16_t device; @@ -5705,6 +5706,7 @@ static const struct iwm_devices { { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, }; static int Modified: head/sys/dev/iwm/if_iwm_8000.c ============================================================================== --- head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:48:56 2017 (r324434) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include "if_iwm_config.h" #define IWM8000_FW "iwm8000Cfw" +#define IWM8265_FW "iwm8265fw" #define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 @@ -90,6 +91,13 @@ __FBSDID("$FreeBSD$"); const struct iwm_cfg iwm8260_cfg = { .name = "Intel(R) Dual Band Wireless AC 8260", .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm8265_cfg = { + .name = "Intel(R) Dual Band Wireless AC 8265", + .fw_name = IWM8265_FW, IWM_DEVICE_8000_COMMON, .host_interrupt_operation_mode = 0, }; Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:48:56 2017 (r324434) @@ -131,5 +131,6 @@ extern const struct iwm_cfg iwm3165_cfg; extern const struct iwm_cfg iwm7265_cfg; extern const struct iwm_cfg iwm7265d_cfg; extern const struct iwm_cfg iwm8260_cfg; +extern const struct iwm_cfg iwm8265_cfg; #endif /* __IWM_CONFIG_H__ */ Added: head/sys/modules/iwmfw/iwm8265fw/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/iwmfw/iwm8265fw/Makefile Mon Oct 9 15:48:56 2017 (r324434) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +KMOD= iwm8265fw +IMG= iwm-8265-22 + +.include From owner-svn-src-all@freebsd.org Mon Oct 9 15:54:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BFEDE33F0D; Mon, 9 Oct 2017 15:54:16 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CF1C182844; Mon, 9 Oct 2017 15:54:15 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1aNfer01hM9gt1aNgeQZtz; Mon, 09 Oct 2017 09:54:13 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=a4Aw6F95ZvH9RvhgbvMA:9 a=K0OK_Eu0TMvzUq_5:21 a=0CyyuH9aOhxaPQ_5:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id B02F0D0; Mon, 9 Oct 2017 08:54:10 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v99FsAjK002950; Mon, 9 Oct 2017 08:54:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710091554.v99FsAjK002950@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324420 - in head/sys: kern sys In-Reply-To: Message from Alan Cox of "Sun, 08 Oct 2017 22:17:39 -0000." <201710082217.v98MHdNI012272@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Oct 2017 08:54:10 -0700 X-CMAE-Envelope: MS4wfDMxvRywROYAUhDwqywor3BDK/16EEP3jKuzwG86D9pgTB5QjUmIinMeTcptv/YsNlQbE4CdtV2R4/cZgefmzxiywC8rZWd62oA/n9yOnJ/38IP/lNyh FxTAaZ3vKLtjXafQsVncvnBJjLZMrspa1vdVonj45Fvel0fwcOst9YOKRtrvyVaQ5HowV6TOycISVzgn5t877qZ39PKHe/g6EkNuEPUmuwOvyn/a7smAjGGZ qeX6XrmgbBvyIZf/kiHnXt1y1G8N8VoJ3XWbh+sLpfg/cwHSb0UFDUStICztvnB9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:54:16 -0000 In message <201710082217.v98MHdNI012272@repo.freebsd.org>, Alan Cox writes: > Author: alc > Date: Sun Oct 8 22:17:39 2017 > New Revision: 324420 > URL: https://svnweb.freebsd.org/changeset/base/324420 > > Log: > The blst_radix_init function has two purposes - to compute the number of > nodes to allocate for the blist, and to initialize them. The computation > can be done much more quickly by identifying the terminating node, if any, > at every level of the tree and then summing the number of nodes at each > level that precedes the topmost terminator. The initialization can also be > done quickly, since settings at the root mark the tree as all-allocated, an > d > only a few terminator nodes need to be marked in the rest of the tree. > Eliminate blst_radix_init, and perform its two functions more simply in > blist_create. > > The allocation of the blist takes places in two pieces, but there's no good > reason to do so, when a single allocation is sufficient, and simpler. > Allocate the blist struct, and the array of nodes associated with it, with > a > single allocation. > > Submitted by: Doug Moore > Reviewed by: markj (an earlier version) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D11968 > > Modified: > head/sys/kern/subr_blist.c > head/sys/sys/blist.h > > Modified: head/sys/kern/subr_blist.c > ============================================================================= > = > --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r32441 > 9) > +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r32442 > 0) > @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad > static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); > static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t coun > t, > u_daddr_t radix); > -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t > count); > #ifndef _KERNEL > static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, > int tab); > @@ -218,30 +218,69 @@ blist_t > blist_create(daddr_t blocks, int flags) > { > blist_t bl; > - daddr_t nodes, radix; > + daddr_t i, last_block; > + u_daddr_t nodes, radix, skip; > + int digit; > > /* > - * Calculate the radix field used for scanning. > + * Calculate the radix and node count used for scanning. Find the last > + * block that is followed by a terminator. > */ > + last_block = blocks - 1; > radix = BLIST_BMAP_RADIX; > while (radix < blocks) { > + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) > + /* > + * A terminator will be added. Update last_block to th > e > + * position just before that terminator. > + */ > + last_block |= radix - 1; > radix *= BLIST_META_RADIX; > } > - nodes = 1 + blst_radix_init(NULL, radix, blocks); > > - bl = malloc(sizeof(struct blist), M_SWAP, flags); > + /* > + * Count the meta-nodes in the expanded tree, including the final > + * terminator, from the bottom level up to the root. > + */ > + nodes = (last_block >= blocks) ? 2 : 1; > + last_block /= BLIST_BMAP_RADIX; > + while (last_block > 0) { > + nodes += last_block + 1; > + last_block /= BLIST_META_RADIX; > + } > + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); > if (bl == NULL) > return (NULL); > > bl->bl_blocks = blocks; > bl->bl_radix = radix; > bl->bl_cursor = 0; > - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); > - if (bl->bl_root == NULL) { > - free(bl, M_SWAP); > - return (NULL); > + > + /* > + * Initialize the empty tree by filling in root values, then initialize > + * just the terminators in the rest of the tree. > + */ > + bl->bl_root[0].bm_bighint = 0; > + if (radix == BLIST_BMAP_RADIX) > + bl->bl_root[0].u.bmu_bitmap = 0; > + else > + bl->bl_root[0].u.bmu_avail = 0; > + last_block = blocks - 1; > + i = 0; > + while (radix > BLIST_BMAP_RADIX) { > + radix /= BLIST_META_RADIX; > + skip = radix_to_skip(radix); > + digit = last_block / radix; > + i += 1 + digit * skip; > + if (digit != BLIST_META_MASK) { > + /* > + * Add a terminator. > + */ > + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; > + bl->bl_root[i + skip].u.bmu_bitmap = 0; > + } > + last_block %= radix; > } > - blst_radix_init(bl->bl_root, radix, blocks); > > #if defined(BLIST_DEBUG) > printf( > @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) > void > blist_destroy(blist_t bl) > { > - free(bl->bl_root, M_SWAP); > + > free(bl, M_SWAP); > } > > @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr > } > scan->u.bmu_avail -= nblks; > return (nblks); > -} > - > -/* > - * BLST_RADIX_INIT() - initialize radix tree > - * > - * Initialize our meta structures and bitmaps and calculate the exact > - * amount of space required to manage 'count' blocks - this space may > - * be considerably less than the calculated radix due to the large > - * RADIX values we use. > - */ > -static daddr_t > -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) > -{ > - daddr_t i, memindex, next_skip, skip; > - > - memindex = 0; > - > - /* > - * Leaf node > - */ > - > - if (radix == BLIST_BMAP_RADIX) { > - if (scan) { > - scan->bm_bighint = 0; > - scan->u.bmu_bitmap = 0; > - } > - return (memindex); > - } > - > - /* > - * Meta node. If allocating the entire object we can special > - * case it. However, we need to figure out how much memory > - * is required to manage 'count' blocks, so we continue on anyway. > - */ > - > - if (scan) { > - scan->bm_bighint = 0; > - scan->u.bmu_avail = 0; > - } > - > - skip = radix_to_skip(radix); > - next_skip = skip / BLIST_META_RADIX; > - radix /= BLIST_META_RADIX; > - > - for (i = 1; i < skip; i += next_skip) { > - if (count >= radix) { > - /* > - * Allocate the entire object > - */ > - memindex = i + > - blst_radix_init(((scan) ? &scan[i] : NULL), radix, > - radix); > - count -= radix; > - } else if (count > 0) { > - /* > - * Allocate a partial object > - */ > - memindex = i + > - blst_radix_init(((scan) ? &scan[i] : NULL), radix, > - count); > - count = 0; > - } else { > - /* > - * Add terminator and break out. Make terminator bitma > p > - * zero to avoid a spanning leaf allocation that > - * includes the terminator. > - */ > - if (scan) { > - scan[i].bm_bighint = (daddr_t)-1; > - scan[i].u.bmu_bitmap = 0; > - } > - break; > - } > - } > - if (memindex < i) > - memindex = i; > - return (memindex); > } > > #ifdef BLIST_DEBUG > > Modified: head/sys/sys/blist.h > ============================================================================= > = > --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) > +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) > @@ -82,7 +82,7 @@ typedef struct blist { > daddr_t bl_blocks; /* area of coverage */ > u_daddr_t bl_radix; /* coverage radix */ > daddr_t bl_cursor; /* next-fit search starts at */ > - blmeta_t *bl_root; /* root of radix tree */ > + blmeta_t bl_root[1]; /* root of radix tree */ > } *blist_t; > > #define BLIST_META_RADIX 16 > This commit is causing this: panic: freeing invalid range On my laptop (Core i3 chip): (kgdb) bt #0 doadump (textdump=1) at pcpu.h:232 #1 0xffffffff80583e16 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff80584306 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff80584123 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff805b9133 in blst_meta_free (scan=0xfffffe00045c3128, freeBlk=, count=0, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:869 #5 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3048, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #6 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3038, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #7 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3028, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #8 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3018, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #9 0xffffffff808359af in swaponsomething (vp=, id=0xfffff8000cb97200, nblks=3145727, strategy=0xffffffff80835c60 , close=0xffffffff80835ee0 , dev=132, flags=1) at /opt/src/svn-current/sys/vm/swap_pager.c:2199 #10 0xffffffff8083392c in sys_swapon (td=, uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 728 #11 0xffffffff80887a11 in amd64_syscall (td=0xfffff8000c659560, traced=0) at subr_syscall.c:132 #12 0xffffffff8086afcb in Xfast_syscall () at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 #13 0x000000002c689aea in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal (kgdb) On my gateway machine (AMD 4600+): (kgdb) bt #0 doadump (textdump=) at pcpu.h:232 #1 0xffffffff80573e11 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff805742e6 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff80574103 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff805a8b63 in blst_meta_free (scan=0xfffffe00021c9038, freeBlk=, count=0, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:869 #5 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9028, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #6 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9018, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #7 0xffffffff8081becf in swaponsomething (vp=, id=0xfffff800124d1080, nblks=262144, strategy=0xffffffff8081c180 , close=0xffffffff8081c400 , dev=101, flags=1) at /opt/src/svn-current/sys/vm/swap_pager.c:2199 #8 0xffffffff80819e4c in sys_swapon (td=, uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 728 #9 0xffffffff80869fb1 in amd64_syscall (td=0xfffff80012558000, traced=0) at subr_syscall.c:132 #10 0xffffffff8084dd4b in Xfast_syscall () at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 #11 0x0000000800a89aea in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal (kgdb) In the case of my laptop, it panicked only once. My gateway machine downstairs was in a panic reboot loop, panicking during swapon. Reverting this diff resolves my issue. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Oct 9 15:54:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5598E33FB5; Mon, 9 Oct 2017 15:54:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40D4B82A5C; Mon, 9 Oct 2017 15:54:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99Fswv0050430; Mon, 9 Oct 2017 15:54:58 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Fsv8k050429; Mon, 9 Oct 2017 15:54:57 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201710091554.v99Fsv8k050429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 9 Oct 2017 15:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324435 - head/sys/contrib/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/sys/contrib/dev/iwm X-SVN-Commit-Revision: 324435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:55:00 -0000 Author: gnn Date: Mon Oct 9 15:54:57 2017 New Revision: 324435 URL: https://svnweb.freebsd.org/changeset/base/324435 Log: Add the firmware for the Intel 8265 WiFi device. MFC after: 1 month Added: head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu Added: head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu Mon Oct 9 15:54:57 2017 (r324435) @@ -0,0 +1,40270 @@ +begin 644 iwm-8265-22.fw +M`````$E73`IS=')E86TZ0V]R94-Y8VQE,3E?````"`````$`````````'@````@````"```` +MCWX#`!P````0`````````````````````````!L````$`````@```#,````, +M````````````@```@`$`,P````P````!``````"(``"````S````#`````(` +M`````$```(`&`!,```"\`@```$!```8```"A```````!``````"&@````P<6 +M(`#/`0!`````0`````$````$A`4````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````U7?1O$KMC1P!%L)AM`1@'DT[FA#1 +MOWMZR()DJ-L;GQEBIN9H[A^ZS%KH6MG.(:=CV\&$V<0:'I[5@L7;]O#+S6])Q;OTUZ` +M@Q9O#\ZQZUROU1XL3>@GIX0A'ZLQS3.]EM]`#)-:.@LH#44.K^C\7[\`!P3D +MY4F9W;8[]70ZRI8T>H?6RDCG3OM +M8]KY^9H/)$3]O$5[L'!Q8_7B]),MEL2SE/;3@!]'*Q0B!J +MSTEZ*8)Z!0@S6DLP1!FVOW/)J9&S#<5HT&$4S<7=^@(C/O$<4EJ.EO9XL_%E +MT>4]#<7,[9G60.1^$&L="\AYAH+6D>M<"8*SB6+Z(O@K2S"E-V&#A#J=*)YQ +M?A=_2W+\0QR``+XRI7=42EPB2)(!`2I!$9U:;0F'*M._3+OF[>!&+"-+#-'H +M\PZ#!\0+`..6,0`#S%^8W8&G25#,,I>V=BW:]"V:&%%;OYJG`P````<````( +M@`$```"```"``0`'````"``%``````````4`!P```%"Y````@$0`2+D``!,` +M```$@`$```"````````6````!(0%```!````````S-:``"0H@`!`_(``Q/.` +M`)04@`"`<($`````````````````````````````````;"#`$`\;"2+<'<`0 +M"@`;0"``&VX,``!A@``;;D```&$``1MN4P``80`"&VYC``!A``0;;GX``&$0 +M`!MN`0``88```&%[``!A```;)"``&R7D'<`12`GA&!\`"&(``!LE`0`;)``` +M!24!``4D``@%.0$`!6*((,`1`@`%)``(!3D!``5BC"#`$00`!20`"`4Y`0`% +M8I`@P!$(``4D``@%.0$`!6*4(,`1$``%)``(!3D!``5BF"#`$2``!20`"`4Y +M`0`%8IP@P!%```4D``@%.0$`!6*@(,`1```()0``""1(">$91`GA&10)P!(! +M`!MP"@``80\<'2($`!TF)`G`$@$;(R+H'<`0`0`C<`$``&$1`!LP`0`;,.@= +MP!&Z#P!A```;)(``&R7D'<`1"`!?<`D``&'0",`2``D;*,P(@($``,`7U`C` +M$@`)&RC("("!``#`%ZP/`&',",`2X`B`@0``P!?(",`2W`B`@0``P!>E#P!A +M```;)``!&R7D'<`1"`!?<*`/`&$```4EX@0%)-0(P!(`"1LH``4;*=P(@($` +M`,`7T`C`$@`)&R@`!1LIX`B`@0``P!>3#P!A```;)``"&R7D'<`1"`!?<`P` +M`&'L'\`0__\;,^P?P!'.[@TE@ID-)`\--R)L(,`0#QLW(O__#24._PTD#PTW +M(H(/`&'L'\`0```;,>P?P!'.[@TE@ID-)`\--R)L(,`0#QLW(O__#26._PTD +M#PTW(G8/`&$```!A```;)2``&R1<',`1````8=P=P!```!TD````(0$`6#'. +M[@TE`8$-)`\--R(/1#$7`$`$`$W`,``!A"`!8,-@>P!`*`!-``@`3;@0` +M`&$!``@D```()40)X1D!``!A`(!8,`@`9#$```!A"`!8;N,/`&$``!,E```3 +M)"00P!$`@!,D```3)3@!,B +M``#&$0,``20```$E#T4`(@!<`#GO_P`R%P``9`"`$R0!`!,E.!S`$0]W$R+@ +M',`1`@`!8@\!$R($",`1?`S`$LA)QQ&0"\`2`0`!;@,`$S`,`,T1"`!8,0\4 +M%2($`!4F`P`3)```$R4$",`1```3)#A%P!$%``!A``!8.`0`6#$``!,D`0`3 +M)3@P!`*`!-``@`3;@0``&$!``@D```()40)X1D$``!A`(!8 +M,`(``&$`(%@P````8>@=P!#F_Q,R__\3,^@=P!$```$D"``!)0\!8R(!`%(D +M"``';@(``&$``!4D#P``80X``&'H'<`0^^K=[OOJW>[[ZMWN^^K=[OOJW>[[ZMWN^^ +MK=[OOJW>[[ZMWN^^K=[OOJW>[[ZMWN^^K=X````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````-`'```` +M``````````$!`0$!`0$!O1\``&,N``#_____```````````````````````` +M```(```````````````````````````````````````````````!```````` +M`````````````0`````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````S,```$1`````````````` +M``HH```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````$0`@````````````"0````H````+````#`````T````.``` +M`#P```!`````1````$@```!,````4````%0```!8````7````&````!D```` +M:````&P```!P````=````'@```!\````@````(0```"(````C````)````"5 +M````F0```)T```"A````I0```*D```"M````L0```"H````Z````2@```%H` +M``!J````>@```(H```";````JP````(````$````!@````,````+````$P`` +M`!L````C````*P```#,````Z````0@````$`````````!`````4````````` +M`````````````/\```#^`0```O\```/_``$`_P$``0(!`@+_`@#_`P(`_@0" +M``/_````````````````".@```H````$````&-J``````````````````!SH +M```*````!````!C:@``````````````````````````````````````````` +M````````````'@```!Z('HA:````5@```%:(5H@"`0``J@```*J(JHC^`0`` +MC`H``%2,5(RD'P````#_```!`/\```/_```&_P``"?\```K_`0#_`0$!`0$! +M``+_`0(#_P$!!O\!`0G_`0`*_P$`_@("`/\#`@($`P(`!?\"``C_`@,&_P(` +M"?\"`@/_`@`*_P(`_@0#`/\%`P('_P,`"?\#`P/_`P,&_P,`"O\#`/X&```` +M````````````:)@```H````$````&-J```````````````````"9```%```` +M!````!C:@````````````````````````````````````````````)S'`0"H +MR0$`",D!`'C)`0`DQ`$`',0!`!QB```D8```>&```"`[`0`````````````` +M``````````````````````````#_!P```/\```?_``$)"```"O\!`@```0,! +M_P$#`O\!`P/_`0$$_P$"!0`!`0O_`0(,_P$$!@8!`0?_`0`(_P$`"O\"`@#_ +M`@,!_P(#`O\"`P/_`@$$`0("!0`"`0L!`@(,`0($!@8"`@<``@`(`0(`"@$# +M`/\"`P,`_P,#`?\#`P+_`P,#!`,!!`4#`@4``P$+!0,"#`4#!`8&`P,'_P,` +M"`4#``H%`P#^`P0$`/\$!`'_!`0"_P0$`_\$!`3_!`0%_P0$"_\$!`S_!`0& +M!@0$!P8$``C_!``*_P````````````#_`````0,``@("``,``@``!?\```;_ +M```$_P``!P0```C_`0#_`0$!``,!`@$"`0("`@$`!/\!`0<$`0`(_P(#``8" +M`@(&`@`%_P(`!O\"``0'`@`'!P(`"`<#`P`&`P`!!0,"`@8#`07_`P`&_P,` +M!`<#``<'`P`(!P`````````````````0``#V#P``V`\``*8/``!A#P``"0\` +M`)T.```@#@``D0T``/$,``!!#```@@L``+0*``#9"0``\@@````(```#!P`` +M_@4``/$$``#>`P``QP(``*P!``".``````````````````````$````!```` +M```````````!`````0````$```````````````$``)S0@``>``$D/@(``0`$ +M``!(MH``!``!L/2```P``0``1,V```$``T#-@``!``.4%(```0`!*-"```$` +M`RS0@``!``/H/0(``@`$```@````(`````````!54@``1T4``$Q)``!.0P`` +M1$D``%-5``!:6@``6EH``%I:``!:6@``6EH``%I:``!:6@``6EH``%I:``!: +M6@`````````(!`P""@8.`0D%#0,+!P\!`````@````P```#P/P$````!```` +M`````````````!@_`P`%```"!````!C:@````````````/\````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````#`````````$YB$`#A +M@0$`3F(0````````````````````````````V0#8``$`)`"`!Q`*`0$"`1T` +M@0J""J$(,0N\!TP*````````)P`[`%L)ZPL`````I*H"`#,S`P````0`,E4% +M````"`"KJ@H````,`,W,#``````````````````````````````````!```` +M````````````````_P```````````````````-CW```%```"!````!C:@`#_ +M````````````````````````````````````!@`````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````"@%(``"/R``!@````````` +M````````````````_LJMJP`````````````````````@`@`````A`@`````B +M`@`````C`@`````D`@`````E`@`````&``````````````!8!`,`3`0#`'@$ +M`P"8!P,`3`4#`!`%`P"\!`,```@#`"@/@`"`]8``'@```"R21``!```````` +M`$J21``````````````````````````````````!```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````/!L!``4```($````&-J````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````@``````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````#_ +M```!`_\```D!```*_P`#!`(```#_``#^`P$`_P0!`0D%`0$*!0$``?\!`P0" +M`0$"_P$!"/\!``#_`0#^!@(`_P<"`@D(`@(*"`("!PD"``'_`@$#_P(#!`H" +M`@+_`@``"P,#"0P#`PH,`P0%#0,#`@X#```/!`#_$`0$"1$$!`H1!`(&_P0" +M`A($!`C_!```_P0`_A,```````````````!<\P``"@````0````8VH`````` +M````````````9",```H````$````&-J``(Q[```(?```D"````!\``"0\@`` +M]/(``-SR``#D(```_"$``'0A``#$(```^"$``+P@``"P(```M"```+@@``"T +MWP``$.```.3?``#)VE````````'P#0_P``````````T/^@_P``!F0`!@8& +M``````#Z_?P`]/GY```````````"`````P````4``````-#_H/\``-#_H/\` +M`-#_H/\``-#_H/\A(2$A(2$A(2$A2$A(2$A(2$A(2%965E965E965E9Q<7%Q +M96!W='%Q2$A(2$A(2$A(2(!@@&"`8(!@@&`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````H!`0$!`0``"`IQR;Z\```````` +M```````````````````````````````````````````````````````````` +M````````````````````_W\```````#_?P```````/]_````````_W\````` +M``#_?P```````/]_````````_W\```````#_?P```````/]_```````````` +M`/]__W]@'H``8!Z``&`>@````````````````````/]_``````$````````` +M````````````````6``H`%@`*``P``````#0_U@`*`!(`"@`2``H`#@`#``` +M`-#_2``H`%``(`!0`"``:`!(`"@`"`!0`"``4``P`%``,`!@`#@`*``(`%`` +M,`!(`"@`2``H`&@`.``H``0`2``H`%@`*`!8`"@`8``H`"@`(`!8`"@`2``H +M`$@`*`!@`"@`*``8`$@`*``````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````_LJMJP`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````!``````D`$```"@`!`G``#H`P``Z`,``+":``!$F@`` +M0)H``)R:``#HRP(`.,P"`!S,`@!@RP(`F,L"`"S+`@`DS`(``0`````````` +M``````````````````````````-````4``````$```````"<)H`````````` +M``````````````````!$,`(`"@````0````8VH```````````````"`````` +M```````````````````````````````````````````````````````````` +M````````````````````````!````````````````````````````/@P`@`% +M````!````!C:@```````````````````````'#("``4```($````&-J````` +M`````````````#0S`@`%```"!````!C:@`#`48`````````````````````` +M``$``````````@``````````````````````````````9T4C`04````"`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(!`@("`@("`@$! +M`@("`@("`@("`@("`@("`@("`@("`O\````0`@`````````````````````` +M````````````.".!```````````````````````````````````````````` +M```````````!```````````````````````````````````````````````` +M```````````````)```````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M_________________________________P`````````````````````````` +M``````T-#0T.#@X.#@\/#P\/$!`0$!$1$1$2$A(2$Q,3$Q04%!45%146%A87 +M%Q<8&!@9&1H:&AL;&QP<'1T='AX?'R`@(2$B(B,C)"0E)28F)R`` +M``K@``!&X```%^```!C@``!'X```*.```"G@```XX```.>````"(`0!B8F)B +M8F(```"<`0!G9V=G9V<```"0`0!D9&1D9&0``&9F9F9F9@`````````````` +M```````````````````````````````````````````````````````````` +M``#D;@``!0````0````8VH``U&X``-QN``",;P``V&X``.!N```````````` +M```````````````````````````````````````````````````````````` +M````````````````I``$``4````$````&-J````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````S!L`````R!L`````0!P` +M````3!P`````4!P`````5!P`````6!P`````7!P`````8!P`````9!P````` +M`````$0?`````(`?`````(0?`````(@?`````(P? +M`````)`?`````)0?`````)@?`````)P?`````*`?`````*0?`````*@?```` +M`*P?`````+`?`````.0?`````/`?`````/0?`````/P?`````$8````````` +M````````````````X!P`````Y!P`````Z!P`````]!P`````^!P`````#!T` +M````&!T`````+!T`````,!T`````G!T`````H!T`````,!X`````-!X````` +M.!X`````/!X`````3!X`````4!X`````5!X`````6!X`````7!X`````9!X` +M````>!X`````?!X`````A!X`````C!X`````D!X`````E!X`````F!X````` +MG!X`````H!X`````P!X`````Q!X`````T!X`````U!X``````!\`````X!X` +M````!!\`````W!X`````=!\`````>!\`````?!\`````^!\`````*@`````` +M``````````````,````?````````````````````$````$M+2TM+```````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````$````````````````````` +M`````````````````````````````````````````````````````````/\` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````/SP```````````````````,````````` +M_P``````````````````````````````````````````````__\````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````(```````````````````````````````````````````````````` +M`````/__________````````````````_(X```H````$````&-J````````` +M````.)0``.25``"(E```D),``!26``"HE0``Y),``$23`````0````$$`0$! +M``(!`0$#`0`"!P$!!`0!`04%`0(#_P(!`08"``('B!,````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````#_____```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````"````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````#_____```````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````"````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_____```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````"````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````#_ +M____```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````"````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````#_____```````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````"````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````_P`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````"< +MZH``+.B``)SJ@`#H[X``C.N``%3J@`!X[X``5.J``"#K@`"`*$`I0"I`*T`L`"T`+@`NP"_`,,`Q@#*`,X` +MT0#5`-@`W`#?`.,`YP#J`.X`\0#U`/@`_`#_``(!!@$)`0T!$`$4`1 +M`2$!)`$H`2L!+@$R`34!.`$[`3\!0@%%`4@!3`%/`5(!50%9`5P!7P%B`64! +M:`%K`6\!<@%U`7@!>P%^`8$!A`&'`8H!C0&0`9,!E@&:`9T!GP&B`:4!J`&K +M`:X!L0&T`;(!Y0'H`>L! +M[0'P`?,!]@'X`?L!_@$!`@,"!@()`@P"#@(1`A0"%@(9`AP"'@(A`B0")@(I +M`BP"+@(Q`C0"-@(Y`CL"/@)!`D,"1@)(`DL"30)0`E,"50)8`EH"70)?`F(" +M9`)G`FD";`)N`G$"P)]`G\"@@*$`H<"B0*,`HX"D`*3`I4"F`*: +M`IP"GP*A`J,"I@*H`JL"K0*O`K("M`*V`KD"NP*]`L`"P@+$`L8"R0++`LT" +MT`+2`M0"U@+9`ML"W0+?`N("Y`+F`N@"Z@+M`N\"\0+S`O8"^`+Z`OP"_@(` +M`ZL````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````!DG0``!0````0````8VH`````` +M```%``!R`0``J`(```0)!`D!!@D,$0$````````````````````````````` +M````````````````````````````````_LJMJP`<``````0<``````@<```` +M``P<`````"@<`````$@<`````$P<`````%`<`````%`<`````'P<`````"@X +M``````!,``````1,``````A,``````Q,`````"!,`````"1,`````"A,```` +M`$!,`````$1,`````&!,`````(!,`````*!,`````,!,`````,1,`````,A, +M`````,Q,`````.!,``````!-`````&!-```````D`````,PF`````-PF```` +M`,0F`````"`D`````#0D`````)@E`````)PE`````*`E`````*0E`````*@E +M`````*PE`````,0E`````,@E`````-0E`````-@E`````-PE`````.`E```` +M`.0E`````.@E`````.PE`````/`E``````0G`````!@0`````"P0`````$`0 +M`````$P0`````(P-`````)0-`````)P-`````,!$`````,1$`````,A$```` +M`,Q$`````-!$`````-1$`````-A$`````.!$`````.1$`````.A$`````.Q$ +M`````/A$`````/Q$``````!%`````"1%`````"A%`````"Q%`````$1%```` +M`&`(``````@-`````!`-`````!0-```````-``````0-`````(@P`````%4` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````!.*(``3`B@`$@(H```````-`J````````````````` +M`'43+A/H$J,27Q(<$MD1F!%8$1@1VA"<$%\0(Q#H#ZX/=0\\#P4/S@Z8#F(. +M+@[Z#<<-E`UB#3(-`0W2#*,,=0Q'#!H,[@O""Y<+;0M#"QH+\0K)"J(*>PI5 +M"B\*"@KE"<$)G0EZ"5<)-0D3"?((T0BQ")$(<@A3"#4(%PCY!]P'OP>C!X<' +M:P=0!S4'&P0!W0'6`=`!R0'"`0`````#0``````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````+@`J`"`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````#;$(Y(FY`""P`````` +M`#,``````````````````````$L#2P-+`TL#2P-+`TL#2P-+`TL#2P-+`TL# +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````*"@H*"@H*"@H*"@H*``H*"@H*"@H*"@H*"@H`"@H*"@H*"@H +M*``H*"@H*"@H*"@`````````````````````````*"@H*"@H*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*``H*"@H*"@H*"@H*"@H*"@H*"@````` +M```````````````````````````````````````````H*"@H&"@H*"@````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````H +M*"@H*"@H*"@H*"@H*```````````````````````````*"@H*"@H*"@H```` +M````````````````````````````````````````````````*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*``````````````````````` +M```H*"@H*"@H*"@H*"@H*"@H*"@`````````````*"@H*"@H*"@H`"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@`*"@H*"@H*"@H`"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@`*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````!65```.`````````!:9```/@````````!JI```/@````````!: +MI```/@````````!:I```/@````````!:9```/@````````!:5```/@`````` +M``!:I```/@````````!:9```/@`````````*(```/@````````!:9```/@`` +M``````!:9```/@````````!:5```/@````````!:9````P````````!:I``` +M`P`````````*````,0`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````#`P``````````````$````` +M`````0```#\0``````````````````````````````4`!0`````````````` +M``0(``$```4$`0`!!``$!0`````!``$``````!K0```3@```"$`$``$`!``:,````&`$``!@!```8`0``&`$` +M*A0``"A(```F>```!K0```3@```"$`$``$`!``:(````&`$`"E0(``B$```& +MM```!.````(0`0``0`$``!@!```8`0``&`$``!@!```8`0!C`````(`$`,8` +M``#&&`<`0$`5`&,!``#&`0``"C0```AH```&N```!.0```(4`0``0`$`!H@` +M```8`0``&`$``!@!```8`0``&`$`"C0```AH```&N```!.0```(4`0``0`$` +M!H@````8`0``&`$``!@!```8`0``&`$``!@!```8`0``&`$``!@!```8`0`` +M&`$``!@!```8`0!"`````````*4```"EE`(`0$`5`$(```"E````"CP```AL +M```&P```!/0```(D`0``4`$``8`!``%,`0`$P````!@!```8`0``&`$`"CP` +M``AL```&P```!/0```(D`0``4`$``8`!``%,`0`$P````!@!```8`0``&`$` +M`!@!```8`0``&`$``!@!```8`0``&`$``!@!```8`0`"``````````8````& +M&```0$`5``(````&````&@```!@8```62```%'@``!*P```&X```!!@!``), +M`0``@`$``!@!```8`0``&`$`&@```!@8```62```%'@``!*P```&X```!!@! +M``),`0``@`$`"'````:L```$V````@@!```X`0``&`$``!@!```8`0``&`$` +M`!@!```8`0"$``````````@!```((00`0$`5`(0````(`0``&@@``!@T```6 +M9```%)0``!+$```&"`$`!#@!``)D`0``E`$``!@!```8`0``&`$`&@@``!@T +M```69```%)0``!+$```&"`$`!#@!``)D`0``E`$``!@!```8`0``&`$``!@! +M```8`0``&`$``!@!```8`0``&`$``!@!```8`0"$``````````@!```((00` +M0$`5`(0````(`0`````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````!````(`````,```#I`.D` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````#/[__P$```#2V```TM@``"YG__\N9___$``` +M`-+8``#2V```+F?__RYG__\0````TM@``-+8```N9___+F?__Q````#2V``` +MTM@``"YG__\N9___$````-+8``#2V```+F?__RYG__\0````TM@``-+8```N +M9___+F?__Q````#2V```TM@``"YG__\N9___$````-+8``#2V```+F?__RYG +M__\0````TM@``-+8```N9___+F?__Q````#2V```TM@``"YG__\N9___$``` +M`-+8``#2V```+F?__RYG__\0````TM@``-+8```N9___+F?__Q`````````` +M````````````````````````````````````````````````F@````$````` +M`.0,```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`/]__W__?_]__W\````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````4%!04("PL,#2$$A45%14E +M+2TQ-842%!04%!PD)"PTA!(5%145'24M-3F%$A45%14E)2TU/842$A(2$AHB +M(BHJ@A(:&AH:(BHN-CZ*`!H:&AHJ,C(Z0HH`&AH:(BHR.D)RB@`='1T=)2TQ +M.46-`!T='1TM-3D]28T`'1T='2TU/4%9C0`;&QL;)R\W/T>+`!D9&2$I,3D] +M38D`&AH:(BHZ0D9FB@`7%Q<7)S,W/T^'`!45%1TE-3U!384`#P\/%Q\G,SMC +M?P`0$!`0("0H,#R```\/#Q+`!D9 +M&2$I,3D]38D`&AH:(BHZ0D9FB@`7%Q<7)S,W/T^'`!45%1TE-3U!384`#P\/ +M%Q\G,SMC?P`0$!`0("0H,#R```\/#Q+`!D9&2$I,3D]38D`&AH:(BHZ0D9FB@`7%Q<7)S,W +M/T^'`!45%1TE-3U!384`#P\/%Q\G,SMC?P`0$!`0("0H,#R```\/#Q#"!,3$Q,C*R\S/X,(%!04%!PD)"PT +MA`@3$Q,3&R,K*S.#"!(2$A(B(BHN,H(($!`0$!@@*"@P@`@8&!@8*"@P-$"( +M`!<7%Q\G,S#"!,3$Q,C*R\S/X,(%!04 +M%!PD)"PTA`@3$Q,3&R,K*S.#"!(2$A(B(BHN,H(($!`0$!@@*"@P@`@8&!@8 +M*"@P-$"(`!<7%Q\G,SV``3$Q,3'RLO +M,S>#"!,3$Q,C*R\S/X,(%!04%!PD)"PTA`@3$Q,3&R,K*S.#"!(2$A(B(BHN +M,H(($!`0$!@@*"@P@`@8&!@8*"@P-$"(`!<7%Q\G,S`"@H +M*"@R/$1,5&``*"@H*#`X0$948``H*"@H,#A`1E1@`!`0$!`4("@H,#`-$!`0 +M$!0@*"@P.`TH*"@H+CA"2$Y8`"@H*"@R/$1,4EX`*"@H*#(\1$Q48``H*"@H +M,#A`1E1@`"@H*"@P.$!&5&``_W__?_]__W__?_]__W__?_]__W\````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````#H`>@! +MN`6X!8@)B`E8#5@-*!$H$?@4^!3(&,@8F!R8'&@@:"`X)#@D""@(*-@KV"NH +M+Z@O>#-X,T@W2#<8.Q@[Z#[H/KA"N$*(1HA&6$I82BA.*$[X4?A1R%7(59A9 +MF%EH76A=.&$X80AE"&78:-AHJ&RH;'AP>'!(=$AT&'@8>.A[Z'NX?[A_B(.( +M@UB'6(.)X(H@BBV*78I:BIJ*EXK7BM +M2+%(L1BU&+7HN.BXN+RXO(C`B,!8Q%C$*,@HR/C+^,O(S\C/F-.8TVC7:-.IXZDCN2.X8\ACRZ/7H];CYN/F(_8C]_O_^__[_ +M_O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^ +M__[__O_^__[__O_^__[__O^@NPT`X"("```````````!``$````!``$````! +M``$````!``$````!``$````!``$````!`````0````$````!`````0````$` +M```!``$````!``$````!``$````!``$````!``$````!``$````!`````0`` +M``$````!`````0````$````!``$````!``$````!``$````!``$````!``$` +M```!``$````!`````0````$````!`````0````$````!``$````!``$````! +M``$````!``$````!``$````!``$````!`````0````$````!`````0````$` +M```!``$````!``$````!``$````!``$````!``$````!``$````!`````0`` +M``$````!`````0````$````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````'=W`P,-#08& +M`P,-#08&`P,-#08&`P,-#08&`P,-#08&`P,-#0`````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````F%D0!)@9BJ(````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Oct 9 16:02:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B127BE34695; Mon, 9 Oct 2017 16:02:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55ADCCA9; Mon, 9 Oct 2017 16:02:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99G2FCk054732; Mon, 9 Oct 2017 16:02:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99G2FEG054731; Mon, 9 Oct 2017 16:02:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710091602.v99G2FEG054731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 16:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324436 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:02:17 -0000 Author: eadler Date: Mon Oct 9 16:02:15 2017 New Revision: 324436 URL: https://svnweb.freebsd.org/changeset/base/324436 Log: See r198948 Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Mon Oct 9 15:54:57 2017 (r324435) +++ head/share/misc/iso3166 Mon Oct 9 16:02:15 2017 (r324436) @@ -236,7 +236,7 @@ SZ SWZ 748 Swaziland SE SWE 752 Sweden CH CHE 756 Switzerland SY SYR 760 Syrian Arab Republic -TW TWN 158 Taiwan, Province of China +TW TWN 158 Taiwan TJ TJK 762 Tajikistan TZ TZA 834 Tanzania United Republic of TH THA 764 Thailand From owner-svn-src-all@freebsd.org Mon Oct 9 16:03:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA82E3476B for ; Mon, 9 Oct 2017 16:03:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 123BFFE0 for ; Mon, 9 Oct 2017 16:03:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-qt0-x234.google.com with SMTP id q4so44014561qtq.8 for ; Mon, 09 Oct 2017 09:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=hbw7VRcM+6P6vsIR8mXxmlIAmY4C26jNOgjgz2sSE1JR16ObT9T0wd3cSmFzzMatLZ v1eMio+CylzhbxJCvSBW479livqxIisHkRaTIF8fwLJZVP9exkDRQL9N6mBtrWwSMYQT 5ELCV8VHgT5mouLSeelt9JBTCJmr1wFKKfkQo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=PCRWnLBh8rrKjOz5gB20Lv7rK0gYabVSP1mSMQcl7ZTVb7UTnz9mggjs0dnjIxpV07 AGFsRI4CgQ2xjWgkHiSUQWHsZxHQw5Y0w42DJxPu7jvPLrrar0iwOP7SlhbXIHIzFsQJ lIsu1MZhCyVidjg0goiw0igMXYwnj5IB/n8YNafbNU2llY5MvTixUlv5qsltDXmrM5xK 09cN9DID9Z3Cuemthv5NpQZNWCZQdVSIYAMRii1bRSJK4ozT1ZXd703w7Y4Td5SOnXj/ 1k8pTdRRd0WqibRygnQX5AfYJBrpj55P2JKZIhpjOT/IvGWoxcBL0szKD83kNEBBzUlm Z3jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=gge6MivVU+Y+anFRt9cymx/CkD1IhqKvnXwEUn7TmZhfV6DK28B+rIgU5qpUPv8RWn buHrNRkxcfy/L9iouZ18gFZ5xnkq+yvyik1vvkR1ipo1r/VatXJfgihgHd71IiXGPtTi nyP+EEJgJN6T1dShr7hxDTGT5eoOm8Z2ULHeV7pVSEKuX4h/RGNvet23jm8VEYVGTY3Y bSBwrvKKHfGCX8G2iZlxjGQvd5oTUYCLE0hkQXOow0aVSYAWexBm3kKQjBWvldiK9bvT 4duzakmXwcauWZ3Y2bvF6S/poACJ1yeDKrdIpCp1qYsB3dbpD5hGZck3efnl+vNmcehU e2xw== X-Gm-Message-State: AMCzsaVxbI12Ee3bOswcbcrll8cUms3l30cA5ykaOB/V+i55ueFezeNK 6Rrhr3BbKcXh0ZzUJqpq3RRFDv/sfdC8rdIFiN39Hw== X-Google-Smtp-Source: AOwi7QCI5JDJ79qgD2j+uHfF+AztDbEXQdybEo4oXm+fTffkcqY+D8NVSE23XFYlJf2+MsF64OrrZFR1D7yxT5cx15Y= X-Received: by 10.37.202.6 with SMTP id a6mr23702ybg.174.1507564995986; Mon, 09 Oct 2017 09:03:15 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.37.44.68 with HTTP; Mon, 9 Oct 2017 09:02:45 -0700 (PDT) In-Reply-To: <20171009144728.GA93977@freefall.freebsd.org> References: <201710090501.v9951qcF079521@repo.freebsd.org> <20171009144728.GA93977@freefall.freebsd.org> From: Eitan Adler Date: Mon, 9 Oct 2017 09:02:45 -0700 X-Google-Sender-Auth: 88KquANzWAEBm3jQy3LsZ8h47Xo Message-ID: Subject: Re: svn commit: r324423 - head/share/misc To: Li-Wen Hsu Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:03:18 -0000 On 9 October 2017 at 07:47, Li-Wen Hsu wrote: > Hi Eitan, > > Plase revert this line, "Taiwan" is how we call ourself. Done in r324436. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Mon Oct 9 16:07:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17206E34A73; Mon, 9 Oct 2017 16:07:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FA86206F; Mon, 9 Oct 2017 16:07:28 +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 v99G7R51054973; Mon, 9 Oct 2017 16:07:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99G7Rhl054971; Mon, 9 Oct 2017 16:07:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091607.v99G7Rhl054971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324437 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:07:29 -0000 Author: kib Date: Mon Oct 9 16:07:27 2017 New Revision: 324437 URL: https://svnweb.freebsd.org/changeset/base/324437 Log: Improvements to set_user_ldt(). Remove mtx_owned() checks from set_user_ldt(). Split the function into _locked() version which requires the dt_lock spinlock owned, and make set_user_ldt() a wrapper. Add a comment in swtch.s noting that the call to the new set_user_ldt() cannot recurse on dt_lock. Remove #ifdef SMP block, the addend is always zero on UP. Fix type of set_user_ldt_rv(), making it match the type used for smb_rendezvous() callback, and remove the cast. Use curproc. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/swtch.s head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Mon Oct 9 16:02:15 2017 (r324436) +++ head/sys/i386/i386/swtch.s Mon Oct 9 16:07:27 2017 (r324437) @@ -279,6 +279,10 @@ sw1: pushl %edx /* Preserve pointer to pcb. */ addl $P_MD,%eax /* Pointer to mdproc is arg. */ pushl %eax + /* + * Holding dt_lock prevents context switches, so dt_lock cannot + * be held now and set_user_ldt() will not deadlock acquiring it. + */ call set_user_ldt addl $4,%esp popl %edx Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:02:15 2017 (r324436) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:07:27 2017 (r324437) @@ -69,10 +69,10 @@ __FBSDID("$FreeBSD$"); #define NULL_LDT_BASE ((caddr_t)NULL) #ifdef SMP -static void set_user_ldt_rv(struct vmspace *vmsp); +static void set_user_ldt_rv(void *arg); #endif static int i386_set_ldt_data(struct thread *, int start, int num, - union descriptor *descs); + union descriptor *descs); static int i386_ldt_grow(struct thread *td, int len); void @@ -405,41 +405,40 @@ done: * Update the GDT entry pointing to the LDT to point to the LDT of the * current process. Manage dt_lock holding/unholding autonomously. */ -void -set_user_ldt(struct mdproc *mdp) +static void +set_user_ldt_locked(struct mdproc *mdp) { struct proc_ldt *pldt; - int dtlocked; + int gdt_idx; - dtlocked = 0; - if (!mtx_owned(&dt_lock)) { - mtx_lock_spin(&dt_lock); - dtlocked = 1; - } + mtx_assert(&dt_lock, MA_OWNED); pldt = mdp->md_ldt; -#ifdef SMP - gdt[PCPU_GET(cpuid) * NGDT + GUSERLDT_SEL].sd = pldt->ldt_sd; -#else - gdt[GUSERLDT_SEL].sd = pldt->ldt_sd; -#endif + gdt_idx = GUSERLDT_SEL; + gdt_idx += PCPU_GET(cpuid) * NGDT; /* always 0 on UP */ + gdt[gdt_idx].sd = pldt->ldt_sd; lldt(GSEL(GUSERLDT_SEL, SEL_KPL)); PCPU_SET(currentldt, GSEL(GUSERLDT_SEL, SEL_KPL)); - if (dtlocked) - mtx_unlock_spin(&dt_lock); } +void +set_user_ldt(struct mdproc *mdp) +{ + + mtx_lock_spin(&dt_lock); + set_user_ldt_locked(mdp); + mtx_unlock_spin(&dt_lock); +} + #ifdef SMP static void -set_user_ldt_rv(struct vmspace *vmsp) +set_user_ldt_rv(void *arg) { - struct thread *td; + struct proc *p; - td = curthread; - if (vmsp != td->td_proc->p_vmspace) - return; - - set_user_ldt(&td->td_proc->p_md); + p = curproc; + if (arg == p->p_vmspace) + set_user_ldt(&p->p_md); } #endif @@ -796,10 +795,10 @@ i386_ldt_grow(struct thread *td, int len) * to acquire it. */ mtx_unlock_spin(&dt_lock); - smp_rendezvous(NULL, (void (*)(void *))set_user_ldt_rv, - NULL, td->td_proc->p_vmspace); + smp_rendezvous(NULL, set_user_ldt_rv, NULL, + td->td_proc->p_vmspace); #else - set_user_ldt(&td->td_proc->p_md); + set_user_ldt_locked(&td->td_proc->p_md); mtx_unlock_spin(&dt_lock); #endif if (old_ldt_base != NULL_LDT_BASE) { From owner-svn-src-all@freebsd.org Mon Oct 9 16:19:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD8EE35320; Mon, 9 Oct 2017 16:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6CE0645EE; Mon, 9 Oct 2017 16:19:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GJQEB059504; Mon, 9 Oct 2017 16:19:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GJQPs059503; Mon, 9 Oct 2017 16:19:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091619.v99GJQPs059503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324438 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:19:28 -0000 Author: kib Date: Mon Oct 9 16:19:26 2017 New Revision: 324438 URL: https://svnweb.freebsd.org/changeset/base/324438 Log: Change i386_get_ldt() to return 'EOF' when the requested range of descriptors does not fit into currently allocated LDT, or trim the return if the range fits partially. Before, the function returned EINVAL. Fix two bugs in r324366: use capped num counter for malloc size, and do not leak allocated buffer on EINVAL (by handling EINVAL case as normal, see above). Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:07:27 2017 (r324437) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:19:26 2017 (r324438) @@ -534,23 +534,20 @@ i386_get_ldt(struct thread *td, struct i386_ldt_args * uap->start, uap->num, (void *)uap->descs); #endif - if (uap->start >= MAX_LD) - return (EINVAL); - num = min(uap->num, MAX_LD - uap->start); - data = malloc(uap->num * sizeof(union descriptor), M_TEMP, M_WAITOK); + num = min(uap->num, MAX_LD); + data = malloc(num * sizeof(union descriptor), M_TEMP, M_WAITOK); mtx_lock_spin(&dt_lock); pldt = td->td_proc->p_md.md_ldt; nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt); - num = min(num, nldt); - if (uap->start > nldt || uap->start + num > nldt) { - mtx_unlock_spin(&dt_lock); - return (EINVAL); + if (uap->start >= nldt) { + num = 0; + } else { + num = min(num, nldt - uap->start); + bcopy(pldt != NULL ? + &((union descriptor *)(pldt->ldt_base))[uap->start] : + &ldt[uap->start], data, num * sizeof(union descriptor)); } - bcopy(pldt != NULL ? - &((union descriptor *)(pldt->ldt_base))[uap->start] : - &ldt[uap->start], data, num * sizeof(union descriptor)); mtx_unlock_spin(&dt_lock); - error = copyout(data, uap->descs, num * sizeof(union descriptor)); if (error == 0) td->td_retval[0] = num; From owner-svn-src-all@freebsd.org Mon Oct 9 16:20:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4321E353C2; Mon, 9 Oct 2017 16:20:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1CD64A32; Mon, 9 Oct 2017 16:20:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GKdoC059610; Mon, 9 Oct 2017 16:20:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GKdVI059609; Mon, 9 Oct 2017 16:20:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091620.v99GKdVI059609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324439 - 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: 324439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:20:40 -0000 Author: kib Date: Mon Oct 9 16:20:39 2017 New Revision: 324439 URL: https://svnweb.freebsd.org/changeset/base/324439 Log: Change amd64_get_ldt() to return 'EOF' when the LDT is not yet allocated, when requested range of descriptors does not fit into currently allocated LDT, or trim the return if the range fits partially. Before, the function returned EINVAL. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Mon Oct 9 16:19:26 2017 (r324438) +++ head/sys/amd64/amd64/sys_machdep.c Mon Oct 9 16:20:39 2017 (r324439) @@ -556,12 +556,12 @@ amd64_get_ldt(struct thread *td, struct i386_ldt_args uap->start, uap->num, (void *)uap->descs); #endif - if (uap->start >= max_ldt_segment) - return (EINVAL); - num = min(uap->num, max_ldt_segment - uap->start); pldt = td->td_proc->p_md.md_ldt; - if (pldt == NULL) - return (EINVAL); + if (pldt == NULL || uap->start >= max_ldt_segment || uap->num == 0) { + td->td_retval[0] = 0; + return (0); + } + num = min(uap->num, max_ldt_segment - uap->start); lp = &((struct user_segment_descriptor *)(pldt->ldt_base))[uap->start]; data = malloc(num * sizeof(struct user_segment_descriptor), M_TEMP, M_WAITOK); From owner-svn-src-all@freebsd.org Mon Oct 9 16:33:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985F3E359F0; Mon, 9 Oct 2017 16:33:38 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5B6679BD; Mon, 9 Oct 2017 16:33:38 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GXbaX067582; Mon, 9 Oct 2017 16:33:37 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GXbmK067581; Mon, 9 Oct 2017 16:33:37 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201710091633.v99GXbmK067581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Mon, 9 Oct 2017 16:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324441 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 324441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:33:38 -0000 Author: ygy (doc committer) Date: Mon Oct 9 16:33:37 2017 New Revision: 324441 URL: https://svnweb.freebsd.org/changeset/base/324441 Log: Fix freebsd-update(8) erroneous message and exit status when "fetch install" used. PR: 190660 Reviewed by: allanjude Approved by: emaste Differential Revision: https://reviews.freebsd.org/D12037 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Oct 9 16:27:31 2017 (r324440) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Oct 9 16:33:37 2017 (r324441) @@ -418,6 +418,9 @@ init_params () { # Run without a TTY NOTTYOK=0 + + # Fetched first in a chain of commands + ISFETCHED=0 } # Parse the command line @@ -783,8 +786,10 @@ install_check_params () { # Check that we have updates ready to install if ! [ -L ${BDHASH}-install ]; then echo "No updates are available to install." - echo "Run '$0 fetch' first." - exit 1 + if [ $ISFETCHED -eq 0 ]; then + echo "Run '$0 fetch' first." + fi + exit 0 fi if ! [ -f ${BDHASH}-install/INDEX-OLD ] || ! [ -f ${BDHASH}-install/INDEX-NEW ]; then @@ -3241,6 +3246,7 @@ cmd_fetch () { fi fetch_check_params fetch_run || exit 1 + ISFETCHED=1 } # Cron command. Make sure the parameters are sensible; wait From owner-svn-src-all@freebsd.org Mon Oct 9 17:12:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFE4E36CF8; Mon, 9 Oct 2017 17:12:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3738E71013; Mon, 9 Oct 2017 17:12:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99HC3Uk084358; Mon, 9 Oct 2017 17:12:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99HC2hj084355; Mon, 9 Oct 2017 17:12:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710091712.v99HC2hj084355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Oct 2017 17:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324442 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:12:05 -0000 Author: gjb Date: Mon Oct 9 17:12:02 2017 New Revision: 324442 URL: https://svnweb.freebsd.org/changeset/base/324442 Log: Switch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC kernel configuration. Submitted by: andrew Differential Revision: https://reviews.freebsd.org/D12484 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/PANDABOARD.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/BEAGLEBONE.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -KERNEL="BEAGLEBONE" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="2m" FAT_TYPE="12" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="BEAGLEBONE" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/CUBIEBOARD.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="ALLWINNER_UP" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="32m -b 1m" FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="CUBIEBOARD" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubieboard" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/PANDABOARD.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -KERNEL="PANDABOARD" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="2m" FAT_TYPE="12" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="PANDABOARD" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard" From owner-svn-src-all@freebsd.org Mon Oct 9 17:16:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22671E36F1F; Mon, 9 Oct 2017 17:16:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A93C571ECB; Mon, 9 Oct 2017 17:16:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8BED410A8BA; Mon, 9 Oct 2017 13:16:24 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324415 - in head/sys: kern sys Date: Mon, 09 Oct 2017 09:47:20 -0700 Message-ID: <1856969.ba1KYHj0O9@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1507485390.86205.323.camel@freebsd.org> References: <201710081733.v98HXnu1094645@repo.freebsd.org> <1507485390.86205.323.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 09 Oct 2017 13:16:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:16:26 -0000 On Sunday, October 08, 2017 11:56:30 AM Ian Lepore wrote: > On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun Oct 8 17:33:49 2017 > > New Revision: 324415 > > URL: https://svnweb.freebsd.org/changeset/base/324415 > > > > Log: > > Add eventhandler notifications for newbus device attach/detach. > > > > [...] > > > > A couple salient comments from the review, they amount to some helpful > > documentation about these events, but there's currently no good place for > > such documentation... > > About this last point... sys/eventhandler.h is now an ever-growing list > of EVENTHANDLER_DECLARE() statements for events that are unrelated to > each other. I think we are at the point where it's no longer a few > well-known "standard system event queues", it's turning into a mess. > > My first thought was to add these to bus.h because they're bus events. > But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, > and I didn't want to pull it (and its dependencies) into bus.h. I think we should fix the headers so that we can declare these in bus.h. It might consist of moving some bits of eventhandler.h into _eventhandler.h. All you would need for _eventhandler.h is struct eventhandler_entry and EVENTHANDLER_DECLARE() I think. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Oct 9 18:00:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC212E37D3C; Mon, 9 Oct 2017 18:00:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A590D74AA9; Mon, 9 Oct 2017 18:00:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99I0e2N001665; Mon, 9 Oct 2017 18:00:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99I0evm001664; Mon, 9 Oct 2017 18:00:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201710091800.v99I0evm001664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Oct 2017 18:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324443 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 324443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:00:42 -0000 Author: np Date: Mon Oct 9 18:00:40 2017 New Revision: 324443 URL: https://svnweb.freebsd.org/changeset/base/324443 Log: cxgbetool(8): Do not close uninitialized fd on malloc failure. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Mon Oct 9 17:12:02 2017 (r324442) +++ head/usr.sbin/cxgbetool/cxgbetool.c Mon Oct 9 18:00:40 2017 (r324443) @@ -1901,7 +1901,6 @@ dumpstate(int argc, const char *argv[]) dump.len = 8 * 1024 * 1024; dump.data = malloc(dump.len); if (dump.data == NULL) { - close(fd); return (ENOMEM); } From owner-svn-src-all@freebsd.org Mon Oct 9 18:19:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9B0E382A5; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E32C752BA; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99IJ6F8009918; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99IJ6oB009917; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710091819.v99IJ6oB009917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 9 Oct 2017 18:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324444 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:19:07 -0000 Author: alc Date: Mon Oct 9 18:19:06 2017 New Revision: 324444 URL: https://svnweb.freebsd.org/changeset/base/324444 Log: The recent change to initialization of blists (r324420) relied on '-1' appearing only where the code explicitly set it, but since much of the data was not initialized, '-1' appeared other places too, and led to panics. Clear the allocated data before initializing nonzero values by allocating with M_ZERO. Submitted by: Doug Moore Reported by: Oleg V. Nauman , cy Tested by: Oleg V. Nauman MFC after: 1 week X-MFC with: r324420 Differential Revision: https://reviews.freebsd.org/D12627 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon Oct 9 18:00:40 2017 (r324443) +++ head/sys/kern/subr_blist.c Mon Oct 9 18:19:06 2017 (r324444) @@ -248,7 +248,8 @@ blist_create(daddr_t blocks, int flags) nodes += last_block + 1; last_block /= BLIST_META_RADIX; } - bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | + M_ZERO); if (bl == NULL) return (NULL); From owner-svn-src-all@freebsd.org Mon Oct 9 18:22:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6437E384C2; Mon, 9 Oct 2017 18:22:20 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (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 9BC0A756D6; Mon, 9 Oct 2017 18:22:19 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v99CcA8l006667; Mon, 9 Oct 2017 13:22:12 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 2desyj8kjc-1; Mon, 09 Oct 2017 13:22:12 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 2BF13460E19; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 2A5F1460DE8; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id qezoSXrTPQVH; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id B84AA460DE3; Mon, 9 Oct 2017 13:22:11 -0500 (CDT) Subject: Re: svn commit: r324420 - in head/sys: kern sys To: Cy Schubert , Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710091554.v99FsAjK002950@slippy.cwsent.com> From: Alan Cox Message-ID: Date: Mon, 9 Oct 2017 13:22:09 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201710091554.v99FsAjK002950@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=10 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:22:20 -0000 On 10/09/2017 10:54, Cy Schubert wrote: > In message <201710082217.v98MHdNI012272@repo.freebsd.org>, Alan Cox writes: >> Author: alc >> Date: Sun Oct 8 22:17:39 2017 >> New Revision: 324420 >> URL: https://svnweb.freebsd.org/changeset/base/324420 >> >> Log: >> The blst_radix_init function has two purposes - to compute the number of >> nodes to allocate for the blist, and to initialize them. The computation >> can be done much more quickly by identifying the terminating node, if any, >> at every level of the tree and then summing the number of nodes at each >> level that precedes the topmost terminator. The initialization can also be >> done quickly, since settings at the root mark the tree as all-allocated, an >> d >> only a few terminator nodes need to be marked in the rest of the tree. >> Eliminate blst_radix_init, and perform its two functions more simply in >> blist_create. >> >> The allocation of the blist takes places in two pieces, but there's no good >> reason to do so, when a single allocation is sufficient, and simpler. >> Allocate the blist struct, and the array of nodes associated with it, with >> a >> single allocation. >> >> Submitted by: Doug Moore >> Reviewed by: markj (an earlier version) >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D11968 >> >> Modified: >> head/sys/kern/subr_blist.c >> head/sys/sys/blist.h >> >> Modified: head/sys/kern/subr_blist.c >> ============================================================================= >> = >> --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r32441 >> 9) >> +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r32442 >> 0) >> @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad >> static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); >> static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t coun >> t, >> u_daddr_t radix); >> -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t >> count); >> #ifndef _KERNEL >> static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, >> int tab); >> @@ -218,30 +218,69 @@ blist_t >> blist_create(daddr_t blocks, int flags) >> { >> blist_t bl; >> - daddr_t nodes, radix; >> + daddr_t i, last_block; >> + u_daddr_t nodes, radix, skip; >> + int digit; >> >> /* >> - * Calculate the radix field used for scanning. >> + * Calculate the radix and node count used for scanning. Find the last >> + * block that is followed by a terminator. >> */ >> + last_block = blocks - 1; >> radix = BLIST_BMAP_RADIX; >> while (radix < blocks) { >> + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) >> + /* >> + * A terminator will be added. Update last_block to th >> e >> + * position just before that terminator. >> + */ >> + last_block |= radix - 1; >> radix *= BLIST_META_RADIX; >> } >> - nodes = 1 + blst_radix_init(NULL, radix, blocks); >> >> - bl = malloc(sizeof(struct blist), M_SWAP, flags); >> + /* >> + * Count the meta-nodes in the expanded tree, including the final >> + * terminator, from the bottom level up to the root. >> + */ >> + nodes = (last_block >= blocks) ? 2 : 1; >> + last_block /= BLIST_BMAP_RADIX; >> + while (last_block > 0) { >> + nodes += last_block + 1; >> + last_block /= BLIST_META_RADIX; >> + } >> + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); >> if (bl == NULL) >> return (NULL); >> >> bl->bl_blocks = blocks; >> bl->bl_radix = radix; >> bl->bl_cursor = 0; >> - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); >> - if (bl->bl_root == NULL) { >> - free(bl, M_SWAP); >> - return (NULL); >> + >> + /* >> + * Initialize the empty tree by filling in root values, then initialize >> + * just the terminators in the rest of the tree. >> + */ >> + bl->bl_root[0].bm_bighint = 0; >> + if (radix == BLIST_BMAP_RADIX) >> + bl->bl_root[0].u.bmu_bitmap = 0; >> + else >> + bl->bl_root[0].u.bmu_avail = 0; >> + last_block = blocks - 1; >> + i = 0; >> + while (radix > BLIST_BMAP_RADIX) { >> + radix /= BLIST_META_RADIX; >> + skip = radix_to_skip(radix); >> + digit = last_block / radix; >> + i += 1 + digit * skip; >> + if (digit != BLIST_META_MASK) { >> + /* >> + * Add a terminator. >> + */ >> + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; >> + bl->bl_root[i + skip].u.bmu_bitmap = 0; >> + } >> + last_block %= radix; >> } >> - blst_radix_init(bl->bl_root, radix, blocks); >> >> #if defined(BLIST_DEBUG) >> printf( >> @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) >> void >> blist_destroy(blist_t bl) >> { >> - free(bl->bl_root, M_SWAP); >> + >> free(bl, M_SWAP); >> } >> >> @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr >> } >> scan->u.bmu_avail -= nblks; >> return (nblks); >> -} >> - >> -/* >> - * BLST_RADIX_INIT() - initialize radix tree >> - * >> - * Initialize our meta structures and bitmaps and calculate the exact >> - * amount of space required to manage 'count' blocks - this space may >> - * be considerably less than the calculated radix due to the large >> - * RADIX values we use. >> - */ >> -static daddr_t >> -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) >> -{ >> - daddr_t i, memindex, next_skip, skip; >> - >> - memindex = 0; >> - >> - /* >> - * Leaf node >> - */ >> - >> - if (radix == BLIST_BMAP_RADIX) { >> - if (scan) { >> - scan->bm_bighint = 0; >> - scan->u.bmu_bitmap = 0; >> - } >> - return (memindex); >> - } >> - >> - /* >> - * Meta node. If allocating the entire object we can special >> - * case it. However, we need to figure out how much memory >> - * is required to manage 'count' blocks, so we continue on anyway. >> - */ >> - >> - if (scan) { >> - scan->bm_bighint = 0; >> - scan->u.bmu_avail = 0; >> - } >> - >> - skip = radix_to_skip(radix); >> - next_skip = skip / BLIST_META_RADIX; >> - radix /= BLIST_META_RADIX; >> - >> - for (i = 1; i < skip; i += next_skip) { >> - if (count >= radix) { >> - /* >> - * Allocate the entire object >> - */ >> - memindex = i + >> - blst_radix_init(((scan) ? &scan[i] : NULL), radix, >> - radix); >> - count -= radix; >> - } else if (count > 0) { >> - /* >> - * Allocate a partial object >> - */ >> - memindex = i + >> - blst_radix_init(((scan) ? &scan[i] : NULL), radix, >> - count); >> - count = 0; >> - } else { >> - /* >> - * Add terminator and break out. Make terminator bitma >> p >> - * zero to avoid a spanning leaf allocation that >> - * includes the terminator. >> - */ >> - if (scan) { >> - scan[i].bm_bighint = (daddr_t)-1; >> - scan[i].u.bmu_bitmap = 0; >> - } >> - break; >> - } >> - } >> - if (memindex < i) >> - memindex = i; >> - return (memindex); >> } >> >> #ifdef BLIST_DEBUG >> >> Modified: head/sys/sys/blist.h >> ============================================================================= >> = >> --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) >> +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) >> @@ -82,7 +82,7 @@ typedef struct blist { >> daddr_t bl_blocks; /* area of coverage */ >> u_daddr_t bl_radix; /* coverage radix */ >> daddr_t bl_cursor; /* next-fit search starts at */ >> - blmeta_t *bl_root; /* root of radix tree */ >> + blmeta_t bl_root[1]; /* root of radix tree */ >> } *blist_t; >> >> #define BLIST_META_RADIX 16 >> > This commit is causing this: > > panic: freeing invalid range > > On my laptop (Core i3 chip): > > (kgdb) bt > #0 doadump (textdump=1) at pcpu.h:232 > #1 0xffffffff80583e16 in kern_reboot (howto=260) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff80584306 in vpanic (fmt=, > ap=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff80584123 in panic (fmt=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff805b9133 in blst_meta_free (scan=0xfffffe00045c3128, > freeBlk=, count=0, radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:869 > #5 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3048, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #6 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3038, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #7 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3028, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #8 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3018, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #9 0xffffffff808359af in swaponsomething (vp=, > id=0xfffff8000cb97200, nblks=3145727, > strategy=0xffffffff80835c60 , > close=0xffffffff80835ee0 , dev=132, flags=1) > at /opt/src/svn-current/sys/vm/swap_pager.c:2199 > #10 0xffffffff8083392c in sys_swapon (td=, > uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 > 728 > #11 0xffffffff80887a11 in amd64_syscall (td=0xfffff8000c659560, traced=0) > at subr_syscall.c:132 > #12 0xffffffff8086afcb in Xfast_syscall () > at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 > #13 0x000000002c689aea in ?? () > Previous frame inner to this frame (corrupt stack?) > Current language: auto; currently minimal > (kgdb) > > > On my gateway machine (AMD 4600+): > > (kgdb) bt > #0 doadump (textdump=) at pcpu.h:232 > #1 0xffffffff80573e11 in kern_reboot (howto=260) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff805742e6 in vpanic (fmt=, > ap=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff80574103 in panic (fmt=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff805a8b63 in blst_meta_free (scan=0xfffffe00021c9038, > freeBlk=, count=0, radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:869 > #5 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9028, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #6 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9018, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #7 0xffffffff8081becf in swaponsomething (vp=, > id=0xfffff800124d1080, nblks=262144, > strategy=0xffffffff8081c180 , > close=0xffffffff8081c400 , dev=101, flags=1) > at /opt/src/svn-current/sys/vm/swap_pager.c:2199 > #8 0xffffffff80819e4c in sys_swapon (td=, > uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 > 728 > #9 0xffffffff80869fb1 in amd64_syscall (td=0xfffff80012558000, traced=0) > at subr_syscall.c:132 > #10 0xffffffff8084dd4b in Xfast_syscall () > at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 > #11 0x0000000800a89aea in ?? () > Previous frame inner to this frame (corrupt stack?) > Current language: auto; currently minimal > (kgdb) > > In the case of my laptop, it panicked only once. My gateway machine > downstairs was in a panic reboot loop, panicking during swapon. > > Reverting this diff resolves my issue. > > Doug Moore has provided a fix, which I just committed. From owner-svn-src-all@freebsd.org Mon Oct 9 18:28:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF71E385F5; Mon, 9 Oct 2017 18:28:10 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ECB375A47; Mon, 9 Oct 2017 18:28:09 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1cmdeAnWOI8mC1cmfer8oV; Mon, 09 Oct 2017 12:28:09 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=QCccru2TAAAA:8 a=YxBL1-UpAAAA:8 a=KOormpjoEEOd_GiNS3AA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=rCjsK_HQOcgUb9vb-KUg:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 94045AD; Mon, 9 Oct 2017 11:28:07 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v99IS7Mj060589; Mon, 9 Oct 2017 11:28:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710091828.v99IS7Mj060589@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324444 - head/sys/kern In-Reply-To: Message from Alan Cox of "Mon, 09 Oct 2017 18:19:06 -0000." <201710091819.v99IJ6oB009917@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Oct 2017 11:28:07 -0700 X-CMAE-Envelope: MS4wfPb6pK35/HS6w5r+Kk8Mybc2Op6gyLtI9387D+jvtFZAXmyC7qNEtoZtZ9lKbNYky7gTFP7G3Sga0Nt+FtuyBe4QDGBtb6YGkZxuYzcibkw1T8TuiUZ8 3kBCGUO4nI5FXKs7TC06Pcsr6DIMApdogn1xovv8W6SZ8k9EYd/Xzxcomuypbikk7Q3u4oOMyM25kAeKuDGihRB7I5JDY+Rq2ZTjQc59tsX+5I3m0h3hDdv0 LjCQzFAk3kiIGJegrhAbpmksdzsq8jVHWyho+Q645DiV48T4CWOIOkX8PEfnSadX X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:28:10 -0000 In message <201710091819.v99IJ6oB009917@repo.freebsd.org>, Alan Cox writes: > Author: alc > Date: Mon Oct 9 18:19:06 2017 > New Revision: 324444 > URL: https://svnweb.freebsd.org/changeset/base/324444 > > Log: > The recent change to initialization of blists (r324420) relied on '-1' > appearing only where the code explicitly set it, but since much of the > data was not initialized, '-1' appeared other places too, and led to > panics. Clear the allocated data before initializing nonzero values by > allocating with M_ZERO. > > Submitted by: Doug Moore > Reported by: Oleg V. Nauman , cy > Tested by: Oleg V. Nauman > MFC after: 1 week > X-MFC with: r324420 > Differential Revision: https://reviews.freebsd.org/D12627 Thanks. This fixes the recurring panic on one of my machines. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Oct 9 18:33:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B56E9E3891E; Mon, 9 Oct 2017 18:33:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 82716760AE; Mon, 9 Oct 2017 18:33:30 +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 v99IXTZ6018081; Mon, 9 Oct 2017 18:33:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99IXTjd018080; Mon, 9 Oct 2017 18:33:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710091833.v99IXTjd018080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Oct 2017 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324445 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:33:30 -0000 Author: hselasky Date: Mon Oct 9 18:33:29 2017 New Revision: 324445 URL: https://svnweb.freebsd.org/changeset/base/324445 Log: When showing the sleepqueues from the in-kernel debugger, properly dump all the sendqueues and not just the first one History: It appears that in the commit which introduced the code, r165272, the array indexes of "sq_blocked[0]" and "td_name[i]" were interchanged. In r180927 "td_name[i]" was corrected to "td_name[0]", but "sq_blocked[0]" was left unchanged. PR: 222624 Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Mon Oct 9 18:19:06 2017 (r324444) +++ head/sys/kern/subr_sleepqueue.c Mon Oct 9 18:33:29 2017 (r324445) @@ -1435,7 +1435,7 @@ found: if (TAILQ_EMPTY(&sq->sq_blocked[i])) db_printf("\tempty\n"); else - TAILQ_FOREACH(td, &sq->sq_blocked[0], + TAILQ_FOREACH(td, &sq->sq_blocked[i], td_slpq) { db_printf("\t%p (tid %d, pid %d, \"%s\")\n", td, td->td_tid, td->td_proc->p_pid, From owner-svn-src-all@freebsd.org Mon Oct 9 20:35:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C183E3B377; Mon, 9 Oct 2017 20:35:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 557D87E910; Mon, 9 Oct 2017 20:35:34 +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 v99KZXEC068991; Mon, 9 Oct 2017 20:35:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99KZVR7068970; Mon, 9 Oct 2017 20:35:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092035.v99KZVR7068970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 20:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324446 - in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap... X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap sys/dev/wb sys/kern sys/... X-SVN-Commit-Revision: 324446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:35:34 -0000 Author: glebius Date: Mon Oct 9 20:35:31 2017 New Revision: 324446 URL: https://svnweb.freebsd.org/changeset/base/324446 Log: Shorten list of arguments to mbuf external storage freeing function. All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/share/man/man9/mbpool.9 head/share/man/man9/mbuf.9 head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/ndis_var.h head/sys/dev/cas/if_cas.c head/sys/dev/cas/if_casvar.h head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/dpaa/if_dtsec_rm.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/lge/if_lge.c head/sys/dev/mwl/if_mwl.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/wb/if_wb.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_mbpool.c head/sys/sys/mbpool.h head/sys/sys/mbuf.h Modified: head/share/man/man9/mbpool.9 ============================================================================== --- head/share/man/man9/mbpool.9 Mon Oct 9 18:33:29 2017 (r324445) +++ head/share/man/man9/mbpool.9 Mon Oct 9 20:35:31 2017 (r324446) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2003 +.Dd September 27, 2017 .Dt MBPOOL 9 .Os .Sh NAME @@ -50,7 +50,7 @@ .Ft void .Fn mbp_free "struct mbpool *mbp" "void *p" .Ft void -.Fn mbp_ext_free "void *" "void *" +.Fn mbp_ext_free "struct mbuf *" .Ft void .Fn mbp_card_free "struct mbpool *mbp" .Ft void @@ -223,8 +223,6 @@ The function can be given to .Fn m_extadd as the free function. -The user argument must be the pointer to -the pool. .Pp Before using the contents of a buffer returned by the card, the driver must call Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Mon Oct 9 18:33:29 2017 (r324445) +++ head/share/man/man9/mbuf.9 Mon Oct 9 20:35:31 2017 (r324446) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2016 +.Dd September 27, 2017 .Dt MBUF 9 .Os .\" @@ -44,12 +44,12 @@ .Fn MCLGET "struct mbuf *mbuf" "int how" .Fo MEXTADD .Fa "struct mbuf *mbuf" -.Fa "caddr_t buf" +.Fa "char *buf" .Fa "u_int size" -.Fa "void (*free)(void *opt_arg1, void *opt_arg2)" +.Fa "void (*free)(struct mbuf *)" .Fa "void *opt_arg1" .Fa "void *opt_arg2" -.Fa "short flags" +.Fa "int flags" .Fa "int type" .Fc .\" @@ -416,8 +416,13 @@ The .Fa opt_arg1 and .Fa opt_arg2 -arguments will be passed unmodified to -.Fa free . +arguments will be saved in +.Va ext_arg1 +and +.Va ext_arg2 +fields of the +.Va struct m_ext +of the mbuf. The .Fa flags argument specifies additional Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/compat/ndis/kern_ndis.c Mon Oct 9 20:35:31 2017 (r324446) @@ -495,17 +495,21 @@ ndis_return(dobj, arg) KeReleaseSpinLock(&block->nmb_returnlock, irql); } +static void +ndis_ext_free(struct mbuf *m) +{ + + return (ndis_return_packet(m->m_ext.ext_arg1)); +} + void -ndis_return_packet(struct mbuf *m, void *buf, void *arg) +ndis_return_packet(ndis_packet *p) { - ndis_packet *p; ndis_miniport_block *block; - if (arg == NULL) + if (p == NULL) return; - p = arg; - /* Decrement refcount. */ p->np_refcnt--; @@ -676,9 +680,8 @@ ndis_ptom(m0, p) return (ENOBUFS); } m->m_len = MmGetMdlByteCount(buf); - m->m_data = MmGetMdlVirtualAddress(buf); - MEXTADD(m, m->m_data, m->m_len, ndis_return_packet, - m->m_data, p, 0, EXT_NDIS); + m_extadd(m, MmGetMdlVirtualAddress(buf), m->m_len, + ndis_ext_free, p, NULL, 0, EXT_NDIS); p->np_refcnt++; totlen += m->m_len; Modified: head/sys/compat/ndis/ndis_var.h ============================================================================== --- head/sys/compat/ndis/ndis_var.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/compat/ndis/ndis_var.h Mon Oct 9 20:35:31 2017 (r324446) @@ -1743,7 +1743,7 @@ extern int ndis_halt_nic(void *); extern int ndis_shutdown_nic(void *); extern int ndis_pnpevent_nic(void *, int); extern int ndis_init_nic(void *); -extern void ndis_return_packet(struct mbuf *, void *, void *); +extern void ndis_return_packet(ndis_packet *); extern int ndis_init_dma(void *); extern int ndis_destroy_dma(void *); extern int ndis_create_sysctls(void *); Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cas/if_cas.c Mon Oct 9 20:35:31 2017 (r324446) @@ -133,7 +133,7 @@ static void cas_detach(struct cas_softc *sc); static int cas_disable_rx(struct cas_softc *sc); static int cas_disable_tx(struct cas_softc *sc); static void cas_eint(struct cas_softc *sc, u_int status); -static void cas_free(struct mbuf *m, void *arg1, void* arg2); +static void cas_free(struct mbuf *m); static void cas_init(void *xsc); static void cas_init_locked(struct cas_softc *sc); static void cas_init_regs(struct cas_softc *sc); @@ -1732,16 +1732,10 @@ cas_rint(struct cas_softc *sc) refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m, (caddr_t)rxds->rxds_buf + + m_extadd(m, (char *)rxds->rxds_buf + off * 256 + ETHER_ALIGN, len, cas_free, - rxds, M_RDONLY, EXT_NET_DRV); -#else - MEXTADD(m, (caddr_t)rxds->rxds_buf + - off * 256 + ETHER_ALIGN, len, cas_free, sc, (void *)(uintptr_t)idx, M_RDONLY, EXT_NET_DRV); -#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1779,16 +1773,10 @@ cas_rint(struct cas_softc *sc) m->m_len = min(CAS_PAGE_SIZE - off, len); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, - m->m_len, cas_free, rxds, M_RDONLY, - EXT_NET_DRV); -#else - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, + m_extadd(m, (char *)rxds->rxds_buf + off, m->m_len, cas_free, sc, (void *)(uintptr_t)idx, M_RDONLY, EXT_NET_DRV); -#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1818,19 +1806,11 @@ cas_rint(struct cas_softc *sc) sc->sc_rdmatag, rxds2->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m2, - (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - rxds2, M_RDONLY, - EXT_NET_DRV); -#else - MEXTADD(m2, - (caddr_t)rxds2->rxds_buf, + m_extadd(m2, + (char *)rxds2->rxds_buf, m2->m_len, cas_free, sc, (void *)(uintptr_t)idx2, M_RDONLY, EXT_NET_DRV); -#endif if ((m2->m_flags & M_EXT) == 0) { m_freem(m2); @@ -1889,21 +1869,15 @@ cas_rint(struct cas_softc *sc) } static void -cas_free(struct mbuf *m, void *arg1, void *arg2) +cas_free(struct mbuf *m) { struct cas_rxdsoft *rxds; struct cas_softc *sc; u_int idx, locked; -#if __FreeBSD_version < 800016 - rxds = arg2; - sc = rxds->rxds_sc; - idx = rxds->rxds_idx; -#else - sc = arg1; - idx = (uintptr_t)arg2; + sc = m->m_ext.ext_arg1; + idx = (uintptr_t)m->m_ext.ext_arg2; rxds = &sc->sc_rxdsoft[idx]; -#endif if (refcount_release(&rxds->rxds_refcount) == 0) return; Modified: head/sys/dev/cas/if_casvar.h ============================================================================== --- head/sys/dev/cas/if_casvar.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cas/if_casvar.h Mon Oct 9 20:35:31 2017 (r324446) @@ -119,10 +119,6 @@ struct cas_rxdsoft { void *rxds_buf; /* receive buffer */ bus_dmamap_t rxds_dmamap; /* our DMA map */ bus_addr_t rxds_paddr; /* physical address of the segment */ -#if __FreeBSD_version < 800016 - struct cas_softc *rxds_sc; /* softc pointer */ - u_int rxds_idx; /* our index */ -#endif u_int rxds_refcount; /* hardware + mbuf references */ }; @@ -239,18 +235,7 @@ do { \ __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], \ &(sc)->sc_rxdsoft[(s)], (s)) -#if __FreeBSD_version < 800016 -#define CAS_INIT_RXDESC(sc, d, s) \ -do { \ - struct cas_rxdsoft *__rxds = &(sc)->sc_rxdsoft[(s)]; \ - \ - __rxds->rxds_sc = (sc); \ - __rxds->rxds_idx = (s); \ - __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], __rxds, (s)); \ -} while (0) -#else #define CAS_INIT_RXDESC(sc, d, s) CAS_UPDATE_RXDESC(sc, d, s) -#endif #define CAS_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->sc_mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1670,10 +1670,10 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str } static void -rxb_free(struct mbuf *m, void *arg1, void *arg2) +rxb_free(struct mbuf *m) { - uma_zone_t zone = arg1; - caddr_t cl = arg2; + uma_zone_t zone = m->m_ext.ext_arg1; + void *cl = m->m_ext.ext_arg2; uma_zfree(zone, cl); counter_u64_add(extfree_rels, 1); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1979,9 +1979,9 @@ free_aiotx_buffer(struct aiotx_buffer *ab) } static void -t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg) +t4_aiotx_mbuf_free(struct mbuf *m) { - struct aiotx_buffer *ab = buffer; + struct aiotx_buffer *ab = m->m_ext.ext_arg1; #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 20:35:31 2017 (r324446) @@ -337,11 +337,13 @@ dtsec_rm_pool_rx_init(struct dtsec_softc *sc) * @{ */ static void -dtsec_rm_fqr_mext_free(struct mbuf *m, void *buffer, void *arg) +dtsec_rm_fqr_mext_free(struct mbuf *m) { struct dtsec_softc *sc; + void *buffer; - sc = arg; + buffer = m->m_ext.ext_arg1; + sc = m->m_ext.ext_arg2; if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) bman_put_buffer(sc->sc_rx_pool, buffer); else Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1418,7 +1418,7 @@ ndis_rxeof(adapter, packets, pktcnt) p = packets[i]; if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) { p->np_refcnt++; - (void)ndis_return_packet(NULL ,p, block); + ndis_return_packet(p); } } return; @@ -1431,7 +1431,7 @@ ndis_rxeof(adapter, packets, pktcnt) if (ndis_ptom(&m0, p)) { device_printf(sc->ndis_dev, "ptom failed\n"); if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) - (void)ndis_return_packet(NULL, p, block); + ndis_return_packet(p); } else { #ifdef notdef if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) { Modified: head/sys/dev/iscsi_initiator/isc_soc.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 20:35:31 2017 (r324446) @@ -70,12 +70,13 @@ static int ou_refcnt = 0; | function for freeing external storage for mbuf */ static void -ext_free(struct mbuf *m, void *a, void *b) +ext_free(struct mbuf *m) { - pduq_t *pq = b; + pduq_t *pq = m->m_ext.ext_arg1; if(pq->buf != NULL) { - debug(3, "ou_refcnt=%d a=%p b=%p", ou_refcnt, a, pq->buf); + debug(3, "ou_refcnt=%d a=%p b=%p", + ou_refcnt, m->m_ext.ext_buf, pq->buf); free(pq->buf, M_ISCSIBUF); pq->buf = NULL; } @@ -137,11 +138,8 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq) md->m_ext.ext_cnt = &ou_refcnt; l = min(MCLBYTES, len); debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l); - MEXTADD(md, pp->ds_addr + off, l, ext_free, -#if __FreeBSD_version >= 800000 - pp->ds_addr + off, -#endif - pq, 0, EXT_EXTREF); + m_extadd(md, pp->ds_addr + off, l, ext_free, pq, NULL, 0, + EXT_EXTREF); md->m_len = l; md->m_next = NULL; mh->m_pkthdr.len += l; Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/lge/if_lge.c Mon Oct 9 20:35:31 2017 (r324446) @@ -123,7 +123,7 @@ static int lge_detach(device_t); static int lge_alloc_jumbo_mem(struct lge_softc *); static void lge_free_jumbo_mem(struct lge_softc *); static void *lge_jalloc(struct lge_softc *); -static void lge_jfree(struct mbuf *, void *, void *); +static void lge_jfree(struct mbuf *); static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *); static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *); @@ -689,7 +689,7 @@ lge_newbuf(sc, c, m) struct mbuf *m; { struct mbuf *m_new = NULL; - caddr_t *buf = NULL; + char *buf = NULL; if (m == NULL) { MGETHDR(m_new, M_NOWAIT, MT_DATA); @@ -710,10 +710,9 @@ lge_newbuf(sc, c, m) return(ENOBUFS); } /* Attach the buffer to the mbuf */ - m_new->m_data = (void *)buf; m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; - MEXTADD(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, - buf, (struct lge_softc *)sc, 0, EXT_NET_DRV); + m_extadd(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, sc, NULL, + 0, EXT_NET_DRV); } else { m_new = m; m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; @@ -848,20 +847,20 @@ lge_jalloc(sc) * Release a jumbo buffer. */ static void -lge_jfree(struct mbuf *m, void *buf, void *args) +lge_jfree(struct mbuf *m) { struct lge_softc *sc; int i; struct lge_jpool_entry *entry; /* Extract the softc struct pointer. */ - sc = args; + sc = m->m_ext.ext_arg1; if (sc == NULL) panic("lge_jfree: can't find softc pointer!"); /* calculate the slot this buffer belongs to */ - i = ((vm_offset_t)buf + i = ((vm_offset_t)m->m_ext.ext_buf - (vm_offset_t)sc->lge_cdata.lge_jumbo_buf) / LGE_JLEN; if ((i < 0) || (i >= LGE_JSLOTS)) Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/mwl/if_mwl.c Mon Oct 9 20:35:31 2017 (r324446) @@ -2522,12 +2522,12 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf } static void -mwl_ext_free(struct mbuf *m, void *data, void *arg) +mwl_ext_free(struct mbuf *m) { - struct mwl_softc *sc = arg; + struct mwl_softc *sc = m->m_ext.ext_arg1; /* XXX bounds check data */ - mwl_putrxdma(sc, data); + mwl_putrxdma(sc, m->m_ext.ext_buf); /* * If we were previously blocked by a lack of rx dma buffers * check if we now have enough to restart rx interrupt handling. @@ -2746,8 +2746,8 @@ mwl_rx_proc(void *arg, int npending) * descriptor using the replacement dma * buffer we just installed above. */ - MEXTADD(m, data, MWL_AGGR_SIZE, mwl_ext_free, - data, sc, 0, EXT_NET_DRV); + m_extadd(m, data, MWL_AGGR_SIZE, mwl_ext_free, sc, NULL, 0, + EXT_NET_DRV); m->m_data += off - hdrlen; m->m_pkthdr.len = m->m_len = pktlen; /* NB: dma buffer assumed read-only */ Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/netmap/netmap_generic.c Mon Oct 9 20:35:31 2017 (r324446) @@ -166,7 +166,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) * has a KASSERT(), checking that the mbuf dtor function is not NULL. */ -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } +static void void_mbuf_dtor(struct mbuf *m) { } #define SET_MBUF_DESTRUCTOR(m, fn) do { \ (m)->m_ext.ext_free = (fn != NULL) ? \ @@ -624,7 +624,7 @@ generic_mbuf_destructor(struct mbuf *m) * txsync. */ netmap_generic_irq(na, r, NULL); #ifdef __FreeBSD__ - void_mbuf_dtor(m, NULL, NULL); + void_mbuf_dtor(m); #endif } Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/wb/if_wb.c Mon Oct 9 20:35:31 2017 (r324446) @@ -143,7 +143,7 @@ static int wb_probe(device_t); static int wb_attach(device_t); static int wb_detach(device_t); -static void wb_bfree(struct mbuf *, void *addr, void *args); +static void wb_bfree(struct mbuf *); static int wb_newbuf(struct wb_softc *, struct wb_chain_onefrag *, struct mbuf *); static int wb_encap(struct wb_softc *, struct wb_chain *, struct mbuf *); @@ -824,7 +824,7 @@ wb_list_rx_init(sc) } static void -wb_bfree(struct mbuf *m, void *buf, void *args) +wb_bfree(struct mbuf *m) { } @@ -843,10 +843,9 @@ wb_newbuf(sc, c, m) MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) return(ENOBUFS); - m_new->m_data = c->wb_buf; m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES; - MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, c->wb_buf, - NULL, 0, EXT_NET_DRV); + m_extadd(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, NULL, + 0, EXT_NET_DRV); } else { m_new = m; m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) @@ -504,7 +504,7 @@ mb_ctor_clust(void *mem, int size, void *arg, int how) #endif m = (struct mbuf *)arg; if (m != NULL) { - m->m_ext.ext_buf = (caddr_t)mem; + m->m_ext.ext_buf = (char *)mem; m->m_data = m->m_ext.ext_buf; m->m_flags |= M_EXT; m->m_ext.ext_free = NULL; @@ -688,15 +688,13 @@ mb_free_ext(struct mbuf *m) case EXT_DISPOSABLE: KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + m->m_ext.ext_free(m); uma_zfree(zone_mbuf, mref); break; case EXT_EXTREF: KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + m->m_ext.ext_free(m); break; default: KASSERT(m->m_ext.ext_type == 0, @@ -918,9 +916,8 @@ m_getm2(struct mbuf *m, int len, int how, short type, * Nothing. */ void -m_extadd(struct mbuf *mb, caddr_t buf, u_int size, - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, - int flags, int type) +m_extadd(struct mbuf *mb, char *buf, u_int size, m_ext_free_t freef, + void *arg1, void *arg2, int flags, int type) { KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); Modified: head/sys/kern/subr_mbpool.c ============================================================================== --- head/sys/kern/subr_mbpool.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/kern/subr_mbpool.c Mon Oct 9 20:35:31 2017 (r324446) @@ -281,10 +281,10 @@ mbp_free(struct mbpool *p, void *ptr) * Mbuf system external mbuf free routine */ void -mbp_ext_free(struct mbuf *m, void *buf, void *arg) +mbp_ext_free(struct mbuf *m) { - mbp_free(arg, buf); + mbp_free(m->m_ext.ext_arg2, m->m_ext.ext_arg1); } /* Modified: head/sys/sys/mbpool.h ============================================================================== --- head/sys/sys/mbpool.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/sys/mbpool.h Mon Oct 9 20:35:31 2017 (r324446) @@ -69,7 +69,7 @@ void *mbp_alloc(struct mbpool *, bus_addr_t *, uint32_ void mbp_free(struct mbpool *, void *); /* free a chunk that is an external mbuf */ -void mbp_ext_free(struct mbuf *, void *, void *); +void mbp_ext_free(struct mbuf *); /* free all buffers that are marked to be on the card */ void mbp_card_free(struct mbpool *); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) @@ -197,17 +197,17 @@ struct pkthdr { * Compile-time assertions in uipc_mbuf.c test these values to ensure that * they are correct. */ +typedef void m_ext_free_t(struct mbuf *); struct m_ext { union { volatile u_int ext_count; /* value of ref count info */ volatile u_int *ext_cnt; /* pointer to ref count info */ }; - caddr_t ext_buf; /* start of buffer */ + char *ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ uint32_t ext_type:8, /* type of external storage */ ext_flags:24; /* external storage mbuf flags */ - void (*ext_free) /* free routine if not the usual */ - (struct mbuf *, void *, void *); + m_ext_free_t *ext_free; /* free routine if not the usual */ void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ }; @@ -436,10 +436,10 @@ struct mbuf { #define EXT_FLAG_NOFREE 0x000010 /* don't free mbuf to pool, notyet */ -#define EXT_FLAG_VENDOR1 0x010000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR2 0x020000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR3 0x040000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR4 0x080000 /* for vendor-internal use */ +#define EXT_FLAG_VENDOR1 0x010000 /* These flags are vendor */ +#define EXT_FLAG_VENDOR2 0x020000 /* or submodule specific, */ +#define EXT_FLAG_VENDOR3 0x040000 /* not used by mbuf code. */ +#define EXT_FLAG_VENDOR4 0x080000 /* Set/read by submodule. */ #define EXT_FLAG_EXP1 0x100000 /* for experimental use */ #define EXT_FLAG_EXP2 0x200000 /* for experimental use */ @@ -610,9 +610,8 @@ struct mbuf *m_devget(char *, int, int, struct ifnet * void (*)(char *, caddr_t, u_int)); struct mbuf *m_dup(const struct mbuf *, int); int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); -void m_extadd(struct mbuf *, caddr_t, u_int, - void (*)(struct mbuf *, void *, void *), void *, void *, - int, int); +void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, + void *, void *, int, int); u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); @@ -667,8 +666,8 @@ m_gettype(int size) * Associated an external reference counted buffer with an mbuf. */ static __inline void -m_extaddref(struct mbuf *m, caddr_t buf, u_int size, u_int *ref_cnt, - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2) +m_extaddref(struct mbuf *m, char *buf, u_int size, u_int *ref_cnt, + m_ext_free_t freef, void *arg1, void *arg2) { KASSERT(ref_cnt != NULL, ("%s: ref_cnt not provided", __func__)); @@ -864,7 +863,7 @@ m_extrefcnt(struct mbuf *m) #define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) #define MCLGET(m, how) m_clget((m), (how)) #define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \ - m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2), \ + m_extadd((m), (char *)(buf), (size), (free), (arg1), (arg2), \ (flags), (type)) #define m_getm(m, len, how, type) \ m_getm2((m), (len), (how), (type), M_PKTHDR) From owner-svn-src-all@freebsd.org Mon Oct 9 20:43:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E6CBE3B8BA; Mon, 9 Oct 2017 20:43:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B3B7F17C; Mon, 9 Oct 2017 20:43:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 106D75A9F27; Mon, 9 Oct 2017 20:33:51 +0000 (UTC) Date: Mon, 9 Oct 2017 20:33:50 +0000 From: Brooks Davis To: rgrimes@freebsd.org Cc: Ngie Cooper , Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324406 - head/sys/modules/em Message-ID: <20171009203350.GB68389@spindle.one-eyed-alien.net> References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:43:58 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: > >=20 > > > On Oct 7, 2017, at 16:33, Sean Bruno wrote: > > >=20 > > > Author: sbruno > > > Date: Sat Oct 7 23:33:14 2017 > > > New Revision: 324406 > > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > >=20 > > > Log: > > > Fix symlink if_igb.ko in -current such that its relative and doesn't > > > end up with non-standard DESTDIR information in its symlink. This > > > can happen very trivially if the release scripts are used. > > >=20 > > > Sponsored by: Limelight Networks > > >=20 > > > Modified: > > > head/sys/modules/em/Makefile > > >=20 > > > Modified: head/sys/modules/em/Makefile > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324= 405) > > > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324= 406) > > > @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 > > > #CFLAGS +=3D -DDEVICE_POLLING > > >=20 > > > afterinstall: > > > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_i= gb.ko > > > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > >=20 > > While this is definitely better, the same thing could be achieved via: > >=20 > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko >=20 > Should this be using SYMLINK+=3D as I thought using ln -sf was a breakage > for meta mode stuff? At the very least it should use INSTALL_LIBSYMLINK or INSTALL_RLIBSYMLINK. Direct use of ln(1) is always a bug in install targets and ideally we would make it fail. (It breaks NO_ROOT installs by failing to add an entry to the METALOG file). -- Brooks --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJZ290uAAoJEKzQXbSebgfAJUcH/iJUHmSlEGqliH+uqHZ51w3p M/+iBM3rGUHAbEE9dL0+qvY/FaZ+DQZh7sxoyOlfppWpdhIEFalDX/pXVy/1pgwW pdOYvVA5ZJgFdJLkKO9LT7yhwessZu9CbxKV+5ZZpZqW9rWzov7gg8q4RANtzR0q PJgTZetq81elAxY3o7tn1KTd2d0Ef29EvWnU4IsRwim3Zj/lCAFHHH3171BzmZKw eX3Orp8p1fgrcQZT+E2KFmSDp/svOQPnU0vz5DwpfWbkLXLeZBTJxYO3ao72GbqP w9CaJULZlhfzXuQcN4p0NAFMYJCzmPHjR6GvIy+1ubpFoLny1jgGmd0gILqBqLM= =smL7 -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- From owner-svn-src-all@freebsd.org Mon Oct 9 20:52:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A84CE3BB02; Mon, 9 Oct 2017 20:52:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 542117F5D9; Mon, 9 Oct 2017 20:52:00 +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 v99KpxEV077383; Mon, 9 Oct 2017 20:51:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99KpxPC077380; Mon, 9 Oct 2017 20:51:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092051.v99KpxPC077380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 20:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324447 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:52:00 -0000 Author: glebius Date: Mon Oct 9 20:51:58 2017 New Revision: 324447 URL: https://svnweb.freebsd.org/changeset/base/324447 Log: In mb_dupcl() don't copy full m_ext, to avoid cache miss. Respectively, in mb_free_ext() always use fields from the original refcount holding mbuf (see. r296242) mbuf. Cuts another cache miss from mb_free_ext(). However, treat EXT_EXTREF mbufs differently, since they are different - they don't have a refcount holding mbuf. Provide longer comments in m_ext declaration to explain this change and change from r296242. In collaboration with: gallatin Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) @@ -675,20 +675,20 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF: - sf_ext_free(m->m_ext.ext_arg1, m->m_ext.ext_arg2); + sf_ext_free(mref->m_ext.ext_arg1, mref->m_ext.ext_arg2); uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF_NOCACHE: - sf_ext_free_nocache(m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + sf_ext_free_nocache(mref->m_ext.ext_arg1, + mref->m_ext.ext_arg2); uma_zfree(zone_mbuf, mref); break; case EXT_NET_DRV: case EXT_MOD_TYPE: case EXT_DISPOSABLE: - KASSERT(m->m_ext.ext_free != NULL, + KASSERT(mref->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - m->m_ext.ext_free(m); + mref->m_ext.ext_free(mref); uma_zfree(zone_mbuf, mref); break; case EXT_EXTREF: Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/kern/uipc_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) @@ -188,7 +188,17 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); KASSERT(!(n->m_flags & M_EXT), ("%s: M_EXT set on %p", __func__, n)); - n->m_ext = m->m_ext; + /* + * Cache access optimization. For most kinds of external + * storage we don't need full copy of m_ext, since the + * holder of the 'ext_count' is responsible to carry the + * free routine and its arguments. Exclusion is EXT_EXTREF, + * where 'ext_cnt' doesn't point into mbuf at all. + */ + if (m->m_ext.ext_type == EXT_EXTREF) + bcopy(&m->m_ext, &n->m_ext, sizeof(struct m_ext)); + else + bcopy(&m->m_ext, &n->m_ext, m_ext_copylen); n->m_flags |= M_EXT; n->m_flags |= m->m_flags & M_RDONLY; Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/sys/mbuf.h Mon Oct 9 20:51:58 2017 (r324447) @@ -200,13 +200,29 @@ struct pkthdr { typedef void m_ext_free_t(struct mbuf *); struct m_ext { union { - volatile u_int ext_count; /* value of ref count info */ - volatile u_int *ext_cnt; /* pointer to ref count info */ + /* + * If EXT_FLAG_EMBREF is set, then we use refcount in the + * mbuf, the 'ext_count' member. Otherwise, we have a + * shadow copy and we use pointer 'ext_cnt'. The original + * mbuf is responsible to carry the pointer to free routine + * and its arguments. They aren't copied into shadows in + * mb_dupcl() to avoid dereferencing next cachelines. + */ + volatile u_int ext_count; + volatile u_int *ext_cnt; }; char *ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ uint32_t ext_type:8, /* type of external storage */ ext_flags:24; /* external storage mbuf flags */ + /* + * Fields below store the free context for the external storage. + * They are valid only in the refcount carrying mbuf, the one with + * EXT_FLAG_EMBREF flag, with exclusion for EXT_EXTREF type, where + * the free context is copied into all mbufs that use same external + * storage. + */ +#define m_ext_copylen offsetof(struct m_ext, ext_free) m_ext_free_t *ext_free; /* free routine if not the usual */ void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ From owner-svn-src-all@freebsd.org Mon Oct 9 21:06:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEBB2E3BD86; Mon, 9 Oct 2017 21:06:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB4DE7FAD7; Mon, 9 Oct 2017 21:06:17 +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 v99L6GXl081899; Mon, 9 Oct 2017 21:06:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99L6Gft081896; Mon, 9 Oct 2017 21:06:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092106.v99L6Gft081896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 21:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324448 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 21:06:17 -0000 Author: glebius Date: Mon Oct 9 21:06:16 2017 New Revision: 324448 URL: https://svnweb.freebsd.org/changeset/base/324448 Log: Improvements to sendfile(2) mbuf free routine. o Fall back to default m_ext free mech, using function pointer in m_ext_free, and remove sf_ext_free() called directly from mbuf code. Testing on modern CPUs showed no regression. o Provide internally used flag EXT_FLAG_SYNC, to mark that I/O uses SF_SYNC flag. Lack of the flag allows us not to dereference ext_arg2, saving from a cache line miss. o Create function sendfile_free_page() that later will be used, for multi-page mbufs. For now compiler will inline it into sendfile_free_mext(). In collaboration with: gallatin Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 21:06:16 2017 (r324448) @@ -675,14 +675,6 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF: - sf_ext_free(mref->m_ext.ext_arg1, mref->m_ext.ext_arg2); - uma_zfree(zone_mbuf, mref); - break; - case EXT_SFBUF_NOCACHE: - sf_ext_free_nocache(mref->m_ext.ext_arg1, - mref->m_ext.ext_arg2); - uma_zfree(zone_mbuf, mref); - break; case EXT_NET_DRV: case EXT_MOD_TYPE: case EXT_DISPOSABLE: Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/kern/kern_sendfile.c Mon Oct 9 21:06:16 2017 (r324448) @@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define EXT_FLAG_SYNC EXT_FLAG_VENDOR1 +#define EXT_FLAG_NOCACHE EXT_FLAG_VENDOR2 + /* * Structure describing a single sendfile(2) I/O, which may consist of * several underlying pager I/Os. @@ -122,63 +125,53 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU * Detach mapped page and release resources back to the system. Called * by mbuf(9) code when last reference to a page is freed. */ -void -sf_ext_free(void *arg1, void *arg2) +static void +sendfile_free_page(vm_page_t pg, bool nocache) { - struct sf_buf *sf = arg1; - struct sendfile_sync *sfs = arg2; - vm_page_t pg = sf_buf_page(sf); - sf_buf_free(sf); - vm_page_lock(pg); /* - * Check for the object going away on us. This can - * happen since we don't hold a reference to it. - * If so, we're responsible for freeing the page. + * In either case check for the object going away on us. This can + * happen since we don't hold a reference to it. If so, we're + * responsible for freeing the page. In 'noncache' case try to free + * the page, but only if it is cheap to. */ - if (vm_page_unwire(pg, PQ_INACTIVE) && pg->object == NULL) - vm_page_free(pg); - vm_page_unlock(pg); + if (vm_page_unwire(pg, nocache ? PQ_NONE : PQ_INACTIVE)) { + vm_object_t obj; - if (sfs != NULL) { - mtx_lock(&sfs->mtx); - KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); - if (--sfs->count == 0) - cv_signal(&sfs->cv); - mtx_unlock(&sfs->mtx); + if ((obj = pg->object) == NULL) + vm_page_free(pg); + else if (nocache) { + if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { + vm_page_free(pg); + VM_OBJECT_WUNLOCK(obj); + } else + vm_page_deactivate(pg); + } } + vm_page_unlock(pg); } -/* - * Same as above, but forces the page to be detached from the object - * and go into free pool. - */ -void -sf_ext_free_nocache(void *arg1, void *arg2) +static void +sendfile_free_mext(struct mbuf *m) { - struct sf_buf *sf = arg1; - struct sendfile_sync *sfs = arg2; - vm_page_t pg = sf_buf_page(sf); + struct sf_buf *sf; + vm_page_t pg; + bool nocache; - sf_buf_free(sf); + KASSERT(m->m_flags & M_EXT && m->m_ext.ext_type == EXT_SFBUF, + ("%s: m %p !M_EXT or !EXT_SFBUF", __func__, m)); - vm_page_lock(pg); - if (vm_page_unwire(pg, PQ_NONE)) { - vm_object_t obj; + sf = m->m_ext.ext_arg1; + pg = sf_buf_page(sf); + nocache = m->m_ext.ext_flags & EXT_FLAG_NOCACHE; - /* Try to free the page, but only if it is cheap to. */ - if ((obj = pg->object) == NULL) - vm_page_free(pg); - else if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - vm_page_free(pg); - VM_OBJECT_WUNLOCK(obj); - } else - vm_page_deactivate(pg); - } - vm_page_unlock(pg); + sf_buf_free(sf); + sendfile_free_page(pg, nocache); - if (sfs != NULL) { + if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { + struct sendfile_sync *sfs = m->m_ext.ext_arg2; + mtx_lock(&sfs->mtx); KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); if (--sfs->count == 0) @@ -782,7 +775,9 @@ retry_space: m0->m_ext.ext_buf = (char *)sf_buf_kva(sf); m0->m_ext.ext_size = PAGE_SIZE; m0->m_ext.ext_arg1 = sf; - m0->m_ext.ext_arg2 = sfs; + m0->m_ext.ext_type = EXT_SFBUF; + m0->m_ext.ext_flags = EXT_FLAG_EMBREF; + m0->m_ext.ext_free = sendfile_free_mext; /* * SF_NOCACHE sets the page as being freed upon send. * However, we ignore it for the last page in 'space', @@ -790,14 +785,18 @@ retry_space: * send (rem > space), or if we have readahead * configured (rhpages > 0). */ - if ((flags & SF_NOCACHE) == 0 || - (i == npages - 1 && - ((off + space) & PAGE_MASK) && - (rem > space || rhpages > 0))) - m0->m_ext.ext_type = EXT_SFBUF; - else - m0->m_ext.ext_type = EXT_SFBUF_NOCACHE; - m0->m_ext.ext_flags = EXT_FLAG_EMBREF; + if ((flags & SF_NOCACHE) && + (i != npages - 1 || + !((off + space) & PAGE_MASK) || + !(rem > space || rhpages > 0))) + m0->m_ext.ext_flags |= EXT_FLAG_NOCACHE; + if (sfs != NULL) { + m0->m_ext.ext_flags |= EXT_FLAG_SYNC; + m0->m_ext.ext_arg2 = sfs; + mtx_lock(&sfs->mtx); + sfs->count++; + mtx_unlock(&sfs->mtx); + } m0->m_ext.ext_count = 1; m0->m_flags |= (M_EXT | M_RDONLY); if (nios) @@ -815,12 +814,6 @@ retry_space: else m = m0; mtail = m0; - - if (sfs != NULL) { - mtx_lock(&sfs->mtx); - sfs->count++; - mtx_unlock(&sfs->mtx); - } } if (vp != NULL) Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/sys/mbuf.h Mon Oct 9 21:06:16 2017 (r324448) @@ -426,7 +426,6 @@ struct mbuf { #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ -#define EXT_SFBUF_NOCACHE 8 /* sendfile(2)'s sf_buf not to be cached */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ @@ -470,12 +469,6 @@ struct mbuf { "\21EXT_FLAG_VENDOR1\22EXT_FLAG_VENDOR2\23EXT_FLAG_VENDOR3" \ "\24EXT_FLAG_VENDOR4\25EXT_FLAG_EXP1\26EXT_FLAG_EXP2\27EXT_FLAG_EXP3" \ "\30EXT_FLAG_EXP4" - -/* - * External reference/free functions. - */ -void sf_ext_free(void *, void *); -void sf_ext_free_nocache(void *, void *); /* * Flags indicating checksum, segmentation and other offload work to be From owner-svn-src-all@freebsd.org Mon Oct 9 22:11:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C3EE3D95B; Mon, 9 Oct 2017 22:11:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31571821CA; Mon, 9 Oct 2017 22:11:59 +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 v99MBwEw010910; Mon, 9 Oct 2017 22:11:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MBwCq010906; Mon, 9 Oct 2017 22:11:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092211.v99MBwCq010906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: arm/uboot efi/boot1 sparc64/loader X-SVN-Commit-Revision: 324449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:11:59 -0000 Author: imp Date: Mon Oct 9 22:11:57 2017 New Revision: 324449 URL: https://svnweb.freebsd.org/changeset/base/324449 Log: Prefer ${LIBSTAND} to -lstand Sponsored by: Netflix Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -121,7 +121,7 @@ CFLAGS+= -fPIC NO_WERROR.clang= DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # as well as required string and memory functions for all platforms. # DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} -lstand +LDADD+= ${LIBEFI} ${LIBSTAND} DPADD+= ${LDSCRIPT} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ CFLAGS+= -I${SRCTOP}/sys DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ From owner-svn-src-all@freebsd.org Mon Oct 9 22:12:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6557E3D9CA; Mon, 9 Oct 2017 22:12:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7C88247E; Mon, 9 Oct 2017 22:12: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 v99MCZ81011005; Mon, 9 Oct 2017 22:12:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCXtD010979; Mon, 9 Oct 2017 22:12:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCXtD010979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324450 - in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader i386/libfirewire i386/libi386 i386/loader libstand32 mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader i386/libfirewire i386/libi386 i386/loader libstand32 mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/kboot powerpc/ofw... X-SVN-Commit-Revision: 324450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:36 -0000 Author: imp Date: Mon Oct 9 22:12:32 2017 New Revision: 324450 URL: https://svnweb.freebsd.org/changeset/base/324450 Log: Define SASRC and use it Define SASRC to point to the current libstand sources. Include ../Makefile.inc early enough in a few places so we can .include "${SASRC}/Makefile" and have it work. Create a new pass-up Makefile.inc in sys/boot/userboot to allow this pattern to work. Sponsored by: Netflix Added: head/sys/boot/userboot/Makefile.inc (contents, props changed) Modified: head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/common/Makefile.inc head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -2,6 +2,11 @@ .include +.if !defined(__BOOT_MAKEFILE_INC__) +__BOOT_MAKEFILE_INC__=${MFILE} + +SASRC=${SRCTOP}/lib/libstand + SSP_CFLAGS= .if ${MACHINE_CPUARCH} == "arm" @@ -24,9 +29,9 @@ DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && e DD=dd ${DD_NOSTATUS} .if ${MK_LOADER_FORCE_LE} != "no" - .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian +.endif .endif .endif Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -113,7 +113,7 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} CFLAGS+= -fPIC Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/common/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -70,7 +70,7 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${.CURDIR}/../../../../lib/libstand +CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -17,7 +17,7 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # EFI library headers CFLAGS+= -I${.CURDIR}/../include Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -37,7 +37,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -37,7 +37,7 @@ CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/libfirewire/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -10,7 +10,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/libi386/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -60,7 +60,7 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. # the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -29,7 +29,7 @@ LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if defined(LOADER_TFTP_SUPPORT) Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/libstand32/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -2,23 +2,25 @@ .include -LIBSTAND_SRC= ${.CURDIR}/../../../lib/libstand +.include "../Makefile.inc" + .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -LIBC_SRC= ${LIBSTAND_SRC}/../libc +LIBSTAND_SRC= ${SASRC} +LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= INCS= MAN= -.PATH: ${LIBSTAND_SRC} +.PATH: ${SASRC} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif -.include "${LIBSTAND_SRC}/Makefile" +.include "${SASRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -58,7 +58,7 @@ CFLAGS= -ffreestanding \ -g # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a LDFLAGS= -nostdlib \ Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -108,7 +108,7 @@ LDFLAGS= -nostdlib \ -e __start # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a DPADD= ${LIBFICL} ${LIBSTAND} Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -116,7 +116,7 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a # clang doesn't understand %D as a specifier to printf Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/ofw/libofw/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -9,7 +9,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -95,7 +95,7 @@ CFLAGS+= -Wa,-mppc64bridge # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -93,7 +93,7 @@ CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -92,7 +92,7 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -98,7 +98,7 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -80,7 +80,7 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/uboot/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/uboot/lib/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -13,7 +13,7 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c Added: head/sys/boot/userboot/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/userboot/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/libstand/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -1,8 +1,9 @@ # $FreeBSD$ .include +.include "../Makefile.inc" -LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand +LIBSTAND_SRC= ${SASRC} INTERNALLIB= INCS= Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -32,7 +32,7 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration Modified: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- head/sys/boot/userboot/zfs/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/zfs/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ SRCS+= zfs.c skein.c skein_block.c CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../../crypto/skein Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/zfs/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${.CURDIR}/../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-all@freebsd.org Mon Oct 9 22:12:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036CEE3D9E7; Mon, 9 Oct 2017 22:12:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C781782485; Mon, 9 Oct 2017 22:12:40 +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 v99MCegs011058; Mon, 9 Oct 2017 22:12:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCdIn011056; Mon, 9 Oct 2017 22:12:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCdIn011056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324451 - in head/sys/boot: . fdt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . fdt X-SVN-Commit-Revision: 324451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:41 -0000 Author: imp Date: Mon Oct 9 22:12:39 2017 New Revision: 324451 URL: https://svnweb.freebsd.org/changeset/base/324451 Log: Add missing -I${SASRC} in a couple of places so that stand.h doesn't accidentally come in via host pollution. Sponsored by: Netflix Modified: head/sys/boot/Makefile.ficl head/sys/boot/fdt/Makefile Modified: head/sys/boot/Makefile.ficl ============================================================================== --- head/sys/boot/Makefile.ficl Mon Oct 9 22:12:32 2017 (r324450) +++ head/sys/boot/Makefile.ficl Mon Oct 9 22:12:39 2017 (r324451) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common + -I${FICLDIR}/../common -I${SASRC} .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) +++ head/sys/boot/fdt/Makefile Mon Oct 9 22:12:39 2017 (r324451) @@ -12,6 +12,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c fdt_overlay.c +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding From owner-svn-src-all@freebsd.org Mon Oct 9 22:12:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF12E3DA56; Mon, 9 Oct 2017 22:12:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C4E8255B; Mon, 9 Oct 2017 22:12:49 +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 v99MCmMI011131; Mon, 9 Oct 2017 22:12:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MClEC011111; Mon, 9 Oct 2017 22:12:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MClEC011111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot... X-SVN-Commit-Revision: 324452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:50 -0000 Author: imp Date: Mon Oct 9 22:12:46 2017 New Revision: 324452 URL: https://svnweb.freebsd.org/changeset/base/324452 Log: Define LIBSA* and use them instead of overloaded LIBSTAND LIBSA is the current stand alone library. LIBSA32 is the 32-bit version of the library. LIBSAU is the userboot version of libsa. Use the proper define instead of the more generic define. Sponsored by: Netflix Modified: head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) @@ -6,6 +6,12 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand +# Normal stand alone library +LIBSA=${OBJTOP}/lib/libstand/libstand.a +# stand alone library compiled for 32-bit version of the processor +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +# stand along library compiled for userboot +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a SSP_CFLAGS= Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -112,7 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from CFLAGS+= -I${SASRC} CFLAGS+= -fPIC @@ -120,8 +119,8 @@ CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -90,8 +90,8 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} ${LIBSTAND} +DPADD+= ${LIBEFI} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -150,9 +150,9 @@ loader.efi: ${PROG} LIBEFI= ${.OBJDIR}/../libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} \ +DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} \ ${LDSCRIPT} -LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/gptboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -50,8 +50,6 @@ OPENCRYPTO_XTS= xform_aes_xts.o LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -76,7 +74,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${.CURDIR}/../../common/ufsread.c Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -60,8 +60,6 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -87,7 +85,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ skein.o skein_block.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -90,8 +90,6 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -127,8 +125,8 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/zfsboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -40,8 +40,6 @@ CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -83,7 +81,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} SRCS= zfsboot.c Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -59,7 +59,6 @@ CFLAGS= -ffreestanding \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a LDFLAGS= -nostdlib \ -static \ @@ -72,7 +71,7 @@ CFLAGS+= -I${.CURDIR}/../common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot @@ -80,7 +79,7 @@ flashboot.md5: flashboot jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -109,10 +109,9 @@ LDFLAGS= -nostdlib \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBSA} +LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -117,14 +117,13 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -94,11 +94,10 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -92,11 +92,10 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -91,11 +91,10 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} SC_DFLT_FONT=cp437 Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -97,11 +97,10 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -85,8 +85,8 @@ CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys -DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -49,8 +49,6 @@ CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a .endif -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a @@ -61,7 +59,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} .include From owner-svn-src-all@freebsd.org Mon Oct 9 22:12:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A6EDE3DA90; Mon, 9 Oct 2017 22:12:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CBA825CB; Mon, 9 Oct 2017 22:12:54 +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 v99MCrx5011185; Mon, 9 Oct 2017 22:12:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCrb0011182; Mon, 9 Oct 2017 22:12:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCrb0011182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324453 - in head/sys/boot: . libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . libsa X-SVN-Commit-Revision: 324453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:54 -0000 Author: imp Date: Mon Oct 9 22:12:53 2017 New Revision: 324453 URL: https://svnweb.freebsd.org/changeset/base/324453 Log: Create sys/boot/libsa and build libstand.a there Build libstand from inside the sys/boot build. Redirect all users in sys/boot to grab it from there. We still build it as libstand.a for the moment. When lib/libstand is moved here, we'll change the name. Sponsored by: Netflix Added: head/sys/boot/libsa/ head/sys/boot/libsa/Makefile (contents, props changed) Modified: head/sys/boot/Makefile head/sys/boot/Makefile.inc Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Oct 9 22:12:46 2017 (r324452) +++ head/sys/boot/Makefile Mon Oct 9 22:12:53 2017 (r324453) @@ -2,6 +2,7 @@ .include +SUBDIR+= libsa .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:53 2017 (r324453) @@ -7,7 +7,7 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand # Normal stand alone library -LIBSA=${OBJTOP}/lib/libstand/libstand.a +LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a # stand alone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a # stand along library compiled for userboot Added: head/sys/boot/libsa/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/libsa/Makefile Mon Oct 9 22:12:53 2017 (r324453) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.include + +.include "../Makefile.inc" + +LIBSTAND_SRC= ${SASRC} +LIBC_SRC= ${SRCTOP}/lib/libc +INTERNALLIB= +INCS= +MAN= +.PATH: ${SASRC} + +.include "${SASRC}/Makefile" From owner-svn-src-all@freebsd.org Mon Oct 9 22:12:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1C2E3DAE1; Mon, 9 Oct 2017 22:12:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A8882662; Mon, 9 Oct 2017 22:12:58 +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 v99MCwTs011241; Mon, 9 Oct 2017 22:12:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCvAf011238; Mon, 9 Oct 2017 22:12:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCvAf011238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324454 - in head: . lib share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . lib share/mk X-SVN-Commit-Revision: 324454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:59 -0000 Author: imp Date: Mon Oct 9 22:12:57 2017 New Revision: 324454 URL: https://svnweb.freebsd.org/changeset/base/324454 Log: Disconnect libstand from the build. Remove libstand from the src/lib build. Remove LIBSTAND from bsd.libnames.mk. Add affected files to the obsolete files list. Sponsored by: Netflix Modified: head/ObsoleteFiles.inc head/lib/Makefile head/share/mk/bsd.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 9 22:12:53 2017 (r324453) +++ head/ObsoleteFiles.inc Mon Oct 9 22:12:57 2017 (r324454) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20161010: Remove libstand +OLD_FILES+=usr/lib/libstand.a +OLD_FILES+=usr/lib/libstand_p.a +OLD_FILES+=usr/include/stand.h +OLD_FILES+=usr/share/man/man3/libstand.3 # 20171003: remove RCMDS OLD_FILES+=bin/rcp OLD_FILES+=rescue/rcp Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Oct 9 22:12:53 2017 (r324453) +++ head/lib/Makefile Mon Oct 9 22:12:57 2017 (r324454) @@ -75,7 +75,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libsbuf \ libsmb \ libsqlite3 \ - libstand \ libstdbuf \ libstdthreads \ libsysdecode \ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Oct 9 22:12:53 2017 (r324453) +++ head/share/mk/bsd.libnames.mk Mon Oct 9 22:12:57 2017 (r324454) @@ -142,7 +142,6 @@ LIBSDP?= ${LIBDESTDIR}${LIBDIR_BASE}/libsdp.a LIBSMB?= ${LIBDESTDIR}${LIBDIR_BASE}/libsmb.a LIBSSL?= ${LIBDESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a -LIBSTAND?= ${LIBDESTDIR}${LIBDIR_BASE}/libstand.a LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a From owner-svn-src-all@freebsd.org Mon Oct 9 22:17:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C554E3DC58; Mon, 9 Oct 2017 22:17:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A2182B49; Mon, 9 Oct 2017 22:17:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MHJRv011455; Mon, 9 Oct 2017 22:17:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MHJqn011453; Mon, 9 Oct 2017 22:17:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092217.v99MHJqn011453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324455 - 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: 324455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:17:20 -0000 Author: imp Date: Mon Oct 9 22:17:18 2017 New Revision: 324455 URL: https://svnweb.freebsd.org/changeset/base/324455 Log: Note libstand is no longer a public interface in UPDATING. Bump FreeBSD_version to 1200051 on the off chance that something cares. Sponsored by: Netflix Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 9 22:12:57 2017 (r324454) +++ head/UPDATING Mon Oct 9 22:17:18 2017 (r324455) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20171010: + libstand has turned into a private library for sys/boot use only. + It is no longer supported as a public interface outside of sys/boot. + 20171005: The arm port has split armv6 into armv6 and armv7. armv7 is now a valid TARGET_ARCH/MACHINE_ARCH setting. If you have an armv7 system Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 9 22:12:57 2017 (r324454) +++ head/sys/sys/param.h Mon Oct 9 22:17:18 2017 (r324455) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200050 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200051 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Oct 9 22:19:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8B5E3DD4F; Mon, 9 Oct 2017 22:19:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 991EA82DB5; Mon, 9 Oct 2017 22:19:59 +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 v99MJwmZ011724; Mon, 9 Oct 2017 22:19:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MJwf0011723; Mon, 9 Oct 2017 22:19:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201710092219.v99MJwf0011723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 9 Oct 2017 22:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324456 - 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: 324456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:19:59 -0000 Author: mckusick Date: Mon Oct 9 22:19:58 2017 New Revision: 324456 URL: https://svnweb.freebsd.org/changeset/base/324456 Log: Do not report the filesystem as modified when the only change is to update the timestamp in the superblock. Reported by: Peter Holm MFC after: 1 week Modified: head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Oct 9 22:17:18 2017 (r324455) +++ head/sbin/fsck_ffs/main.c Mon Oct 9 22:19:58 2017 (r324456) @@ -231,6 +231,7 @@ checkfilesys(char *filesys) struct group *grp; struct iovec *iov; char errmsg[255]; + int ofsmodified; int iovlen; int cylno; intmax_t blks, files; @@ -425,10 +426,15 @@ checkfilesys(char *filesys) } /* * Write the superblock so we don't try to recover the - * journal on another pass. + * journal on another pass. If this is the only change + * to the filesystem, we do not want it to be called + * out as modified. */ sblock.fs_mtime = time(NULL); sbdirty(); + ofsmodified = fsmodified; + flush(fswritefd, &sblk); + fsmodified = ofsmodified; } /* From owner-svn-src-all@freebsd.org Mon Oct 9 22:27:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBA47E3DF8C; Mon, 9 Oct 2017 22:27:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9487E832A5; Mon, 9 Oct 2017 22:27:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MRcIx016143; Mon, 9 Oct 2017 22:27:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MRcFV016141; Mon, 9 Oct 2017 22:27:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710092227.v99MRcFV016141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 9 Oct 2017 22:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324457 - in head/sys/dev: pccbb pci X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys/dev: pccbb pci X-SVN-Commit-Revision: 324457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:27:39 -0000 Author: asomers Date: Mon Oct 9 22:27:38 2017 New Revision: 324457 URL: https://svnweb.freebsd.org/changeset/base/324457 Log: Remove embedded newlines from sysctl variable descriptions PR: 112556 Submitted by: Willem Jan Withagen (earlier version) Reported by: Willem Jan Withagen, ighighi@gmail.com MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/dev/pccbb/pccbb_isa.c head/sys/dev/pci/pci.c Modified: head/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:19:58 2017 (r324456) +++ head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:27:38 2017 (r324457) @@ -75,11 +75,11 @@ static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, - "Mask of allowable interrupts for this laptop. The default is generally\n\ -correct, but some laptops do not route all the IRQ pins to the bridge to\n\ -save wires. Sometimes you need a more restrictive mask because some of the\n\ -hardware in your laptop may not have a driver so its IRQ might not be\n\ -allocated."); + "Mask of allowable interrupts for this laptop. The default is generally" + " correct, but some laptops do not route all the IRQ pins to the bridge to" + " save wires. Sometimes you need a more restrictive mask because some of" + " the hardware in your laptop may not have a driver so its IRQ might not be" + " allocated."); /* * CL-PD6722's VSENSE method @@ -90,13 +90,13 @@ allocated."); int pcic_pd6722_vsense = 1; SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_RDTUN, &pcic_pd6722_vsense, 1, - "Select CL-PD6722's VSENSE method. VSENSE is used to determine the\n\ -volatage of inserted cards. The CL-PD6722 has two methods to determine the\n\ -voltage of the card. 0 means assume a 5.0V card and do not check. 1 means\n\ -use the same method that the CL-PD6710 uses (default). 2 means use the\n\ -same method as the CL-PD6729. 2 is documented in the datasheet as being\n\ -the correct way, but 1 seems to give better results on more laptops."); - + "Select CL-PD6722's VSENSE method. VSENSE is used to determine the" + " voltage of inserted cards. The CL-PD6722 has two methods to determine" + " the voltage of the card. 0 means assume a 5.0V card and do not check. 1" + " means use the same method that the CL-PD6710 uses (default). 2 means use" + " the same method as the CL-PD6729. 2 is documented in the datasheet as" + " being the correct way, but 1 seems to give better results on more" + " laptops."); /***************************************************************************** * End of configurable parameters. *****************************************************************************/ Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Oct 9 22:19:58 2017 (r324456) +++ head/sys/dev/pci/pci.c Mon Oct 9 22:27:38 2017 (r324457) @@ -321,9 +321,9 @@ SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bu static int pci_enable_io_modes = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RWTUN, &pci_enable_io_modes, 1, - "Enable I/O and memory bits in the config register. Some BIOSes do not\n\ -enable these bits correctly. We'd like to do this all the time, but there\n\ -are some peripherals that this causes problems with."); + "Enable I/O and memory bits in the config register. Some BIOSes do not" + " enable these bits correctly. We'd like to do this all the time, but" + " there are some peripherals that this causes problems with."); static int pci_do_realloc_bars = 0; SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RWTUN, @@ -334,10 +334,10 @@ SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW static int pci_do_power_nodriver = 0; SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RWTUN, &pci_do_power_nodriver, 0, - "Place a function into D3 state when no driver attaches to it. 0 means\n\ -disable. 1 means conservatively place devices into D3 state. 2 means\n\ -aggressively place devices into D3 state. 3 means put absolutely everything\n\ -in D3 state."); + "Place a function into D3 state when no driver attaches to it. 0 means" + " disable. 1 means conservatively place devices into D3 state. 2 means" + " aggressively place devices into D3 state. 3 means put absolutely" + " everything in D3 state."); int pci_do_power_resume = 1; SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RWTUN, @@ -372,9 +372,10 @@ static int pci_usb_takeover = 1; static int pci_usb_takeover = 0; #endif SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, - &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ -Disable this if you depend on BIOS emulation of USB devices, that is\n\ -you use USB devices (like keyboard or mouse) but do not load USB drivers"); + &pci_usb_takeover, 1, + "Enable early takeover of USB controllers. Disable this if you depend on" + " BIOS emulation of USB devices, that is you use USB devices (like" + " keyboard or mouse) but do not load USB drivers"); static int pci_clear_bars; SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, From owner-svn-src-all@freebsd.org Mon Oct 9 23:20:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956E8E3EEE7; Mon, 9 Oct 2017 23:20:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D46684BB3; Mon, 9 Oct 2017 23:20:54 +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 v99NKqtl029450 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Oct 2017 16:20:52 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v99NKqXQ029449; Mon, 9 Oct 2017 16:20:52 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 9 Oct 2017 16:20:52 -0700 From: Gleb Smirnoff To: Sean Bruno , Jason Eggleston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324405 - head/sys/kern Message-ID: <20171009232052.GU1055@FreeBSD.org> References: <201710072330.v97NUv7E040636@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZYOWEO2dMm2Af3e3" Content-Disposition: inline In-Reply-To: <201710072330.v97NUv7E040636@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:20:54 -0000 --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sean & Jason, On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: S> Author: sbruno S> Date: Sat Oct 7 23:30:57 2017 S> New Revision: 324405 S> URL: https://svnweb.freebsd.org/changeset/base/324405 S> S> Log: S> Check so_error early in sendfile() call. Prior to this patch, if a S> connection was reset by the remote end, sendfile() would just report S> ENOTCONN instead of ECONNRESET. S> S> Submitted by: Jason Eggleston S> Reviewed by: glebius S> Sponsored by: Limelight Networks S> Differential Revision: https://reviews.freebsd.org/D12575 S> S> Modified: S> head/sys/kern/kern_sendfile.c S> S> Modified: head/sys/kern/kern_sendfile.c S> ============================================================================== S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 (r324404) S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 (r324405) S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct file S> *so = (*sock_fp)->f_data; S> if ((*so)->so_type != SOCK_STREAM) S> return (EINVAL); S> + if ((*so)->so_error) { S> + error = (*so)->so_error; S> + (*so)->so_error = 0; S> + return (error); S> + } S> if (((*so)->so_state & SS_ISCONNECTED) == 0) S> return (ENOTCONN); S> return (0); Despite my initial positive review, now I am quite unsure on that. Problem is that sendfile(2) isn't defined by SUS, so there is no distinctive final answer on that. Should we match other OSes? Should we match our historic behaviour? Or should we match write(2)/send(2) to socket, which are closest analogy. I probably believe in the latter: sendfile(2) belongs to write(2)/send(2) family. SUS specifies that write may return ECONNRESET. It also documents EPIPE. However, our manual page documents only EPIPE for both send(2) and write(2). For write we have: SOCKBUF_LOCK(&so->so_snd); if (so->so_snd.sb_state & SBS_CANTSENDMORE) { SOCKBUF_UNLOCK(&so->so_snd); error = EPIPE; goto out; } if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); goto out; } Indeed, EPIPE will be returned prior to return/clear of so_error, which supposedly is ECONNRESET. In the sendfile(2) implementation we see exactly same code: if (so->so_snd.sb_state & SBS_CANTSENDMORE) { error = EPIPE; SOCKBUF_UNLOCK(&so->so_snd); goto done; } else if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); goto done; } But it isn't reached. Before due to SS_ISCONNECTED check, now due to your change. Now we got two spots where so_error is returned/cleared. For the receive family (read(2) and recv(2)), SUS specifies ECONNRESET and our code does that. It also clears so_error. So, after your change at least one standard case is broken: an application that polls/selects for both readability and writeability of a socket. It discovers that socket is available for writing, does sendfile(2), receives ECONNRESET. Then it does read on the socket, and blocks(?) or returns a bogus error(?), not sure. But definitely not ECONNRESET, since it is now cleared. Now, where does this ENOTCONN come from? These two lines: if (((*so)->so_state & SS_ISCONNECTED) == 0) return (ENOTCONN); can be traced back all the way to original 1998 commit of sendfile. Here comes difference between sendfile(2) and send(2). In send(2), this check is done _after_ so_error check, so your change is correct in placing of so_error check wrt so_state check, but is incorrect in placing wrt socket buffer state check. After all this considerations, I would suggest to revert your change, and apply this patch. It would make behavior of sendfile(2) to match send(2). I would appreciate more reviews around it. -- Gleb Smirnoff --ZYOWEO2dMm2Af3e3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sendfile-error.diff" Index: kern_sendfile.c =================================================================== --- kern_sendfile.c (revision 324457) +++ kern_sendfile.c (working copy) @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if ((*so)->so_error) { - error = (*so)->so_error; - (*so)->so_error = 0; - return (error); - } - if (((*so)->so_state & SS_ISCONNECTED) == 0) - return (ENOTCONN); return (0); } @@ -622,6 +615,12 @@ retry_space: SOCKBUF_UNLOCK(&so->so_snd); goto done; } + if ((so->so_state & SS_ISCONNECTED) == 0) { + SOCKBUF_UNLOCK(&so->so_snd); + error = ENOTCONN; + goto done; + } + space = sbspace(&so->so_snd); if (space < rem && (space <= 0 || --ZYOWEO2dMm2Af3e3-- From owner-svn-src-all@freebsd.org Mon Oct 9 23:24:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D31E3EFB0; Mon, 9 Oct 2017 23:24:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B5D84F37; Mon, 9 Oct 2017 23:24:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E347910A87D; Mon, 9 Oct 2017 19:24:29 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... Date: Mon, 09 Oct 2017 16:23:35 -0700 Message-ID: <2405988.NgFGazePSZ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201710092212.v99MClEC011111@repo.freebsd.org> References: <201710092212.v99MClEC011111@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 09 Oct 2017 19:24:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:24:31 -0000 On Monday, October 09, 2017 10:12:47 PM Warner Losh wrote: > Author: imp > Date: Mon Oct 9 22:12:46 2017 > New Revision: 324452 > URL: https://svnweb.freebsd.org/changeset/base/324452 > > Log: > Define LIBSA* and use them instead of overloaded LIBSTAND > > LIBSA is the current stand alone library. LIBSA32 is the 32-bit > version of the library. LIBSAU is the userboot version of libsa. Use > the proper define instead of the more generic define. > > Sponsored by: Netflix > > Modified: > head/sys/boot/Makefile.inc > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/efi/loader/Makefile > head/sys/boot/i386/gptboot/Makefile > head/sys/boot/i386/gptzfsboot/Makefile > head/sys/boot/i386/loader/Makefile > head/sys/boot/i386/zfsboot/Makefile > head/sys/boot/mips/beri/boot2/Makefile > head/sys/boot/mips/beri/loader/Makefile > head/sys/boot/mips/uboot/Makefile > head/sys/boot/powerpc/kboot/Makefile > head/sys/boot/powerpc/ofw/Makefile > head/sys/boot/powerpc/ps3/Makefile > head/sys/boot/powerpc/uboot/Makefile > head/sys/boot/sparc64/loader/Makefile > head/sys/boot/userboot/userboot/Makefile > > Modified: head/sys/boot/Makefile.inc > ============================================================================== > --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:39 2017 (r324451) > +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) > @@ -6,6 +6,12 @@ > __BOOT_MAKEFILE_INC__=${MFILE} > > SASRC=${SRCTOP}/lib/libstand > +# Normal stand alone library > +LIBSA=${OBJTOP}/lib/libstand/libstand.a > +# stand alone library compiled for 32-bit version of the processor > +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a > +# stand along library compiled for userboot > +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a s/along/alone/. bde@ probably prefers that the comments start with a capital letter as well. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Oct 9 23:56:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC67E3F553 for ; Mon, 9 Oct 2017 23:56:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4BFD5B for ; Mon, 9 Oct 2017 23:56:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x233.google.com with SMTP id m72so585210wmc.1 for ; Mon, 09 Oct 2017 16:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=PQ/8BJ9i3CexgPdglZN1iGMsuEcPLPGg9uK6updi6ps=; b=v0uFV2T2IlAUB3a7Th1dB+3qym0fMY+VPIcie2pvTQ0ApF9kREm5APP4L8kOH/a3mJ BScJq4xNop4hNiATcQZPhMnrqLG13dFEHSlmR70t2Bt9etIkSZErNKfT/kApK6Vvz0+U +a2NsYjYbEeHpyKosrPm2JexW/sAVaXYAtHC0UdNX48saies8XKRHIP+AIZYrFtS4q54 tkIpgiwvPJMV5AHS+SZMp5XDk6/LXM9HGmNBuOORa7wExwWsy6b1jRSUzfY1T9wz+KpY 8invKjU/wOxdfX2P5u730UkJ9M+yNPrHCbL+/c3+HMGAh2oVGsoPq+8rXk2PePFQtl39 ZnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=PQ/8BJ9i3CexgPdglZN1iGMsuEcPLPGg9uK6updi6ps=; b=KQ5pIv2uOluD1hgGxXvdsSmPxyRbWF+2AmW82OmC9Unuar6Ya1AmVAhjJD00X1D1GD RR5+3ll9zj3PFCus/fRQzNDkFBJTKlh3+43p3cjmpSJsMG8MSB5jxlEphxEKJZ9ftFu0 5tWxkidHlQIOwlOtXa69UVxYvvCtRdzJA5VkwQEPiEJrpCOgXBm21/Z+keNUIRIRkZlQ s09OkCkxYSCNZ+RGIRS37vhsbstMvwqV39ptq8MqQ6r8aLvBkL89eOMkb2YZFFM0WFcv lrg0Yz5ZUn/2tmHa7m4WAD8Eoyq2UX+8VNSTFbhqxeLp5HYrVdefEjN0zD61h/bmByXo qSaQ== X-Gm-Message-State: AMCzsaUx4QWe2K5RhORgL+852QIFmjLUjZPjGWyx8fcNl/tGETcwY4MU ufdbofMeM2vRs6VQhGgj7HY18w== X-Google-Smtp-Source: AOwi7QCy6egPPfs7veSEilYvcPom/uwnZ10yLjCyCgMOHrSeRuVYQnEZGLGE/HXIzpnCEFImAOX5MA== X-Received: by 10.223.163.26 with SMTP id c26mr4517219wrb.185.1507593368262; Mon, 09 Oct 2017 16:56:08 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id v80sm1808085wrc.49.2017.10.09.16.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 16:56:06 -0700 (PDT) Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Tue, 10 Oct 2017 00:56:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710092211.v99MBwCq010906@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:56:11 -0000 Not sure which of these sets of changes caused the issue but a clean build from scratch is currently failing here with: In file included from /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/ufs_module.c:41: In file included from /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/boot_module.h:35: /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: fatal error: 'stand.h' file not found #include          ^~~~~~~~~ Build was with -j24 in case it matters, going to try without -j but that will take many hours On 09/10/2017 23:11, Warner Losh wrote: > Author: imp > Date: Mon Oct 9 22:11:57 2017 > New Revision: 324449 > URL: https://svnweb.freebsd.org/changeset/base/324449 > > Log: > Prefer ${LIBSTAND} to -lstand > > Sponsored by: Netflix > > Modified: > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/sparc64/loader/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -121,7 +121,7 @@ CFLAGS+= -fPIC > NO_WERROR.clang= > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand > +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > > OBJS+= ${SRCS:N*.h:R:S/$/.o/g} > > > Modified: head/sys/boot/efi/boot1/Makefile > ============================================================================== > --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a > # as well as required string and memory functions for all platforms. > # > DPADD+= ${LIBEFI} ${LIBSTAND} > -LDADD+= ${LIBEFI} -lstand > +LDADD+= ${LIBEFI} ${LIBSTAND} > > DPADD+= ${LDSCRIPT} > > > Modified: head/sys/boot/sparc64/loader/Makefile > ============================================================================== > --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > CFLAGS+= -I${SRCTOP}/sys > > DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand > +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > > loader.help: help.common help.sparc64 > cat ${.ALLSRC} | \ > From owner-svn-src-all@freebsd.org Tue Oct 10 00:00:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18A1E3F799 for ; Tue, 10 Oct 2017 00:00:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B496AEFC for ; Tue, 10 Oct 2017 00:00:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id j17so7373125iod.5 for ; Mon, 09 Oct 2017 17:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PPIKE1TxdyYeVNgxrqBnX+xK7h4I+d19dRUznmMCcvg=; b=YU+m3BiCNAE7+6U/qGwq5fb76PS5Bwro77cCwYkX8YDpiCFRyGNVk67wQsBnwIgnwA +ibvHNOD4Piq8MKvmM0fWK+WveS9J5lqxayDmIVh6oviSTJUDv4+A0ba7iM3exTe8Stm cxwkDuiXx4iXo9FjgXeChLCADFOUDy2tVHbId7/HXXWBXY7alSPHodxoLg6pjNTivM7o xJnQNqPsznUHnqAQFlC7tn1XDXLvs/oaRerRPJzPEE38JMXBo/UKoPjKWbHj0ZIhfQft Orj4WEpB8PIEcEGpAGB1862S1k17JcjelXyf/4w0B5EAHfGVdioTgj3aBYMs9wh4AhsQ 3n2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PPIKE1TxdyYeVNgxrqBnX+xK7h4I+d19dRUznmMCcvg=; b=UCA5TK7lIyB9kxx4xMDEnIhBj735EqGKnSa+lm4PevLXlR3OcgcbyHvQbFNaFmyUPw 7f53in8NEZpj2enUBHpYyPklbp0PwYDK0RJ8XCdePmE1ObE3MD/ySBUEgFBt/tALCLbH /03IU3/Txmllxu0CFuQjXLLoHo32GPKLN50TV9hrbAg0Z4yTtqHQa0iKCtk7izBGoEpw C8T5o+h11JZm9yk4bSDyNewe7alJ2HRitAMN+ya4HSTl9IsI87KOHiHIAKCF3KIjCIW8 PoXjFIapthMQVoAknsbQZuMtUTzh+wDHiZ+YRnFSzgMt1QNxIqRYn8CpyBGIzzvTroFE avZQ== X-Gm-Message-State: AMCzsaWLDwWK20IuV6lujKE+NbmXqpgUmHxSR1bu5E0HcOZVHCCt2PTX T0nJwKAyvIRiLKCo6PoQLFY2lXMTipF7qROkAMjOdg== X-Google-Smtp-Source: AOwi7QBiv4gVKIcgUmLPX4r70AFJh2UhGCgZhxsyzD43UPHeQ7iEpVarXl7F4ttTJdmbzU86ad7ttlPPwvmB1yhKEKo= X-Received: by 10.107.133.85 with SMTP id h82mr14342327iod.208.1507593604981; Mon, 09 Oct 2017 17:00:04 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 17:00:04 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 18:00:04 -0600 X-Google-Sender-Auth: pQkSVC_67vTljgjQ5ovRalmPG8M Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:00:06 -0000 Can you find out? A clean build works for me. Chances are good that sys/boot/efi/boot1/Makefile needs a line like CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will look into when I get back if you can't make progress. I don't see one there and I had to add it a couple of other places. Warner On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Not sure which of these sets of changes caused the issue but a clean build > from scratch is currently failing here with: > > In file included from /usr/home/smh/freebsd/base/ > head/sys/boot/efi/boot1/ufs_module.c:41: > In file included from /usr/home/smh/freebsd/base/ > head/sys/boot/efi/boot1/boot_module.h:35: > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: > fatal error: 'stand.h' file not found > #include > ^~~~~~~~~ > > Build was with -j24 in case it matters, going to try without -j but that > will take many hours > > > On 09/10/2017 23:11, Warner Losh wrote: > > Author: imp > Date: Mon Oct 9 22:11:57 2017 > New Revision: 324449 > URL: https://svnweb.freebsd.org/changeset/base/324449 > > Log: > Prefer ${LIBSTAND} to -lstand > > Sponsored by: Netflix > > Modified: > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/sparc64/loader/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -121,7 +121,7 @@ CFLAGS+= -fPIC > NO_WERROR.clang= > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand > +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > > OBJS+= ${SRCS:N*.h:R:S/$/.o/g} > > > Modified: head/sys/boot/efi/boot1/Makefile > ============================================================================== > --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a > # as well as required string and memory functions for all platforms. > # > DPADD+= ${LIBEFI} ${LIBSTAND} > -LDADD+= ${LIBEFI} -lstand > +LDADD+= ${LIBEFI} ${LIBSTAND} > > DPADD+= ${LDSCRIPT} > > > Modified: head/sys/boot/sparc64/loader/Makefile > ============================================================================== > --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > CFLAGS+= -I${SRCTOP}/sys > > DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand > +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > > loader.help: help.common help.sparc64 > cat ${.ALLSRC} | \ > > > > From owner-svn-src-all@freebsd.org Tue Oct 10 00:01:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071ACE3F8A6; Tue, 10 Oct 2017 00:01:06 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x244.google.com (mail-oi0-x244.google.com [IPv6:2607:f8b0:4003:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBFBD1220; Tue, 10 Oct 2017 00:01:05 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x244.google.com with SMTP id f3so14370160oia.2; Mon, 09 Oct 2017 17:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kd+M/rO07n5xVOIwWxq+yjoljlc2j8tL8dCwcZMzWYo=; b=tvPHoJud6jsnfEpSL4N2lMm+7cOpkZkI+HXKTBPNu4zxIwvtpb6pm/vmaClG7Wb2Ku KdgjLLlEl6Fqx29YIElbL98pNjRQAyZwxC8lU5LFd19MO1sH8UGIuMupNZP4PFW+HSve vCLJkVGMHCKSWbk3mj5O6ArM5+4QPmvAOKQlbEmyk8RKhW2e6h+d9WpDM9VgyJ6XPCaL q4KRazI9N4UKoJEkjoZZrZeH8H8jPDYvqvnqfHsupZMvt6ZFodWkZLzm/YbuLUItcQtK e0Tw4ERtCqL8viWESZiOIgvr+bhUtCvvE0RkhI4adcpj3w21Nm3qgbCP2g8/OrUZfkZF KJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kd+M/rO07n5xVOIwWxq+yjoljlc2j8tL8dCwcZMzWYo=; b=nHMxiMB4OA9uTSFP3KrKUb7PrACfPeLBc3Cab4nq5VZxrZz6dGm7ncYG7DacS8jDvL OpUhJxjPSIQQkgAicGKMw1GNpYESNCC4UjKcAZnr0SN6Ge4su4pssWs0SJK49ksuiwMk E2AAF+gPu2cIKuqX0S5UwojCucsM+/ZXjgNLvozqvKY13CYDyupBebkUa03S4ChgDRPD f0UyeyH5tG3cnw003ubnKKVamunZFTQJWoP5KCafx1enn5/yg4+U7WUkFyi3eVR5kDQN JN0EvjWo1HXI171fWUEnDAJGqOMjqKc3RWoVWPA/C3xODqITw+iqZY1uZ9LMEa9s459D SH3A== X-Gm-Message-State: AMCzsaVKqw8TNRzdAPIIrCIpRGL93LL3Mo1/5PFfMNv5eto5pPUqQIuF XRsOFI19MTtOrfRwNdhkEo7+1zCm/EGLnY9y3b8bYdl+ X-Google-Smtp-Source: AOwi7QA3f1tWeMpoWStlq0VJx9XCR1cVVheIeaYD3Xfh+atxUjJJ9dyzoyZlTYLsHjmuH95eI8LtttIp1dFK4bsPGX0= X-Received: by 10.157.63.173 with SMTP id r42mr628849otc.107.1507593664612; Mon, 09 Oct 2017 17:01:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Mon, 9 Oct 2017 17:01:03 -0700 (PDT) In-Reply-To: <20171009232052.GU1055@FreeBSD.org> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> From: Jason Eggleston Date: Mon, 9 Oct 2017 17:01:03 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Gleb Smirnoff Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:01:06 -0000 In tcp_input.c, this is where a RST is handled. so_error gets ECONNRESET, then tcp_close() is called. case TCPS_ESTABLISHED: case TCPS_FIN_WAIT_1: case TCPS_FIN_WAIT_2: case TCPS_CLOSE_WAIT: case TCPS_CLOSING: case TCPS_LAST_ACK: so->so_error = ECONNRESET; close: /* FALLTHROUGH */ default: tp = tcp_close(tp); tcp_close() calls soisdisconnected() which sets this flag: so->so_state |= SS_ISDISCONNECTED; Followed by: ... socantrcvmore_locked(so); ... socantsendmore_locked(so); ... Those two functions set these flags: so->so_rcv.sb_state |= SBS_CANTRCVMORE; so->so_snd.sb_state |= SBS_CANTSENDMORE; A TCP session cannot survive a RST, and i/o calls will not work afterword, no matter how many times you try. Having said that, there's a race condition between when so_error is set and when the socket and socket buffer flags are set, and I agree with your strategy of: - have sendfile() match send() - The current send() behavior is probably fine as is I agree sendfile() should match write() and send(), by checking in this order: SBS_CANTSENDMORE so_error SS_ISCONNECTED and will prep a new review with your patch. On Mon, Oct 9, 2017 at 4:20 PM, Gleb Smirnoff wrote: > Sean & Jason, > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > S> Author: sbruno > S> Date: Sat Oct 7 23:30:57 2017 > S> New Revision: 324405 > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > S> > S> Log: > S> Check so_error early in sendfile() call. Prior to this patch, if a > S> connection was reset by the remote end, sendfile() would just report > S> ENOTCONN instead of ECONNRESET. > S> > S> Submitted by: Jason Eggleston > S> Reviewed by: glebius > S> Sponsored by: Limelight Networks > S> Differential Revision: https://reviews.freebsd.org/D12575 > S> > S> Modified: > S> head/sys/kern/kern_sendfile.c > S> > S> Modified: head/sys/kern/kern_sendfile.c > S> ============================================================ > ================== > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 > (r324404) > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 > (r324405) > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct > file > S> *so = (*sock_fp)->f_data; > S> if ((*so)->so_type != SOCK_STREAM) > S> return (EINVAL); > S> + if ((*so)->so_error) { > S> + error = (*so)->so_error; > S> + (*so)->so_error = 0; > S> + return (error); > S> + } > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > S> return (ENOTCONN); > S> return (0); > > Despite my initial positive review, now I am quite unsure on that. > > Problem is that sendfile(2) isn't defined by SUS, so there is no > distinctive final answer on that. Should we match other OSes? > Should we match our historic behaviour? Or should we match > write(2)/send(2) to socket, which are closest analogy. I probably > believe in the latter: sendfile(2) belongs to write(2)/send(2) > family. > > SUS specifies that write may return ECONNRESET. It also documents > EPIPE. However, our manual page documents only EPIPE for both > send(2) and write(2). For write we have: > > SOCKBUF_LOCK(&so->so_snd); > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EPIPE; > goto out; > } > if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto out; > } > > Indeed, EPIPE will be returned prior to return/clear of so_error, > which supposedly is ECONNRESET. > > In the sendfile(2) implementation we see exactly same code: > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > error = EPIPE; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } else if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > > But it isn't reached. Before due to SS_ISCONNECTED check, now > due to your change. Now we got two spots where so_error is > returned/cleared. > > For the receive family (read(2) and recv(2)), SUS specifies > ECONNRESET and our code does that. It also clears so_error. > > So, after your change at least one standard case is broken: an > application that polls/selects for both readability and > writeability of a socket. It discovers that socket is available > for writing, does sendfile(2), receives ECONNRESET. Then it does > read on the socket, and blocks(?) or returns a bogus error(?), > not sure. But definitely not ECONNRESET, since it is now cleared. > > Now, where does this ENOTCONN come from? These two lines: > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > return (ENOTCONN); > > can be traced back all the way to original 1998 commit of sendfile. > > Here comes difference between sendfile(2) and send(2). In send(2), > this check is done _after_ so_error check, so your change is correct > in placing of so_error check wrt so_state check, but is incorrect > in placing wrt socket buffer state check. > > After all this considerations, I would suggest to revert your change, > and apply this patch. It would make behavior of sendfile(2) to match > send(2). I would appreciate more reviews around it. > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Tue Oct 10 00:01:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B77CE3F9B2 for ; Tue, 10 Oct 2017 00:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04AB2144E for ; Tue, 10 Oct 2017 00:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id f202so8914832ioe.3 for ; Mon, 09 Oct 2017 17:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3LR223Te/Io7e7r47PuEY1SpN2gY+9GszCzIChSgonI=; b=m99EuQYVStiWw8dqBHHCGS8L8j+fJJsT2R6P9Gl6F5to/h1J2IHnThpYQfp+rmEaZG v4bIFoUiFqdIcljXrng5pdAR7tFUuec9rEyMFW+VVenS+iI3IJ2mfV/WwN1XuwyHi7OW fD4EIKFOSsj9lioXMCfUesvrFocvWO5N5tP1y8L5+HwrNP83Hl9xb0liSmtGIaHu1M41 5FXizJ7g/hA5Jfi4/tGVTREBB8ykkIBtotgg+HGQYavf5AYt2fEn8s9uPQ8pWV117JSN y4cc3PxVLVk+6w2m1Kd8eAceW8tBS19viuafEet2SeRHpjl3RRhleUPNt83r1m6LHpfa kFFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3LR223Te/Io7e7r47PuEY1SpN2gY+9GszCzIChSgonI=; b=WWWvHR2DgTKELq9xI9CFrI1oD3feZzludLSH3Ge54F/1cw4QBt57J10dyqfalYkLGi fbop6/c04QlwQebaUoAHfZIDlFex1/U3xemXsKLmJ/DyhEyU5f/Q73L+YjnC+lxnY1Es 222w/U32G5LRY6OPA8kQ8OsM9rnJbab/TouLYZKpPufPwOdR9eji8+UGj1w//dEY9uJM xFUTRcVcIsSEK0jWB2De2sXaT02LQDN6Q2oG+dDsxc+eCsmGAzXl0wlfCmshoB7YTbEO YgD7HnbVCLUxX1fUwKQp0cjHxgQ1J5jO0x0LK/2fObNsD+gv9c+oIhpVqKYzEokQrkSH 9MWA== X-Gm-Message-State: AMCzsaUIS1eEeImNzr2IWdeSUvXAbCkYv/IpS2n6g1iuPyammrxeOabt ouEdTJLXz1jWtSCaJeQSKB+ePCsROfJsBzBW85Va0A== X-Google-Smtp-Source: AOwi7QAQQ5wLQ87pVnQGKe+BSdplbJ9T1kNEuy16FPaCjdW1ULXJ24gqBEYUz3gK9y5Ptz3dn2O0ryD7CaMQAvj5GY4= X-Received: by 10.107.68.6 with SMTP id r6mr16407396ioa.282.1507593705280; Mon, 09 Oct 2017 17:01:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 17:01:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 18:01:44 -0600 X-Google-Sender-Auth: K-A_U0F4G0vfvogxaol_0pssNaE Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:01:46 -0000 Oh, killed /usr/include/stand.h and found it. I'll post a fix when I get back. On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh wrote: > Can you find out? A clean build works for me. Chances are good that > sys/boot/efi/boot1/Makefile needs a line like > CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will look > into when I get back if you can't make progress. I don't see one there and > I had to add it a couple of other places. > > Warner > > On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > >> Not sure which of these sets of changes caused the issue but a clean >> build from scratch is currently failing here with: >> >> In file included from /usr/home/smh/freebsd/base/hea >> d/sys/boot/efi/boot1/ufs_module.c:41: >> In file included from /usr/home/smh/freebsd/base/hea >> d/sys/boot/efi/boot1/boot_module.h:35: >> /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: >> fatal error: 'stand.h' file not found >> #include >> ^~~~~~~~~ >> >> Build was with -j24 in case it matters, going to try without -j but that >> will take many hours >> >> >> On 09/10/2017 23:11, Warner Losh wrote: >> >> Author: imp >> Date: Mon Oct 9 22:11:57 2017 >> New Revision: 324449 >> URL: https://svnweb.freebsd.org/changeset/base/324449 >> >> Log: >> Prefer ${LIBSTAND} to -lstand >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/boot/arm/uboot/Makefile >> head/sys/boot/efi/boot1/Makefile >> head/sys/boot/sparc64/loader/Makefile >> >> Modified: head/sys/boot/arm/uboot/Makefile >> ============================================================================== >> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >> NO_WERROR.clang= >> >> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> >> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >> >> >> Modified: head/sys/boot/efi/boot1/Makefile >> ============================================================================== >> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >> # as well as required string and memory functions for all platforms. >> # >> DPADD+= ${LIBEFI} ${LIBSTAND} >> -LDADD+= ${LIBEFI} -lstand >> +LDADD+= ${LIBEFI} ${LIBSTAND} >> >> DPADD+= ${LDSCRIPT} >> >> >> Modified: head/sys/boot/sparc64/loader/Makefile >> ============================================================================== >> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >> CFLAGS+= -I${SRCTOP}/sys >> >> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> >> loader.help: help.common help.sparc64 >> cat ${.ALLSRC} | \ >> >> >> >> > From owner-svn-src-all@freebsd.org Tue Oct 10 00:09:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A9CE3FD59; Tue, 10 Oct 2017 00:09:51 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD9817BD; Tue, 10 Oct 2017 00:09:51 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x232.google.com with SMTP id j126so42524578oia.10; Mon, 09 Oct 2017 17:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8q7VMyLqrSo1ghQTe/Sr6Z65NBz5KrRuWT/vP+5bCqY=; b=mS7RVB2sG/ypS5CtHAgZjt5ZA+75KsuzzRl7mt5CQ8aAbkBF+HQJfd+yAFQWgQ6VYT yKpl/Adwng/uT4zWsD69U+SeeMNu/368yiSScEpbS6lot7gvvMuLJUDEjd4zSEmpsDBD aPCjng083UkX6hLxKj1PZ1jJwHRJcNpaXYh+GVdXAn4tP5g+mO5uAlzTImQtOkxV5QC+ q7fCgnWKTg7bjYV7tz4Sr2glZwm5wgK0Orb8W3o6gzBZTYmBGXiabSPIdn+Ae2cp4GEo reNqittL/5c0J4vKuN4K8/5XM3iRwtXZ5RjDWKRGFrZJcX+Ka3lIveWQ0Kn0a5jZFqUb q7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8q7VMyLqrSo1ghQTe/Sr6Z65NBz5KrRuWT/vP+5bCqY=; b=IqgXqZDUNlr1bxPxrnlh9i+TawLBTUyMuoo1CuXKzQ8A6yNBTvffYQHcalsiXPGqph JT/ObDgrQrQqsHk60CsNiy+UP1rsyf3YMH0O3xMMQnvAGSuZgH9CYT8qmCHxUIcx9aBx PjQ5UPwnoysbqTq5374zSBl8erNJkUDjrKQpbyM2H6bDnJ3iDFhltEnNnH9/1PZ8aK5t CHlLaEfbNx6oXTN1HUsDW1aqxumgwNnaKUkxydg7MvhDOjt1S/jI6Sc8Pbmgs+KheQjc 7nvM0GG708FVRU2kq2migz08Kwmxd5zODLxs/qEBQyXIEwqyJ9g3/WR0FPmLBf8PQEAy r5WA== X-Gm-Message-State: AMCzsaXk12c86PsIu2Y/x+6KZA1NKrTMGgesIZ8zGdTTtt7kwwwLiYhK nuDlaOvW+AiPALdpsyocjYu75iUevnunLrZsqzKhHm+w X-Google-Smtp-Source: AOwi7QAK9g2fVoOF41lAyBGYgAUaFlbo08mPcAXY1N0v9FuHCBRXieK/s7AAwxdyFU8zkaBtsf7u9IYnUTGX3lP8zIw= X-Received: by 10.157.73.131 with SMTP id g3mr513500otf.451.1507594190136; Mon, 09 Oct 2017 17:09:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Mon, 9 Oct 2017 17:09:49 -0700 (PDT) In-Reply-To: References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> From: Jason Eggleston Date: Mon, 9 Oct 2017 17:09:49 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Gleb Smirnoff Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:09:51 -0000 https://reviews.freebsd.org/D12633 On Mon, Oct 9, 2017 at 5:01 PM, Jason Eggleston wrote: > In tcp_input.c, this is where a RST is handled. so_error gets ECONNRESET, > then tcp_close() is called. > > case TCPS_ESTABLISHED: > case TCPS_FIN_WAIT_1: > case TCPS_FIN_WAIT_2: > case TCPS_CLOSE_WAIT: > case TCPS_CLOSING: > case TCPS_LAST_ACK: > so->so_error = ECONNRESET; > close: > /* FALLTHROUGH */ > default: > tp = tcp_close(tp); > > tcp_close() calls soisdisconnected() which sets this flag: > > so->so_state |= SS_ISDISCONNECTED; > > Followed by: > > ... > socantrcvmore_locked(so); > ... > socantsendmore_locked(so); > ... > > Those two functions set these flags: > > so->so_rcv.sb_state |= SBS_CANTRCVMORE; > so->so_snd.sb_state |= SBS_CANTSENDMORE; > > A TCP session cannot survive a RST, and i/o calls will not work afterword, > no matter how many times you try. > > Having said that, there's a race condition between when so_error is set > and when the socket and socket buffer flags are set, and I agree with your > strategy of: > > - have sendfile() match send() > - The current send() behavior is probably fine as is > > I agree sendfile() should match write() and send(), by checking in this > order: > > SBS_CANTSENDMORE > so_error > SS_ISCONNECTED > > and will prep a new review with your patch. > > On Mon, Oct 9, 2017 at 4:20 PM, Gleb Smirnoff wrote: > >> Sean & Jason, >> >> On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: >> S> Author: sbruno >> S> Date: Sat Oct 7 23:30:57 2017 >> S> New Revision: 324405 >> S> URL: https://svnweb.freebsd.org/changeset/base/324405 >> S> >> S> Log: >> S> Check so_error early in sendfile() call. Prior to this patch, if a >> S> connection was reset by the remote end, sendfile() would just report >> S> ENOTCONN instead of ECONNRESET. >> S> >> S> Submitted by: Jason Eggleston >> S> Reviewed by: glebius >> S> Sponsored by: Limelight Networks >> S> Differential Revision: https://reviews.freebsd.org/D12575 >> S> >> S> Modified: >> S> head/sys/kern/kern_sendfile.c >> S> >> S> Modified: head/sys/kern/kern_sendfile.c >> S> ============================================================ >> ================== >> S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 >> (r324404) >> S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 >> (r324405) >> S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct >> file >> S> *so = (*sock_fp)->f_data; >> S> if ((*so)->so_type != SOCK_STREAM) >> S> return (EINVAL); >> S> + if ((*so)->so_error) { >> S> + error = (*so)->so_error; >> S> + (*so)->so_error = 0; >> S> + return (error); >> S> + } >> S> if (((*so)->so_state & SS_ISCONNECTED) == 0) >> S> return (ENOTCONN); >> S> return (0); >> >> Despite my initial positive review, now I am quite unsure on that. >> >> Problem is that sendfile(2) isn't defined by SUS, so there is no >> distinctive final answer on that. Should we match other OSes? >> Should we match our historic behaviour? Or should we match >> write(2)/send(2) to socket, which are closest analogy. I probably >> believe in the latter: sendfile(2) belongs to write(2)/send(2) >> family. >> >> SUS specifies that write may return ECONNRESET. It also documents >> EPIPE. However, our manual page documents only EPIPE for both >> send(2) and write(2). For write we have: >> >> SOCKBUF_LOCK(&so->so_snd); >> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >> SOCKBUF_UNLOCK(&so->so_snd); >> error = EPIPE; >> goto out; >> } >> if (so->so_error) { >> error = so->so_error; >> so->so_error = 0; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto out; >> } >> >> Indeed, EPIPE will be returned prior to return/clear of so_error, >> which supposedly is ECONNRESET. >> >> In the sendfile(2) implementation we see exactly same code: >> >> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >> error = EPIPE; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto done; >> } else if (so->so_error) { >> error = so->so_error; >> so->so_error = 0; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto done; >> } >> >> But it isn't reached. Before due to SS_ISCONNECTED check, now >> due to your change. Now we got two spots where so_error is >> returned/cleared. >> >> For the receive family (read(2) and recv(2)), SUS specifies >> ECONNRESET and our code does that. It also clears so_error. >> >> So, after your change at least one standard case is broken: an >> application that polls/selects for both readability and >> writeability of a socket. It discovers that socket is available >> for writing, does sendfile(2), receives ECONNRESET. Then it does >> read on the socket, and blocks(?) or returns a bogus error(?), >> not sure. But definitely not ECONNRESET, since it is now cleared. >> >> Now, where does this ENOTCONN come from? These two lines: >> >> if (((*so)->so_state & SS_ISCONNECTED) == 0) >> return (ENOTCONN); >> >> can be traced back all the way to original 1998 commit of sendfile. >> >> Here comes difference between sendfile(2) and send(2). In send(2), >> this check is done _after_ so_error check, so your change is correct >> in placing of so_error check wrt so_state check, but is incorrect >> in placing wrt socket buffer state check. >> >> After all this considerations, I would suggest to revert your change, >> and apply this patch. It would make behavior of sendfile(2) to match >> send(2). I would appreciate more reviews around it. >> >> -- >> Gleb Smirnoff >> > > From owner-svn-src-all@freebsd.org Tue Oct 10 00:17:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12E9E3FFAE; Tue, 10 Oct 2017 00:17:27 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 69C9F1C57; Tue, 10 Oct 2017 00:17:26 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (75-173-106-27.albq.qwest.net [75.173.106.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 5C2BF192892; Tue, 10 Oct 2017 00:17:24 +0000 (UTC) Subject: Re: svn commit: r324406 - head/sys/modules/em To: Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> From: Sean Bruno Message-ID: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Date: Mon, 9 Oct 2017 18:17:21 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171009203350.GB68389@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:17:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt Content-Type: multipart/mixed; boundary="WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj"; protected-headers="v1" From: Sean Bruno To: Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Subject: Re: svn commit: r324406 - head/sys/modules/em References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> In-Reply-To: <20171009203350.GB68389@spindle.one-eyed-alien.net> --WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10/09/17 14:33, Brooks Davis wrote: > On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: >>> >>>> On Oct 7, 2017, at 16:33, Sean Bruno wrote: >>>> >>>> Author: sbruno >>>> Date: Sat Oct 7 23:33:14 2017 >>>> New Revision: 324406 >>>> URL: https://svnweb.freebsd.org/changeset/base/324406 >>>> >>>> Log: >>>> Fix symlink if_igb.ko in -current such that its relative and doesn'= t >>>> end up with non-standard DESTDIR information in its symlink. This >>>> can happen very trivially if the release scripts are used. >>>> >>>> Sponsored by: Limelight Networks >>>> >>>> Modified: >>>> head/sys/modules/em/Makefile >>>> >>>> Modified: head/sys/modules/em/Makefile >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r32= 4405) >>>> +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r32= 4406) >>>> @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 >>>> #CFLAGS +=3D -DDEVICE_POLLING >>>> >>>> afterinstall: >>>> - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_= igb.ko >>>> + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko >>> >>> While this is definitely better, the same thing could be achieved via= : >>> >>> ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko >> >> Should this be using SYMLINK+=3D as I thought using ln -sf was a break= age >> for meta mode stuff? >=20 > At the very least it should use INSTALL_LIBSYMLINK or INSTALL_RLIBSYMLI= NK. > Direct use of ln(1) is always a bug in install targets and ideally we > would make it fail. (It breaks NO_ROOT installs by failing to add an > entry to the METALOG file). >=20 > -- Brooks >=20 I'm more than happy to make changes here. The closest example I can see in the tree from a Makefile is some of the things in etc: ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound Is that, more or less, something y'all would like to see? sean --WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj-- --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlncEZFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LbOmQf/Yy7PetHAJcvKn2wVkxf6/FE6wqIAQONdIp+wsitE9MTY1aImbXk4r7/G aXSpoSejHdpoiSzAwjwt/DkHTwkQT95t+5hgBVGOeLvMmoUIGHLN+U26gBxm2dz/ OmmfNHF2lGI3d8YT1w+aYdsFCRqxpJPH0gSLAF1a5ykXNPUvn20u9BW1F8rlIP4J NTaP0aV9PSKFROZGw23j0aAY29+5jU8Bmmfrr6YXi/PCabvWzxhusNQp35tc7O7p OCX13xSaABENih6SrZjuXKM2HMPoDlzdfDMPQwo4NSwKn0fcdsT2GAqIw43FJa7B Lml2fmYAceFtcF4vpRCcbbvf7h2T4A== =mywg -----END PGP SIGNATURE----- --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt-- From owner-svn-src-all@freebsd.org Tue Oct 10 00:26:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFE95E4025D; Tue, 10 Oct 2017 00:26:45 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F60F20BB; Tue, 10 Oct 2017 00:26:45 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A0QiS3065309; Tue, 10 Oct 2017 00:26:44 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A0Qiqh065308; Tue, 10 Oct 2017 00:26:44 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201710100026.v9A0Qiqh065308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Tue, 10 Oct 2017 00:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324458 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 324458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:26:45 -0000 Author: bjk (doc committer) Date: Tue Oct 10 00:26:44 2017 New Revision: 324458 URL: https://svnweb.freebsd.org/changeset/base/324458 Log: Add Asus USB-N13, rev. B1 to the rtwn_usb hardware list Reported by: Patrik Horst Modified: head/share/man/man4/rtwn_usb.4 Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Mon Oct 9 22:27:38 2017 (r324457) +++ head/share/man/man4/rtwn_usb.4 Tue Oct 10 00:26:44 2017 (r324458) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 24, 2017 +.Dd October 9, 2017 .Dt RTWN_USB 4 .Os .Sh NAME @@ -64,6 +64,7 @@ based USB wireless network adapters, including: .It "Alfa AWUS036NHR v2" Ta USB 2.0 .It "ASUS USB-AC56" Ta USB 3.0 .It "ASUS USB-N10 NANO" Ta USB 2.0 +.It "Asus USB-N13, rev. B1" Ta USB 2.0 .It "Belkin F7D1102 Surf Wireless Micro" Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta USB 3.0 From owner-svn-src-all@freebsd.org Tue Oct 10 00:32:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96609E40427; Tue, 10 Oct 2017 00:32:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65CE7255D; Tue, 10 Oct 2017 00:32:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A0WLiV069346; Tue, 10 Oct 2017 00:32:21 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A0WLCa069345; Tue, 10 Oct 2017 00:32:21 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710100032.v9A0WLCa069345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 00:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324459 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:32:22 -0000 Author: sbruno Date: Tue Oct 10 00:32:21 2017 New Revision: 324459 URL: https://svnweb.freebsd.org/changeset/base/324459 Log: Revert r324405 at the request of the submitter pending better solution. Submitted by: Jason Eggleston Sponsored by: Limelight Networks Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Oct 10 00:26:44 2017 (r324458) +++ head/sys/kern/kern_sendfile.c Tue Oct 10 00:32:21 2017 (r324459) @@ -507,11 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if ((*so)->so_error) { - error = (*so)->so_error; - (*so)->so_error = 0; - return (error); - } if (((*so)->so_state & SS_ISCONNECTED) == 0) return (ENOTCONN); return (0); From owner-svn-src-all@freebsd.org Tue Oct 10 00:38:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D3BE405AD for ; Tue, 10 Oct 2017 00:38:09 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA96B27A9 for ; Tue, 10 Oct 2017 00:38:08 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x234.google.com with SMTP id f4so771437wme.0 for ; Mon, 09 Oct 2017 17:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=/z7of2WcE8sqg+vOorLBB3B/ZJkudsfQfdEWQJc7OUE=; b=NL9Z8hWWNcPf2m06OBblwdaXFZ8fNw5mLjfznsQcqKNrhECGET90rYigUZviGJXDo+ L1E5QaCoHDpqe+uOUd5gmHzNBfDrWKYTRBR+Rvvs9pzvisIcJf6me3f48lGB6sPywn2G styBqYOo5ZpeBE92n3XPAjKrMpD3J0RB/XBCjgyiCE9qjEsqZ599ZEzGXfQ8rCgNN99N D04D+oCmgWga/wZwR1ReVgcLTrRTbeJkQSsm/c8FQPKWJGY9gHAJ9KUZZ8nBe+HXKOrE BBHPxdEf9OS7LOoiEUKXVoghYHH5zk+/ugNBzcE1CzI2IPO1wpg5+tuLFf3CXfLHYZnn /PWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=/z7of2WcE8sqg+vOorLBB3B/ZJkudsfQfdEWQJc7OUE=; b=TPwKCkLG6ka3cTXysWEZ6F2vbgMS3WIKZ9V2Ce6XUqE21gRKt1iNagLW9CyncZ5BUR 25b6dAmNXtMNb/H2arABHvTsM8P0UPLsQe+kG7PU6BoWP7ETq5GKuaG5qbiOgdTsNXaS TyP2baJvM2CtfRq0y2M5REdTeg256TgOC/htzO50KhQQ5QkyZFjcorFnWUl0Hc9BHgDQ wfxtu2sWjlg4PUrf8RgkYmqbUi/lIiAn7vu3G/23s8d66SsWbqqEPKpjzTucEYVY57Ab IS8OxUrKzhttVqo8AnwPDKIbKuk1CCRPasxtvP+U0V0B4Z1VfMDrD5qDZtRI1h/07GzA kY7w== X-Gm-Message-State: AMCzsaXNguZoXEyFmtlEqaICuouGTGEJANB/ktnsj9haUZakgNWTaPJy iQ8t72pO3Lon7EXxMl610DUQOw== X-Google-Smtp-Source: AOwi7QCPqwSiJYtTzWR5sQeaeCyRoyJI9ZGuzsMMqf/vDhP31op2lWcP7kkmAVdH4PzpNjhN/RpNpg== X-Received: by 10.28.173.1 with SMTP id w1mr9045157wme.3.1507595887238; Mon, 09 Oct 2017 17:38:07 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id y84sm3476363wmg.43.2017.10.09.17.38.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 17:38:05 -0700 (PDT) Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Tue, 10 Oct 2017 01:38:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:38:09 -0000 Yer even no -j fails :( On 10/10/2017 01:01, Warner Losh wrote: > Oh, killed /usr/include/stand.h and found it. I'll post a fix when I > get back. > > On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh > wrote: > > Can you find out? A clean build works for me. Chances are good > that sys/boot/efi/boot1/Makefile needs a line like > CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but > will look into when I get back if you can't make progress. I don't > see one there and I had to add it a couple of other places. > > Warner > > On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland > > wrote: > > Not sure which of these sets of changes caused the issue but a > clean build from scratch is currently failing here with: > > In file included from > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/ufs_module.c:41: > In file included from > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/boot_module.h:35: > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: > fatal error: 'stand.h' file not found > #include >          ^~~~~~~~~ > > Build was with -j24 in case it matters, going to try without > -j but that will take many hours > > > On 09/10/2017 23:11, Warner Losh wrote: >> Author: imp >> Date: Mon Oct 9 22:11:57 2017 >> New Revision: 324449 >> URL:https://svnweb.freebsd.org/changeset/base/324449 >> >> >> Log: >> Prefer ${LIBSTAND} to -lstand >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/boot/arm/uboot/Makefile >> head/sys/boot/efi/boot1/Makefile >> head/sys/boot/sparc64/loader/Makefile >> >> Modified: head/sys/boot/arm/uboot/Makefile >> ============================================================================== >> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >> NO_WERROR.clang= >> >> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> >> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >> >> >> Modified: head/sys/boot/efi/boot1/Makefile >> ============================================================================== >> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >> # as well as required string and memory functions for all platforms. >> # >> DPADD+= ${LIBEFI} ${LIBSTAND} >> -LDADD+= ${LIBEFI} -lstand >> +LDADD+= ${LIBEFI} ${LIBSTAND} >> >> DPADD+= ${LDSCRIPT} >> >> >> Modified: head/sys/boot/sparc64/loader/Makefile >> ============================================================================== >> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >> CFLAGS+= -I${SRCTOP}/sys >> >> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> >> loader.help: help.common help.sparc64 >> cat ${.ALLSRC} | \ >> > > > From owner-svn-src-all@freebsd.org Tue Oct 10 01:31:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCDAE421CB; Tue, 10 Oct 2017 01:31:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C41D663BDC; Tue, 10 Oct 2017 01:31:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A1VkJM093134; Tue, 10 Oct 2017 01:31:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A1VijN091588; Tue, 10 Oct 2017 01:31:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710100131.v9A1VijN091588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Oct 2017 01:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324460 - in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/kboot powerpc/ofw powerp... X-SVN-Commit-Revision: 324460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:31:48 -0000 Author: imp Date: Tue Oct 10 01:31:44 2017 New Revision: 324460 URL: https://svnweb.freebsd.org/changeset/base/324460 Log: Rather than laying whack-a-mole with including the path to stand.h, always include it. Remove places where we explicitly include it. This also helps reduce the 'cut-and-paste' factor of these Makefiles. Sponsored by: Netflix Modified: head/sys/boot/Makefile.ficl head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/common/Makefile.inc head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/fdt/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/Makefile.ficl ============================================================================== --- head/sys/boot/Makefile.ficl Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/Makefile.ficl Tue Oct 10 01:31:44 2017 (r324460) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common -I${SASRC} + -I${FICLDIR}/../common .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/Makefile.inc Tue Oct 10 01:31:44 2017 (r324460) @@ -13,6 +13,8 @@ LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a # stand along library compiled for userboot LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a +CFLAGS+=-I${SASRC} + SSP_CFLAGS= .if ${MACHINE_CPUARCH} == "arm" Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/arm/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -112,8 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -CFLAGS+= -I${SASRC} - CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/common/Makefile.inc Tue Oct 10 01:31:44 2017 (r324460) @@ -70,7 +70,6 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -17,8 +17,6 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${SASRC} - # EFI library headers CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/libefi/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -37,7 +37,6 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -36,10 +36,6 @@ CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,7 +12,6 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c fdt_overlay.c -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/libfirewire/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -10,7 +10,6 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/libi386/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -59,8 +59,6 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. -# the location of libstand -CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -28,10 +28,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT .endif Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/beri/boot2/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -57,9 +57,6 @@ CFLAGS= -ffreestanding \ -msoft-float \ -g -# where to get libstand from -CFLAGS+= -I${SASRC} - LDFLAGS= -nostdlib \ -static \ -Wl,-N \ Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/beri/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -107,9 +107,6 @@ LDFLAGS= -nostdlib \ -L${.CURDIR} \ -e __start -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -115,9 +115,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/ofw/libofw/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -9,8 +9,6 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${SASRC} - # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/kboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -93,9 +93,6 @@ CFLAGS+= -Wa,-mppc64bridge #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/ofw/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -91,9 +91,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/ps3/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -90,9 +90,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -96,9 +96,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/sparc64/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -79,9 +79,6 @@ LDFLAGS= -static LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ -# where to get libstand from -CFLAGS+= -I${SASRC} - # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/uboot/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,8 +12,6 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/uboot/lib/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -13,8 +13,6 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c CFLAGS+= -DLOADER_DISK_SUPPORT Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/userboot/userboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -32,7 +32,6 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/zfs/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,7 +12,6 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-all@freebsd.org Tue Oct 10 01:33:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19782E42505 for ; Tue, 10 Oct 2017 01:33:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC93B63EAE for ; Tue, 10 Oct 2017 01:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id m16so14217421iod.1 for ; Mon, 09 Oct 2017 18:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qll4/7QvzgGkwOp5yL2bkM+KvBOUhmoS39dKPfzvTSU=; b=X359/znqcdjlXcXriPsnrawZJqWuxNhXobYF27B4+YbTfU0qeUJL1nOmUPcZUmhMXB TjaGkTb2Sso4m1OyGeW7aUaN8MlV6SdEu2zgM+2RL8/R7sKgi4SwnsnwMEriBGGE7iud aTJ4o87oAj1DW4fhjRsdAh8LkTGqoXw92Bn1E/6va8+l7JrvPmqcu3wcqa9UyJB9j/tv mE35AOBatYWNWZgGDfoUqcupQjQv4Ulgg5ZKr7Y8lD2QkS5eza9zijCBGgD0amoajore xshYRfcsw7PDcdsDci4XNRaEALFcytDr7qXjmot2p5YVxhUIBx0QKyJIHTHunrlm2tPP H8kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qll4/7QvzgGkwOp5yL2bkM+KvBOUhmoS39dKPfzvTSU=; b=UkVds/EfKv13bBKorpT5BkytjTmY0R5P8wV42qPJkC0dc+KUs5jZxjq4tQOTHMCwkl r8F3WUH+FvbPp/+100wpzFNNld9DTUhDsklXDgAFyj7URZyAM6fiIt6QxzUjNBwqP02k 0TayKqqdhghDWtxYeSh9uOoY09+TnaN1NXy8G/OZkXhh0FIuqHUsusmdhtjDSi/0UjH8 IzNMm4k6beX1VhVdN/ZJsZ11MsD1pf6BVZPguzpohcQhkb5yPt53MlVyQdTKxCMkH35V Wn1hxTr62UYSeBowL1aUBeSMAFvVN0rBj+TA8WyxqiwvAeNTrBHZW1Q5Nh8xyfQ75R1M PJjQ== X-Gm-Message-State: AMCzsaXuSPHpXXc1EMfEfAWtv3tdhI8txV5EPJmfwmWszhNXW5X42Av2 Khb9eSPdy292IuwmxBV6ABGvJD6aoluoDF7/Vr/jhA== X-Google-Smtp-Source: AOwi7QC6/OAQKad4cMsSpA3zHlavgsIySoDnGwRdpvlxnr0UbTKrYGm6GL/Yqan+pdPP4xY56xN8IGT2TA3foQcgZfQ= X-Received: by 10.107.185.6 with SMTP id j6mr11078796iof.221.1507599220143; Mon, 09 Oct 2017 18:33:40 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 18:33:39 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 19:33:39 -0600 X-Google-Sender-Auth: 1PadNpsu93vd9O5fRbQB1crDq9w Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:33:41 -0000 Yea, that's my bad. I didn't do a completely clean build with stand.h gone, so I didn't catch it before the commit. I've just pushed in a fixup so that we always include the path to stand.h in the include path, since almost everybody needs it, and it is harmless to the others to include. Sorry for the bumps... Warner On Mon, Oct 9, 2017 at 6:38 PM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Yer even no -j fails :( > > > On 10/10/2017 01:01, Warner Losh wrote: > > Oh, killed /usr/include/stand.h and found it. I'll post a fix when I get > back. > > On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh wrote: > >> Can you find out? A clean build works for me. Chances are good that >> sys/boot/efi/boot1/Makefile needs a line like >> CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will >> look into when I get back if you can't make progress. I don't see one there >> and I had to add it a couple of other places. >> >> Warner >> >> On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < >> steven.hartland@multiplay.co.uk> wrote: >> >>> Not sure which of these sets of changes caused the issue but a clean >>> build from scratch is currently failing here with: >>> >>> In file included from /usr/home/smh/freebsd/base/hea >>> d/sys/boot/efi/boot1/ufs_module.c:41: >>> In file included from /usr/home/smh/freebsd/base/hea >>> d/sys/boot/efi/boot1/boot_module.h:35: >>> /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: >>> fatal error: 'stand.h' file not found >>> #include >>> ^~~~~~~~~ >>> >>> Build was with -j24 in case it matters, going to try without -j but that >>> will take many hours >>> >>> >>> On 09/10/2017 23:11, Warner Losh wrote: >>> >>> Author: imp >>> Date: Mon Oct 9 22:11:57 2017 >>> New Revision: 324449 >>> URL: https://svnweb.freebsd.org/changeset/base/324449 >>> >>> Log: >>> Prefer ${LIBSTAND} to -lstand >>> >>> Sponsored by: Netflix >>> >>> Modified: >>> head/sys/boot/arm/uboot/Makefile >>> head/sys/boot/efi/boot1/Makefile >>> head/sys/boot/sparc64/loader/Makefile >>> >>> Modified: head/sys/boot/arm/uboot/Makefile >>> ============================================================================== >>> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >>> NO_WERROR.clang= >>> >>> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >>> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >>> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >>> >>> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >>> >>> >>> Modified: head/sys/boot/efi/boot1/Makefile >>> ============================================================================== >>> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >>> # as well as required string and memory functions for all platforms. >>> # >>> DPADD+= ${LIBEFI} ${LIBSTAND} >>> -LDADD+= ${LIBEFI} -lstand >>> +LDADD+= ${LIBEFI} ${LIBSTAND} >>> >>> DPADD+= ${LDSCRIPT} >>> >>> >>> Modified: head/sys/boot/sparc64/loader/Makefile >>> ============================================================================== >>> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >>> CFLAGS+= -I${SRCTOP}/sys >>> >>> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >>> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >>> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >>> >>> loader.help: help.common help.sparc64 >>> cat ${.ALLSRC} | \ >>> >>> >>> >>> >> > > From owner-svn-src-all@freebsd.org Tue Oct 10 01:54:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2575E4310E for ; Tue, 10 Oct 2017 01:54:17 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 4CA8B64AD8 for ; Tue, 10 Oct 2017 01:54:16 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e7375abd-ad5d-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e7375abd-ad5d-11e7-a893-25625093991c; Tue, 10 Oct 2017 01:54:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9A1s53Y002547; Mon, 9 Oct 2017 19:54:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507600445.84167.23.camel@freebsd.org> Subject: Re: svn commit: r324406 - head/sys/modules/em From: Ian Lepore To: Sean Bruno , Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 09 Oct 2017 19:54:05 -0600 In-Reply-To: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:54:17 -0000 On Mon, 2017-10-09 at 18:17 -0600, Sean Bruno wrote: > > On 10/09/17 14:33, Brooks Davis wrote: > > > > On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > On Oct 7, 2017, at 16:33, Sean Bruno > > > > > wrote: > > > > > > > > > > Author: sbruno > > > > > Date: Sat Oct  7 23:33:14 2017 > > > > > New Revision: 324406 > > > > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > > > > > > > > > Log: > > > > >  Fix symlink if_igb.ko in -current such that its relative and > > > > > doesn't > > > > >  end up with non-standard DESTDIR information in its > > > > > symlink.  This > > > > >  can happen very trivially if the release scripts are used. > > > > > > > > > >  Sponsored by:    Limelight Networks > > > > > > > > > > Modified: > > > > >  head/sys/modules/em/Makefile > > > > > > > > > > Modified: head/sys/modules/em/Makefile > > > > > ============================================================= > > > > > ================= > > > > > --- head/sys/modules/em/Makefile    Sat Oct  7 23:30:57 > > > > > 2017    (r324405) > > > > > +++ head/sys/modules/em/Makefile    Sat Oct  7 23:33:14 > > > > > 2017    (r324406) > > > > > @@ -23,6 +23,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 > > > > > #CFLAGS  += -DDEVICE_POLLING > > > > > > > > > > afterinstall: > > > > > -    ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko > > > > > ${DESTDIR}${KMODDIR}/if_igb.ko > > > > > +    cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > > > > While this is definitely better, the same thing could be > > > > achieved via: > > > > > > > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko > > > Should this be using SYMLINK+= as I thought using ln -sf was a > > > breakage > > > for meta mode stuff? > > At the very least it should use INSTALL_LIBSYMLINK or > > INSTALL_RLIBSYMLINK. > > Direct use of ln(1) is always a bug in install targets and ideally > > we > > would make it fail.  (It breaks NO_ROOT installs by failing to add > > an > > entry to the METALOG file). > > > > -- Brooks > > > > I'm more than happy to make changes here. > > The closest example I can see in the tree from a Makefile is some of > the > things in etc: > > ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound > > Is that, more or less, something y'all would like to see? > > sean > I think the right answer here is just   LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko -- Ian From owner-svn-src-all@freebsd.org Tue Oct 10 02:22:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F988E44239; Tue, 10 Oct 2017 02:22:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD241659D4; Tue, 10 Oct 2017 02:22:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A2MZuJ015446; Tue, 10 Oct 2017 02:22:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A2MY6U015429; Tue, 10 Oct 2017 02:22:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100222.v9A2MY6U015429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 02:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324461 - in stable/10/sys/dev/hyperv: include netvsc pcib storvsc utilities vmbus vmbus/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/10/sys/dev/hyperv: include netvsc pcib storvsc utilities vmbus vmbus/amd64 X-SVN-Commit-Revision: 324461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 02:22:37 -0000 Author: sephe Date: Tue Oct 10 02:22:34 2017 New Revision: 324461 URL: https://svnweb.freebsd.org/changeset/base/324461 Log: MFC 322488 hyperv: Update copyright for the files changed in 2017 Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11982 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_nvs.h stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.h stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnreg.h stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c stable/10/sys/dev/hyperv/vmbus/hyperv.c stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/include/hyperv.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2010-2012 Citrix Inc. - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * All rights reserved. * Modified: stable/10/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnreg.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/if_hnreg.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014,2016 Microsoft Corp. + * Copyright (c) 2014,2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014,2016 Microsoft Corp. + * Copyright (c) 2014,2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Tue Oct 10 01:31:44 2017 (r324460) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Tue Oct 10 02:22:34 2017 (r324461) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015,2016 Microsoft Corp. + * Copyright (c) 2015,2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Tue Oct 10 02:35:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E0DE4498A; Tue, 10 Oct 2017 02:35:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0A366021; Tue, 10 Oct 2017 02:35:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A2Z54K019798; Tue, 10 Oct 2017 02:35:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A2Z5xK019795; Tue, 10 Oct 2017 02:35:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100235.v9A2Z5xK019795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 02:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324462 - in stable/10/sys: net sys X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/10/sys: net sys X-SVN-Commit-Revision: 324462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 02:35:06 -0000 Author: sephe Date: Tue Oct 10 02:35:04 2017 New Revision: 324462 URL: https://svnweb.freebsd.org/changeset/base/324462 Log: MFC 323170 if: Add ioctls to get RSS key and hash type/function. It will be needed by hn(4) to configure its RSS key and hash type/function in the transparent VF mode in order to match VF's RSS settings. The description of the transparent VF mode and the RSS hash value issue are here: https://svnweb.freebsd.org/base?view=revision&revision=322299 https://svnweb.freebsd.org/base?view=revision&revision=322485 These are generic enough to promise two independent IOCs instead of abusing SIOCGDRVSPEC. Setting RSS key and hash type/function is a different story, which probably requires more discussion. Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch in the review request; these hash types are standardized now. Reviewed by: gallatin Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12174 Modified: stable/10/sys/net/if.c stable/10/sys/net/if.h stable/10/sys/sys/sockio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Tue Oct 10 02:22:34 2017 (r324461) +++ stable/10/sys/net/if.c Tue Oct 10 02:35:04 2017 (r324462) @@ -2632,6 +2632,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, case SIOCGIFMEDIA: case SIOCGIFXMEDIA: case SIOCGIFGENERIC: + case SIOCGIFRSSKEY: + case SIOCGIFRSSHASH: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); Modified: stable/10/sys/net/if.h ============================================================================== --- stable/10/sys/net/if.h Tue Oct 10 02:22:34 2017 (r324461) +++ stable/10/sys/net/if.h Tue Oct 10 02:35:04 2017 (r324462) @@ -534,6 +534,42 @@ struct ifi2creq { uint8_t data[8]; /* read buffer */ }; +/* + * RSS hash. + */ + +#define RSS_FUNC_NONE 0 /* RSS disabled */ +#define RSS_FUNC_PRIVATE 1 /* non-standard */ +#define RSS_FUNC_TOEPLITZ 2 + +#define RSS_TYPE_IPV4 0x00000001 +#define RSS_TYPE_TCP_IPV4 0x00000002 +#define RSS_TYPE_IPV6 0x00000004 +#define RSS_TYPE_IPV6_EX 0x00000008 +#define RSS_TYPE_TCP_IPV6 0x00000010 +#define RSS_TYPE_TCP_IPV6_EX 0x00000020 +#define RSS_TYPE_UDP_IPV4 0x00000040 +#define RSS_TYPE_UDP_IPV6 0x00000080 +#define RSS_TYPE_UDP_IPV6_EX 0x00000100 + +#define RSS_KEYLEN 128 + +struct ifrsskey { + char ifrk_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrk_func; /* RSS_FUNC_ */ + uint8_t ifrk_spare0; + uint16_t ifrk_keylen; + uint8_t ifrk_key[RSS_KEYLEN]; +}; + +struct ifrsshash { + char ifrh_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrh_func; /* RSS_FUNC_ */ + uint8_t ifrh_spare0; + uint16_t ifrh_spare1; + uint32_t ifrh_types; /* RSS_TYPE_ */ +}; + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL Modified: stable/10/sys/sys/sockio.h ============================================================================== --- stable/10/sys/sys/sockio.h Tue Oct 10 02:22:34 2017 (r324461) +++ stable/10/sys/sys/sockio.h Tue Oct 10 02:35:04 2017 (r324462) @@ -134,4 +134,8 @@ #define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */ #define SIOCGIFXMEDIA _IOWR('i', 139, struct ifmediareq) /* get net xmedia */ +#define SIOCGIFRSSKEY _IOWR('i', 150, struct ifrsskey)/* get RSS key */ +#define SIOCGIFRSSHASH _IOWR('i', 151, struct ifrsshash)/* get the current RSS + type/func settings */ + #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-all@freebsd.org Tue Oct 10 02:51:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5244E450C1; Tue, 10 Oct 2017 02:51:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 850B36695C; Tue, 10 Oct 2017 02:51:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-69-250-194.dyn.iinet.net.au [106.69.250.194]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v9A2pFg9070357 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Oct 2017 19:51:18 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r324446 - in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap... To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710092035.v99KZVR7068970@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Tue, 10 Oct 2017 10:51:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710092035.v99KZVR7068970@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 02:51:21 -0000 On 10/10/17 4:35 am, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Oct 9 20:35:31 2017 > New Revision: 324446 > URL: https://svnweb.freebsd.org/changeset/base/324446 > > Log: > Shorten list of arguments to mbuf external storage freeing function. > > All of these arguments are stored in m_ext, so there is no reason > to pass them in the argument list. Not all functions need the second > argument, some don't even need the first one. The second argument > lives in next cache line, so not dereferencing it is a performance > gain. This was discovered in sendfile(2), which will be covered by > next commits. > Originally the external free function was not necessarily freeing things that were mbuf related. In fact in one early use the items being freed were used by both the network layer and the disk io layer. The disk layer had no idea what an m_ext was or an mbuf for that matter. > The second goal of this commit is to bring even more flexibility > to m_ext mbufs, allowing to create more fields in m_ext, opaque to > the generic mbuf code, and potentially set and dereferenced by > subsystems. > > Reviewed by: gallatin, kbowling > Differential Revision: https://reviews.freebsd.org/D12615 > > Modified: > head/share/man/man9/mbpool.9 > head/share/man/man9/mbuf.9 > head/sys/compat/ndis/kern_ndis.c > head/sys/compat/ndis/ndis_var.h > head/sys/dev/cas/if_cas.c > head/sys/dev/cas/if_casvar.h > head/sys/dev/cxgbe/t4_sge.c > head/sys/dev/cxgbe/tom/t4_cpl_io.c > head/sys/dev/dpaa/if_dtsec_rm.c > head/sys/dev/if_ndis/if_ndis.c > head/sys/dev/iscsi_initiator/isc_soc.c > head/sys/dev/lge/if_lge.c > head/sys/dev/mwl/if_mwl.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/wb/if_wb.c > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_mbpool.c > head/sys/sys/mbpool.h > head/sys/sys/mbuf.h > > Modified: head/share/man/man9/mbpool.9 > ============================================================================== > --- head/share/man/man9/mbpool.9 Mon Oct 9 18:33:29 2017 (r324445) > +++ head/share/man/man9/mbpool.9 Mon Oct 9 20:35:31 2017 (r324446) > @@ -27,7 +27,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 15, 2003 > +.Dd September 27, 2017 > .Dt MBPOOL 9 > .Os > .Sh NAME > @@ -50,7 +50,7 @@ > .Ft void > .Fn mbp_free "struct mbpool *mbp" "void *p" > .Ft void > -.Fn mbp_ext_free "void *" "void *" > +.Fn mbp_ext_free "struct mbuf *" > .Ft void > .Fn mbp_card_free "struct mbpool *mbp" > .Ft void > @@ -223,8 +223,6 @@ The function > can be given to > .Fn m_extadd > as the free function. > -The user argument must be the pointer to > -the pool. > .Pp > Before using the contents of a buffer returned by the card, the driver > must call > > Modified: head/share/man/man9/mbuf.9 > ============================================================================== > --- head/share/man/man9/mbuf.9 Mon Oct 9 18:33:29 2017 (r324445) > +++ head/share/man/man9/mbuf.9 Mon Oct 9 20:35:31 2017 (r324446) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 10, 2016 > +.Dd September 27, 2017 > .Dt MBUF 9 > .Os > .\" > @@ -44,12 +44,12 @@ > .Fn MCLGET "struct mbuf *mbuf" "int how" > .Fo MEXTADD > .Fa "struct mbuf *mbuf" > -.Fa "caddr_t buf" > +.Fa "char *buf" > .Fa "u_int size" > -.Fa "void (*free)(void *opt_arg1, void *opt_arg2)" > +.Fa "void (*free)(struct mbuf *)" > .Fa "void *opt_arg1" > .Fa "void *opt_arg2" > -.Fa "short flags" > +.Fa "int flags" > .Fa "int type" > .Fc > .\" > @@ -416,8 +416,13 @@ The > .Fa opt_arg1 > and > .Fa opt_arg2 > -arguments will be passed unmodified to > -.Fa free . > +arguments will be saved in > +.Va ext_arg1 > +and > +.Va ext_arg2 > +fields of the > +.Va struct m_ext > +of the mbuf. > The > .Fa flags > argument specifies additional > > Modified: head/sys/compat/ndis/kern_ndis.c > ============================================================================== > --- head/sys/compat/ndis/kern_ndis.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/compat/ndis/kern_ndis.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -495,17 +495,21 @@ ndis_return(dobj, arg) > KeReleaseSpinLock(&block->nmb_returnlock, irql); > } > > +static void > +ndis_ext_free(struct mbuf *m) > +{ > + > + return (ndis_return_packet(m->m_ext.ext_arg1)); > +} > + > void > -ndis_return_packet(struct mbuf *m, void *buf, void *arg) > +ndis_return_packet(ndis_packet *p) > { > - ndis_packet *p; > ndis_miniport_block *block; > > - if (arg == NULL) > + if (p == NULL) > return; > > - p = arg; > - > /* Decrement refcount. */ > p->np_refcnt--; > > @@ -676,9 +680,8 @@ ndis_ptom(m0, p) > return (ENOBUFS); > } > m->m_len = MmGetMdlByteCount(buf); > - m->m_data = MmGetMdlVirtualAddress(buf); > - MEXTADD(m, m->m_data, m->m_len, ndis_return_packet, > - m->m_data, p, 0, EXT_NDIS); > + m_extadd(m, MmGetMdlVirtualAddress(buf), m->m_len, > + ndis_ext_free, p, NULL, 0, EXT_NDIS); > p->np_refcnt++; > > totlen += m->m_len; > > Modified: head/sys/compat/ndis/ndis_var.h > ============================================================================== > --- head/sys/compat/ndis/ndis_var.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/compat/ndis/ndis_var.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -1743,7 +1743,7 @@ extern int ndis_halt_nic(void *); > extern int ndis_shutdown_nic(void *); > extern int ndis_pnpevent_nic(void *, int); > extern int ndis_init_nic(void *); > -extern void ndis_return_packet(struct mbuf *, void *, void *); > +extern void ndis_return_packet(ndis_packet *); > extern int ndis_init_dma(void *); > extern int ndis_destroy_dma(void *); > extern int ndis_create_sysctls(void *); > > Modified: head/sys/dev/cas/if_cas.c > ============================================================================== > --- head/sys/dev/cas/if_cas.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cas/if_cas.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -133,7 +133,7 @@ static void cas_detach(struct cas_softc *sc); > static int cas_disable_rx(struct cas_softc *sc); > static int cas_disable_tx(struct cas_softc *sc); > static void cas_eint(struct cas_softc *sc, u_int status); > -static void cas_free(struct mbuf *m, void *arg1, void* arg2); > +static void cas_free(struct mbuf *m); > static void cas_init(void *xsc); > static void cas_init_locked(struct cas_softc *sc); > static void cas_init_regs(struct cas_softc *sc); > @@ -1732,16 +1732,10 @@ cas_rint(struct cas_softc *sc) > refcount_acquire(&rxds->rxds_refcount); > bus_dmamap_sync(sc->sc_rdmatag, > rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m, (caddr_t)rxds->rxds_buf + > + m_extadd(m, (char *)rxds->rxds_buf + > off * 256 + ETHER_ALIGN, len, cas_free, > - rxds, M_RDONLY, EXT_NET_DRV); > -#else > - MEXTADD(m, (caddr_t)rxds->rxds_buf + > - off * 256 + ETHER_ALIGN, len, cas_free, > sc, (void *)(uintptr_t)idx, > M_RDONLY, EXT_NET_DRV); > -#endif > if ((m->m_flags & M_EXT) == 0) { > m_freem(m); > m = NULL; > @@ -1779,16 +1773,10 @@ cas_rint(struct cas_softc *sc) > m->m_len = min(CAS_PAGE_SIZE - off, len); > bus_dmamap_sync(sc->sc_rdmatag, > rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, > - m->m_len, cas_free, rxds, M_RDONLY, > - EXT_NET_DRV); > -#else > - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, > + m_extadd(m, (char *)rxds->rxds_buf + off, > m->m_len, cas_free, sc, > (void *)(uintptr_t)idx, M_RDONLY, > EXT_NET_DRV); > -#endif > if ((m->m_flags & M_EXT) == 0) { > m_freem(m); > m = NULL; > @@ -1818,19 +1806,11 @@ cas_rint(struct cas_softc *sc) > sc->sc_rdmatag, > rxds2->rxds_dmamap, > BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m2, > - (caddr_t)rxds2->rxds_buf, > - m2->m_len, cas_free, > - rxds2, M_RDONLY, > - EXT_NET_DRV); > -#else > - MEXTADD(m2, > - (caddr_t)rxds2->rxds_buf, > + m_extadd(m2, > + (char *)rxds2->rxds_buf, > m2->m_len, cas_free, sc, > (void *)(uintptr_t)idx2, > M_RDONLY, EXT_NET_DRV); > -#endif > if ((m2->m_flags & M_EXT) == > 0) { > m_freem(m2); > @@ -1889,21 +1869,15 @@ cas_rint(struct cas_softc *sc) > } > > static void > -cas_free(struct mbuf *m, void *arg1, void *arg2) > +cas_free(struct mbuf *m) > { > struct cas_rxdsoft *rxds; > struct cas_softc *sc; > u_int idx, locked; > > -#if __FreeBSD_version < 800016 > - rxds = arg2; > - sc = rxds->rxds_sc; > - idx = rxds->rxds_idx; > -#else > - sc = arg1; > - idx = (uintptr_t)arg2; > + sc = m->m_ext.ext_arg1; > + idx = (uintptr_t)m->m_ext.ext_arg2; > rxds = &sc->sc_rxdsoft[idx]; > -#endif > if (refcount_release(&rxds->rxds_refcount) == 0) > return; > > > Modified: head/sys/dev/cas/if_casvar.h > ============================================================================== > --- head/sys/dev/cas/if_casvar.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cas/if_casvar.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -119,10 +119,6 @@ struct cas_rxdsoft { > void *rxds_buf; /* receive buffer */ > bus_dmamap_t rxds_dmamap; /* our DMA map */ > bus_addr_t rxds_paddr; /* physical address of the segment */ > -#if __FreeBSD_version < 800016 > - struct cas_softc *rxds_sc; /* softc pointer */ > - u_int rxds_idx; /* our index */ > -#endif > u_int rxds_refcount; /* hardware + mbuf references */ > }; > > @@ -239,18 +235,7 @@ do { \ > __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], \ > &(sc)->sc_rxdsoft[(s)], (s)) > > -#if __FreeBSD_version < 800016 > -#define CAS_INIT_RXDESC(sc, d, s) \ > -do { \ > - struct cas_rxdsoft *__rxds = &(sc)->sc_rxdsoft[(s)]; \ > - \ > - __rxds->rxds_sc = (sc); \ > - __rxds->rxds_idx = (s); \ > - __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], __rxds, (s)); \ > -} while (0) > -#else > #define CAS_INIT_RXDESC(sc, d, s) CAS_UPDATE_RXDESC(sc, d, s) > -#endif > > #define CAS_LOCK_INIT(_sc, _name) \ > mtx_init(&(_sc)->sc_mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) > > Modified: head/sys/dev/cxgbe/t4_sge.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1670,10 +1670,10 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str > } > > static void > -rxb_free(struct mbuf *m, void *arg1, void *arg2) > +rxb_free(struct mbuf *m) > { > - uma_zone_t zone = arg1; > - caddr_t cl = arg2; > + uma_zone_t zone = m->m_ext.ext_arg1; > + void *cl = m->m_ext.ext_arg2; > > uma_zfree(zone, cl); > counter_u64_add(extfree_rels, 1); > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1979,9 +1979,9 @@ free_aiotx_buffer(struct aiotx_buffer *ab) > } > > static void > -t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg) > +t4_aiotx_mbuf_free(struct mbuf *m) > { > - struct aiotx_buffer *ab = buffer; > + struct aiotx_buffer *ab = m->m_ext.ext_arg1; > > #ifdef VERBOSE_TRACES > CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, > > Modified: head/sys/dev/dpaa/if_dtsec_rm.c > ============================================================================== > --- head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -337,11 +337,13 @@ dtsec_rm_pool_rx_init(struct dtsec_softc *sc) > * @{ > */ > static void > -dtsec_rm_fqr_mext_free(struct mbuf *m, void *buffer, void *arg) > +dtsec_rm_fqr_mext_free(struct mbuf *m) > { > struct dtsec_softc *sc; > + void *buffer; > > - sc = arg; > + buffer = m->m_ext.ext_arg1; > + sc = m->m_ext.ext_arg2; > if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) > bman_put_buffer(sc->sc_rx_pool, buffer); > else > > Modified: head/sys/dev/if_ndis/if_ndis.c > ============================================================================== > --- head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1418,7 +1418,7 @@ ndis_rxeof(adapter, packets, pktcnt) > p = packets[i]; > if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) { > p->np_refcnt++; > - (void)ndis_return_packet(NULL ,p, block); > + ndis_return_packet(p); > } > } > return; > @@ -1431,7 +1431,7 @@ ndis_rxeof(adapter, packets, pktcnt) > if (ndis_ptom(&m0, p)) { > device_printf(sc->ndis_dev, "ptom failed\n"); > if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) > - (void)ndis_return_packet(NULL, p, block); > + ndis_return_packet(p); > } else { > #ifdef notdef > if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) { > > Modified: head/sys/dev/iscsi_initiator/isc_soc.c > ============================================================================== > --- head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -70,12 +70,13 @@ static int ou_refcnt = 0; > | function for freeing external storage for mbuf > */ > static void > -ext_free(struct mbuf *m, void *a, void *b) > +ext_free(struct mbuf *m) > { > - pduq_t *pq = b; > + pduq_t *pq = m->m_ext.ext_arg1; > > if(pq->buf != NULL) { > - debug(3, "ou_refcnt=%d a=%p b=%p", ou_refcnt, a, pq->buf); > + debug(3, "ou_refcnt=%d a=%p b=%p", > + ou_refcnt, m->m_ext.ext_buf, pq->buf); > free(pq->buf, M_ISCSIBUF); > pq->buf = NULL; > } > @@ -137,11 +138,8 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq) > md->m_ext.ext_cnt = &ou_refcnt; > l = min(MCLBYTES, len); > debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l); > - MEXTADD(md, pp->ds_addr + off, l, ext_free, > -#if __FreeBSD_version >= 800000 > - pp->ds_addr + off, > -#endif > - pq, 0, EXT_EXTREF); > + m_extadd(md, pp->ds_addr + off, l, ext_free, pq, NULL, 0, > + EXT_EXTREF); > md->m_len = l; > md->m_next = NULL; > mh->m_pkthdr.len += l; > > Modified: head/sys/dev/lge/if_lge.c > ============================================================================== > --- head/sys/dev/lge/if_lge.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/lge/if_lge.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -123,7 +123,7 @@ static int lge_detach(device_t); > static int lge_alloc_jumbo_mem(struct lge_softc *); > static void lge_free_jumbo_mem(struct lge_softc *); > static void *lge_jalloc(struct lge_softc *); > -static void lge_jfree(struct mbuf *, void *, void *); > +static void lge_jfree(struct mbuf *); > > static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *); > static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *); > @@ -689,7 +689,7 @@ lge_newbuf(sc, c, m) > struct mbuf *m; > { > struct mbuf *m_new = NULL; > - caddr_t *buf = NULL; > + char *buf = NULL; > > if (m == NULL) { > MGETHDR(m_new, M_NOWAIT, MT_DATA); > @@ -710,10 +710,9 @@ lge_newbuf(sc, c, m) > return(ENOBUFS); > } > /* Attach the buffer to the mbuf */ > - m_new->m_data = (void *)buf; > m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; > - MEXTADD(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, > - buf, (struct lge_softc *)sc, 0, EXT_NET_DRV); > + m_extadd(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, sc, NULL, > + 0, EXT_NET_DRV); > } else { > m_new = m; > m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; > @@ -848,20 +847,20 @@ lge_jalloc(sc) > * Release a jumbo buffer. > */ > static void > -lge_jfree(struct mbuf *m, void *buf, void *args) > +lge_jfree(struct mbuf *m) > { > struct lge_softc *sc; > int i; > struct lge_jpool_entry *entry; > > /* Extract the softc struct pointer. */ > - sc = args; > + sc = m->m_ext.ext_arg1; > > if (sc == NULL) > panic("lge_jfree: can't find softc pointer!"); > > /* calculate the slot this buffer belongs to */ > - i = ((vm_offset_t)buf > + i = ((vm_offset_t)m->m_ext.ext_buf > - (vm_offset_t)sc->lge_cdata.lge_jumbo_buf) / LGE_JLEN; > > if ((i < 0) || (i >= LGE_JSLOTS)) > > Modified: head/sys/dev/mwl/if_mwl.c > ============================================================================== > --- head/sys/dev/mwl/if_mwl.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/mwl/if_mwl.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -2522,12 +2522,12 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf > } > > static void > -mwl_ext_free(struct mbuf *m, void *data, void *arg) > +mwl_ext_free(struct mbuf *m) > { > - struct mwl_softc *sc = arg; > + struct mwl_softc *sc = m->m_ext.ext_arg1; > > /* XXX bounds check data */ > - mwl_putrxdma(sc, data); > + mwl_putrxdma(sc, m->m_ext.ext_buf); > /* > * If we were previously blocked by a lack of rx dma buffers > * check if we now have enough to restart rx interrupt handling. > @@ -2746,8 +2746,8 @@ mwl_rx_proc(void *arg, int npending) > * descriptor using the replacement dma > * buffer we just installed above. > */ > - MEXTADD(m, data, MWL_AGGR_SIZE, mwl_ext_free, > - data, sc, 0, EXT_NET_DRV); > + m_extadd(m, data, MWL_AGGR_SIZE, mwl_ext_free, sc, NULL, 0, > + EXT_NET_DRV); > m->m_data += off - hdrlen; > m->m_pkthdr.len = m->m_len = pktlen; > /* NB: dma buffer assumed read-only */ > > Modified: head/sys/dev/netmap/netmap_generic.c > ============================================================================== > --- head/sys/dev/netmap/netmap_generic.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/netmap/netmap_generic.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -166,7 +166,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) > * has a KASSERT(), checking that the mbuf dtor function is not NULL. > */ > > -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } > +static void void_mbuf_dtor(struct mbuf *m) { } > > #define SET_MBUF_DESTRUCTOR(m, fn) do { \ > (m)->m_ext.ext_free = (fn != NULL) ? \ > @@ -624,7 +624,7 @@ generic_mbuf_destructor(struct mbuf *m) > * txsync. */ > netmap_generic_irq(na, r, NULL); > #ifdef __FreeBSD__ > - void_mbuf_dtor(m, NULL, NULL); > + void_mbuf_dtor(m); > #endif > } > > > Modified: head/sys/dev/wb/if_wb.c > ============================================================================== > --- head/sys/dev/wb/if_wb.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/wb/if_wb.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -143,7 +143,7 @@ static int wb_probe(device_t); > static int wb_attach(device_t); > static int wb_detach(device_t); > > -static void wb_bfree(struct mbuf *, void *addr, void *args); > +static void wb_bfree(struct mbuf *); > static int wb_newbuf(struct wb_softc *, struct wb_chain_onefrag *, > struct mbuf *); > static int wb_encap(struct wb_softc *, struct wb_chain *, struct mbuf *); > @@ -824,7 +824,7 @@ wb_list_rx_init(sc) > } > > static void > -wb_bfree(struct mbuf *m, void *buf, void *args) > +wb_bfree(struct mbuf *m) > { > } > > @@ -843,10 +843,9 @@ wb_newbuf(sc, c, m) > MGETHDR(m_new, M_NOWAIT, MT_DATA); > if (m_new == NULL) > return(ENOBUFS); > - m_new->m_data = c->wb_buf; > m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES; > - MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, c->wb_buf, > - NULL, 0, EXT_NET_DRV); > + m_extadd(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, NULL, > + 0, EXT_NET_DRV); > } else { > m_new = m; > m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES; > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -504,7 +504,7 @@ mb_ctor_clust(void *mem, int size, void *arg, int how) > #endif > m = (struct mbuf *)arg; > if (m != NULL) { > - m->m_ext.ext_buf = (caddr_t)mem; > + m->m_ext.ext_buf = (char *)mem; > m->m_data = m->m_ext.ext_buf; > m->m_flags |= M_EXT; > m->m_ext.ext_free = NULL; > @@ -688,15 +688,13 @@ mb_free_ext(struct mbuf *m) > case EXT_DISPOSABLE: > KASSERT(m->m_ext.ext_free != NULL, > ("%s: ext_free not set", __func__)); > - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, > - m->m_ext.ext_arg2); > + m->m_ext.ext_free(m); > uma_zfree(zone_mbuf, mref); > break; > case EXT_EXTREF: > KASSERT(m->m_ext.ext_free != NULL, > ("%s: ext_free not set", __func__)); > - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, > - m->m_ext.ext_arg2); > + m->m_ext.ext_free(m); > break; > default: > KASSERT(m->m_ext.ext_type == 0, > @@ -918,9 +916,8 @@ m_getm2(struct mbuf *m, int len, int how, short type, > * Nothing. > */ > void > -m_extadd(struct mbuf *mb, caddr_t buf, u_int size, > - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, > - int flags, int type) > +m_extadd(struct mbuf *mb, char *buf, u_int size, m_ext_free_t freef, > + void *arg1, void *arg2, int flags, int type) > { > > KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); > > Modified: head/sys/kern/subr_mbpool.c > ============================================================================== > --- head/sys/kern/subr_mbpool.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/kern/subr_mbpool.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -281,10 +281,10 @@ mbp_free(struct mbpool *p, void *ptr) > * Mbuf system external mbuf free routine > */ > void > -mbp_ext_free(struct mbuf *m, void *buf, void *arg) > +mbp_ext_free(struct mbuf *m) > { > > - mbp_free(arg, buf); > + mbp_free(m->m_ext.ext_arg2, m->m_ext.ext_arg1); > } > > /* > > Modified: head/sys/sys/mbpool.h > ============================================================================== > --- head/sys/sys/mbpool.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/sys/mbpool.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -69,7 +69,7 @@ void *mbp_alloc(struct mbpool *, bus_addr_t *, uint32_ > void mbp_free(struct mbpool *, void *); > > /* free a chunk that is an external mbuf */ > -void mbp_ext_free(struct mbuf *, void *, void *); > +void mbp_ext_free(struct mbuf *); > > /* free all buffers that are marked to be on the card */ > void mbp_card_free(struct mbpool *); > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -197,17 +197,17 @@ struct pkthdr { > * Compile-time assertions in uipc_mbuf.c test these values to ensure that > * they are correct. > */ > +typedef void m_ext_free_t(struct mbuf *); > struct m_ext { > union { > volatile u_int ext_count; /* value of ref count info */ > volatile u_int *ext_cnt; /* pointer to ref count info */ > }; > - caddr_t ext_buf; /* start of buffer */ > + char *ext_buf; /* start of buffer */ > uint32_t ext_size; /* size of buffer, for ext_free */ > uint32_t ext_type:8, /* type of external storage */ > ext_flags:24; /* external storage mbuf flags */ > - void (*ext_free) /* free routine if not the usual */ > - (struct mbuf *, void *, void *); > + m_ext_free_t *ext_free; /* free routine if not the usual */ > void *ext_arg1; /* optional argument pointer */ > void *ext_arg2; /* optional argument pointer */ > }; > @@ -436,10 +436,10 @@ struct mbuf { > > #define EXT_FLAG_NOFREE 0x000010 /* don't free mbuf to pool, notyet */ > > -#define EXT_FLAG_VENDOR1 0x010000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR2 0x020000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR3 0x040000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR4 0x080000 /* for vendor-internal use */ > +#define EXT_FLAG_VENDOR1 0x010000 /* These flags are vendor */ > +#define EXT_FLAG_VENDOR2 0x020000 /* or submodule specific, */ > +#define EXT_FLAG_VENDOR3 0x040000 /* not used by mbuf code. */ > +#define EXT_FLAG_VENDOR4 0x080000 /* Set/read by submodule. */ > > #define EXT_FLAG_EXP1 0x100000 /* for experimental use */ > #define EXT_FLAG_EXP2 0x200000 /* for experimental use */ > @@ -610,9 +610,8 @@ struct mbuf *m_devget(char *, int, int, struct ifnet * > void (*)(char *, caddr_t, u_int)); > struct mbuf *m_dup(const struct mbuf *, int); > int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); > -void m_extadd(struct mbuf *, caddr_t, u_int, > - void (*)(struct mbuf *, void *, void *), void *, void *, > - int, int); > +void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, > + void *, void *, int, int); > u_int m_fixhdr(struct mbuf *); > struct mbuf *m_fragment(struct mbuf *, int, int); > void m_freem(struct mbuf *); > @@ -667,8 +666,8 @@ m_gettype(int size) > * Associated an external reference counted buffer with an mbuf. > */ > static __inline void > -m_extaddref(struct mbuf *m, caddr_t buf, u_int size, u_int *ref_cnt, > - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2) > +m_extaddref(struct mbuf *m, char *buf, u_int size, u_int *ref_cnt, > + m_ext_free_t freef, void *arg1, void *arg2) > { > > KASSERT(ref_cnt != NULL, ("%s: ref_cnt not provided", __func__)); > @@ -864,7 +863,7 @@ m_extrefcnt(struct mbuf *m) > #define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) > #define MCLGET(m, how) m_clget((m), (how)) > #define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \ > - m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2), \ > + m_extadd((m), (char *)(buf), (size), (free), (arg1), (arg2), \ > (flags), (type)) > #define m_getm(m, len, how, type) \ > m_getm2((m), (len), (how), (type), M_PKTHDR) > > From owner-svn-src-all@freebsd.org Tue Oct 10 02:57:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A8DE45582; Tue, 10 Oct 2017 02:57:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E4A666CD2; Tue, 10 Oct 2017 02:57:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A2vUaT028307; Tue, 10 Oct 2017 02:57:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A2vUOu028306; Tue, 10 Oct 2017 02:57:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100257.v9A2vUOu028306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 02:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324463 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 02:57:31 -0000 Author: sephe Date: Tue Oct 10 02:57:30 2017 New Revision: 324463 URL: https://svnweb.freebsd.org/changeset/base/324463 Log: MFC 323175 hyperv/hn: Implement SIOCGIFRSS{KEY,HASH}. The conditional compiling in the review request is removed, since these IOCTLs will be available in stable/10 and stable/11. Reviewed by: gallatin Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12175 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 02:35:04 2017 (r324462) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 02:57:30 2017 (r324463) @@ -3303,6 +3303,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr = (struct ifreq *)data, ifr_vf; struct ifnet *vf_ifp; int mask, error = 0; + struct ifrsskey *ifrk; + struct ifrsshash *ifrh; switch (cmd) { case SIOCSIFMTU: @@ -3558,6 +3560,56 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } HN_UNLOCK(sc); error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); + break; + + case SIOCGIFRSSHASH: + ifrh = (struct ifrsshash *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrh->ifrh_func = RSS_FUNC_NONE; + ifrh->ifrh_types = 0; + break; + } + + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; + else + ifrh->ifrh_func = RSS_FUNC_PRIVATE; + + ifrh->ifrh_types = 0; + if (sc->hn_rss_hash & NDIS_HASH_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + HN_UNLOCK(sc); + break; + + case SIOCGIFRSSKEY: + ifrk = (struct ifrsskey *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrk->ifrk_func = RSS_FUNC_NONE; + ifrk->ifrk_keylen = 0; + break; + } + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; + else + ifrk->ifrk_func = RSS_FUNC_PRIVATE; + ifrk->ifrk_keylen = NDIS_HASH_KEYSIZE_TOEPLITZ; + memcpy(ifrk->ifrk_key, sc->hn_rss.rss_key, + NDIS_HASH_KEYSIZE_TOEPLITZ); + HN_UNLOCK(sc); break; default: From owner-svn-src-all@freebsd.org Tue Oct 10 03:02:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CAA4E458C2; Tue, 10 Oct 2017 03:02:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE46673E0; Tue, 10 Oct 2017 03:02:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A32tGk033133; Tue, 10 Oct 2017 03:02:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A32tI7033132; Tue, 10 Oct 2017 03:02:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100302.v9A32tI7033132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 03:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324464 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 03:02:56 -0000 Author: sephe Date: Tue Oct 10 03:02:54 2017 New Revision: 324464 URL: https://svnweb.freebsd.org/changeset/base/324464 Log: MFC 323176 hyperv/hn: Log RSS capabilities mask. This helps to detect when UDP hash types can be supported. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12177 Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 02:57:30 2017 (r324463) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 03:02:54 2017 (r324464) @@ -498,6 +498,8 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c caps.ndis_caps); return (EOPNOTSUPP); } + if (bootverbose) + if_printf(sc->hn_ifp, "RSS caps %#x\n", caps.ndis_caps); /* Commit! */ sc->hn_rss_ind_size = indsz; From owner-svn-src-all@freebsd.org Tue Oct 10 03:21:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D78E46107; Tue, 10 Oct 2017 03:21:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C647767D24; Tue, 10 Oct 2017 03:21:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A3LIjT038383; Tue, 10 Oct 2017 03:21:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A3LHpZ038379; Tue, 10 Oct 2017 03:21:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100321.v9A3LHpZ038379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 03:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324465 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 03:21:19 -0000 Author: sephe Date: Tue Oct 10 03:21:17 2017 New Revision: 324465 URL: https://svnweb.freebsd.org/changeset/base/324465 Log: MFC 323727,324316 323727 hyperv/hn: Apply VF's RSS setting Since in Azure SYN and SYN|ACK go through the synthetic parts while the rest of the same TCP flow goes through the VF, apply VF's RSS settings to synthetic parts to have a consistent hash value/type for the same TCP flow. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12333 324316 hyperv/hn: Fix options RSS building Reported by: np Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 03:02:54 2017 (r324464) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 03:21:17 2017 (r324465) @@ -503,7 +503,7 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; - sc->hn_rss_hash = hash_func | hash_types; + sc->hn_rss_hcap = hash_func | hash_types; *rxr_cnt0 = rxr_cnt; return (0); } Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:02:54 2017 (r324464) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:21:17 2017 (r324465) @@ -279,6 +279,8 @@ static void hn_xpnt_vf_init_taskfunc(void *, int); static void hn_xpnt_vf_init(struct hn_softc *); static void hn_xpnt_vf_setenable(struct hn_softc *); static void hn_xpnt_vf_setdisable(struct hn_softc *, bool); +static void hn_vf_rss_fixup(struct hn_softc *, bool); +static void hn_vf_rss_restore(struct hn_softc *); static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); @@ -320,6 +322,8 @@ static int hn_rxfilter_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); @@ -377,8 +381,11 @@ static int hn_set_rxfilter(struct hn_softc *, uint32 static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); static void hn_rss_ind_fixup(struct hn_softc *); +static void hn_rss_mbuf_hash(struct hn_softc *, uint32_t); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); +static uint32_t hn_rss_type_fromndis(uint32_t); +static uint32_t hn_rss_type_tondis(uint32_t); static int hn_tx_ring_create(struct hn_softc *, int); static void hn_tx_ring_destroy(struct hn_tx_ring *); @@ -1121,11 +1128,13 @@ hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, hn_rxvf_set(sc, rxvf ? ifp : NULL); if (rxvf) { + hn_vf_rss_fixup(sc, true); hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { + hn_vf_rss_restore(sc); hn_resume_mgmt(sc); } @@ -1322,7 +1331,249 @@ hn_mtu_change_fixup(struct hn_softc *sc) #endif } +static uint32_t +hn_rss_type_fromndis(uint32_t rss_hash) +{ + uint32_t types = 0; + + if (rss_hash & NDIS_HASH_IPV4) + types |= RSS_TYPE_IPV4; + if (rss_hash & NDIS_HASH_TCP_IPV4) + types |= RSS_TYPE_TCP_IPV4; + if (rss_hash & NDIS_HASH_IPV6) + types |= RSS_TYPE_IPV6; + if (rss_hash & NDIS_HASH_IPV6_EX) + types |= RSS_TYPE_IPV6_EX; + if (rss_hash & NDIS_HASH_TCP_IPV6) + types |= RSS_TYPE_TCP_IPV6; + if (rss_hash & NDIS_HASH_TCP_IPV6_EX) + types |= RSS_TYPE_TCP_IPV6_EX; + return (types); +} + +static uint32_t +hn_rss_type_tondis(uint32_t types) +{ + uint32_t rss_hash = 0; + + KASSERT((types & + (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP4, UDP6 and UDP6EX are not supported")); + + if (types & RSS_TYPE_IPV4) + rss_hash |= NDIS_HASH_IPV4; + if (types & RSS_TYPE_TCP_IPV4) + rss_hash |= NDIS_HASH_TCP_IPV4; + if (types & RSS_TYPE_IPV6) + rss_hash |= NDIS_HASH_IPV6; + if (types & RSS_TYPE_IPV6_EX) + rss_hash |= NDIS_HASH_IPV6_EX; + if (types & RSS_TYPE_TCP_IPV6) + rss_hash |= NDIS_HASH_TCP_IPV6; + if (types & RSS_TYPE_TCP_IPV6_EX) + rss_hash |= NDIS_HASH_TCP_IPV6_EX; + return (rss_hash); +} + static void +hn_rss_mbuf_hash(struct hn_softc *sc, uint32_t mbuf_hash) +{ + int i; + + HN_LOCK_ASSERT(sc); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_mbuf_hash = mbuf_hash; +} + +static void +hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) +{ + struct ifnet *ifp, *vf_ifp; + struct ifrsshash ifrh; + struct ifrsskey ifrk; + int error; + uint32_t my_types, diff_types, mbuf_types = 0; + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) { + /* No RSS on synthetic parts; done. */ + return; + } + if ((sc->hn_rss_hcap & NDIS_HASH_FUNCTION_TOEPLITZ) == 0) { + /* Synthetic parts do not support Toeplitz; done. */ + return; + } + + ifp = sc->hn_ifp; + vf_ifp = sc->hn_vf_ifp; + + /* + * Extract VF's RSS key. Only 40 bytes key for Toeplitz is + * supported. + */ + memset(&ifrk, 0, sizeof(ifrk)); + strlcpy(ifrk.ifrk_name, vf_ifp->if_xname, sizeof(ifrk.ifrk_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSKEY, (caddr_t)&ifrk); + if (error) { + if_printf(ifp, "%s SIOCGRSSKEY failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrk.ifrk_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrk.ifrk_func); + goto done; + } + if (ifrk.ifrk_keylen != NDIS_HASH_KEYSIZE_TOEPLITZ) { + if_printf(ifp, "%s invalid RSS Toeplitz key length %d\n", + vf_ifp->if_xname, ifrk.ifrk_keylen); + goto done; + } + + /* + * Extract VF's RSS hash. Only Toeplitz is supported. + */ + memset(&ifrh, 0, sizeof(ifrh)); + strlcpy(ifrh.ifrh_name, vf_ifp->if_xname, sizeof(ifrh.ifrh_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSHASH, (caddr_t)&ifrh); + if (error) { + if_printf(ifp, "%s SIOCGRSSHASH failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrh.ifrh_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrh.ifrh_func); + goto done; + } + + my_types = hn_rss_type_fromndis(sc->hn_rss_hcap); + if ((ifrh.ifrh_types & my_types) == 0) { + /* This disables RSS; ignore it then */ + if_printf(ifp, "%s intersection of RSS types failed. " + "VF %#x, mine %#x\n", vf_ifp->if_xname, + ifrh.ifrh_types, my_types); + goto done; + } + + diff_types = my_types ^ ifrh.ifrh_types; + my_types &= ifrh.ifrh_types; + mbuf_types = my_types; + + /* + * Detect RSS hash value/type confliction. + * + * NOTE: + * We don't disable the hash type, but stop delivery the hash + * value/type through mbufs on RX path. + */ + if ((my_types & RSS_TYPE_IPV4) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV4 | RSS_TYPE_UDP_IPV4))) { + /* Conflict; disable IPV4 hash type/value delivery. */ + if_printf(ifp, "disable IPV4 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV4; + } + if ((my_types & RSS_TYPE_IPV6) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6_EX))) { + /* Conflict; disable IPV6 hash type/value delivery. */ + if_printf(ifp, "disable IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6; + } + if ((my_types & RSS_TYPE_IPV6_EX) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6))) { + /* Conflict; disable IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6_EX; + } + if ((my_types & RSS_TYPE_TCP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6_EX)) { + /* Conflict; disable TCP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6; + } + if ((my_types & RSS_TYPE_TCP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6)) { + /* Conflict; disable TCP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6_EX; + } + if ((my_types & RSS_TYPE_UDP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6_EX)) { + /* Conflict; disable UDP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6; + } + if ((my_types & RSS_TYPE_UDP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6)) { + /* Conflict; disable UDP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6_EX; + } + + /* + * Indirect table does not matter. + */ + + sc->hn_rss_hash = (sc->hn_rss_hcap & NDIS_HASH_FUNCTION_MASK) | + hn_rss_type_tondis(my_types); + memcpy(sc->hn_rss.rss_key, ifrk.ifrk_key, sizeof(sc->hn_rss.rss_key)); + sc->hn_flags |= HN_FLAG_HAS_RSSKEY; + + if (reconf) { + error = hn_rss_reconfig(sc); + if (error) { + /* XXX roll-back? */ + if_printf(ifp, "hn_rss_reconfig failed: %d\n", error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, hn_rss_type_tondis(mbuf_types)); +} + +static void +hn_vf_rss_restore(struct hn_softc *sc) +{ + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) + goto done; + + /* + * Restore hash types. Key does _not_ matter. + */ + if (sc->hn_rss_hash != sc->hn_rss_hcap) { + int error; + + sc->hn_rss_hash = sc->hn_rss_hcap; + error = hn_rss_reconfig(sc); + if (error) { + if_printf(sc->hn_ifp, "hn_rss_reconfig failed: %d\n", + error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, NDIS_HASH_ALL); +} + +static void hn_xpnt_vf_setready(struct hn_softc *sc) { struct ifnet *ifp, *vf_ifp; @@ -1488,6 +1739,13 @@ hn_xpnt_vf_init(struct hn_softc *sc) */ hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_VF); + /* + * NOTE: + * Fixup RSS related bits _after_ the VF is brought up, since + * many VFs generate RSS key during it's initialization. + */ + hn_vf_rss_fixup(sc, true); + /* Mark transparent mode VF as enabled. */ hn_xpnt_vf_setenable(sc); } @@ -1646,7 +1904,8 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) ifp->if_input = sc->hn_vf_input; sc->hn_vf_input = NULL; - if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED) + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) && + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_SYNTH); if (sc->hn_vf_rdytick == 0) { @@ -1668,11 +1927,18 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) sc->hn_ifp->if_hw_tsomaxsegsize = sc->hn_saved_tsosegsz; } - /* - * Resume link status management, which was suspended - * by hn_ifnet_attevent(). - */ - hn_resume_mgmt(sc); + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + /* + * Restore RSS settings. + */ + hn_vf_rss_restore(sc); + + /* + * Resume link status management, which was suspended + * by hn_ifnet_attevent(). + */ + hn_resume_mgmt(sc); + } } /* Mark transparent mode VF as disabled. */ @@ -1918,6 +2184,12 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hash", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_rss_hash_sysctl, "A", "RSS hash"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hashcap", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_hcap_sysctl, "A", "RSS hash capabilities"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "mbuf_hash", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_mbuf_sysctl, "A", "RSS hash for mbufs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rss_ind_size", CTLFLAG_RD, &sc->hn_rss_ind_size, 0, "RSS indirect entry count"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_key", @@ -3015,14 +3287,21 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int { struct ifnet *ifp, *hn_ifp = rxr->hn_ifp; struct mbuf *m_new; - int size, do_lro = 0, do_csum = 1; - int hash_type = M_HASHTYPE_OPAQUE; + int size, do_lro = 0, do_csum = 1, is_vf = 0; + int hash_type = M_HASHTYPE_NONE; - /* - * If the non-transparent mode VF is active, inject this packet - * into the VF. - */ - ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : hn_ifp; + ifp = hn_ifp; + if (rxr->hn_rxvf_ifp != NULL) { + /* + * Non-transparent mode VF; pretend this packet is from + * the VF. + */ + ifp = rxr->hn_rxvf_ifp; + is_vf = 1; + } else if (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF) { + /* Transparent mode VF. */ + is_vf = 1; + } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3175,16 +3454,6 @@ skip: * If VF is activated (tranparent/non-transparent mode does not * matter here). * - * - Don't setup mbuf hash, if 'options RSS' is set. - * - * In Azure, when VF is activated, TCP SYN and SYN|ACK go - * through hn(4) while the rest of segments and ACKs belonging - * to the same TCP 4-tuple go through the VF. So don't setup - * mbuf hash, if a VF is activated and 'options RSS' is not - * enabled. hn(4) and the VF may use neither the same RSS - * hash key nor the same RSS hash function, so the hash value - * for packets belonging to the same flow could be different! - * * - Disable LRO * * hn(4) will only receive broadcast packets, multicast packets, @@ -3195,19 +3464,23 @@ skip: * all, since the LRO flush will use hn(4) as the receiving * interface; i.e. hn_ifp->if_input(hn_ifp, m). */ - if (hn_ifp != ifp || (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF)) { - do_lro = 0; /* disable LRO. */ -#ifndef RSS - goto skip_hash; /* skip mbuf hash setup */ -#endif - } + if (is_vf) + do_lro = 0; + /* + * If VF is activated (tranparent/non-transparent mode does not + * matter here), do _not_ mess with unsupported hash types or + * functions. + */ if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) { rxr->hn_rss_pkts++; m_new->m_pkthdr.flowid = info->hash_value; + if (!is_vf) + hash_type = M_HASHTYPE_OPAQUE; if ((info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { - uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK); + uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK & + rxr->hn_mbuf_hash); /* * NOTE: @@ -3244,14 +3517,11 @@ skip: break; } } - } else { + } else if (!is_vf) { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; } M_HASHTYPE_SET(m_new, hash_type); -#ifndef RSS -skip_hash: -#endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (hn_ifp != ifp) { const struct ether_header *eh; @@ -3576,20 +3846,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; else ifrh->ifrh_func = RSS_FUNC_PRIVATE; - - ifrh->ifrh_types = 0; - if (sc->hn_rss_hash & NDIS_HASH_IPV4) - ifrh->ifrh_types |= RSS_TYPE_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_IPV6) - ifrh->ifrh_types |= RSS_TYPE_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + ifrh->ifrh_types = hn_rss_type_fromndis(sc->hn_rss_hash); HN_UNLOCK(sc); break; @@ -4139,6 +4396,16 @@ hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS) if (error || req->newptr == NULL) goto back; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (hn_xpnt_vf && sc->hn_vf_ifp != NULL)) { + /* + * RSS key is synchronized w/ VF's, don't allow users + * to change it. + */ + error = EBUSY; + goto back; + } + error = SYSCTL_IN(req, sc->hn_rss.rss_key, sizeof(sc->hn_rss.rss_key)); if (error) goto back; @@ -4203,6 +4470,34 @@ hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rss_hcap; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int +hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rx_ring[0].hn_mbuf_hash; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; @@ -4502,6 +4797,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + rxr->hn_mbuf_hash = NDIS_HASH_ALL; rxr->hn_ifp = sc->hn_ifp; if (i < sc->hn_tx_ring_cnt) rxr->hn_txr = &sc->hn_tx_ring[i]; @@ -5952,6 +6248,7 @@ hn_synth_attach(struct hn_softc *sc, int mtu) /* Clear RSS stuffs. */ sc->hn_rss_ind_size = 0; sc->hn_rss_hash = 0; + sc->hn_rss_hcap = 0; /* * Attach the primary channel _before_ attaching NVS and RNDIS. @@ -6058,6 +6355,12 @@ hn_synth_attach(struct hn_softc *sc, int mtu) hn_rss_ind_fixup(sc); } + sc->hn_rss_hash = sc->hn_rss_hcap; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) { + /* NOTE: Don't reconfigure RSS; will do immediately. */ + hn_vf_rss_fixup(sc, false); + } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); if (error) goto failed; Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 03:02:54 2017 (r324464) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 03:21:17 2017 (r324465) @@ -64,6 +64,7 @@ struct hn_rx_ring { void *hn_pktbuf; int hn_pktbuf_len; int hn_rx_flags; /* HN_RX_FLAG_ */ + uint32_t hn_mbuf_hash; /* NDIS_HASH_ */ uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; @@ -239,7 +240,8 @@ struct hn_softc { uint32_t hn_rndis_agg_align; int hn_rss_ind_size; - uint32_t hn_rss_hash; /* NDIS_HASH_ */ + uint32_t hn_rss_hash; /* setting, NDIS_HASH_ */ + uint32_t hn_rss_hcap; /* caps, NDIS_HASH_ */ struct ndis_rssprm_toeplitz hn_rss; eventhandler_tag hn_ifaddr_evthand; Modified: stable/10/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 03:02:54 2017 (r324464) +++ stable/10/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 03:21:17 2017 (r324465) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,13 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ From owner-svn-src-all@freebsd.org Tue Oct 10 03:29:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2571EE46670; Tue, 10 Oct 2017 03:29:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2D3968503; Tue, 10 Oct 2017 03:29:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A3TbRp041783; Tue, 10 Oct 2017 03:29:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A3Ta8U041777; Tue, 10 Oct 2017 03:29:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100329.v9A3Ta8U041777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 03:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324466 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 03:29:38 -0000 Author: sephe Date: Tue Oct 10 03:29:36 2017 New Revision: 324466 URL: https://svnweb.freebsd.org/changeset/base/324466 Log: MFC 323728,323729 323728 hyperv/hn: Fix MTU setting - Add size of an ethernet header to the value configured to NVS. This does not seem to have any effects if MTU is 1500, but fix hypervisor side's setting if MTU > 1500. - Override the MTU setting according to the view from the hypervisor side. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12352 323729 hyperv/hn: Incease max supported MTU Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12365 Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.h stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 03:21:17 2017 (r324465) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 03:29:36 2017 (r324466) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -503,7 +504,7 @@ hn_nvs_conf_ndis(struct hn_softc *sc, int mtu) memset(&conf, 0, sizeof(conf)); conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; - conf.nvs_mtu = mtu; + conf.nvs_mtu = mtu + ETHER_HDR_LEN; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 03:21:17 2017 (r324465) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 03:29:36 2017 (r324466) @@ -189,6 +189,24 @@ hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t return (0); } +int +hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu) +{ + size_t size; + int error; + + size = sizeof(*mtu); + error = hn_rndis_query(sc, OID_GEN_MAXIMUM_FRAME_SIZE, NULL, 0, + mtu, &size); + if (error) + return (error); + if (size != sizeof(uint32_t)) { + if_printf(sc->hn_ifp, "invalid mtu len %zu\n", size); + return (EINVAL); + } + return (0); +} + static const void * hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, struct hn_nvs_sendctx *sndc, size_t *comp_len) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 03:21:17 2017 (r324465) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 03:29:36 2017 (r324466) @@ -41,6 +41,7 @@ int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t * /* link_status: NDIS_MEDIA_STATE_ */ int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); +int hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu); /* filter: NDIS_PACKET_TYPE_. */ int hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter); void hn_rndis_rx_ctrl(struct hn_softc *sc, const void *data, Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:21:17 2017 (r324465) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:29:36 2017 (r324466) @@ -1990,6 +1990,7 @@ hn_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; + uint32_t mtu; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -2142,6 +2143,12 @@ hn_attach(device_t dev) if (error) goto failed; + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ETHERMTU; + else if (bootverbose) + device_printf(dev, "RNDIS mtu %u\n", mtu); + #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* @@ -2326,6 +2333,10 @@ hn_attach(device_t dev) if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } + if (mtu < ETHERMTU) { + if_printf(ifp, "fixup mtu %lu -> %u\n", ifp->if_mtu, mtu); + ifp->if_mtu = mtu; + } /* Inform the upper layer about the long frame support. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); @@ -3575,6 +3586,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) int mask, error = 0; struct ifrsskey *ifrk; struct ifrsshash *ifrh; + uint32_t mtu; switch (cmd) { case SIOCSIFMTU: @@ -3638,11 +3650,23 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ifr->ifr_mtu; + else if (bootverbose) + if_printf(ifp, "RNDIS mtu %u\n", mtu); + /* * Commit the requested MTU, after the synthetic parts * have been successfully attached. */ - ifp->if_mtu = ifr->ifr_mtu; + if (mtu >= ifr->ifr_mtu) { + mtu = ifr->ifr_mtu; + } else { + if_printf(ifp, "fixup mtu %d -> %u\n", + ifr->ifr_mtu, mtu); + } + ifp->if_mtu = mtu; /* * Synthetic parts' reattach may change the chimney Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 03:21:17 2017 (r324465) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 03:29:36 2017 (r324466) @@ -36,8 +36,7 @@ #define HN_RXBUF_SIZE (16 * 1024 * 1024) #define HN_RXBUF_SIZE_COMPAT (15 * 1024 * 1024) -/* Claimed to be 12232B */ -#define HN_MTU_MAX (9 * 1024) +#define HN_MTU_MAX (65535 - ETHER_ADDR_LEN) #define HN_TXBR_SIZE (128 * PAGE_SIZE) #define HN_RXBR_SIZE (128 * PAGE_SIZE) From owner-svn-src-all@freebsd.org Tue Oct 10 03:35:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 651C9E46ABE; Tue, 10 Oct 2017 03:35:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 420A768A5B; Tue, 10 Oct 2017 03:35:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A3ZOjG045759; Tue, 10 Oct 2017 03:35:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A3ZOBK045757; Tue, 10 Oct 2017 03:35:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100335.v9A3ZOBK045757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 03:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324467 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 03:35:25 -0000 Author: sephe Date: Tue Oct 10 03:35:24 2017 New Revision: 324467 URL: https://svnweb.freebsd.org/changeset/base/324467 Log: MFC 324048 hyperv/hn: Set tcp header offset for CSUM/LSO offloading. No observable effect; better safe than sorry. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12417 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:29:36 2017 (r324466) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:35:24 2017 (r324467) @@ -716,6 +716,7 @@ hn_tso_fixup(struct mbuf *m_head) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { @@ -725,6 +726,7 @@ hn_tso_fixup(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; + m_head->m_pkthdr.l3hlen = iphlen; PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); th = mtodo(m_head, ehlen + iphlen); @@ -748,6 +750,7 @@ hn_tso_fixup(struct mbuf *m_head) m_freem(m_head); return (NULL); } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); th = mtodo(m_head, ehlen + sizeof(*ip6)); @@ -757,41 +760,34 @@ hn_tso_fixup(struct mbuf *m_head) } #endif return (m_head); - } /* * NOTE: If this function failed, the m_head would be freed. */ static __inline struct mbuf * -hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +hn_set_hlen(struct mbuf *m_head) { const struct ether_vlan_header *evl; - const struct tcphdr *th; int ehlen; - *tcpsyn = 0; - PULLUP_HDR(m_head, sizeof(*evl)); evl = mtod(m_head, const struct ether_vlan_header *); if (evl->evl_encap_proto == ntohs(ETHERTYPE_VLAN)) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET - if (m_head->m_pkthdr.csum_flags & CSUM_IP_TCP) { + if (m_head->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP_UDP)) { const struct ip *ip; int iphlen; PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; - - PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); - th = mtodo(m_head, ehlen + iphlen); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + m_head->m_pkthdr.l3hlen = iphlen; } #endif #if defined(INET6) && defined(INET) @@ -803,18 +799,36 @@ hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) - return (m_head); - - PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); - th = mtodo(m_head, ehlen + sizeof(*ip6)); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + if (ip6->ip6_nxt != IPPROTO_TCP) { + m_freem(m_head); + return (NULL); + } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); } #endif return (m_head); } +/* + * NOTE: If this function failed, the m_head would be freed. + */ +static __inline struct mbuf * +hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +{ + const struct tcphdr *th; + int ehlen, iphlen; + + *tcpsyn = 0; + ehlen = m_head->m_pkthdr.l2hlen; + iphlen = m_head->m_pkthdr.l3hlen; + + PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); + th = mtodo(m_head, ehlen + iphlen); + if (th->th_flags & TH_SYN) + *tcpsyn = 1; + return (m_head); +} + #undef PULLUP_HDR #endif /* INET6 || INET */ @@ -2999,7 +3013,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st NDIS_LSO2_INFO_SIZE, NDIS_PKTINFO_TYPE_LSO); #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { - *pi_data = NDIS_LSO2_INFO_MAKEIPV4(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV4( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen, m_head->m_pkthdr.tso_segsz); } #endif @@ -3008,7 +3023,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st #endif #ifdef INET6 { - *pi_data = NDIS_LSO2_INFO_MAKEIPV6(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV6( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen, m_head->m_pkthdr.tso_segsz); } #endif @@ -3025,11 +3041,15 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st *pi_data |= NDIS_TXCSUM_INFO_IPCS; } - if (m_head->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) - *pi_data |= NDIS_TXCSUM_INFO_TCPCS; - else if (m_head->m_pkthdr.csum_flags & - (CSUM_IP_UDP | CSUM_IP6_UDP)) - *pi_data |= NDIS_TXCSUM_INFO_UDPCS; + if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_TCP | CSUM_IP6_TCP)) { + *pi_data |= NDIS_TXCSUM_INFO_MKTCPCS( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen); + } else if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP6_UDP)) { + *pi_data |= NDIS_TXCSUM_INFO_MKUDPCS( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen); + } } pkt_hlen = pkt->rm_pktinfooffset + pkt->rm_pktinfolen; @@ -5550,6 +5570,13 @@ hn_start_locked(struct hn_tx_ring *txr, int len) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } + } else if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP6_UDP | CSUM_IP6_TCP)) { + m_head = hn_set_hlen(m_head); + if (__predict_false(m_head == NULL)) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + continue; + } } #endif @@ -5830,11 +5857,18 @@ hn_transmit(struct ifnet *ifp, struct mbuf *m) #if defined(INET6) || defined(INET) /* - * Perform TSO packet header fixup now, since the TSO - * packet header should be cache-hot. + * Perform TSO packet header fixup or get l2/l3 header length now, + * since packet headers should be cache-hot. */ if (m->m_pkthdr.csum_flags & CSUM_TSO) { m = hn_tso_fixup(m); + if (__predict_false(m == NULL)) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return EIO; + } + } else if (m->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP6_UDP | CSUM_IP6_TCP)) { + m = hn_set_hlen(m); if (__predict_false(m == NULL)) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return EIO; Modified: stable/10/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 03:29:36 2017 (r324466) +++ stable/10/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 03:35:24 2017 (r324467) @@ -402,4 +402,13 @@ struct ndis_offload { #define NDIS_TXCSUM_INFO_IPCS 0x00000010 #define NDIS_TXCSUM_INFO_THOFF 0x03ff0000 +#define NDIS_TXCSUM_INFO_MKL4CS(thoff, flag) \ + ((((uint32_t)(thoff)) << 16) | (flag)) + +#define NDIS_TXCSUM_INFO_MKTCPCS(thoff) \ + NDIS_TXCSUM_INFO_MKL4CS((thoff), NDIS_TXCSUM_INFO_TCPCS) + +#define NDIS_TXCSUM_INFO_MKUDPCS(thoff) \ + NDIS_TXCSUM_INFO_MKL4CS((thoff), NDIS_TXCSUM_INFO_UDPCS) + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-all@freebsd.org Tue Oct 10 03:40:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0320E46E48; Tue, 10 Oct 2017 03:40:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B84D69343; Tue, 10 Oct 2017 03:40:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A3ecXB046019; Tue, 10 Oct 2017 03:40:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A3ecYX046018; Tue, 10 Oct 2017 03:40:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100340.v9A3ecYX046018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 03:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324468 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 03:40:39 -0000 Author: sephe Date: Tue Oct 10 03:40:38 2017 New Revision: 324468 URL: https://svnweb.freebsd.org/changeset/base/324468 Log: MFC 324049,324077 324049 hyperv/hn: Fix UDP checksum offload issue in Azure. UDP checksum offload does not work in Azure if following conditions are met: - sizeof(IP hdr + UDP hdr + payload) > 1420. - IP_DF is not set in IP hdr Use software checksum for UDP datagrams falling into this category. Add two tunables to disable UDP/IPv4 and UDP/IPv6 checksum offload, in case something unexpected happened. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12429 324077 hyperv/hn: Unbreak i386 building. Reported by: cy Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:35:24 2017 (r324467) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 03:40:38 2017 (r324468) @@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$"); #include "opt_hn.h" #include +#include #include +#include #include #include #include @@ -76,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -451,6 +452,35 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostip, CTLFLAG_RDT "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); +/* + * Offload UDP/IPv4 checksum. + */ +static int hn_enable_udp4cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp4cs, CTLFLAG_RDTUN, + &hn_enable_udp4cs, 0, "Offload UDP/IPv4 checksum"); + +/* + * Offload UDP/IPv6 checksum. + */ +static int hn_enable_udp6cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp6cs, CTLFLAG_RDTUN, + &hn_enable_udp6cs, 0, "Offload UDP/IPv6 checksum"); + +/* Stats. */ +static counter_u64_t hn_udpcs_fixup; +SYSCTL_COUNTER_U64(_hw_hn, OID_AUTO, udpcs_fixup, CTLFLAG_RW, + &hn_udpcs_fixup, "# of UDP checksum fixup"); + +/* + * See hn_set_hlen(). + * + * This value is for Azure. For Hyper-V, set this above + * 65536 to disable UDP datagram checksum fixup. + */ +static int hn_udpcs_fixup_mtu = 1420; +SYSCTL_INT(_hw_hn, OID_AUTO, udpcs_fixup_mtu, CTLFLAG_RWTUN, + &hn_udpcs_fixup_mtu, 0, "UDP checksum fixup MTU threshold"); + /* Limit TSO burst size */ static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, @@ -788,6 +818,27 @@ hn_set_hlen(struct mbuf *m_head) ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; m_head->m_pkthdr.l3hlen = iphlen; + + /* + * UDP checksum offload does not work in Azure, if the + * following conditions meet: + * - sizeof(IP hdr + UDP hdr + payload) > 1420. + * - IP_DF is not set in the IP hdr. + * + * Fallback to software checksum for these UDP datagrams. + */ + if ((m_head->m_pkthdr.csum_flags & CSUM_IP_UDP) && + m_head->m_pkthdr.len > hn_udpcs_fixup_mtu + ehlen && + (ntohs(ip->ip_off) & IP_DF) == 0) { + uint16_t off = ehlen + iphlen; + + counter_u64_add(hn_udpcs_fixup, 1); + PULLUP_HDR(m_head, off + sizeof(struct udphdr)); + *(uint16_t *)(m_head->m_data + off + + m_head->m_pkthdr.csum_data) = in_cksum_skip( + m_head, m_head->m_pkthdr.len, off); + m_head->m_pkthdr.csum_flags &= ~CSUM_IP_UDP; + } } #endif #if defined(INET6) && defined(INET) @@ -5463,11 +5514,11 @@ hn_fixup_tx_data(struct hn_softc *sc) csum_assist |= CSUM_IP; if (sc->hn_caps & HN_CAP_TCP4CS) csum_assist |= CSUM_IP_TCP; - if (sc->hn_caps & HN_CAP_UDP4CS) + if ((sc->hn_caps & HN_CAP_UDP4CS) && hn_enable_udp4cs) csum_assist |= CSUM_IP_UDP; if (sc->hn_caps & HN_CAP_TCP6CS) csum_assist |= CSUM_IP6_TCP; - if (sc->hn_caps & HN_CAP_UDP6CS) + if ((sc->hn_caps & HN_CAP_UDP6CS) && hn_enable_udp6cs) csum_assist |= CSUM_IP6_UDP; for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; @@ -7289,6 +7340,8 @@ hn_sysinit(void *arg __unused) { int i; + hn_udpcs_fixup = counter_u64_alloc(M_WAITOK); + #ifdef HN_IFSTART_SUPPORT /* * Don't use ifnet.if_start if transparent VF mode is requested; @@ -7368,5 +7421,7 @@ hn_sysuninit(void *arg __unused) if (hn_vfmap != NULL) free(hn_vfmap, M_DEVBUF); rm_destroy(&hn_vfmap_lock); + + counter_u64_free(hn_udpcs_fixup); } SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); From owner-svn-src-all@freebsd.org Tue Oct 10 04:32:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59147E484FB; Tue, 10 Oct 2017 04:32:42 +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 E1FC86AC8B; Tue, 10 Oct 2017 04:32:41 +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 8B2C93C36B3; Tue, 10 Oct 2017 15:32:38 +1100 (AEDT) Date: Tue, 10 Oct 2017 15:32:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324457 - in head/sys/dev: pccbb pci In-Reply-To: <201710092227.v99MRcFV016141@repo.freebsd.org> Message-ID: <20171010142321.Q1134@besplex.bde.org> References: <201710092227.v99MRcFV016141@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=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Iau21ub-UXeGsUTFskIA:9 a=pNLrUVhz5m34pnmG:21 a=gw8T9opGQSYv2c5R:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:32:42 -0000 On Mon, 9 Oct 2017, Alan Somers wrote: > Log: > Remove embedded newlines from sysctl variable descriptions This doesn't fix the main bug of writing man pages in sysctl descriptions. > Modified: head/sys/dev/pccbb/pccbb_isa.c > ============================================================================== > --- head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:19:58 2017 (r324456) > +++ head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:27:38 2017 (r324457) > @@ -75,11 +75,11 @@ static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, > > static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; > SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, > - "Mask of allowable interrupts for this laptop. The default is generally\n\ > -correct, but some laptops do not route all the IRQ pins to the bridge to\n\ > -save wires. Sometimes you need a more restrictive mask because some of the\n\ > -hardware in your laptop may not have a driver so its IRQ might not be\n\ > -allocated."); > + "Mask of allowable interrupts for this laptop. The default is generally" > + " correct, but some laptops do not route all the IRQ pins to the bridge to" > + " save wires. Sometimes you need a more restrictive mask because some of" > + " the hardware in your laptop may not have a driver so its IRQ might not be" > + " allocated."); More low quality sysctl messages can be found using sysctl -da | grep -v ': ' # Sloppy check for embedded newlines sysctl -da | grep '^[^ ]*: [^A-Z]' # Uncapitalized messages previous | grep '^dev.*%'' # Auto-generated spam for dev tree sysctl -da | grep '[^.]*\.$' # Terminating period sysctl -da | grep '^[^ ]*: .*\..*\.$' # Multiple sentence, term. period sysctl -da | grep '^[^ ]*: .*\..*[^.]$' # Period, but not terminating sysctl -da | grep '\. ' # Normal sentence break sysctl -da | grep '\. [^.]' # Misformatted sentence break sysctl -da | grep '......' # (Really 80 dots). Long lines Results on freefall: - 3294 lines of output - 7 lines with embedded newlines - 1041 lines with uncapitalized messages - 637 lines with previous bug auto-generated for dev tree. Approx 5 lines duplicated for each device - 109 lines with a terminating period but no other periods - 5 lines with multiple sentences and a terminating period - 43 lines with a period but not a terminating period. This is a sloppy check for multiple sentences. It finds a few correct descriptions with periods in sysctl names - 7 lines with normal sentence breaks. Half for man pages in sysctls in this commit - 17 lines with single-space sentence breaks - 359 long lines. Not counting the sysctl name or ': ', only 30 lines are too long. These lines and ones up to about 10 shorter are also too long for source lines. Another type of search finds inconsistent spellings of booleans. grep -i for literal "disable" shows 63 lines with the following inconsistencies and verboseness: - often "disable" in the description echoes "disable" in the sysctl name. But sometimes the sysctl uses "control", or the sysctl name uses "disable" but the description uses "disallow" - when the description uses "Enable/disable" (10 instances), the name uses "allow" (2 instances), "use" (1 instance), "enable "(1 instance) or is not clearly boolean (6 instances), - often (in usb cloned descriptions), "Disable is spelled verbosely as "Set to disable". This is still not verbose enough to say that unset means "enable" or even "don't disable". Disable/enable is never used. For integer variables, there are lots of inconsistences and verboseness involving "number/number of/num/n". Bruce From owner-svn-src-all@freebsd.org Tue Oct 10 04:37:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7956CE48604; Tue, 10 Oct 2017 04:37:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE186AE5E; Tue, 10 Oct 2017 04:37:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id z11so6039666pfk.4; Mon, 09 Oct 2017 21:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=0V385TKyWXJarKmk6m0gZR2KLfX6mWxzYDMnUzIANQk=; b=iVf7lqKSOIDNvTvtjdeymL+44hWy7c5zZSl8CMcogJKpCGQmKp5Gyaw0K/NGEUAUhv ovMTRnnC/GMpp1IJrZyA77SyxBOuRcA/ZLTA6CRhxuJozM35mgMNCmyeFIuN4rz/iWPQ 4+Hwh1cWStHCq/y3SkdMtazH3LawqyKbQhbxATLVHhX6GlF+iDq0gG0Cd7M8vxkiKixQ 8KyHqyVlnwQyrRAiWvg90zPDKCxGhVaC2GXOlnE7p5v3GBtfTzLNZMIBxVJ0ffGHOsoB lCVu6rb0CHSs5YVN8HevF5L4L9blPZ6yKUCby5fhQ8I0EF4uPlWKyrcutdWTgW+ty5We C+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=0V385TKyWXJarKmk6m0gZR2KLfX6mWxzYDMnUzIANQk=; b=j3dAa6gZIu/0gVfHIOruAMF+9xQa23TsMW1QN1/DEcAF6VAQ8WQejqvwmAbythOtp/ O87kxMHK3IRikBGaGbNeeRG3glzW9TWiFb2JCajo9TeH2OF0p8vZ2rL5POb9bBYi8Alz ILSx6kAkCc+D8iqOXYUjOIxkzS1fP0dBM6PNalvgKqmQcfZCsnc2boQ74HJ2cNqSSxTU lT4mJqE5afNX5RdduMDHKqpRJUUIAlu9oIJE6/GkGOZ6Eo6K9FI0hCouzD4GJXB6Yzxg B70iSKueZVd+QL6Hj3jIvp/GIwR2aUfSmZIhZskr6PJSLhoVaV3bHF/Tu3rAVaj96wh8 Q2Uw== X-Gm-Message-State: AMCzsaWsYwM4x5QPX9qB/Yscgw5tMS/kBvyjAc0YryAyAYQ9UYYguCvn kJ3+9ayiI+qYyhOaRoxQcsRjB5i3 X-Google-Smtp-Source: AOwi7QCuPB29X5CxDjoVtMRZQpZkNSCG9/GET5ckfsXIYTrLt/TLAqHJrmGmEJjxD41pGuZSqvDP2A== X-Received: by 10.99.131.66 with SMTP id h63mr10966059pge.156.1507610227430; Mon, 09 Oct 2017 21:37:07 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 81sm1042976pfh.145.2017.10.09.21.37.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:37:06 -0700 (PDT) Subject: Re: svn commit: r324406 - head/sys/modules/em Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <1507600445.84167.23.camel@freebsd.org> Date: Mon, 9 Oct 2017 21:37:05 -0700 Cc: Sean Bruno , Brooks Davis , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> <1507600445.84167.23.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:37:08 -0000 --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 > On Oct 9, 2017, at 18:54, Ian Lepore wrote: ... > I think the right answer here is just > > LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko That will definitely work and is probably the best pattern. Thanks, -Ngie --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3E5xAAoJEPWDqSZpMIYV0EkP/itl1jeHLq9i4zZiZcvIQw3R yNMc7MJyBiszqFOINl6t3jP24tZwx1EU058tRqvmgt2zdMHljBdwqM1T5vJDw3Gs BicoIyB9zd4wC46O6ZiMITK14Otx2oJfsKo5Ov+0vj3yDao+xLrzrbHNESZ4YcMj kpkqmp8qHGsDR++MmWpNY0YaTNIryu66qfZqh6jPT6V3FAPILAIN7yX+11iWTXz5 YvuaH1czn0ioaCcjsbIm23rXzWHcLJSmUh1s9uZFeOXYgB3J0aKphtQHiAld7+NE 8yR7b3bPZVZGIAe2ZQnDHk2pU5yXK7qAk3EcNX9GFrDja2Qr0xUTPZFRl+NuCzQW vWHXQVIpuyKLOo/oAQmLP5kPMAVRf1v6/f5/0rdJr4Ra9FD+tc9NRqLV9lUv3ERD Qh7JbHNJLraFpM7w46+crOdq17Naerj5RU3F5GVIH9HziSp/jBmBU8UTI/0C+JK8 nsDVUbWhRY/m6OEe1T6NjXK1P968dESfd2HqFVcYvSzsfAzY0Oh2eLcDqkokkpLy uju5On0cU2swZ2RNgahF8du6LjtH1gRmiKCodnSdv7HwRySIQo8RCh8b/0REGkTv odsiep7WPSLt02a7pvWGoWBoccmUoXJWNXuUZj2JhygbNxZQ9X6I2eFC63vcjQZn tvVVOC8Iva7g0wnThXjD =51vv -----END PGP SIGNATURE----- --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1-- From owner-svn-src-all@freebsd.org Tue Oct 10 04:39:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2CBE486B1; Tue, 10 Oct 2017 04:39:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 232AE6AFF1; Tue, 10 Oct 2017 04:39:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id z11so6045279pfk.4; Mon, 09 Oct 2017 21:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=rAPzoaxSu7xAc7BqyjdH5ieASKFNsnfGZfaGO0DVbH0=; b=JF1VJLiS3hguQp6DVBQXXn4UU1wR9BHKY+B8LK+m9qAOKTiqzs9qPiImfsa/OKh+fM KimqU64fhbu9Z74E4CT7R6w4iALvpvEpz84PHV8ozbLREHt5LBJ95lUCu26T//9LGv71 pw+PYLtXSG10Ee6gFKZPVn1yXJLDe1wA8AIthZb/wJ+CbzXPXjJSC4MpWW1B30NZpCEQ OvsrQcLiZTFc+RUFOS3vF3FZl/Ck0eZ9UoMFkaNs/V2a3rspEOmJxdinK+VF3w2exDh+ QJ0FObdpFIWFqBooMppvNhHNPkvMCc2fJfZfXehw1WEfy/eqWI6VgEts4qtwUFlWzHQo j9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=rAPzoaxSu7xAc7BqyjdH5ieASKFNsnfGZfaGO0DVbH0=; b=Z2aVPzzaf6NSt9IRsvj+Ps4LoRYa37wjypU1LVJFkfrjBBQgPAcBkf084FobruKS2V gNSISEHwHwZfOKSjQv9llqUduUd9BXWIurRnfXai2zllVCNYlvQnOjcCNWf9hX2erpmN dZv3PD1PM9e46Z7DKItgSemtmCtYrH3PQh6iGtGXvh7L616o8GhCEJTr0ZXCWQNfC2T+ 9nbnkc/QAvIXqiFMV6vMr6pBssR+GKeAjmW9ipi/CIWtnDw0Q6/qtZ8iPjsvBmEkn5PK uDI3ctlU2R5j3oynFz0BUThRgmFbr28XzS5Za2iwRQBg/0LmmSMuF5KPommkgbtomsc/ cR5Q== X-Gm-Message-State: AMCzsaUbs7+9HBJr4acmrQmoxvHeir3TsKtQbvdsVvUmYhKxW1xQQ806 WlLFSrn1N7P5d2EeRXvYXq9eD0Iy X-Google-Smtp-Source: AOwi7QD/SYc6MUO1KsffbwywrGdzGhX4SUAYf2wAHRbW8VzHqaeFkhcjQv5Z4u93SMWxawL6Raqjmg== X-Received: by 10.99.106.67 with SMTP id f64mr11512245pgc.101.1507610369438; Mon, 09 Oct 2017 21:39:29 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d12sm14835285pgu.91.2017.10.09.21.39.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:39:28 -0700 (PDT) Subject: Re: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <2405988.NgFGazePSZ@ralph.baldwin.cx> Date: Mon, 9 Oct 2017 21:39:27 -0700 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4675B6E0-7E3E-4C86-AAB3-4DBD3D44AD94@gmail.com> References: <201710092212.v99MClEC011111@repo.freebsd.org> <2405988.NgFGazePSZ@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:39:30 -0000 --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 9, 2017, at 16:23, John Baldwin wrote: =E2=80=A6 > s/along/alone/. bde@ probably prefers that the comments start with a = capital > letter as well. Also: standalone is one word, not 2. -Ngie --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3E8AAAoJEPWDqSZpMIYVxnEQALfmuc9sR6cLlyzbNG7pgMGU MgFcPdUeJ0FY9Xg1CR47UIFgsRm9wygiknNMRSbaln4IyFxJXTXg2IKScELRQBVd VWKgOfepGtVk4h80EvjNWpOffsjzNHULkmDSr+80fgguJUGLkJDWqr69oJF9F36p 49fB8YCKM9OpOuvmDbCVUiTyTcUliBBrFAhtCz2MusN+XMIsv5wT0HiXAwt3S0Cl AiGb84omWAwqFowYg4G9MA67T3OG+EfJUAvHUq16l7j8YJ+XXi3vdR03excbdIF1 P3MBUNgb1pDwy1NC2Ttui/HzoLyYq2ty1hdyN6sWsZ4Y+VAquky/N783jXun+MvL BDlakKFYe3ehbMiKDvsmVd9c/M1e1Bjdv/7qX3JFoXrhyNQL47WgWz4ntz7GLkjA thf1r/o6S3UZISDPqx/6X3ccpF7WtWHOaDulbGGqPaqPnomOu0sNf2XfJp4xe4aS 9oduiusMFN6DzTYqm54BnwXJja2Qqx5XTxsI7ZicKP/jFwIYnc2H16vFw6pF/QBT CFpECnPRgE4bqL9RBU2eRRN4vRUL32fZRWFHovlKwd/xGkQs4Ar+Gbtxz7Wzmp6Y yvuzrERV1QNRmgPY4tGDGTj62LVP3416VC17D37uwEyPIkpch/hl5euYlXBUrmuV RXUpDdENaNMXEeRHwjjy =q4aq -----END PGP SIGNATURE----- --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7-- From owner-svn-src-all@freebsd.org Tue Oct 10 04:47:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26149E48909; Tue, 10 Oct 2017 04:47:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E755C6B3F7; Tue, 10 Oct 2017 04:47:02 +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 v9A4l2uS074453; Tue, 10 Oct 2017 04:47:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4l2Rv074452; Tue, 10 Oct 2017 04:47:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100447.v9A4l2Rv074452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324469 - head/sys/modules/iwmfw X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/modules/iwmfw X-SVN-Commit-Revision: 324469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:47:03 -0000 Author: ngie Date: Tue Oct 10 04:47:01 2017 New Revision: 324469 URL: https://svnweb.freebsd.org/changeset/base/324469 Log: Sort SUBDIR and put entries on a single list This is to aid with identifying diffs between commits. MFC after: 3 days Modified: head/sys/modules/iwmfw/Makefile Modified: head/sys/modules/iwmfw/Makefile ============================================================================== --- head/sys/modules/iwmfw/Makefile Tue Oct 10 03:40:38 2017 (r324468) +++ head/sys/modules/iwmfw/Makefile Tue Oct 10 04:47:01 2017 (r324469) @@ -1,5 +1,9 @@ # $FreeBSD$ -SUBDIR= iwm3160fw iwm7260fw iwm7265fw iwm8000Cfw iwm7265Dfw +SUBDIR= iwm3160fw \ + iwm7260fw \ + iwm7265fw \ + iwm7265Dfw \ + iwm8000Cfw .include From owner-svn-src-all@freebsd.org Tue Oct 10 04:50:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B85CE48A0C; Tue, 10 Oct 2017 04:50:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0E46B57D; Tue, 10 Oct 2017 04:50:06 +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 v9A4o514074618; Tue, 10 Oct 2017 04:50:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4o56r074617; Tue, 10 Oct 2017 04:50:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100450.v9A4o56r074617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324470 - head/sys/modules/iwmfw X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/modules/iwmfw X-SVN-Commit-Revision: 324470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:50:06 -0000 Author: ngie Date: Tue Oct 10 04:50:05 2017 New Revision: 324470 URL: https://svnweb.freebsd.org/changeset/base/324470 Log: Add missing SUBDIR needed for iwmfw to load after ^/head@r324434 Submitted by: Pete Wright MFC after: 1 month MFC with: r324434 Modified: head/sys/modules/iwmfw/Makefile Modified: head/sys/modules/iwmfw/Makefile ============================================================================== --- head/sys/modules/iwmfw/Makefile Tue Oct 10 04:47:01 2017 (r324469) +++ head/sys/modules/iwmfw/Makefile Tue Oct 10 04:50:05 2017 (r324470) @@ -4,6 +4,7 @@ SUBDIR= iwm3160fw \ iwm7260fw \ iwm7265fw \ iwm7265Dfw \ - iwm8000Cfw + iwm8000Cfw \ + iwm8265fw .include From owner-svn-src-all@freebsd.org Tue Oct 10 04:53:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59940E48BAC; Tue, 10 Oct 2017 04:53:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 240DD6B92F; Tue, 10 Oct 2017 04:53:27 +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 v9A4rQ21078537; Tue, 10 Oct 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4rQ6W078536; Tue, 10 Oct 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100453.v9A4rQ6W078536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324471 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:53:27 -0000 Author: ngie Date: Tue Oct 10 04:53:26 2017 New Revision: 324471 URL: https://svnweb.freebsd.org/changeset/base/324471 Log: Fix typos: `stand alon{e,g}` should be spelled like `standalone` Modified: head/sys/boot/Makefile.inc Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Tue Oct 10 04:50:05 2017 (r324470) +++ head/sys/boot/Makefile.inc Tue Oct 10 04:53:26 2017 (r324471) @@ -6,11 +6,11 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand -# Normal stand alone library +# Normal standalone library LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a -# stand alone library compiled for 32-bit version of the processor +# Standalone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# stand along library compiled for userboot +# Standalone library compiled for userboot LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a CFLAGS+=-I${SASRC} From owner-svn-src-all@freebsd.org Tue Oct 10 04:56:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD10E48C39 for ; Tue, 10 Oct 2017 04:56:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 182DC6BAA3 for ; Tue, 10 Oct 2017 04:56:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id 72so912561itl.5 for ; Mon, 09 Oct 2017 21:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XqVCfnnDdWOvRvMLO0QaJx0MqLy639Ze8+fthj171d8=; b=Nvtu3Hpwb6HN3bwPI+oP48SM6hKYDpOP2c30tBx7OkaMzoMSFFDn1wGvHGINb29n6G 8hmwo9UEfCXQpp54UW1YV39gLnTsi3dD6tRY2PUjj9drXO+H5rtHwwU/qTMJKoi8jjxM M4kM+VWA+rG4gieuG91talqSojZS7W+RV1vDKIUtuhepSoOiTl1Lcvd//MRZUNCsnbx9 pMPUijZxhXxoO8vpjnq3/CJG82liLFj81QZlizxOysY/4Wcv4K9/n3n6pl4LU70IoQfq ZIQ9EkQ2oxNfoGKI/ZZm29/OIDCCOXrHuP04SzPRkjNnKVmJZtAniEt56kun81BgWv/x BIcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XqVCfnnDdWOvRvMLO0QaJx0MqLy639Ze8+fthj171d8=; b=hvvokImv4aic87yDgzr51gZv60QAOIz/1cb6qY8Ja0wGrXjKeS/TnopsS4DebGFM+5 VHIZ9QVifhWu5NklP2Tn0HbzhWQYq5qBYt0fz1WCuoJ7ysXSQLXLYuWY87FDleexmoyh IPiVQA20C15NNRFj408zv9ZzGOTLDNAImyVwgtkwB47UCDMT/Td/pGMlGg1Gdh2sdKGE Y+cSkUQf4wInxmGKy5J+6uvzhrWHDvaYoj+SL1GgI5shGluEC/lj50uck0zBkX/eTmRC 3aJn+JtlUF88uxD0WQKXLDxX1fPm5Kl2XHHKk80bYiA0YHsOSdW57V8d+M+yT6cn/am9 Mung== X-Gm-Message-State: AMCzsaVW3lWuFAvRX9MZkbskFclKvD343OQXqxfck3qCnbub7w7fUJIm VEqgu9VmtHzxr2dTlWhfsafBYKsEbLDcEGoqE7R0lg== X-Google-Smtp-Source: AOwi7QBhUzAwjbZO7F7m6EkfJL1iceXBMUv/jz3XX9djK8pWB7QDMj7XZBr0j/L34YT2Y0B45Upg6xakZ0INGa1bAiM= X-Received: by 10.36.203.3 with SMTP id u3mr15347955itg.136.1507611406359; Mon, 09 Oct 2017 21:56:46 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 21:56:45 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: <201710100453.v9A4rQ6W078536@repo.freebsd.org> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 22:56:45 -0600 X-Google-Sender-Auth: KEkzSxtsquCCgiinnZHrQEWCNFU Message-ID: Subject: Re: svn commit: r324471 - head/sys/boot To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:56:47 -0000 DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. DO NOT MAKE ANY COMMITS TO sys/boot. BACK OFF. Seriously, though, extra changes create extra friction, and these changes aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a conflict when I update. So please, do not make any edits to sys/boot whatsoever, no matter how trivial. At least until I'm done. Thanks. Warner On Mon, Oct 9, 2017 at 10:53 PM, Ngie Cooper wrote: > Author: ngie > Date: Tue Oct 10 04:53:26 2017 > New Revision: 324471 > URL: https://svnweb.freebsd.org/changeset/base/324471 > > Log: > Fix typos: `stand alon{e,g}` should be spelled like `standalone` > > Modified: > head/sys/boot/Makefile.inc > > Modified: head/sys/boot/Makefile.inc > ============================================================ > ================== > --- head/sys/boot/Makefile.inc Tue Oct 10 04:50:05 2017 (r324470) > +++ head/sys/boot/Makefile.inc Tue Oct 10 04:53:26 2017 (r324471) > @@ -6,11 +6,11 @@ > __BOOT_MAKEFILE_INC__=${MFILE} > > SASRC=${SRCTOP}/lib/libstand > -# Normal stand alone library > +# Normal standalone library > LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a > -# stand alone library compiled for 32-bit version of the processor > +# Standalone library compiled for 32-bit version of the processor > LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a > -# stand along library compiled for userboot > +# Standalone library compiled for userboot > LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a > > CFLAGS+=-I${SASRC} > > From owner-svn-src-all@freebsd.org Tue Oct 10 04:57:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11675E48CA8; Tue, 10 Oct 2017 04:57:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CECC76BBEC; Tue, 10 Oct 2017 04:57:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id n14so14123970pfh.8; Mon, 09 Oct 2017 21:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Ty0y1lylmMsfvc55h2m4uoAHWlzevEwZbvzQAryHZOU=; b=ZJSs0orAMxu3Br5+RjDmcYK7xQDt/5SLnGUTumcC8mOQuW4Vl7R0h3XVxnQvPJYcYT WIzSgJRy32kLJDd7O9D+E2tbfk/JINrlzp6yK3NyWg0MGOWTEd6ie2zwrQ4UUioMwmF8 FeyNqtfwwZZlC4bAxnQpJkhmwn/h6gohM1E4aXGBzXLnEwCEJG8Jy1n3MecxjajMZ3iq aAR7Cq3+mlClI8wdkzCdX3VuDnrTDxwoEulhoeeQhFq0wTbhc0otgx+HBAOJ27Z2lC3n K48DauKT3ymVKtzWMhnTgubcwgUyDviyxbhaCDAEgQ/1Dw2rwEP3h7nb0nvukjhtIH7z mqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Ty0y1lylmMsfvc55h2m4uoAHWlzevEwZbvzQAryHZOU=; b=X/5LQMFN7P5H6HpzkiE2FFovUCr1nGfx5Z2YugWuc/ukoU/yZkkgpIdn4wL5YNL265 mNSXK9UcUKZommRlwZ9+XEXq/F6pTJ7gPSYxp7LIS8Ny+e+PE4lZKFKAW42soTT3IO6t Y/7Iz5goTs1MUAu4dAMQ2IUI15Kdhz7a6cpL+7ggCDa2NEvcy76u0tQfpHz1fcCoJl5/ R5ULLI5qJS3wW+H/JI1mG1U40zw4SLCZvi+ItacFePSQXWI156+8W1hMMkpz56MOLSv9 LAPVojlVzqNH1v9+X3ZuAllKmlpLdP/xGxUeacLF7CwsoEUqyFyJJl22QdGy+fBJFQmH SWEQ== X-Gm-Message-State: AMCzsaVznY+TBsFZEoG1wh+6Yoo2ld4rvjDEJ4SnTnMaTA0uSGwkQRwD dCMM15chPtDLgHnzhKuRVOcu/cBH X-Google-Smtp-Source: AOwi7QCxeZLODHvz7foKA3/lQa6PxizLA0NCW7cfRc2gWUGXrtcgGK5g5srNOa+ogvvWwgZ1ljIxZA== X-Received: by 10.99.136.198 with SMTP id l189mr10912497pgd.165.1507611449409; Mon, 09 Oct 2017 21:57:29 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z126sm18190632pfz.70.2017.10.09.21.57.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:57:28 -0700 (PDT) Subject: Re: svn commit: r324471 - head/sys/boot Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 9 Oct 2017 21:57:27 -0700 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:57:30 -0000 --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 9, 2017, at 21:56, Warner Losh wrote: >=20 > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >=20 > DO NOT MAKE ANY COMMITS TO sys/boot. >=20 > BACK OFF. >=20 > Seriously, though, extra changes create extra friction, and these = changes aren't worth any friction at all. I'm deleting LIBSAU and this = guarantees a conflict when I update. >=20 > So please, do not make any edits to sys/boot whatsoever, no matter how = trivial. >=20 > At least until I'm done. Ok --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3FM3AAoJEPWDqSZpMIYVf3kP/Rv80h4YoUvKQw1qnL6wYYI9 88QHhRreSMDfImEBoZCbzfKWWpqKdRN7Pu54XVCJy9NghmR/oMl452qhzxQxssbP eQXcFaZlReCY9tckyWvL3mt550C0OiHBQHZQeMEqlG4nfEmbcQCsih9aoY0WlejO DrbPeZs6jeERDwql0T2KtjOeSiemcU6oFdwX2ayv5CdFpYzD8sc0JCNEo+fmZb5t UV/7SeJ8MJIhNV0KKQ62IIsaexbXMRtPNJkRy3FnyX6NaBqaeYLP3wOnJpM/27wE 5R9tDS0m6EzyZmr0Ignp9JKqLftlcCpb7iRM/LEtGq7SuxCBnccxNVj3P4QUOa6x 8aRd2LWzPd7HBGzFgMP6/aCULZs25CPf7uW8FUeguVfCudE9LwFd8/6cS1r/EkLm VE+Rcg8WzN2gXwBKvMe/uUFRwlM3+1n1KJtvKYNi6gH2yUfNX4tv7e836TnCbq6r OMhVr9LZoYe8tQypQgPonhnEz44jaZB++Ue6NftdfU+EOZH+mygB6Q3xsa/v5QCO RiAjhkSmSO1DJOhKNjiZ8FGcvhx+0GSDFfvKCQuvisbzz+HHY2qtDxeXwSLPw0iS mdrQa/h+4iDZgjUQ9FP+WVgjAhVSMfxtGMAFLPStuS2yz5mnwro1GMSDnDgmsE8u e3yoUe8/3iqKwPaBoyBZ =Hdq/ -----END PGP SIGNATURE----- --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED-- From owner-svn-src-all@freebsd.org Tue Oct 10 05:25:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54F9EE248B7; Tue, 10 Oct 2017 05:25:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30AE36C978; Tue, 10 Oct 2017 05:25:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5PkER091266; Tue, 10 Oct 2017 05:25:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5Pk0d091263; Tue, 10 Oct 2017 05:25:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100525.v9A5Pk0d091263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 05:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324472 - in stable/11/sys: net sys X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/11/sys: net sys X-SVN-Commit-Revision: 324472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:25:47 -0000 Author: sephe Date: Tue Oct 10 05:25:46 2017 New Revision: 324472 URL: https://svnweb.freebsd.org/changeset/base/324472 Log: MFC 323170 if: Add ioctls to get RSS key and hash type/function. It will be needed by hn(4) to configure its RSS key and hash type/function in the transparent VF mode in order to match VF's RSS settings. The description of the transparent VF mode and the RSS hash value issue are here: https://svnweb.freebsd.org/base?view=revision&revision=322299 https://svnweb.freebsd.org/base?view=revision&revision=322485 These are generic enough to promise two independent IOCs instead of abusing SIOCGDRVSPEC. Setting RSS key and hash type/function is a different story, which probably requires more discussion. Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch in the review request; these hash types are standardized now. Reviewed by: gallatin Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12174 Modified: stable/11/sys/net/if.c stable/11/sys/net/if.h stable/11/sys/sys/sockio.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Tue Oct 10 04:53:26 2017 (r324471) +++ stable/11/sys/net/if.c Tue Oct 10 05:25:46 2017 (r324472) @@ -2661,6 +2661,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, case SIOCGIFMEDIA: case SIOCGIFXMEDIA: case SIOCGIFGENERIC: + case SIOCGIFRSSKEY: + case SIOCGIFRSSHASH: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Tue Oct 10 04:53:26 2017 (r324471) +++ stable/11/sys/net/if.h Tue Oct 10 05:25:46 2017 (r324472) @@ -525,6 +525,42 @@ struct ifi2creq { uint8_t data[8]; /* read buffer */ }; +/* + * RSS hash. + */ + +#define RSS_FUNC_NONE 0 /* RSS disabled */ +#define RSS_FUNC_PRIVATE 1 /* non-standard */ +#define RSS_FUNC_TOEPLITZ 2 + +#define RSS_TYPE_IPV4 0x00000001 +#define RSS_TYPE_TCP_IPV4 0x00000002 +#define RSS_TYPE_IPV6 0x00000004 +#define RSS_TYPE_IPV6_EX 0x00000008 +#define RSS_TYPE_TCP_IPV6 0x00000010 +#define RSS_TYPE_TCP_IPV6_EX 0x00000020 +#define RSS_TYPE_UDP_IPV4 0x00000040 +#define RSS_TYPE_UDP_IPV6 0x00000080 +#define RSS_TYPE_UDP_IPV6_EX 0x00000100 + +#define RSS_KEYLEN 128 + +struct ifrsskey { + char ifrk_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrk_func; /* RSS_FUNC_ */ + uint8_t ifrk_spare0; + uint16_t ifrk_keylen; + uint8_t ifrk_key[RSS_KEYLEN]; +}; + +struct ifrsshash { + char ifrh_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrh_func; /* RSS_FUNC_ */ + uint8_t ifrh_spare0; + uint16_t ifrh_spare1; + uint32_t ifrh_types; /* RSS_TYPE_ */ +}; + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL Modified: stable/11/sys/sys/sockio.h ============================================================================== --- stable/11/sys/sys/sockio.h Tue Oct 10 04:53:26 2017 (r324471) +++ stable/11/sys/sys/sockio.h Tue Oct 10 05:25:46 2017 (r324472) @@ -134,4 +134,8 @@ #define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */ #define SIOCGIFXMEDIA _IOWR('i', 139, struct ifmediareq) /* get net xmedia */ +#define SIOCGIFRSSKEY _IOWR('i', 150, struct ifrsskey)/* get RSS key */ +#define SIOCGIFRSSHASH _IOWR('i', 151, struct ifrsshash)/* get the current RSS + type/func settings */ + #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-all@freebsd.org Tue Oct 10 05:30:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15065E249D4; Tue, 10 Oct 2017 05:30:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E010B6CC4A; Tue, 10 Oct 2017 05:30:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5UnqT091514; Tue, 10 Oct 2017 05:30:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5UnBr091513; Tue, 10 Oct 2017 05:30:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100530.v9A5UnBr091513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 05:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324473 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:30:51 -0000 Author: sephe Date: Tue Oct 10 05:30:49 2017 New Revision: 324473 URL: https://svnweb.freebsd.org/changeset/base/324473 Log: MFC 323175 hyperv/hn: Implement SIOCGIFRSS{KEY,HASH}. The conditional compiling in the review request is removed, since these IOCTLs will be available in stable/10 and stable/11. Reviewed by: gallatin Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12175 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:25:46 2017 (r324472) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:30:49 2017 (r324473) @@ -3316,6 +3316,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr = (struct ifreq *)data, ifr_vf; struct ifnet *vf_ifp; int mask, error = 0; + struct ifrsskey *ifrk; + struct ifrsshash *ifrh; switch (cmd) { case SIOCSIFMTU: @@ -3571,6 +3573,56 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } HN_UNLOCK(sc); error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); + break; + + case SIOCGIFRSSHASH: + ifrh = (struct ifrsshash *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrh->ifrh_func = RSS_FUNC_NONE; + ifrh->ifrh_types = 0; + break; + } + + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; + else + ifrh->ifrh_func = RSS_FUNC_PRIVATE; + + ifrh->ifrh_types = 0; + if (sc->hn_rss_hash & NDIS_HASH_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + HN_UNLOCK(sc); + break; + + case SIOCGIFRSSKEY: + ifrk = (struct ifrsskey *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrk->ifrk_func = RSS_FUNC_NONE; + ifrk->ifrk_keylen = 0; + break; + } + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; + else + ifrk->ifrk_func = RSS_FUNC_PRIVATE; + ifrk->ifrk_keylen = NDIS_HASH_KEYSIZE_TOEPLITZ; + memcpy(ifrk->ifrk_key, sc->hn_rss.rss_key, + NDIS_HASH_KEYSIZE_TOEPLITZ); + HN_UNLOCK(sc); break; default: From owner-svn-src-all@freebsd.org Tue Oct 10 05:38:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F370CE24C74; Tue, 10 Oct 2017 05:38:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1E876CEF4; Tue, 10 Oct 2017 05:38:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5c8CC095419; Tue, 10 Oct 2017 05:38:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5c8c2095418; Tue, 10 Oct 2017 05:38:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100538.v9A5c8c2095418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 05:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324474 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:38:09 -0000 Author: sephe Date: Tue Oct 10 05:38:07 2017 New Revision: 324474 URL: https://svnweb.freebsd.org/changeset/base/324474 Log: MFC 323176 hyperv/hn: Log RSS capabilities mask. This helps to detect when UDP hash types can be supported. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12177 Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:30:49 2017 (r324473) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:38:07 2017 (r324474) @@ -497,6 +497,8 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c caps.ndis_caps); return (EOPNOTSUPP); } + if (bootverbose) + if_printf(sc->hn_ifp, "RSS caps %#x\n", caps.ndis_caps); /* Commit! */ sc->hn_rss_ind_size = indsz; From owner-svn-src-all@freebsd.org Tue Oct 10 05:46:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC68AE24F0E; Tue, 10 Oct 2017 05:46:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAAF26D30D; Tue, 10 Oct 2017 05:46:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5kwnZ099680; Tue, 10 Oct 2017 05:46:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5kvcN099676; Tue, 10 Oct 2017 05:46:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100546.v9A5kvcN099676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 05:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324475 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:46:59 -0000 Author: sephe Date: Tue Oct 10 05:46:57 2017 New Revision: 324475 URL: https://svnweb.freebsd.org/changeset/base/324475 Log: MFC 323727,324316 323727 hyperv/hn: Apply VF's RSS setting Since in Azure SYN and SYN|ACK go through the synthetic parts while the rest of the same TCP flow goes through the VF, apply VF's RSS settings to synthetic parts to have a consistent hash value/type for the same TCP flow. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12333 324316 hyperv/hn: Fix options RSS building Reported by: np Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h stable/11/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:38:07 2017 (r324474) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:46:57 2017 (r324475) @@ -502,7 +502,7 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; - sc->hn_rss_hash = hash_func | hash_types; + sc->hn_rss_hcap = hash_func | hash_types; *rxr_cnt0 = rxr_cnt; return (0); } Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:38:07 2017 (r324474) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:46:57 2017 (r324475) @@ -284,6 +284,8 @@ static void hn_xpnt_vf_init_taskfunc(void *, int); static void hn_xpnt_vf_init(struct hn_softc *); static void hn_xpnt_vf_setenable(struct hn_softc *); static void hn_xpnt_vf_setdisable(struct hn_softc *, bool); +static void hn_vf_rss_fixup(struct hn_softc *, bool); +static void hn_vf_rss_restore(struct hn_softc *); static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); @@ -327,6 +329,8 @@ static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); @@ -382,12 +386,13 @@ static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); -#ifndef RSS static int hn_rss_reconfig(struct hn_softc *); -#endif static void hn_rss_ind_fixup(struct hn_softc *); +static void hn_rss_mbuf_hash(struct hn_softc *, uint32_t); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); +static uint32_t hn_rss_type_fromndis(uint32_t); +static uint32_t hn_rss_type_tondis(uint32_t); static int hn_tx_ring_create(struct hn_softc *, int); static void hn_tx_ring_destroy(struct hn_tx_ring *); @@ -953,7 +958,6 @@ hn_get_txswq_depth(const struct hn_tx_ring *txr) return hn_tx_swq_depth; } -#ifndef RSS static int hn_rss_reconfig(struct hn_softc *sc) { @@ -992,7 +996,6 @@ hn_rss_reconfig(struct hn_softc *sc) } return (0); } -#endif /* !RSS */ static void hn_rss_ind_fixup(struct hn_softc *sc) @@ -1134,11 +1137,13 @@ hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, hn_rxvf_set(sc, rxvf ? ifp : NULL); if (rxvf) { + hn_vf_rss_fixup(sc, true); hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { + hn_vf_rss_restore(sc); hn_resume_mgmt(sc); } @@ -1335,7 +1340,249 @@ hn_mtu_change_fixup(struct hn_softc *sc) #endif } +static uint32_t +hn_rss_type_fromndis(uint32_t rss_hash) +{ + uint32_t types = 0; + + if (rss_hash & NDIS_HASH_IPV4) + types |= RSS_TYPE_IPV4; + if (rss_hash & NDIS_HASH_TCP_IPV4) + types |= RSS_TYPE_TCP_IPV4; + if (rss_hash & NDIS_HASH_IPV6) + types |= RSS_TYPE_IPV6; + if (rss_hash & NDIS_HASH_IPV6_EX) + types |= RSS_TYPE_IPV6_EX; + if (rss_hash & NDIS_HASH_TCP_IPV6) + types |= RSS_TYPE_TCP_IPV6; + if (rss_hash & NDIS_HASH_TCP_IPV6_EX) + types |= RSS_TYPE_TCP_IPV6_EX; + return (types); +} + +static uint32_t +hn_rss_type_tondis(uint32_t types) +{ + uint32_t rss_hash = 0; + + KASSERT((types & + (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP4, UDP6 and UDP6EX are not supported")); + + if (types & RSS_TYPE_IPV4) + rss_hash |= NDIS_HASH_IPV4; + if (types & RSS_TYPE_TCP_IPV4) + rss_hash |= NDIS_HASH_TCP_IPV4; + if (types & RSS_TYPE_IPV6) + rss_hash |= NDIS_HASH_IPV6; + if (types & RSS_TYPE_IPV6_EX) + rss_hash |= NDIS_HASH_IPV6_EX; + if (types & RSS_TYPE_TCP_IPV6) + rss_hash |= NDIS_HASH_TCP_IPV6; + if (types & RSS_TYPE_TCP_IPV6_EX) + rss_hash |= NDIS_HASH_TCP_IPV6_EX; + return (rss_hash); +} + static void +hn_rss_mbuf_hash(struct hn_softc *sc, uint32_t mbuf_hash) +{ + int i; + + HN_LOCK_ASSERT(sc); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_mbuf_hash = mbuf_hash; +} + +static void +hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) +{ + struct ifnet *ifp, *vf_ifp; + struct ifrsshash ifrh; + struct ifrsskey ifrk; + int error; + uint32_t my_types, diff_types, mbuf_types = 0; + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) { + /* No RSS on synthetic parts; done. */ + return; + } + if ((sc->hn_rss_hcap & NDIS_HASH_FUNCTION_TOEPLITZ) == 0) { + /* Synthetic parts do not support Toeplitz; done. */ + return; + } + + ifp = sc->hn_ifp; + vf_ifp = sc->hn_vf_ifp; + + /* + * Extract VF's RSS key. Only 40 bytes key for Toeplitz is + * supported. + */ + memset(&ifrk, 0, sizeof(ifrk)); + strlcpy(ifrk.ifrk_name, vf_ifp->if_xname, sizeof(ifrk.ifrk_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSKEY, (caddr_t)&ifrk); + if (error) { + if_printf(ifp, "%s SIOCGRSSKEY failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrk.ifrk_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrk.ifrk_func); + goto done; + } + if (ifrk.ifrk_keylen != NDIS_HASH_KEYSIZE_TOEPLITZ) { + if_printf(ifp, "%s invalid RSS Toeplitz key length %d\n", + vf_ifp->if_xname, ifrk.ifrk_keylen); + goto done; + } + + /* + * Extract VF's RSS hash. Only Toeplitz is supported. + */ + memset(&ifrh, 0, sizeof(ifrh)); + strlcpy(ifrh.ifrh_name, vf_ifp->if_xname, sizeof(ifrh.ifrh_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSHASH, (caddr_t)&ifrh); + if (error) { + if_printf(ifp, "%s SIOCGRSSHASH failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrh.ifrh_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrh.ifrh_func); + goto done; + } + + my_types = hn_rss_type_fromndis(sc->hn_rss_hcap); + if ((ifrh.ifrh_types & my_types) == 0) { + /* This disables RSS; ignore it then */ + if_printf(ifp, "%s intersection of RSS types failed. " + "VF %#x, mine %#x\n", vf_ifp->if_xname, + ifrh.ifrh_types, my_types); + goto done; + } + + diff_types = my_types ^ ifrh.ifrh_types; + my_types &= ifrh.ifrh_types; + mbuf_types = my_types; + + /* + * Detect RSS hash value/type confliction. + * + * NOTE: + * We don't disable the hash type, but stop delivery the hash + * value/type through mbufs on RX path. + */ + if ((my_types & RSS_TYPE_IPV4) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV4 | RSS_TYPE_UDP_IPV4))) { + /* Conflict; disable IPV4 hash type/value delivery. */ + if_printf(ifp, "disable IPV4 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV4; + } + if ((my_types & RSS_TYPE_IPV6) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6_EX))) { + /* Conflict; disable IPV6 hash type/value delivery. */ + if_printf(ifp, "disable IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6; + } + if ((my_types & RSS_TYPE_IPV6_EX) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6))) { + /* Conflict; disable IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6_EX; + } + if ((my_types & RSS_TYPE_TCP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6_EX)) { + /* Conflict; disable TCP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6; + } + if ((my_types & RSS_TYPE_TCP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6)) { + /* Conflict; disable TCP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6_EX; + } + if ((my_types & RSS_TYPE_UDP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6_EX)) { + /* Conflict; disable UDP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6; + } + if ((my_types & RSS_TYPE_UDP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6)) { + /* Conflict; disable UDP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6_EX; + } + + /* + * Indirect table does not matter. + */ + + sc->hn_rss_hash = (sc->hn_rss_hcap & NDIS_HASH_FUNCTION_MASK) | + hn_rss_type_tondis(my_types); + memcpy(sc->hn_rss.rss_key, ifrk.ifrk_key, sizeof(sc->hn_rss.rss_key)); + sc->hn_flags |= HN_FLAG_HAS_RSSKEY; + + if (reconf) { + error = hn_rss_reconfig(sc); + if (error) { + /* XXX roll-back? */ + if_printf(ifp, "hn_rss_reconfig failed: %d\n", error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, hn_rss_type_tondis(mbuf_types)); +} + +static void +hn_vf_rss_restore(struct hn_softc *sc) +{ + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) + goto done; + + /* + * Restore hash types. Key does _not_ matter. + */ + if (sc->hn_rss_hash != sc->hn_rss_hcap) { + int error; + + sc->hn_rss_hash = sc->hn_rss_hcap; + error = hn_rss_reconfig(sc); + if (error) { + if_printf(sc->hn_ifp, "hn_rss_reconfig failed: %d\n", + error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, NDIS_HASH_ALL); +} + +static void hn_xpnt_vf_setready(struct hn_softc *sc) { struct ifnet *ifp, *vf_ifp; @@ -1501,6 +1748,13 @@ hn_xpnt_vf_init(struct hn_softc *sc) */ hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_VF); + /* + * NOTE: + * Fixup RSS related bits _after_ the VF is brought up, since + * many VFs generate RSS key during it's initialization. + */ + hn_vf_rss_fixup(sc, true); + /* Mark transparent mode VF as enabled. */ hn_xpnt_vf_setenable(sc); } @@ -1659,7 +1913,8 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) ifp->if_input = sc->hn_vf_input; sc->hn_vf_input = NULL; - if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED) + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) && + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_SYNTH); if (sc->hn_vf_rdytick == 0) { @@ -1681,11 +1936,18 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) sc->hn_ifp->if_hw_tsomaxsegsize = sc->hn_saved_tsosegsz; } - /* - * Resume link status management, which was suspended - * by hn_ifnet_attevent(). - */ - hn_resume_mgmt(sc); + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + /* + * Restore RSS settings. + */ + hn_vf_rss_restore(sc); + + /* + * Resume link status management, which was suspended + * by hn_ifnet_attevent(). + */ + hn_resume_mgmt(sc); + } } /* Mark transparent mode VF as disabled. */ @@ -1935,6 +2197,12 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hash", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_rss_hash_sysctl, "A", "RSS hash"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hashcap", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_hcap_sysctl, "A", "RSS hash capabilities"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "mbuf_hash", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_mbuf_sysctl, "A", "RSS hash for mbufs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rss_ind_size", CTLFLAG_RD, &sc->hn_rss_ind_size, 0, "RSS indirect entry count"); #ifndef RSS @@ -3026,14 +3294,21 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int { struct ifnet *ifp, *hn_ifp = rxr->hn_ifp; struct mbuf *m_new; - int size, do_lro = 0, do_csum = 1; - int hash_type; + int size, do_lro = 0, do_csum = 1, is_vf = 0; + int hash_type = M_HASHTYPE_NONE; - /* - * If the non-transparent mode VF is active, inject this packet - * into the VF. - */ - ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : hn_ifp; + ifp = hn_ifp; + if (rxr->hn_rxvf_ifp != NULL) { + /* + * Non-transparent mode VF; pretend this packet is from + * the VF. + */ + ifp = rxr->hn_rxvf_ifp; + is_vf = 1; + } else if (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF) { + /* Transparent mode VF. */ + is_vf = 1; + } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3186,16 +3461,6 @@ skip: * If VF is activated (tranparent/non-transparent mode does not * matter here). * - * - Don't setup mbuf hash, if 'options RSS' is set. - * - * In Azure, when VF is activated, TCP SYN and SYN|ACK go - * through hn(4) while the rest of segments and ACKs belonging - * to the same TCP 4-tuple go through the VF. So don't setup - * mbuf hash, if a VF is activated and 'options RSS' is not - * enabled. hn(4) and the VF may use neither the same RSS - * hash key nor the same RSS hash function, so the hash value - * for packets belonging to the same flow could be different! - * * - Disable LRO * * hn(4) will only receive broadcast packets, multicast packets, @@ -3206,20 +3471,23 @@ skip: * all, since the LRO flush will use hn(4) as the receiving * interface; i.e. hn_ifp->if_input(hn_ifp, m). */ - if (hn_ifp != ifp || (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF)) { - do_lro = 0; /* disable LRO. */ -#ifndef RSS - goto skip_hash; /* skip mbuf hash setup */ -#endif - } + if (is_vf) + do_lro = 0; + /* + * If VF is activated (tranparent/non-transparent mode does not + * matter here), do _not_ mess with unsupported hash types or + * functions. + */ if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) { rxr->hn_rss_pkts++; m_new->m_pkthdr.flowid = info->hash_value; - hash_type = M_HASHTYPE_OPAQUE_HASH; + if (!is_vf) + hash_type = M_HASHTYPE_OPAQUE_HASH; if ((info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { - uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK); + uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK & + rxr->hn_mbuf_hash); /* * NOTE: @@ -3256,15 +3524,12 @@ skip: break; } } - } else { + } else if (!is_vf) { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; hash_type = M_HASHTYPE_OPAQUE; } M_HASHTYPE_SET(m_new, hash_type); -#ifndef RSS -skip_hash: -#endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (hn_ifp != ifp) { const struct ether_header *eh; @@ -3589,20 +3854,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; else ifrh->ifrh_func = RSS_FUNC_PRIVATE; - - ifrh->ifrh_types = 0; - if (sc->hn_rss_hash & NDIS_HASH_IPV4) - ifrh->ifrh_types |= RSS_TYPE_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_IPV6) - ifrh->ifrh_types |= RSS_TYPE_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + ifrh->ifrh_types = hn_rss_type_fromndis(sc->hn_rss_hash); HN_UNLOCK(sc); break; @@ -4154,6 +4406,16 @@ hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS) if (error || req->newptr == NULL) goto back; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (hn_xpnt_vf && sc->hn_vf_ifp != NULL)) { + /* + * RSS key is synchronized w/ VF's, don't allow users + * to change it. + */ + error = EBUSY; + goto back; + } + error = SYSCTL_IN(req, sc->hn_rss.rss_key, sizeof(sc->hn_rss.rss_key)); if (error) goto back; @@ -4220,6 +4482,34 @@ hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rss_hcap; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int +hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rx_ring[0].hn_mbuf_hash; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; @@ -4519,6 +4809,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + rxr->hn_mbuf_hash = NDIS_HASH_ALL; rxr->hn_ifp = sc->hn_ifp; if (i < sc->hn_tx_ring_cnt) rxr->hn_txr = &sc->hn_tx_ring[i]; @@ -5980,6 +6271,7 @@ hn_synth_attach(struct hn_softc *sc, int mtu) /* Clear RSS stuffs. */ sc->hn_rss_ind_size = 0; sc->hn_rss_hash = 0; + sc->hn_rss_hcap = 0; /* * Attach the primary channel _before_ attaching NVS and RNDIS. @@ -6098,6 +6390,12 @@ hn_synth_attach(struct hn_softc *sc, int mtu) hn_rss_ind_fixup(sc); } + sc->hn_rss_hash = sc->hn_rss_hcap; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) { + /* NOTE: Don't reconfigure RSS; will do immediately. */ + hn_vf_rss_fixup(sc, false); + } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); if (error) goto failed; Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 05:38:07 2017 (r324474) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 05:46:57 2017 (r324475) @@ -64,6 +64,7 @@ struct hn_rx_ring { void *hn_pktbuf; int hn_pktbuf_len; int hn_rx_flags; /* HN_RX_FLAG_ */ + uint32_t hn_mbuf_hash; /* NDIS_HASH_ */ uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; @@ -238,7 +239,8 @@ struct hn_softc { uint32_t hn_rndis_agg_align; int hn_rss_ind_size; - uint32_t hn_rss_hash; /* NDIS_HASH_ */ + uint32_t hn_rss_hash; /* setting, NDIS_HASH_ */ + uint32_t hn_rss_hcap; /* caps, NDIS_HASH_ */ struct ndis_rssprm_toeplitz hn_rss; eventhandler_tag hn_ifaddr_evthand; Modified: stable/11/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 05:38:07 2017 (r324474) +++ stable/11/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 05:46:57 2017 (r324475) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,13 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ From owner-svn-src-all@freebsd.org Tue Oct 10 05:47:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C418BE24F59; Tue, 10 Oct 2017 05:47:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D20E6D3B7; Tue, 10 Oct 2017 05:47:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5lAxe099745; Tue, 10 Oct 2017 05:47:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5lA0L099744; Tue, 10 Oct 2017 05:47:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710100547.v9A5lA0L099744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 10 Oct 2017 05:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324476 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:47:11 -0000 Author: eadler Date: Tue Oct 10 05:47:10 2017 New Revision: 324476 URL: https://svnweb.freebsd.org/changeset/base/324476 Log: Add OpenBSD 6.2, reorder macOS 10.13 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 10 05:46:57 2017 (r324475) +++ head/share/misc/bsd-family-tree Tue Oct 10 05:47:10 2017 (r324476) @@ -351,12 +351,12 @@ FreeBSD 5.2 | | | *--FreeBSD | macOS | OpenBSD 6.0 | | 11.0 | 10.12 | | | | | | | NetBSD 7.1 | | - | | | | | | DragonFly 4.8.0 - | | | | | OpenBSD 6.1 | + | | | macOS | | DragonFly 4.8.0 + | | | 10.13 | OpenBSD 6.1 | | FreeBSD | | | | | | 11.1 FreeBSD | | | | - | | 10.4 macOS | | | - | v 10.13 | | | + | | 10.4 | | OpenBSD 6.2 | + | v | | | | | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -719,6 +719,7 @@ OpenBSD 6.1 2017-04-11 [OBD] FreeBSD 11.1 2017-07-26 [FBD] macOS 10.13 2017-09-25 [APL] FreeBSD 10.4 2017-10-03 [FBD] +OpenBSD 6.2 2017-10-09 [OBD] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Tue Oct 10 05:52:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4009CE251AA; Tue, 10 Oct 2017 05:52:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B7836D829; Tue, 10 Oct 2017 05:52:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5qTZ4003689; Tue, 10 Oct 2017 05:52:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5qSuj003684; Tue, 10 Oct 2017 05:52:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100552.v9A5qSuj003684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 05:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324477 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:52:30 -0000 Author: sephe Date: Tue Oct 10 05:52:28 2017 New Revision: 324477 URL: https://svnweb.freebsd.org/changeset/base/324477 Log: MFC 323728,323729 323728 hyperv/hn: Fix MTU setting - Add size of an ethernet header to the value configured to NVS. This does not seem to have any effects if MTU is 1500, but fix hypervisor side's setting if MTU > 1500. - Override the MTU setting according to the view from the hypervisor side. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12352 323729 hyperv/hn: Incease max supported MTU Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12365 Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c stable/11/sys/dev/hyperv/netvsc/hn_rndis.c stable/11/sys/dev/hyperv/netvsc/hn_rndis.h stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 05:47:10 2017 (r324476) +++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 05:52:28 2017 (r324477) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -503,7 +504,7 @@ hn_nvs_conf_ndis(struct hn_softc *sc, int mtu) memset(&conf, 0, sizeof(conf)); conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; - conf.nvs_mtu = mtu; + conf.nvs_mtu = mtu + ETHER_HDR_LEN; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:47:10 2017 (r324476) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Tue Oct 10 05:52:28 2017 (r324477) @@ -188,6 +188,24 @@ hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t return (0); } +int +hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu) +{ + size_t size; + int error; + + size = sizeof(*mtu); + error = hn_rndis_query(sc, OID_GEN_MAXIMUM_FRAME_SIZE, NULL, 0, + mtu, &size); + if (error) + return (error); + if (size != sizeof(uint32_t)) { + if_printf(sc->hn_ifp, "invalid mtu len %zu\n", size); + return (EINVAL); + } + return (0); +} + static const void * hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, struct hn_nvs_sendctx *sndc, size_t *comp_len) Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 05:47:10 2017 (r324476) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.h Tue Oct 10 05:52:28 2017 (r324477) @@ -41,6 +41,7 @@ int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t * /* link_status: NDIS_MEDIA_STATE_ */ int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); +int hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu); /* filter: NDIS_PACKET_TYPE_. */ int hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter); void hn_rndis_rx_ctrl(struct hn_softc *sc, const void *data, Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:47:10 2017 (r324476) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:52:28 2017 (r324477) @@ -1999,6 +1999,7 @@ hn_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; + uint32_t mtu; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -2155,6 +2156,12 @@ hn_attach(device_t dev) if (error) goto failed; + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ETHERMTU; + else if (bootverbose) + device_printf(dev, "RNDIS mtu %u\n", mtu); + #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* @@ -2339,6 +2346,10 @@ hn_attach(device_t dev) if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } + if (mtu < ETHERMTU) { + if_printf(ifp, "fixup mtu %u -> %u\n", ifp->if_mtu, mtu); + ifp->if_mtu = mtu; + } /* Inform the upper layer about the long frame support. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); @@ -3583,6 +3594,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) int mask, error = 0; struct ifrsskey *ifrk; struct ifrsshash *ifrh; + uint32_t mtu; switch (cmd) { case SIOCSIFMTU: @@ -3646,11 +3658,23 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ifr->ifr_mtu; + else if (bootverbose) + if_printf(ifp, "RNDIS mtu %u\n", mtu); + /* * Commit the requested MTU, after the synthetic parts * have been successfully attached. */ - ifp->if_mtu = ifr->ifr_mtu; + if (mtu >= ifr->ifr_mtu) { + mtu = ifr->ifr_mtu; + } else { + if_printf(ifp, "fixup mtu %d -> %u\n", + ifr->ifr_mtu, mtu); + } + ifp->if_mtu = mtu; /* * Synthetic parts' reattach may change the chimney Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 05:47:10 2017 (r324476) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 05:52:28 2017 (r324477) @@ -36,8 +36,7 @@ #define HN_RXBUF_SIZE (16 * 1024 * 1024) #define HN_RXBUF_SIZE_COMPAT (15 * 1024 * 1024) -/* Claimed to be 12232B */ -#define HN_MTU_MAX (9 * 1024) +#define HN_MTU_MAX (65535 - ETHER_ADDR_LEN) #define HN_TXBR_SIZE (128 * PAGE_SIZE) #define HN_RXBR_SIZE (128 * PAGE_SIZE) From owner-svn-src-all@freebsd.org Tue Oct 10 05:58:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8E2E25340; Tue, 10 Oct 2017 05:58:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 985486DA88; Tue, 10 Oct 2017 05:58:34 +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 v9A5wXHV003971; Tue, 10 Oct 2017 05:58:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5wXkR003969; Tue, 10 Oct 2017 05:58:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100558.v9A5wXkR003969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 05:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324478 - in head: sbin/growfs/tests tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: sbin/growfs/tests tests/sys/geom/class/eli X-SVN-Commit-Revision: 324478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:58:34 -0000 Author: ngie Date: Tue Oct 10 05:58:33 2017 New Revision: 324478 URL: https://svnweb.freebsd.org/changeset/base/324478 Log: Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output ^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e., ensure that the exit code is either 0 or 7. The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made the issue apparent -- thus this needs to be fixed independent of ^/head@r323923. PR: 222780 MFC after: 1 week MFC with: r323923 Reported by: Jenkins Modified: head/sbin/growfs/tests/legacy_test.pl head/tests/sys/geom/class/eli/resize_test.sh Modified: head/sbin/growfs/tests/legacy_test.pl ============================================================================== --- head/sbin/growfs/tests/legacy_test.pl Tue Oct 10 05:52:28 2017 (r324477) +++ head/sbin/growfs/tests/legacy_test.pl Tue Oct 10 05:58:33 2017 (r324478) @@ -2,6 +2,7 @@ use strict; use warnings; +use POSIX; use Test::More tests => 19; use Fcntl qw(:DEFAULT :seek); @@ -11,6 +12,22 @@ use constant BLKS_PER_MB => 2048; my $unit; END { system "mdconfig -du$unit" if defined $unit }; +sub fsck_md { + my ($is_clean, $md); + + $md = shift; + + chomp(my @fsck_output = `fsck_ffs -Ffy ${md}a`); + $is_clean = WIFEXITED($?) && + (WEXITSTATUS($?) == 0 || WEXITSTATUS($?) == 7); + ok($is_clean, "checking ${md}a's filesystem"); + if ($is_clean) { + diag "filesystem reported clean"; + } else { + diag "filesystem not reported clean: " . join("\n", @fsck_output); + } +} + sub setsize { my ($partszMB, $unitszMB) = @_; @@ -46,9 +63,8 @@ SKIP: { ok(setsize(10, 40), "Sized ${md}a to 10m"); system "newfs -O $type -U ${md}a >/dev/null"; is($?, 0, "Initialised the filesystem on ${md}a as UFS$type"); - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + + fsck_md($md); } extend20_zeroed: { @@ -62,9 +78,7 @@ SKIP: { fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) if $unallocated; - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + fsck_md($md); } extend30_garbaged: { @@ -78,9 +92,7 @@ SKIP: { fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) if $unallocated; - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + fsck_md($md); } } Modified: head/tests/sys/geom/class/eli/resize_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/resize_test.sh Tue Oct 10 05:52:28 2017 (r324477) +++ head/tests/sys/geom/class/eli/resize_test.sh Tue Oct 10 05:58:33 2017 (r324478) @@ -12,6 +12,19 @@ md=$(mdconfig -s40m) || exit 1 unit=${md#md} i=1 +fsck_md() +{ + local is_clean + + out=$(fsck_ffs -Ffy ${md}a.eli) + if [ $? -eq 0 -o $? -eq 7 ]; then + echo "ok $i - fsck says ${md}a.eli is clean" + else + echo "not ok $i - fsck says ${md}a.eli is dirty" + fi + i=$((i + 1)) +} + setsize() { partszMB=$1 unitszMB=$2 @@ -38,13 +51,8 @@ i=$((i + 1)) newfs -U ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Initialised the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md - # Doing a backup, resize & restore must be forced (with -f) as geli # verifies that the provider size in the metadata matches the consumer. @@ -78,13 +86,8 @@ growfs -y ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Extended the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md - # Now do the resize properly geli detach ${md}a.eli || echo -n "not " @@ -110,11 +113,7 @@ growfs -y ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Extended the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md geli detach ${md}a.eli gpart destroy -F $md >/dev/null From owner-svn-src-all@freebsd.org Tue Oct 10 06:03:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A549E2559D; Tue, 10 Oct 2017 06:03:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4F36DE6A; Tue, 10 Oct 2017 06:03:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A63Nmd008014; Tue, 10 Oct 2017 06:03:23 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A63NN8008012; Tue, 10 Oct 2017 06:03:23 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100603.v9A63NN8008012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 06:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324479 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 06:03:24 -0000 Author: sephe Date: Tue Oct 10 06:03:23 2017 New Revision: 324479 URL: https://svnweb.freebsd.org/changeset/base/324479 Log: MFC 324048 hyperv/hn: Set tcp header offset for CSUM/LSO offloading. No observable effect; better safe than sorry. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12417 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 05:58:33 2017 (r324478) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 06:03:23 2017 (r324479) @@ -725,6 +725,7 @@ hn_tso_fixup(struct mbuf *m_head) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { @@ -734,6 +735,7 @@ hn_tso_fixup(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; + m_head->m_pkthdr.l3hlen = iphlen; PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); th = mtodo(m_head, ehlen + iphlen); @@ -757,6 +759,7 @@ hn_tso_fixup(struct mbuf *m_head) m_freem(m_head); return (NULL); } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); th = mtodo(m_head, ehlen + sizeof(*ip6)); @@ -766,41 +769,34 @@ hn_tso_fixup(struct mbuf *m_head) } #endif return (m_head); - } /* * NOTE: If this function failed, the m_head would be freed. */ static __inline struct mbuf * -hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +hn_set_hlen(struct mbuf *m_head) { const struct ether_vlan_header *evl; - const struct tcphdr *th; int ehlen; - *tcpsyn = 0; - PULLUP_HDR(m_head, sizeof(*evl)); evl = mtod(m_head, const struct ether_vlan_header *); if (evl->evl_encap_proto == ntohs(ETHERTYPE_VLAN)) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET - if (m_head->m_pkthdr.csum_flags & CSUM_IP_TCP) { + if (m_head->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP_UDP)) { const struct ip *ip; int iphlen; PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; - - PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); - th = mtodo(m_head, ehlen + iphlen); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + m_head->m_pkthdr.l3hlen = iphlen; } #endif #if defined(INET6) && defined(INET) @@ -812,18 +808,36 @@ hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) - return (m_head); - - PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); - th = mtodo(m_head, ehlen + sizeof(*ip6)); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + if (ip6->ip6_nxt != IPPROTO_TCP) { + m_freem(m_head); + return (NULL); + } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); } #endif return (m_head); } +/* + * NOTE: If this function failed, the m_head would be freed. + */ +static __inline struct mbuf * +hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +{ + const struct tcphdr *th; + int ehlen, iphlen; + + *tcpsyn = 0; + ehlen = m_head->m_pkthdr.l2hlen; + iphlen = m_head->m_pkthdr.l3hlen; + + PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); + th = mtodo(m_head, ehlen + iphlen); + if (th->th_flags & TH_SYN) + *tcpsyn = 1; + return (m_head); +} + #undef PULLUP_HDR #endif /* INET6 || INET */ @@ -3006,7 +3020,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st NDIS_LSO2_INFO_SIZE, NDIS_PKTINFO_TYPE_LSO); #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { - *pi_data = NDIS_LSO2_INFO_MAKEIPV4(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV4( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen, m_head->m_pkthdr.tso_segsz); } #endif @@ -3015,7 +3030,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st #endif #ifdef INET6 { - *pi_data = NDIS_LSO2_INFO_MAKEIPV6(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV6( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen, m_head->m_pkthdr.tso_segsz); } #endif @@ -3032,11 +3048,15 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st *pi_data |= NDIS_TXCSUM_INFO_IPCS; } - if (m_head->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) - *pi_data |= NDIS_TXCSUM_INFO_TCPCS; - else if (m_head->m_pkthdr.csum_flags & - (CSUM_IP_UDP | CSUM_IP6_UDP)) - *pi_data |= NDIS_TXCSUM_INFO_UDPCS; + if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_TCP | CSUM_IP6_TCP)) { + *pi_data |= NDIS_TXCSUM_INFO_MKTCPCS( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen); + } else if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP6_UDP)) { + *pi_data |= NDIS_TXCSUM_INFO_MKUDPCS( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen); + } } pkt_hlen = pkt->rm_pktinfooffset + pkt->rm_pktinfolen; @@ -5562,6 +5582,13 @@ hn_start_locked(struct hn_tx_ring *txr, int len) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } + } else if (m_head->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP6_UDP | CSUM_IP6_TCP)) { + m_head = hn_set_hlen(m_head); + if (__predict_false(m_head == NULL)) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + continue; + } } #endif @@ -5842,11 +5869,18 @@ hn_transmit(struct ifnet *ifp, struct mbuf *m) #if defined(INET6) || defined(INET) /* - * Perform TSO packet header fixup now, since the TSO - * packet header should be cache-hot. + * Perform TSO packet header fixup or get l2/l3 header length now, + * since packet headers should be cache-hot. */ if (m->m_pkthdr.csum_flags & CSUM_TSO) { m = hn_tso_fixup(m); + if (__predict_false(m == NULL)) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return EIO; + } + } else if (m->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP6_UDP | CSUM_IP6_TCP)) { + m = hn_set_hlen(m); if (__predict_false(m == NULL)) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return EIO; Modified: stable/11/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 05:58:33 2017 (r324478) +++ stable/11/sys/dev/hyperv/netvsc/ndis.h Tue Oct 10 06:03:23 2017 (r324479) @@ -402,4 +402,13 @@ struct ndis_offload { #define NDIS_TXCSUM_INFO_IPCS 0x00000010 #define NDIS_TXCSUM_INFO_THOFF 0x03ff0000 +#define NDIS_TXCSUM_INFO_MKL4CS(thoff, flag) \ + ((((uint32_t)(thoff)) << 16) | (flag)) + +#define NDIS_TXCSUM_INFO_MKTCPCS(thoff) \ + NDIS_TXCSUM_INFO_MKL4CS((thoff), NDIS_TXCSUM_INFO_TCPCS) + +#define NDIS_TXCSUM_INFO_MKUDPCS(thoff) \ + NDIS_TXCSUM_INFO_MKL4CS((thoff), NDIS_TXCSUM_INFO_UDPCS) + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-all@freebsd.org Tue Oct 10 06:12:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A5F7E2580C; Tue, 10 Oct 2017 06:12:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D72A46E226; Tue, 10 Oct 2017 06:12:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A6C7qE012289; Tue, 10 Oct 2017 06:12:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A6C7ox012288; Tue, 10 Oct 2017 06:12:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100612.v9A6C7ox012288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 06:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324480 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 06:12:09 -0000 Author: sephe Date: Tue Oct 10 06:12:07 2017 New Revision: 324480 URL: https://svnweb.freebsd.org/changeset/base/324480 Log: MFC 324049,324077 324049 hyperv/hn: Fix UDP checksum offload issue in Azure. UDP checksum offload does not work in Azure if following conditions are met: - sizeof(IP hdr + UDP hdr + payload) > 1420. - IP_DF is not set in IP hdr Use software checksum for UDP datagrams falling into this category. Add two tunables to disable UDP/IPv4 and UDP/IPv6 checksum offload, in case something unexpected happened. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12429 324077 hyperv/hn: Unbreak i386 building. Reported by: cy Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 06:03:23 2017 (r324479) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 06:12:07 2017 (r324480) @@ -61,7 +61,9 @@ __FBSDID("$FreeBSD$"); #include "opt_rss.h" #include +#include #include +#include #include #include #include @@ -76,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -458,6 +459,35 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostip, CTLFLAG_RDT "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); +/* + * Offload UDP/IPv4 checksum. + */ +static int hn_enable_udp4cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp4cs, CTLFLAG_RDTUN, + &hn_enable_udp4cs, 0, "Offload UDP/IPv4 checksum"); + +/* + * Offload UDP/IPv6 checksum. + */ +static int hn_enable_udp6cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp6cs, CTLFLAG_RDTUN, + &hn_enable_udp6cs, 0, "Offload UDP/IPv6 checksum"); + +/* Stats. */ +static counter_u64_t hn_udpcs_fixup; +SYSCTL_COUNTER_U64(_hw_hn, OID_AUTO, udpcs_fixup, CTLFLAG_RW, + &hn_udpcs_fixup, "# of UDP checksum fixup"); + +/* + * See hn_set_hlen(). + * + * This value is for Azure. For Hyper-V, set this above + * 65536 to disable UDP datagram checksum fixup. + */ +static int hn_udpcs_fixup_mtu = 1420; +SYSCTL_INT(_hw_hn, OID_AUTO, udpcs_fixup_mtu, CTLFLAG_RWTUN, + &hn_udpcs_fixup_mtu, 0, "UDP checksum fixup MTU threshold"); + /* Limit TSO burst size */ static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, @@ -797,6 +827,27 @@ hn_set_hlen(struct mbuf *m_head) ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; m_head->m_pkthdr.l3hlen = iphlen; + + /* + * UDP checksum offload does not work in Azure, if the + * following conditions meet: + * - sizeof(IP hdr + UDP hdr + payload) > 1420. + * - IP_DF is not set in the IP hdr. + * + * Fallback to software checksum for these UDP datagrams. + */ + if ((m_head->m_pkthdr.csum_flags & CSUM_IP_UDP) && + m_head->m_pkthdr.len > hn_udpcs_fixup_mtu + ehlen && + (ntohs(ip->ip_off) & IP_DF) == 0) { + uint16_t off = ehlen + iphlen; + + counter_u64_add(hn_udpcs_fixup, 1); + PULLUP_HDR(m_head, off + sizeof(struct udphdr)); + *(uint16_t *)(m_head->m_data + off + + m_head->m_pkthdr.csum_data) = in_cksum_skip( + m_head, m_head->m_pkthdr.len, off); + m_head->m_pkthdr.csum_flags &= ~CSUM_IP_UDP; + } } #endif #if defined(INET6) && defined(INET) @@ -5475,11 +5526,11 @@ hn_fixup_tx_data(struct hn_softc *sc) csum_assist |= CSUM_IP; if (sc->hn_caps & HN_CAP_TCP4CS) csum_assist |= CSUM_IP_TCP; - if (sc->hn_caps & HN_CAP_UDP4CS) + if ((sc->hn_caps & HN_CAP_UDP4CS) && hn_enable_udp4cs) csum_assist |= CSUM_IP_UDP; if (sc->hn_caps & HN_CAP_TCP6CS) csum_assist |= CSUM_IP6_TCP; - if (sc->hn_caps & HN_CAP_UDP6CS) + if ((sc->hn_caps & HN_CAP_UDP6CS) && hn_enable_udp6cs) csum_assist |= CSUM_IP6_UDP; for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; @@ -7332,6 +7383,8 @@ hn_sysinit(void *arg __unused) { int i; + hn_udpcs_fixup = counter_u64_alloc(M_WAITOK); + #ifdef HN_IFSTART_SUPPORT /* * Don't use ifnet.if_start if transparent VF mode is requested; @@ -7411,5 +7464,7 @@ hn_sysuninit(void *arg __unused) if (hn_vfmap != NULL) free(hn_vfmap, M_DEVBUF); rm_destroy(&hn_vfmap_lock); + + counter_u64_free(hn_udpcs_fixup); } SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); From owner-svn-src-all@freebsd.org Tue Oct 10 07:17:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948B2E26E9B; Tue, 10 Oct 2017 07:17:15 +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 18A506FE63; Tue, 10 Oct 2017 07:17:14 +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 v9A7H4Gj045834 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Oct 2017 10:17:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v9A7H4Gj045834 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v9A7H3tq045833; Tue, 10 Oct 2017 10:17:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Oct 2017 10:17:03 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: Sean Bruno , Jason Eggleston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324405 - head/sys/kern Message-ID: <20171010071703.GR95911@kib.kiev.ua> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171009232052.GU1055@FreeBSD.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 07:17:15 -0000 On Mon, Oct 09, 2017 at 04:20:52PM -0700, Gleb Smirnoff wrote: > Sean & Jason, > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > S> Author: sbruno > S> Date: Sat Oct 7 23:30:57 2017 > S> New Revision: 324405 > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > S> > S> Log: > S> Check so_error early in sendfile() call. Prior to this patch, if a > S> connection was reset by the remote end, sendfile() would just report > S> ENOTCONN instead of ECONNRESET. > S> > S> Submitted by: Jason Eggleston > S> Reviewed by: glebius > S> Sponsored by: Limelight Networks > S> Differential Revision: https://reviews.freebsd.org/D12575 > S> > S> Modified: > S> head/sys/kern/kern_sendfile.c > S> > S> Modified: head/sys/kern/kern_sendfile.c > S> ============================================================================== > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 (r324404) > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 (r324405) > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct file > S> *so = (*sock_fp)->f_data; > S> if ((*so)->so_type != SOCK_STREAM) > S> return (EINVAL); > S> + if ((*so)->so_error) { > S> + error = (*so)->so_error; > S> + (*so)->so_error = 0; > S> + return (error); > S> + } > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > S> return (ENOTCONN); > S> return (0); > > Despite my initial positive review, now I am quite unsure on that. > > Problem is that sendfile(2) isn't defined by SUS, so there is no > distinctive final answer on that. Should we match other OSes? > Should we match our historic behaviour? Or should we match > write(2)/send(2) to socket, which are closest analogy. I probably > believe in the latter: sendfile(2) belongs to write(2)/send(2) > family. > > SUS specifies that write may return ECONNRESET. It also documents > EPIPE. However, our manual page documents only EPIPE for both > send(2) and write(2). For write we have: > > SOCKBUF_LOCK(&so->so_snd); > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EPIPE; > goto out; > } > if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto out; > } > > Indeed, EPIPE will be returned prior to return/clear of so_error, > which supposedly is ECONNRESET. > > In the sendfile(2) implementation we see exactly same code: > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > error = EPIPE; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } else if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > > But it isn't reached. Before due to SS_ISCONNECTED check, now > due to your change. Now we got two spots where so_error is > returned/cleared. Do you mean that EPIPE could be returned from sendfile(2) after some round of changes ? It should be not. EPIPE is a workaround for naive programs that use stdio and cannot detect the broken pipe when used as an element in the shell plumbing. EPIPE results in SIGPIPE terminating such programs (instead of looping endlessly when write(2) returns error). Any application using sendfile(2) must understand the API to properly handle disconnects, so SIGPIPE workaround would be avoided. Often such applications are already sofisticated enough to block SIGPIPE, but if blocking becomes a new requirement because EPIPE was not returned in earlier version of the system, they might not block it still. > > For the receive family (read(2) and recv(2)), SUS specifies > ECONNRESET and our code does that. It also clears so_error. > > So, after your change at least one standard case is broken: an > application that polls/selects for both readability and > writeability of a socket. It discovers that socket is available > for writing, does sendfile(2), receives ECONNRESET. Then it does > read on the socket, and blocks(?) or returns a bogus error(?), > not sure. But definitely not ECONNRESET, since it is now cleared. > > Now, where does this ENOTCONN come from? These two lines: > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > return (ENOTCONN); > > can be traced back all the way to original 1998 commit of sendfile. > > Here comes difference between sendfile(2) and send(2). In send(2), > this check is done _after_ so_error check, so your change is correct > in placing of so_error check wrt so_state check, but is incorrect > in placing wrt socket buffer state check. > > After all this considerations, I would suggest to revert your change, > and apply this patch. It would make behavior of sendfile(2) to match > send(2). I would appreciate more reviews around it. > > -- > Gleb Smirnoff > Index: kern_sendfile.c > =================================================================== > --- kern_sendfile.c (revision 324457) > +++ kern_sendfile.c (working copy) > @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct > *so = (*sock_fp)->f_data; > if ((*so)->so_type != SOCK_STREAM) > return (EINVAL); > - if ((*so)->so_error) { > - error = (*so)->so_error; > - (*so)->so_error = 0; > - return (error); > - } > - if (((*so)->so_state & SS_ISCONNECTED) == 0) > - return (ENOTCONN); > return (0); > } > > @@ -622,6 +615,12 @@ retry_space: > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > + if ((so->so_state & SS_ISCONNECTED) == 0) { > + SOCKBUF_UNLOCK(&so->so_snd); > + error = ENOTCONN; > + goto done; > + } > + > space = sbspace(&so->so_snd); > if (space < rem && > (space <= 0 || From owner-svn-src-all@freebsd.org Tue Oct 10 08:16:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCE5EE2879D; Tue, 10 Oct 2017 08:16:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3B671F68; Tue, 10 Oct 2017 08:16:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8Gtdp061919; Tue, 10 Oct 2017 08:16:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8Gt6l061918; Tue, 10 Oct 2017 08:16:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100816.v9A8Gt6l061918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324487 - head/sys/dev/hyperv/vmbus X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 324487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:16:56 -0000 Author: sephe Date: Tue Oct 10 08:16:55 2017 New Revision: 324487 URL: https://svnweb.freebsd.org/changeset/base/324487 Log: hyperv/vmbus: Add tunable to pin/unpin event tasks. Event tasks are pinned to their respective CPU by default, in the same fashion as they were. Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain CPUs serve special purpose. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 08:07:05 2017 (r324486) +++ head/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 08:16:55 2017 (r324487) @@ -128,6 +128,13 @@ static void vmbus_event_proc_dummy(struct vmbus_soft static struct vmbus_softc *vmbus_sc; +SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V vmbus"); + +static int vmbus_pin_evttask = 1; +SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, + &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); + extern inthand_t IDTVEC(vmbus_isr); static const uint32_t vmbus_version[] = { @@ -905,10 +912,16 @@ vmbus_intr_setup(struct vmbus_softc *sc) VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast( "hyperv event", M_WAITOK, taskqueue_thread_enqueue, VMBUS_PCPU_PTR(sc, event_tq, cpu)); - CPU_SETOF(cpu, &cpu_mask); - taskqueue_start_threads_cpuset( - VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask, - "hvevent%d", cpu); + if (vmbus_pin_evttask) { + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); + } else { + taskqueue_start_threads( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + "hvevent%d", cpu); + } /* * Setup tasks and taskqueues to handle messages. From owner-svn-src-all@freebsd.org Tue Oct 10 08:23:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93BA5E28ABF; Tue, 10 Oct 2017 08:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4B1723F1; Tue, 10 Oct 2017 08:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8NJIc065769; Tue, 10 Oct 2017 08:23:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8NJ28065767; Tue, 10 Oct 2017 08:23:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100823.v9A8NJ28065767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324488 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in head/sys/dev/hyperv: include vmbus X-SVN-Commit-Revision: 324488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:23:20 -0000 Author: sephe Date: Tue Oct 10 08:23:19 2017 New Revision: 324488 URL: https://svnweb.freebsd.org/changeset/base/324488 Log: hyperv/vmbus: Expose Hyper-V major version. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hyperv.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Tue Oct 10 08:16:55 2017 (r324487) +++ head/sys/dev/hyperv/include/hyperv.h Tue Oct 10 08:23:19 2017 (r324488) @@ -90,6 +90,7 @@ int hyperv_guid2str(const struct hyperv_guid *, char */ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +extern u_int hyperv_ver_major; #endif /* _KERNEL */ Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 08:16:55 2017 (r324487) +++ head/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 08:23:19 2017 (r324488) @@ -77,6 +77,8 @@ static u_int hyperv_get_timecount(struct timecounter static bool hyperv_identify(void); static void hypercall_memfree(void); +u_int hyperv_ver_major; + u_int hyperv_features; u_int hyperv_recommends; @@ -169,8 +171,9 @@ hyperv_identify(void) hyperv_features3 = regs[3]; do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + hyperv_ver_major = regs[1] >> 16; printf("Hyper-V Version: %d.%d.%d [SP%d]\n", - regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020" From owner-svn-src-all@freebsd.org Tue Oct 10 08:32:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43ADE28DE4; Tue, 10 Oct 2017 08:32:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97FD57283C; Tue, 10 Oct 2017 08:32:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8W3Jm066117; Tue, 10 Oct 2017 08:32:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8W3FV066114; Tue, 10 Oct 2017 08:32:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100832.v9A8W3FV066114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324489 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:32:04 -0000 Author: sephe Date: Tue Oct 10 08:32:03 2017 New Revision: 324489 URL: https://svnweb.freebsd.org/changeset/base/324489 Log: hyperv/hn: Workaround erroneous hash type observed on WS2016. Background: - UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016, which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS. - Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as TCP_IPV4. Currently this erroneous behavior only applies to WS2016/Windows10. Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4, and the Hyper-V is running on WS2016/Windows10. If the RXed packet is UDP datagram, adjust mbuf hash type to UDP_IPV4. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 08:32:03 2017 (r324489) @@ -601,6 +601,11 @@ hn_nvs_attach(struct hn_softc *sc, int mtu) { int error; + if (hyperv_ver_major >= 10) { + /* UDP 4-tuple hash is enforced. */ + sc->hn_caps |= HN_CAP_UDPHASH; + } + /* * Initialize NVS. */ Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 08:32:03 2017 (r324489) @@ -385,6 +385,7 @@ static void hn_link_status(struct hn_softc *); static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); +static void hn_rxpkt_proto(const struct mbuf *, int *, int *); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); @@ -399,6 +400,7 @@ static int hn_tx_ring_create(struct hn_softc *, int) static void hn_tx_ring_destroy(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *, int); static void hn_fixup_tx_data(struct hn_softc *); +static void hn_fixup_rx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); static void hn_txdesc_gc(struct hn_tx_ring *, @@ -2238,9 +2240,10 @@ hn_attach(device_t dev) #endif /* - * Fixup TX stuffs after synthetic parts are attached. + * Fixup TX/RX stuffs after synthetic parts are attached. */ hn_fixup_tx_data(sc); + hn_fixup_rx_data(sc); ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -3378,6 +3381,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int struct mbuf *m_new; int size, do_lro = 0, do_csum = 1, is_vf = 0; int hash_type = M_HASHTYPE_NONE; + int l3proto = ETHERTYPE_MAX, l4proto = IPPROTO_DONE; ifp = hn_ifp; if (rxr->hn_rxvf_ifp != NULL) { @@ -3477,31 +3481,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; } else { - const struct ether_header *eh; - uint16_t etype; - int hoff; - - hoff = sizeof(*eh); - /* Checked at the beginning of this function. */ - KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); - - eh = mtod(m_new, struct ether_header *); - etype = ntohs(eh->ether_type); - if (etype == ETHERTYPE_VLAN) { - const struct ether_vlan_header *evl; - - hoff = sizeof(*evl); - if (m_new->m_len < hoff) - goto skip; - evl = mtod(m_new, struct ether_vlan_header *); - etype = ntohs(evl->evl_proto); - } - - if (etype == ETHERTYPE_IP) { - int pr; - - pr = hn_check_iplen(m_new, hoff); - if (pr == IPPROTO_TCP) { + hn_rxpkt_proto(m_new, &l3proto, &l4proto); + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_TCP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { @@ -3512,7 +3494,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int m_new->m_pkthdr.csum_data = 0xffff; } do_lro = 1; - } else if (pr == IPPROTO_UDP) { + } else if (l4proto == IPPROTO_UDP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { @@ -3522,7 +3504,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } - } else if (pr != IPPROTO_DONE && do_csum && + } else if (l4proto != IPPROTO_DONE && do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= @@ -3530,7 +3512,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int } } } -skip: + if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( NDIS_VLAN_INFO_ID(info->vlan_info), @@ -3585,6 +3567,35 @@ skip: case NDIS_HASH_TCP_IPV4: hash_type = M_HASHTYPE_RSS_TCP_IPV4; + if (rxr->hn_rx_flags & HN_RX_FLAG_UDP_HASH) { + int def_htype = M_HASHTYPE_OPAQUE_HASH; + + if (is_vf) + def_htype = M_HASHTYPE_NONE; + + /* + * UDP 4-tuple hash is delivered as + * TCP 4-tuple hash. + */ + if (l3proto == ETHERTYPE_MAX) { + hn_rxpkt_proto(m_new, + &l3proto, &l4proto); + } + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_UDP) { + hash_type = + M_HASHTYPE_RSS_UDP_IPV4; + do_lro = 0; + } else if (l4proto != + IPPROTO_TCP) { + hash_type = def_htype; + do_lro = 0; + } + } else { + hash_type = def_htype; + do_lro = 0; + } + } break; case NDIS_HASH_IPV6: @@ -4835,6 +4846,36 @@ hn_check_iplen(const struct mbuf *m, int hoff) return ip->ip_p; } +static void +hn_rxpkt_proto(const struct mbuf *m_new, int *l3proto, int *l4proto) +{ + const struct ether_header *eh; + uint16_t etype; + int hoff; + + hoff = sizeof(*eh); + /* Checked at the beginning of this function. */ + KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); + + eh = mtod(m_new, const struct ether_header *); + etype = ntohs(eh->ether_type); + if (etype == ETHERTYPE_VLAN) { + const struct ether_vlan_header *evl; + + hoff = sizeof(*evl); + if (m_new->m_len < hoff) + return; + evl = mtod(m_new, const struct ether_vlan_header *); + etype = ntohs(evl->evl_proto); + } + *l3proto = etype; + + if (etype == ETHERTYPE_IP) + *l4proto = hn_check_iplen(m_new, hoff); + else + *l4proto = IPPROTO_DONE; +} + static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { @@ -5543,6 +5584,18 @@ hn_fixup_tx_data(struct hn_softc *sc) if_printf(sc->hn_ifp, "support HASHVAL pktinfo\n"); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; + } +} + +static void +hn_fixup_rx_data(struct hn_softc *sc) +{ + + if (sc->hn_caps & HN_CAP_UDPHASH) { + int i; + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags |= HN_RX_FLAG_UDP_HASH; } } Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 08:32:03 2017 (r324489) @@ -97,6 +97,7 @@ struct hn_rx_ring { #define HN_RX_FLAG_ATTACHED 0x0001 #define HN_RX_FLAG_BR_REF 0x0002 #define HN_RX_FLAG_XPNT_VF 0x0004 +#define HN_RX_FLAG_UDP_HASH 0x0008 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -304,11 +305,12 @@ do { \ #define HN_CAP_TSO4 0x0080 #define HN_CAP_TSO6 0x0100 #define HN_CAP_HASHVAL 0x0200 +#define HN_CAP_UDPHASH 0x0400 /* Capability description for use with printf(9) %b identifier. */ #define HN_CAP_BITS \ "\020\1VLAN\2MTU\3IPCS\4TCP4CS\5TCP6CS" \ - "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL" + "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL\13UDPHASH" #define HN_LINK_FLAG_LINKUP 0x0001 #define HN_LINK_FLAG_NETCHG 0x0002 From owner-svn-src-all@freebsd.org Tue Oct 10 12:10:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE9DCE2F625; Tue, 10 Oct 2017 12:10:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id B38A27ECFB; Tue, 10 Oct 2017 12:10:20 +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 v9ACAJj9060588; Tue, 10 Oct 2017 12:10:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACAJ8W060587; Tue, 10 Oct 2017 12:10:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101210.v9ACAJ8W060587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324490 - head/sys/contrib/rdma/krping X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/contrib/rdma/krping X-SVN-Commit-Revision: 324490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:10:21 -0000 Author: hselasky Date: Tue Oct 10 12:10:19 2017 New Revision: 324490 URL: https://svnweb.freebsd.org/changeset/base/324490 Log: Add support for parsing and using IPv6 addresses in krping. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Oct 10 08:32:03 2017 (r324489) +++ head/sys/contrib/rdma/krping/krping.c Tue Oct 10 12:10:19 2017 (r324490) @@ -86,6 +86,7 @@ static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, {"size", OPT_INT, 'S'}, {"addr", OPT_STRING, 'a'}, + {"addr6", OPT_STRING, 'A'}, {"port", OPT_INT, 'p'}, {"verbose", OPT_NOPARAM, 'v'}, {"validate", OPT_NOPARAM, 'V'}, @@ -220,7 +221,11 @@ struct krping_cb { struct krping_stats stats; uint16_t port; /* dst port in NBO */ - struct in_addr addr; /* dst addr in NBO */ + union { + struct in_addr v4; + struct in6_addr v6; + } addr; /* dst addr in NBO */ + int addr_type; /* AF_INET or AF_INET6 */ char *addr_str; /* dst addr string */ int verbose; /* verbose logging */ int count; /* ping count */ @@ -1600,15 +1605,31 @@ static int fastreg_supported(struct krping_cb *cb, int static int krping_bind_server(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin); if (ret) { PRINTF(cb, "rdma_bind_addr error %d\n", ret); @@ -3059,15 +3080,31 @@ static int krping_connect_client(struct krping_cb *cb) static int krping_bind_client(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &sin, 2000); if (ret) { @@ -3140,12 +3177,29 @@ err1: krping_free_qp(cb); } +static uint16_t +krping_get_ipv6_scope_id(char *name) +{ + struct ifnet *ifp; + uint16_t retval; + + if (name == NULL) + return (0); + ifp = ifunit_ref(name); + if (ifp == NULL) + return (0); + retval = ifp->if_index; + if_rele(ifp); + return (retval); +} + int krping_doit(char *cmd, void *cookie) { struct krping_cb *cb; int op; int ret = 0; char *optarg; + char *scope; unsigned long optint; cb = kzalloc(sizeof(*cb), GFP_KERNEL); @@ -3162,6 +3216,7 @@ int krping_doit(char *cmd, void *cookie) cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; cb->mem = DMA; + cb->addr_type = AF_INET; init_waitqueue_head(&cb->sem); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -3169,11 +3224,33 @@ int krping_doit(char *cmd, void *cookie) switch (op) { case 'a': cb->addr_str = optarg; - DEBUG_LOG(cb, "ipaddr (%s)\n", optarg); - if (!inet_aton(optarg, &cb->addr)) { + cb->addr_type = AF_INET; + DEBUG_LOG(cb, "ipv4addr (%s)\n", optarg); + if (inet_pton(AF_INET, optarg, &cb->addr) != 1) { PRINTF(cb, "bad addr string %s\n", optarg); ret = EINVAL; + } + break; + case 'A': + cb->addr_str = optarg; + cb->addr_type = AF_INET6; + DEBUG_LOG(cb, "ipv6addr (%s)\n", optarg); + scope = strstr(optarg, "%"); + /* extract scope ID, if any */ + if (scope != NULL) + *scope++ = 0; + /* extract IPv6 network address */ + if (inet_pton(AF_INET6, optarg, &cb->addr) != 1) { + PRINTF(cb, "bad addr string %s\n", + optarg); + ret = EINVAL; + } else if (IN6_IS_SCOPE_LINKLOCAL(&cb->addr.v6) || + IN6_IS_ADDR_MC_INTFACELOCAL(&cb->addr.v6)) { + uint16_t scope_id = krping_get_ipv6_scope_id(scope); + DEBUG_LOG(cb, "ipv6 scope ID = %d\n", scope_id); + cb->addr.v6.s6_addr[2] = scope_id >> 8; + cb->addr.v6.s6_addr[3] = scope_id & 0xFF; } break; case 'p': From owner-svn-src-all@freebsd.org Tue Oct 10 12:24:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 276B8E2FFC1; Tue, 10 Oct 2017 12:24:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id E85D67F6C3; Tue, 10 Oct 2017 12:24:53 +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 v9ACOrJB068853; Tue, 10 Oct 2017 12:24:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACOr0Z068852; Tue, 10 Oct 2017 12:24:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101224.v9ACOr0Z068852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324491 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 324491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:24:54 -0000 Author: hselasky Date: Tue Oct 10 12:24:52 2017 New Revision: 324491 URL: https://svnweb.freebsd.org/changeset/base/324491 Log: Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Tue Oct 10 12:10:19 2017 (r324490) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Tue Oct 10 12:24:52 2017 (r324491) @@ -562,26 +562,6 @@ mlx5_make_default_gid(struct net_device *dev, union ib mlx5_addrconf_ifid_eui48(&gid->raw[8], dev); } -static inline int -mlx5_ip2gid(const struct sockaddr *addr, union ib_gid *gid) -{ - switch (addr->sa_family) { - case AF_INET: - ipv6_addr_set_v4mapped(((const struct sockaddr_in *)addr)->sin_addr.s_addr, - (struct in6_addr *)gid->raw); - break; - case AF_INET6: - memcpy(gid->raw, &((const struct sockaddr_in6 *)addr)->sin6_addr, 16); - /* clear SCOPE ID */ - gid->raw[2] = 0; - gid->raw[3] = 0; - break; - default: - return -EINVAL; - } - return 0; -} - static void mlx5_ib_roce_port_update(void *arg) { @@ -639,7 +619,7 @@ mlx5_ib_roce_port_update(void *arg) gid_index >= MLX5_IB_GID_MAX) continue; memset(&gid_temp, 0, sizeof(gid_temp)); - mlx5_ip2gid(ifa->ifa_addr, &gid_temp); + rdma_ip2gid(ifa->ifa_addr, &gid_temp); /* check for existing entry */ for (j = 0; j != gid_index; j++) { if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0) From owner-svn-src-all@freebsd.org Tue Oct 10 12:36:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D46AE30446; Tue, 10 Oct 2017 12:36:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2AC697FCB3; Tue, 10 Oct 2017 12:36:42 +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 v9ACafvq073203; Tue, 10 Oct 2017 12:36:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACafPP073202; Tue, 10 Oct 2017 12:36:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101236.v9ACafPP073202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324492 - head/sys/ofed/include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/include/rdma X-SVN-Commit-Revision: 324492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:36:42 -0000 Author: hselasky Date: Tue Oct 10 12:36:41 2017 New Revision: 324492 URL: https://svnweb.freebsd.org/changeset/base/324492 Log: Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a valid GID entry based on IPv6 addresses can fail. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Tue Oct 10 12:24:52 2017 (r324491) +++ head/sys/ofed/include/rdma/ib_addr.h Tue Oct 10 12:36:41 2017 (r324492) @@ -157,6 +157,12 @@ static inline int rdma_ip2gid(struct sockaddr *addr, u case AF_INET6: memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr, 16); + /* make sure scope ID gets zeroed inside GID */ + if (IN6_IS_SCOPE_LINKLOCAL((struct in6_addr *)gid->raw) || + IN6_IS_ADDR_MC_INTFACELOCAL((struct in6_addr *)gid->raw)) { + gid->raw[2] = 0; + gid->raw[3] = 0; + } break; default: return -EINVAL; From owner-svn-src-all@freebsd.org Tue Oct 10 12:54:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB6C8E309A8; Tue, 10 Oct 2017 12:54:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5A9080841; Tue, 10 Oct 2017 12:54:37 +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 v9ACsaD6081552; Tue, 10 Oct 2017 12:54:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACsaSD081550; Tue, 10 Oct 2017 12:54:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101254.v9ACsaSD081550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 12:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324493 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 324493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:54:38 -0000 Author: andrew Date: Tue Oct 10 12:54:36 2017 New Revision: 324493 URL: https://svnweb.freebsd.org/changeset/base/324493 Log: Move the pmap_l0_index, etc. macros to pte.h. These will be used by the EFI Runtime Services code. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Oct 10 12:36:41 2017 (r324492) +++ head/sys/arm64/arm64/pmap.c Tue Oct 10 12:54:36 2017 (r324493) @@ -306,11 +306,6 @@ pagecopy(void *s, void *d) memcpy(d, s, PAGE_SIZE); } -#define pmap_l0_index(va) (((va) >> L0_SHIFT) & L0_ADDR_MASK) -#define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK) -#define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK) -#define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK) - static __inline pd_entry_t * pmap_l0(pmap_t pmap, vm_offset_t va) { Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Tue Oct 10 12:36:41 2017 (r324492) +++ head/sys/arm64/include/pte.h Tue Oct 10 12:54:36 2017 (r324493) @@ -118,6 +118,11 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define Ln_ADDR_MASK (Ln_ENTRIES - 1) #define Ln_TABLE_MASK ((1 << 12) - 1) +#define pmap_l0_index(va) (((va) >> L0_SHIFT) & L0_ADDR_MASK) +#define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK) +#define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK) +#define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK) + #endif /* !_MACHINE_PTE_H_ */ /* End of pte.h */ From owner-svn-src-all@freebsd.org Tue Oct 10 13:02:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CA0E30D76; Tue, 10 Oct 2017 13:02:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 881C080DD1; Tue, 10 Oct 2017 13:02:59 +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 v9AD2wcN085769; Tue, 10 Oct 2017 13:02:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD2w8K085768; Tue, 10 Oct 2017 13:02:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101302.v9AD2w8K085768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 13:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324494 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 324494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:02:59 -0000 Author: andrew Date: Tue Oct 10 13:02:58 2017 New Revision: 324494 URL: https://svnweb.freebsd.org/changeset/base/324494 Log: Add machine/fpu.h on arm64 for compatibility with amd64. Sponsored by: DARPA, AFRL Added: head/sys/arm64/include/fpu.h (contents, props changed) Added: head/sys/arm64/include/fpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/fpu.h Tue Oct 10 13:02:58 2017 (r324494) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ +#include From owner-svn-src-all@freebsd.org Tue Oct 10 13:05:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C008E30E3E; Tue, 10 Oct 2017 13:05:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77FDB80F55; Tue, 10 Oct 2017 13:05:28 +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 v9AD5RmE085951; Tue, 10 Oct 2017 13:05:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD5RKI085945; Tue, 10 Oct 2017 13:05:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101305.v9AD5RKI085945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 13:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324495 - in head/sys: arm64/arm64 arm64/include conf modules X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf modules X-SVN-Commit-Revision: 324495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:05:28 -0000 Author: andrew Date: Tue Oct 10 13:05:26 2017 New Revision: 324495 URL: https://svnweb.freebsd.org/changeset/base/324495 Log: Support the EFI Runtime Services on arm64. As with amd64 we use the 1:1 mapping. This uses the new common code shared with amd64. The RTC should only be accessed via EFI. There is no locking around it as the spec only has this as a requirement for the PC-AT CMOS device. Reviewed by: kib, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12595 Added: head/sys/arm64/arm64/efirt_machdep.c (contents, props changed) Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/include/efi.h head/sys/conf/files.arm64 head/sys/conf/options.arm64 head/sys/modules/Makefile Added: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/efirt_machdep.c Tue Oct 10 13:05:26 2017 (r324495) @@ -0,0 +1,252 @@ +/*- + * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2001 Doug Rabson + * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2017 Andrew Turner + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static vm_object_t obj_1t1_pt; +static vm_page_t efi_l0_page; +static pd_entry_t *efi_l0; + +void +efi_destroy_1t1_map(void) +{ + vm_page_t m; + + if (obj_1t1_pt != NULL) { + VM_OBJECT_RLOCK(obj_1t1_pt); + TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) + m->wire_count = 0; + atomic_subtract_int(&vm_cnt.v_wire_count, + obj_1t1_pt->resident_page_count); + VM_OBJECT_RUNLOCK(obj_1t1_pt); + vm_object_deallocate(obj_1t1_pt); + } + + obj_1t1_pt = NULL; + efi_l0 = NULL; + efi_l0_page = NULL; +} + +static vm_page_t +efi_1t1_page(vm_pindex_t idx) +{ + + return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED | VM_ALLOC_ZERO)); +} + +static pt_entry_t * +efi_1t1_l3(vm_offset_t va) +{ + pd_entry_t *l0, *l1, *l2; + pt_entry_t *l3; + vm_pindex_t l0_idx, l1_idx, l2_idx; + vm_page_t m; + vm_paddr_t mphys; + + l0_idx = pmap_l0_index(va); + l0 = &efi_l0[l0_idx]; + if (*l0 == 0) { + m = efi_1t1_page(1 + l0_idx); + mphys = VM_PAGE_TO_PHYS(m); + *l0 = mphys | L0_TABLE; + } else { + mphys = *l0 & ~ATTR_MASK; + } + + l1 = (pd_entry_t *)PHYS_TO_DMAP(mphys); + l1_idx = pmap_l1_index(va); + l1 += l1_idx; + if (*l1 == 0) { + m = efi_1t1_page(1 + L0_ENTRIES + (l0_idx + 1) * (l1_idx + 1)); + mphys = VM_PAGE_TO_PHYS(m); + *l1 = mphys | L1_TABLE; + } else { + mphys = *l1 & ~ATTR_MASK; + } + + l2 = (pd_entry_t *)PHYS_TO_DMAP(mphys); + l2_idx = pmap_l2_index(va); + l2 += l2_idx; + if (*l2 == 0) { + m = efi_1t1_page(1 + L0_ENTRIES + L0_ENTRIES * Ln_ENTRIES + + (l0_idx + 1) * (l1_idx + 1) * (l2_idx + 1)); + mphys = VM_PAGE_TO_PHYS(m); + *l2 = mphys | L2_TABLE; + } else { + mphys = *l2 & ~ATTR_MASK; + } + + l3 = (pt_entry_t *)PHYS_TO_DMAP(mphys); + l3 += pmap_l3_index(va); + KASSERT(*l3 == 0, ("%s: Already mapped: va %#jx *pt %#jx", __func__, + va, *l3)); + + return (l3); +} + +/* + * Create the 1:1 virtual to physical map for EFI + */ +bool +efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) +{ + struct efi_md *p; + pt_entry_t *l3; + vm_offset_t va; + uint64_t idx; + int i, mode; + + obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, L0_ENTRIES + + L0_ENTRIES * Ln_ENTRIES + L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES + + L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES * Ln_ENTRIES, + VM_PROT_ALL, 0, NULL); + VM_OBJECT_WLOCK(obj_1t1_pt); + efi_l0_page = efi_1t1_page(0); + VM_OBJECT_WUNLOCK(obj_1t1_pt); + efi_l0 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_l0_page)); + bzero(efi_l0, L0_ENTRIES * sizeof(*efi_l0)); + + for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, + descsz)) { + if ((p->md_attr & EFI_MD_ATTR_RT) == 0) + continue; + if (p->md_virt != NULL) { + if (bootverbose) + printf("EFI Runtime entry %d is mapped\n", i); + goto fail; + } + if ((p->md_phys & EFI_PAGE_MASK) != 0) { + if (bootverbose) + printf("EFI Runtime entry %d is not aligned\n", + i); + goto fail; + } + if (p->md_phys + p->md_pages * EFI_PAGE_SIZE < p->md_phys || + p->md_phys + p->md_pages * EFI_PAGE_SIZE >= + VM_MAXUSER_ADDRESS) { + printf("EFI Runtime entry %d is not in mappable for RT:" + "base %#016jx %#jx pages\n", + i, (uintmax_t)p->md_phys, + (uintmax_t)p->md_pages); + goto fail; + } + if ((p->md_attr & EFI_MD_ATTR_WB) != 0) + mode = VM_MEMATTR_WRITE_BACK; + else if ((p->md_attr & EFI_MD_ATTR_WT) != 0) + mode = VM_MEMATTR_WRITE_THROUGH; + else if ((p->md_attr & EFI_MD_ATTR_WC) != 0) + mode = VM_MEMATTR_WRITE_COMBINING; + else if ((p->md_attr & EFI_MD_ATTR_UC) != 0) + mode = VM_MEMATTR_UNCACHEABLE; + else { + if (bootverbose) + printf("EFI Runtime entry %d mapping " + "attributes unsupported\n", i); + mode = VM_MEMATTR_UNCACHEABLE; + } + + printf("MAP %lx mode %x pages %lu\n", p->md_phys, mode, p->md_pages); + VM_OBJECT_WLOCK(obj_1t1_pt); + for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++, + va += PAGE_SIZE) { + l3 = efi_1t1_l3(va); + *l3 = va | ATTR_DEFAULT | ATTR_IDX(mode) | + ATTR_AP(ATTR_AP_RW) | L3_PAGE; + } + VM_OBJECT_WUNLOCK(obj_1t1_pt); + } + + return (true); +fail: + efi_destroy_1t1_map(); + return (false); +} + +int +efi_arch_enter(void) +{ + + __asm __volatile( + "msr ttbr0_el1, %0 \n" + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(VM_PAGE_TO_PHYS(efi_l0_page))); + + return (0); +} + +void +efi_arch_leave(void) +{ + struct thread *td; + + td = curthread; + __asm __volatile( + "msr ttbr0_el1, %0 \n" + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(td->td_proc->p_md.md_l0addr)); +} Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/arm64/arm64/machdep.c Tue Oct 10 13:05:26 2017 (r324495) @@ -121,6 +121,12 @@ int64_t idcache_line_size; /* The minimum cache line s int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ int has_pan; +/* + * Physical address of the EFI System Table. Stashed from the metadata hints + * passed into the kernel and used by the EFI code to call runtime services. + */ +vm_paddr_t efi_systbl_phys; + /* pagezero_* implementations are provided in support.S */ void pagezero_simple(void *); void pagezero_cache(void *); @@ -985,6 +991,8 @@ initarm(struct arm64_bootparams *abp) #ifdef FDT try_load_dtb(kmdp); #endif + + efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t); /* Find the address to start allocating from */ lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); Modified: head/sys/arm64/include/efi.h ============================================================================== --- head/sys/arm64/include/efi.h Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/arm64/include/efi.h Tue Oct 10 13:05:26 2017 (r324495) @@ -1,6 +1,32 @@ /*- - * This file is in the public domain since it's just boilerplate. + * Copyright (c) 2017 Andrew Turner + * All rights reserved. * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ @@ -8,5 +34,11 @@ #define __ARM64_INCLUDE_EFI_H_ #define EFIABI_ATTR + +#ifdef _KERNEL +#define EFI_TIME_LOCK() +#define EFI_TIME_UNLOCK() +#define EFI_TIME_OWNED() +#endif #endif /* __ARM64_INCLUDE_EFI_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/conf/files.arm64 Tue Oct 10 13:05:26 2017 (r324495) @@ -95,6 +95,7 @@ arm64/arm64/db_trace.c optional ddb arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard +arm64/arm64/efirt_machdep.c optional efirt arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard arm64/arm64/gicv3_its.c optional intrng fdt Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/conf/options.arm64 Tue Oct 10 13:05:26 2017 (r324495) @@ -7,6 +7,10 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h +# EFI Runtime services support +EFIRT opt_efirt.h + +# Devices DEV_PSCI opt_platform.h # SoC Support Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/modules/Makefile Tue Oct 10 13:05:26 2017 (r324495) @@ -562,6 +562,7 @@ _cxgb= cxgb .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto= armv8crypto +_efirt= efirt _em= em .endif From owner-svn-src-all@freebsd.org Tue Oct 10 13:06:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CBEE30F22; Tue, 10 Oct 2017 13:06:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88A8681191; Tue, 10 Oct 2017 13:06:12 +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 v9AD6BuU086032; Tue, 10 Oct 2017 13:06:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD6Bck086031; Tue, 10 Oct 2017 13:06:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710101306.v9AD6Bck086031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Oct 2017 13:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324496 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:06:12 -0000 Author: bapt Date: Tue Oct 10 13:06:11 2017 New Revision: 324496 URL: https://svnweb.freebsd.org/changeset/base/324496 Log: Do not print error when running make check-old on system without catpages directories Reported by: dim Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 10 13:05:26 2017 (r324495) +++ head/Makefile.inc1 Tue Oct 10 13:06:11 2017 (r324496) @@ -2590,7 +2590,7 @@ check-old-files: .PHONY done; \ done # Check for catpages without corresponding manpages. - @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ + @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ while read catpage; do \ read manpage; \ From owner-svn-src-all@freebsd.org Tue Oct 10 13:23:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CF7E319C8; Tue, 10 Oct 2017 13:23:26 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4D12822D6; Tue, 10 Oct 2017 13:23:25 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id j126so45097980oia.10; Tue, 10 Oct 2017 06:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=w277796g0AvXYWxKgYN1kUUDcKx/aTFLFqN8QIVdVxo=; b=HQ6A6ZHIBRivIMC0307WSXCZvgfqf1S0wiMbHLgTDhToqiUyCwp7J0d0vVSzbdU++o XpECBd2okXWxj+2cD/EtC3ehv7JttdkceaDRK83TwNwtmA3+2LP8ZRv1Vb4NYrtq33bm RzvMQ/Hx0fbrnxrG1KlJ4I5w19i7efVuzGCG7IxaqYsaXJgndqdt0OkEaI+9ph+4Qo7J 2Zh+ORdy28Bfc+jHF5P8KDCFnz3/Y7m/3lEh4BtO85oKsRGxv4YI8KbiTweN1laYTyNG AE1TTvP7AdXqa2p6/5XjYr+QJQ8CsEywvbvV37RvxnrbwLymcqJJXxFavv149LiJf+HK vPnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=w277796g0AvXYWxKgYN1kUUDcKx/aTFLFqN8QIVdVxo=; b=UasJU5gvGHT8dZOWNSlWzBOjjBAJXDWL2tRfwoVqUnS1CXeblViG9gmD92h5lh2qxv 7JIU/V7fL0YNhaLYq9h7rY4dSWWNb4xUnoXJ4Bt0ckaYkxms9MaMNm1drGy5zRHAjYnY KiLzquCmHRQYrNBpdqsrz8XtPOaPvKn1jYEWkFdw/QyLk7+1uHhsvcR3r21RcCB6PWwa f5USZqHonCrX7yOKHTOr8ljczFEI9Z3PP5xIpo4/MD40Y11fLWrWxo5yGPsx+CXirKSl SD77d5V+ljDzMe3/hhL0M/1g2dW4qyAQuNrjPL5Pd5BV4NvYoe1DKUZp6In+ecovaDnX PyOw== X-Gm-Message-State: AMCzsaXRr5B5RaJ8w0uip7X6QyHNLK604B6E9KHHm3K9oNRnI30ZwJHm 6C0BLE5Rhpfc0BQWpRcMYX1H+RsKPYjKT6i9MYk= X-Google-Smtp-Source: AOwi7QAU6JEDfHFdnM7CxELOxzU49hFha6CDKbQV+70UwMb3ef7v06/D+6x74pBRsTKQBzY0fveP6rVExS+mJHabvuA= X-Received: by 10.157.46.207 with SMTP id w73mr265663ota.227.1507641804946; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) Received: by 10.74.10.211 with HTTP; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) In-Reply-To: <20171010071703.GR95911@kib.kiev.ua> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> <20171010071703.GR95911@kib.kiev.ua> From: Jason Eggleston Date: Tue, 10 Oct 2017 06:23:24 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Konstantin Belousov Cc: Gleb Smirnoff , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:23:26 -0000 Sendfile does return EPIPE today. All that has to happen is receiving a RST after sendfile starts looping. There is a race condition, which still exists after this suggested patch, where ECONNRESET could be returned. But mostly it is EPIPE. On Oct 10, 2017 12:17 AM, "Konstantin Belousov" wrote: > On Mon, Oct 09, 2017 at 04:20:52PM -0700, Gleb Smirnoff wrote: > > Sean & Jason, > > > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > > S> Author: sbruno > > S> Date: Sat Oct 7 23:30:57 2017 > > S> New Revision: 324405 > > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > > S> > > S> Log: > > S> Check so_error early in sendfile() call. Prior to this patch, if a > > S> connection was reset by the remote end, sendfile() would just report > > S> ENOTCONN instead of ECONNRESET. > > S> > > S> Submitted by: Jason Eggleston > > S> Reviewed by: glebius > > S> Sponsored by: Limelight Networks > > S> Differential Revision: https://reviews.freebsd.org/D12575 > > S> > > S> Modified: > > S> head/sys/kern/kern_sendfile.c > > S> > > S> Modified: head/sys/kern/kern_sendfile.c > > S> ============================================================ > ================== > > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 > (r324404) > > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 > (r324405) > > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, > struct file > > S> *so = (*sock_fp)->f_data; > > S> if ((*so)->so_type != SOCK_STREAM) > > S> return (EINVAL); > > S> + if ((*so)->so_error) { > > S> + error = (*so)->so_error; > > S> + (*so)->so_error = 0; > > S> + return (error); > > S> + } > > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > > S> return (ENOTCONN); > > S> return (0); > > > > Despite my initial positive review, now I am quite unsure on that. > > > > Problem is that sendfile(2) isn't defined by SUS, so there is no > > distinctive final answer on that. Should we match other OSes? > > Should we match our historic behaviour? Or should we match > > write(2)/send(2) to socket, which are closest analogy. I probably > > believe in the latter: sendfile(2) belongs to write(2)/send(2) > > family. > > > > SUS specifies that write may return ECONNRESET. It also documents > > EPIPE. However, our manual page documents only EPIPE for both > > send(2) and write(2). For write we have: > > > > SOCKBUF_LOCK(&so->so_snd); > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > > SOCKBUF_UNLOCK(&so->so_snd); > > error = EPIPE; > > goto out; > > } > > if (so->so_error) { > > error = so->so_error; > > so->so_error = 0; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto out; > > } > > > > Indeed, EPIPE will be returned prior to return/clear of so_error, > > which supposedly is ECONNRESET. > > > > In the sendfile(2) implementation we see exactly same code: > > > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > > error = EPIPE; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } else if (so->so_error) { > > error = so->so_error; > > so->so_error = 0; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } > > > > But it isn't reached. Before due to SS_ISCONNECTED check, now > > due to your change. Now we got two spots where so_error is > > returned/cleared. > Do you mean that EPIPE could be returned from sendfile(2) after some > round of changes ? It should be not. > > EPIPE is a workaround for naive programs that use stdio and cannot detect > the broken pipe when used as an element in the shell plumbing. EPIPE > results in SIGPIPE terminating such programs (instead of looping endlessly > when write(2) returns error). > > Any application using sendfile(2) must understand the API to properly > handle > disconnects, so SIGPIPE workaround would be avoided. Often such > applications > are already sofisticated enough to block SIGPIPE, but if blocking becomes > a new requirement because EPIPE was not returned in earlier version of > the system, they might not block it still. > > > > > For the receive family (read(2) and recv(2)), SUS specifies > > ECONNRESET and our code does that. It also clears so_error. > > > > So, after your change at least one standard case is broken: an > > application that polls/selects for both readability and > > writeability of a socket. It discovers that socket is available > > for writing, does sendfile(2), receives ECONNRESET. Then it does > > read on the socket, and blocks(?) or returns a bogus error(?), > > not sure. But definitely not ECONNRESET, since it is now cleared. > > > > Now, where does this ENOTCONN come from? These two lines: > > > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > > return (ENOTCONN); > > > > can be traced back all the way to original 1998 commit of sendfile. > > > > Here comes difference between sendfile(2) and send(2). In send(2), > > this check is done _after_ so_error check, so your change is correct > > in placing of so_error check wrt so_state check, but is incorrect > > in placing wrt socket buffer state check. > > > > After all this considerations, I would suggest to revert your change, > > and apply this patch. It would make behavior of sendfile(2) to match > > send(2). I would appreciate more reviews around it. > > > > -- > > Gleb Smirnoff > > > Index: kern_sendfile.c > > =================================================================== > > --- kern_sendfile.c (revision 324457) > > +++ kern_sendfile.c (working copy) > > @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct > > *so = (*sock_fp)->f_data; > > if ((*so)->so_type != SOCK_STREAM) > > return (EINVAL); > > - if ((*so)->so_error) { > > - error = (*so)->so_error; > > - (*so)->so_error = 0; > > - return (error); > > - } > > - if (((*so)->so_state & SS_ISCONNECTED) == 0) > > - return (ENOTCONN); > > return (0); > > } > > > > @@ -622,6 +615,12 @@ retry_space: > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } > > + if ((so->so_state & SS_ISCONNECTED) == 0) { > > + SOCKBUF_UNLOCK(&so->so_snd); > > + error = ENOTCONN; > > + goto done; > > + } > > + > > space = sbspace(&so->so_snd); > > if (space < rem && > > (space <= 0 || > > From owner-svn-src-all@freebsd.org Tue Oct 10 14:46:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65020E33E08; Tue, 10 Oct 2017 14:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 280F284E84; Tue, 10 Oct 2017 14:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA02552; Tue, 10 Oct 2017 17:46:27 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1vnf-0001ey-1y; Tue, 10 Oct 2017 17:46:27 +0300 From: Andriy Gapon Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> Message-ID: <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> Date: Tue, 10 Oct 2017 17:45:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201709112149.v8BLncAs049328@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 14:46:31 -0000 On 12/09/2017 00:49, Ian Lepore wrote: > Author: ian > Date: Mon Sep 11 21:49:38 2017 > New Revision: 323465 > URL: https://svnweb.freebsd.org/changeset/base/323465 > > Log: > Make i2c -s (device scan) work on hardware that supports only full xfers. > > The existing scan code is based on sending an i2c START condition and if > there is no error it assumes there is a device at that i2c address. Some > i2c controllers don't support sending individual start/stop signals on the > bus, they can only perform complete data transfers with start/stop handled > in the silicon. > > This adds a fallback mechanism that attempts to read a single byte from each > i2c address. It's less reliable than looking for an an ACK repsonse to a > start, because some devices will NAK an attempt to read that isn't preceeded > by a write of a register address. Writing to devices to probe them is too > dangerous to even consider. The user is told that a less-reliable scan is > being done, so even if the read-scan comes up empty too, it's still a vast > improvement over the old situation where it would just claim there were no > devices on the bus even though the devices were there and working fine. > > If the i2c controller responds with a proper ENODEV (device doesn't support > operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > to a read-scan right away. Most controllers respond with ENXIO or EIO if > they don't support START/STOP, so no quick-out is available. For those, > if a scan of all 127 addresses and come up empty, the scan is re-done using > the read method. Perhaps the new scan method should have been added as a separate option that has to be explicitly activated... My concern is that there are some extremely simple I2C devices out there that do no sanity checking and may get confused > Reported by: Maxim Filimonov > > Modified: > head/usr.sbin/i2c/i2c.c > > Modified: head/usr.sbin/i2c/i2c.c > ============================================================================== > --- head/usr.sbin/i2c/i2c.c Mon Sep 11 21:32:35 2017 (r323464) > +++ head/usr.sbin/i2c/i2c.c Mon Sep 11 21:49:38 2017 (r323465) > @@ -121,9 +121,12 @@ skip_get_tokens(char *skip_addr, int *sk_addr, int max > static int > scan_bus(struct iiccmd cmd, char *dev, int skip, char *skip_addr) > { > + struct iic_msg rdmsg; > + struct iic_rdwr_data rdwrdata; > struct skip_range addr_range = { 0, 0 }; > int *tokens, fd, error, i, index, j; > - int len = 0, do_skip = 0, no_range = 1; > + int len = 0, do_skip = 0, no_range = 1, num_found = 0, use_read_xfer = 0; > + uint8_t rdbyte; > > fd = open(dev, O_RDWR); > if (fd == -1) { > @@ -157,6 +160,14 @@ scan_bus(struct iiccmd cmd, char *dev, int skip, char > } > > printf("Scanning I2C devices on %s: ", dev); > + > +start_over: > + if (use_read_xfer) { > + fprintf(stderr, > + "Hardware may not support START/STOP scanning; " > + "trying less-reliable read method.\n"); > + } > + > for (i = 1; i < 127; i++) { > > if (skip && ( addr_range.start < addr_range.end)) { > @@ -180,17 +191,46 @@ scan_bus(struct iiccmd cmd, char *dev, int skip, char > cmd.last = 1; > cmd.count = 0; > error = ioctl(fd, I2CRSTCARD, &cmd); > - if (error) > + if (error) { > + fprintf(stderr, "Controller reset failed\n"); > goto out; > - > - cmd.slave = i << 1; > - cmd.last = 1; > - error = ioctl(fd, I2CSTART, &cmd); > - if (!error) > - printf("%x ", i); > - cmd.slave = i << 1; > - cmd.last = 1; > - error = ioctl(fd, I2CSTOP, &cmd); > + } > + if (use_read_xfer) { > + rdmsg.buf = &rdbyte; > + rdmsg.len = 1; > + rdmsg.flags = IIC_M_RD; > + rdmsg.slave = i << 1; > + rdwrdata.msgs = &rdmsg; > + rdwrdata.nmsgs = 1; > + error = ioctl(fd, I2CRDWR, &rdwrdata); > + } else { > + cmd.slave = i << 1; > + cmd.last = 1; > + error = ioctl(fd, I2CSTART, &cmd); > + if (errno == ENODEV || errno == EOPNOTSUPP) { > + /* If START not supported try reading. */ > + use_read_xfer = 1; > + goto start_over; > + } > + cmd.slave = i << 1; > + cmd.last = 1; > + ioctl(fd, I2CSTOP, &cmd); > + } > + if (error == 0) { > + ++num_found; > + printf("%02x ", i); > + } > + } > + /* > + * If we found nothing, maybe START is not supported and returns a > + * generic error code such as EIO or ENXIO, so try again using reads. > + */ > + if (num_found == 0) { > + if (!use_read_xfer) { > + use_read_xfer = 1; > + goto start_over; > + } > + printf(""); > } > printf("\n"); > > -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Oct 10 15:39:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7F3E3505E; Tue, 10 Oct 2017 15:39:29 +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 89D521AE9; Tue, 10 Oct 2017 15:39:28 +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 v9AFdNUn083073; Tue, 10 Oct 2017 08:39:24 -0700 (PDT) (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 v9AFdMMM083072; Tue, 10 Oct 2017 08:39:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201710101539.v9AFdMMM083072@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r324406 - head/sys/modules/em In-Reply-To: To: "Ngie Cooper (yaneurabeya)" Date: Tue, 10 Oct 2017 08:39:22 -0700 (PDT) CC: Ian Lepore , Sean Bruno , Brooks Davis , rgrimes@freebsd.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 15:39:29 -0000 > > > On Oct 9, 2017, at 18:54, Ian Lepore wrote: > > ... > > > I think the right answer here is just > > > > LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko > > That will definitely work and is probably the best pattern. > Thanks, > -Ngie I concur, a hard link would probably be a better solution all around than a symlink, unless there is some major reason for this to be a symlink? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Oct 10 15:41:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49433E35541; Tue, 10 Oct 2017 15:41:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18FCE2003; Tue, 10 Oct 2017 15:41:37 +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 v9AFfaQx051652; Tue, 10 Oct 2017 15:41:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AFfaiw051651; Tue, 10 Oct 2017 15:41:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710101541.v9AFfaiw051651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 15:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324497 - head/usr.bin/su X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/su X-SVN-Commit-Revision: 324497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 15:41:37 -0000 Author: ngie Date: Tue Oct 10 15:41:35 2017 New Revision: 324497 URL: https://svnweb.freebsd.org/changeset/base/324497 Log: Mute gcc warning about p not being possibly initialized I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and powerpc. MFC after: 1 week Modified: head/usr.bin/su/su.c Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Tue Oct 10 13:06:11 2017 (r324496) +++ head/usr.bin/su/su.c Tue Oct 10 15:41:35 2017 (r324497) @@ -172,7 +172,7 @@ main(int argc, char *argv[]) au_id_t auid; #endif - shell = class = cleanenv = NULL; + p = shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; user = "root"; iscsh = UNSET; From owner-svn-src-all@freebsd.org Tue Oct 10 16:12:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 865CAE3634F for ; Tue, 10 Oct 2017 16:12:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 69E4E3305 for ; Tue, 10 Oct 2017 16:12:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c55db599-add5-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id c55db599-add5-11e7-b50b-53dc5ecda239; Tue, 10 Oct 2017 16:12:11 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AGCimK004201; Tue, 10 Oct 2017 10:12:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507651963.84167.37.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 10:12:43 -0600 In-Reply-To: <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:12:52 -0000 On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: > On 12/09/2017 00:49, Ian Lepore wrote: > > > > Author: ian > > Date: Mon Sep 11 21:49:38 2017 > > New Revision: 323465 > > URL: https://svnweb.freebsd.org/changeset/base/323465 > > > > Log: > >   Make i2c -s (device scan) work on hardware that supports only full xfers. > >    > >   The existing scan code is based on sending an i2c START condition and if > >   there is no error it assumes there is a device at that i2c address.  Some > >   i2c controllers don't support sending individual start/stop signals on the > >   bus, they can only perform complete data transfers with start/stop handled > >   in the silicon. > >    > >   This adds a fallback mechanism that attempts to read a single byte from each > >   i2c address.  It's less reliable than looking for an an ACK repsonse to a > >   start, because some devices will NAK an attempt to read that isn't preceeded > >   by a write of a register address.  Writing to devices to probe them is too > >   dangerous to even consider.  The user is told that a less-reliable scan is > >   being done, so even if the read-scan comes up empty too, it's still a vast > >   improvement over the old situation where it would just claim there were no > >   devices on the bus even though the devices were there and working fine. > >    > >   If the i2c controller responds with a proper ENODEV (device doesn't support > >   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > >   to a read-scan right away.  Most controllers respond with ENXIO or EIO if > >   they don't support START/STOP, so no quick-out is available.  For those, > >   if a scan of all 127 addresses and come up empty, the scan is re-done using > >   the read method. > > Perhaps the new scan method should have been added as a separate option that has > to be explicitly activated...  My concern is that there are some extremely > simple I2C devices out there that do no sanity checking and may get confused > i2c -s is not a thing that's done routinely in a production system or normal system operations... it's something a person does manually when trying to configure or debug a system.  In that situation, there is more harm in being told there are no working devices on the bus when in fact everything is fine, than there is some some hypothetical device doing some hypothetical "bad thing" in response to a read command.  In all my years of working with i2c stuff I've never seen a device doing anything more harmful than hanging the bus, requiring a reset (and even causing that requires worse behavior than an unexpected read).  On the other hand, I've seen a lot of people frustrated that i2c -s on freebsd says there are no devices, while the equivelent command on linux shows that everything is fine. -- Ian From owner-svn-src-all@freebsd.org Tue Oct 10 16:17:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC567E3641A; Tue, 10 Oct 2017 16:17:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9959134B8; Tue, 10 Oct 2017 16:17:04 +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 v9AGH3Ag065098; Tue, 10 Oct 2017 16:17:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AGH3fc065096; Tue, 10 Oct 2017 16:17:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201710101617.v9AGH3fc065096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 10 Oct 2017 16:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324499 - head/sbin/growfs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/growfs X-SVN-Commit-Revision: 324499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:17:04 -0000 Author: mckusick Date: Tue Oct 10 16:17:03 2017 New Revision: 324499 URL: https://svnweb.freebsd.org/changeset/base/324499 Log: Growfs got missed in r323923 that added a check hash to cylinder groups. This makes the needed changes to add/update cylinder group check hashes when a filesystem is expanded. Reported by: kib and Warner Losh (imp) Reviewed by: kib Tested by: Peter Holm (pho) Modified: head/sbin/growfs/Makefile head/sbin/growfs/growfs.c Modified: head/sbin/growfs/Makefile ============================================================================== --- head/sbin/growfs/Makefile Tue Oct 10 15:46:58 2017 (r324498) +++ head/sbin/growfs/Makefile Tue Oct 10 16:17:03 2017 (r324499) @@ -20,7 +20,7 @@ CFLAGS+= -DFS_DEBUG NO_WCAST_ALIGN= yes .endif -LIBADD= util +LIBADD= ufs util HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Oct 10 15:46:58 2017 (r324498) +++ head/sbin/growfs/growfs.c Tue Oct 10 16:17:03 2017 (r324499) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "debug.h" @@ -121,6 +122,7 @@ static void updcsloc(time_t, int, int, unsigned int); static void frag_adjust(ufs2_daddr_t, int); static void updclst(int); static void mount_reload(const struct statfs *stfs); +static void cgckhash(struct cg *); /* * Here we actually start growing the file system. We basically read the @@ -480,6 +482,7 @@ initcg(int cylno, time_t modtime, int fso, unsigned in sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + cgckhash(&acg); memcpy(iobuf, &acg, sblock.fs_cgsize); memset(iobuf + sblock.fs_cgsize, '\0', sblock.fs_bsize * 3 - sblock.fs_cgsize); @@ -771,6 +774,7 @@ updjcg(int cylno, time_t modtime, int fsi, int fso, un /* * Write the updated "joining" cylinder group back to disk. */ + cgckhash(&acg); wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); DBG_PRINT0("jcg written\n"); @@ -1738,4 +1742,18 @@ mount_reload(const struct statfs *stfs) err(9, "%s: cannot reload filesystem%s%s", stfs->f_mntonname, *errmsg != '\0' ? ": " : "", errmsg); } +} + +/* + * Calculate the check-hash of the cylinder group. + */ +static void +cgckhash(cgp) + struct cg *cgp; +{ + + if ((sblock.fs_metackhash & CK_CYLGRP) == 0) + return; + cgp->cg_ckhash = 0; + cgp->cg_ckhash = calculate_crc32c(~0L, (void *)cgp, sblock.fs_cgsize); } From owner-svn-src-all@freebsd.org Tue Oct 10 16:21:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF332E36684; Tue, 10 Oct 2017 16:21:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 74F0038E1; Tue, 10 Oct 2017 16:21:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA02726; Tue, 10 Oct 2017 19:21:21 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xHU-0001ia-V5; Tue, 10 Oct 2017 19:21:20 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> From: Andriy Gapon Message-ID: Date: Tue, 10 Oct 2017 19:20:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:21:24 -0000 On 10/10/2017 19:12, Ian Lepore wrote: > i2c -s is not a thing that's done routinely in a production system or > normal system operations... it's something a person does manually when > trying to configure or debug a system.  In that situation, there is > more harm in being told there are no working devices on the bus when in > fact everything is fine, than there is some some hypothetical device > doing some hypothetical "bad thing" in response to a read command.  In > all my years of working with i2c stuff I've never seen a device doing > anything more harmful than hanging the bus, requiring a reset (and even > causing that requires worse behavior than an unexpected read).  On the > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > says there are no devices, while the equivelent command on linux shows > that everything is fine. Okay. However, I will just mention that in the past I used to own a system where scanning the bus would make a slave that controlled CPU frequency to change it to some garbage. The system "just" crashed, but theoretically the damage could have been worse. Also, I own a system right now where scanning the bus results in something like what you mentioned, but a little bit worse, the hanging bus that can be brought back only by a power cycle (not even a warm reset). -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Oct 10 16:23:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A264E368DF; Tue, 10 Oct 2017 16:23:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 378AC3BE7; Tue, 10 Oct 2017 16:23:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA02734; Tue, 10 Oct 2017 19:23:37 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xJh-0001im-JJ; Tue, 10 Oct 2017 19:23:37 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> From: Andriy Gapon Message-ID: <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> Date: Tue, 10 Oct 2017 19:23:02 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:23:41 -0000 On 10/10/2017 19:12, Ian Lepore wrote: > On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: >> On 12/09/2017 00:49, Ian Lepore wrote: >>> >>> Author: ian >>> Date: Mon Sep 11 21:49:38 2017 >>> New Revision: 323465 >>> URL: https://svnweb.freebsd.org/changeset/base/323465 >>> >>> Log: >>>   Make i2c -s (device scan) work on hardware that supports only full xfers. >>>    >>>   The existing scan code is based on sending an i2c START condition and if >>>   there is no error it assumes there is a device at that i2c address.  Some >>>   i2c controllers don't support sending individual start/stop signals on the >>>   bus, they can only perform complete data transfers with start/stop handled >>>   in the silicon. >>>    >>>   This adds a fallback mechanism that attempts to read a single byte from each >>>   i2c address.  It's less reliable than looking for an an ACK repsonse to a >>>   start, because some devices will NAK an attempt to read that isn't preceeded >>>   by a write of a register address.  Writing to devices to probe them is too >>>   dangerous to even consider.  The user is told that a less-reliable scan is >>>   being done, so even if the read-scan comes up empty too, it's still a vast >>>   improvement over the old situation where it would just claim there were no >>>   devices on the bus even though the devices were there and working fine. >>>    >>>   If the i2c controller responds with a proper ENODEV (device doesn't support >>>   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched >>>   to a read-scan right away.  Most controllers respond with ENXIO or EIO if >>>   they don't support START/STOP, so no quick-out is available.  For those, >>>   if a scan of all 127 addresses and come up empty, the scan is re-done using >>>   the read method. >> >> Perhaps the new scan method should have been added as a separate option that has >> to be explicitly activated...  My concern is that there are some extremely >> simple I2C devices out there that do no sanity checking and may get confused >> > > i2c -s is not a thing that's done routinely in a production system or > normal system operations... it's something a person does manually when > trying to configure or debug a system. Right. And another point, it's not extremely hard to type another option on the command line. I haven't suggested that the functionality should not have been added at all, I have just suggested adding a new option to unlock it. > In that situation, there is > more harm in being told there are no working devices on the bus when in > fact everything is fine, than there is some some hypothetical device > doing some hypothetical "bad thing" in response to a read command.  In > all my years of working with i2c stuff I've never seen a device doing > anything more harmful than hanging the bus, requiring a reset (and even > causing that requires worse behavior than an unexpected read).  On the > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > says there are no devices, while the equivelent command on linux shows > that everything is fine. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Oct 10 16:42:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E078E36FD3 for ; Tue, 10 Oct 2017 16:42:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 09C02638AD for ; Tue, 10 Oct 2017 16:42:34 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 01450651-adda-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 01450651-adda-11e7-a893-25625093991c; Tue, 10 Oct 2017 16:42:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AGgQnd004242; Tue, 10 Oct 2017 10:42:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507653746.84167.40.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 10:42:26 -0600 In-Reply-To: References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:42:35 -0000 On Tue, 2017-10-10 at 19:20 +0300, Andriy Gapon wrote: > On 10/10/2017 19:12, Ian Lepore wrote: > > > > i2c -s is not a thing that's done routinely in a production system or > > normal system operations... it's something a person does manually when > > trying to configure or debug a system.  In that situation, there is > > more harm in being told there are no working devices on the bus when in > > fact everything is fine, than there is some some hypothetical device > > doing some hypothetical "bad thing" in response to a read command.  In > > all my years of working with i2c stuff I've never seen a device doing > > anything more harmful than hanging the bus, requiring a reset (and even > > causing that requires worse behavior than an unexpected read).  On the > > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > > says there are no devices, while the equivelent command on linux shows > > that everything is fine. > Okay. > > However, I will just mention that in the past I used to own a system where > scanning the bus would make a slave that controlled CPU frequency to change it > to some garbage.  The system "just" crashed, but theoretically the damage could > have been worse. > Also, I own a system right now where scanning the bus results in something like > what you mentioned, but a little bit worse, the hanging bus that can be brought > back only by a power cycle (not even a warm reset). > These systems didn't used to hang on i2c -s, and now they do? -- Ian From owner-svn-src-all@freebsd.org Tue Oct 10 17:01:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 876BFE378B0; Tue, 10 Oct 2017 17:01:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 385F06431C; Tue, 10 Oct 2017 17:01:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA02806; Tue, 10 Oct 2017 20:01:53 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xuj-0001kH-7d; Tue, 10 Oct 2017 20:01:53 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <1507653746.84167.40.camel@freebsd.org> From: Andriy Gapon Message-ID: <736553e2-050b-a444-d52e-5526e03c0ae8@FreeBSD.org> Date: Tue, 10 Oct 2017 20:00:32 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507653746.84167.40.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:01:56 -0000 On 10/10/2017 19:42, Ian Lepore wrote: > On Tue, 2017-10-10 at 19:20 +0300, Andriy Gapon wrote: >> On 10/10/2017 19:12, Ian Lepore wrote: >>> >>> i2c -s is not a thing that's done routinely in a production system or >>> normal system operations... it's something a person does manually when >>> trying to configure or debug a system.  In that situation, there is >>> more harm in being told there are no working devices on the bus when in >>> fact everything is fine, than there is some some hypothetical device >>> doing some hypothetical "bad thing" in response to a read command.  In >>> all my years of working with i2c stuff I've never seen a device doing >>> anything more harmful than hanging the bus, requiring a reset (and even >>> causing that requires worse behavior than an unexpected read).  On the >>> other hand, I've seen a lot of people frustrated that i2c -s on freebsd >>> says there are no devices, while the equivelent command on linux shows >>> that everything is fine. >> Okay. >> >> However, I will just mention that in the past I used to own a system where >> scanning the bus would make a slave that controlled CPU frequency to change it >> to some garbage.  The system "just" crashed, but theoretically the damage could >> have been worse. >> Also, I own a system right now where scanning the bus results in something like >> what you mentioned, but a little bit worse, the hanging bus that can be brought >> back only by a power cycle (not even a warm reset). >> > > These systems didn't used to hang on i2c -s, and now they do? Sorry, I failed to clarify that I talked about smbus and smbmsg -p. I imagine that pure i2c slaves can be as fragile. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Oct 10 17:04:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCEE5E37A68 for ; Tue, 10 Oct 2017 17:04:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 7769D6450E for ; Tue, 10 Oct 2017 17:04:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0098d88a-addd-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 0098d88a-addd-11e7-a893-25625093991c; Tue, 10 Oct 2017 17:03:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AH3rK3004302; Tue, 10 Oct 2017 11:03:54 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507655033.84167.54.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 11:03:53 -0600 In-Reply-To: <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:04:04 -0000 On Tue, 2017-10-10 at 19:23 +0300, Andriy Gapon wrote: > On 10/10/2017 19:12, Ian Lepore wrote: > > > > On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: > > > > > > On 12/09/2017 00:49, Ian Lepore wrote: > > > > > > > > > > > > Author: ian > > > > Date: Mon Sep 11 21:49:38 2017 > > > > New Revision: 323465 > > > > URL: https://svnweb.freebsd.org/changeset/base/323465 > > > > > > > > Log: > > > >   Make i2c -s (device scan) work on hardware that supports only full xfers. > > > >    > > > >   The existing scan code is based on sending an i2c START condition and if > > > >   there is no error it assumes there is a device at that i2c address.  Some > > > >   i2c controllers don't support sending individual start/stop signals on the > > > >   bus, they can only perform complete data transfers with start/stop handled > > > >   in the silicon. > > > >    > > > >   This adds a fallback mechanism that attempts to read a single byte from each > > > >   i2c address.  It's less reliable than looking for an an ACK repsonse to a > > > >   start, because some devices will NAK an attempt to read that isn't preceeded > > > >   by a write of a register address.  Writing to devices to probe them is too > > > >   dangerous to even consider.  The user is told that a less-reliable scan is > > > >   being done, so even if the read-scan comes up empty too, it's still a vast > > > >   improvement over the old situation where it would just claim there were no > > > >   devices on the bus even though the devices were there and working fine. > > > >    > > > >   If the i2c controller responds with a proper ENODEV (device doesn't support > > > >   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > > > >   to a read-scan right away.  Most controllers respond with ENXIO or EIO if > > > >   they don't support START/STOP, so no quick-out is available.  For those, > > > >   if a scan of all 127 addresses and come up empty, the scan is re-done using > > > >   the read method. > > > Perhaps the new scan method should have been added as a separate option that has > > > to be explicitly activated...  My concern is that there are some extremely > > > simple I2C devices out there that do no sanity checking and may get confused > > > > > i2c -s is not a thing that's done routinely in a production system or > > normal system operations... it's something a person does manually when > > trying to configure or debug a system. > Right.  And another point, it's not extremely hard to type another option on the > command line.  I haven't suggested that the functionality should not have been > added at all, I have just suggested adding a new option to unlock it. > This conversation is making me think harder about what's happening on the bus during the two different kinds of scans, and I'm realizing the answer is "almost exactly the same thing in both cases". A "normal" scan is a START, followed by 9 clocks during which the slave address is put on the bus and either an ACK or NAK happens, followed by a STOP. A new-style "read" scan is a START, followed by 9 clocks during which the slave address is put on the bus and either an ACK or NAK happens, followed by 9 more clocks for transferring a byte+NAK, followed by a STOP. So the entire difference is 9 extra clocks, in terms of bus behavior.  Operationally, the slave device already indicated a willingness to service a read operation when it ACK'd its address following the start. Actually doing the read shouldn't put the device into a bad state, but I guess we could theorize it might... maybe it likes to work in 16-bit chunks and a STOP after 8 bits confuses it.  But before the stop comes a NAK from the master which says "I don't want to read anymore" and if that confuses the device, it's violating the protocol. All in all, I'm now wondering if what should change is removing the wording about the read-based scan being somehow "less reliable", I don't think it really is. -- Ian From owner-svn-src-all@freebsd.org Tue Oct 10 17:28:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749F8E381E0; Tue, 10 Oct 2017 17:28:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2050A650F8; Tue, 10 Oct 2017 17:28:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA02848; Tue, 10 Oct 2017 20:28:12 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1yKC-0001lP-1v; Tue, 10 Oct 2017 20:28:12 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> <1507655033.84167.54.camel@freebsd.org> From: Andriy Gapon Message-ID: <4f91a38d-4de8-b6a7-1076-4f6c200708fe@FreeBSD.org> Date: Tue, 10 Oct 2017 20:27:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507655033.84167.54.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:28:15 -0000 On 10/10/2017 20:03, Ian Lepore wrote: > This conversation is making me think harder about what's happening on > the bus during the two different kinds of scans, and I'm realizing the > answer is "almost exactly the same thing in both cases". > > A "normal" scan is a START, followed by 9 clocks during which the slave > address is put on the bus and either an ACK or NAK happens, followed by > a STOP. > > A new-style "read" scan is a START, followed by 9 clocks during which > the slave address is put on the bus and either an ACK or NAK happens, > followed by 9 more clocks for transferring a byte+NAK, followed by a > STOP. > > So the entire difference is 9 extra clocks, in terms of bus behavior. >  Operationally, the slave device already indicated a willingness to > service a read operation when it ACK'd its address following the start. > > Actually doing the read shouldn't put the device into a bad state, but > I guess we could theorize it might... maybe it likes to work in 16-bit > chunks and a STOP after 8 bits confuses it.  But before the stop comes > a NAK from the master which says "I don't want to read anymore" and if > that confuses the device, it's violating the protocol. > > All in all, I'm now wondering if what should change is removing the > wording about the read-based scan being somehow "less reliable", I > don't think it really is. Well, the misbehaving devices most certainly violate the protocol, but that does not change the fact that they exist. For example, the PLL chip I mentioned earlier simply listened for its slave address and then expected a fixed length sequence of bytes to program a new frequency. The slave even ignored the R/W bit and intermediate start-stop bits. It simply treated the next 8 x N bits as the data. I think that it was this chip or something like it: http://pdf1.alldatasheet.com/datasheet-pdf/view/58355/CYPRESS/W48S111-14.html -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Oct 10 19:14:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 641E7E3A806; Tue, 10 Oct 2017 19:14:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 331E16891F; Tue, 10 Oct 2017 19:14:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AJEejQ040537; Tue, 10 Oct 2017 19:14:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJEenl040536; Tue, 10 Oct 2017 19:14:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710101914.v9AJEenl040536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 19:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324500 - head/sys/modules/em X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/modules/em X-SVN-Commit-Revision: 324500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:14:41 -0000 Author: sbruno Date: Tue Oct 10 19:14:40 2017 New Revision: 324500 URL: https://svnweb.freebsd.org/changeset/base/324500 Log: Hard link if_igb.ko to if_em.ko. Use a LINK directive to ensure that this is more friendly to the tree. Tested this with loader.conf:if_igb_load="YES" and it does the right thing. Submitted by: Ian Lepore Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Tue Oct 10 16:17:03 2017 (r324499) +++ head/sys/modules/em/Makefile Tue Oct 10 19:14:40 2017 (r324500) @@ -22,7 +22,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING -afterinstall: - cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko +LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko .include From owner-svn-src-all@freebsd.org Tue Oct 10 19:20:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C77E3AA3D; Tue, 10 Oct 2017 19:20:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id C2E3C69251; Tue, 10 Oct 2017 19:20:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AJKcMP041750; Tue, 10 Oct 2017 19:20:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJKcto041749; Tue, 10 Oct 2017 19:20:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201710101920.v9AJKcto041749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Oct 2017 19:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324501 - head/sys/dev/acpica/Osd X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/dev/acpica/Osd X-SVN-Commit-Revision: 324501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:20:40 -0000 Author: jkim Date: Tue Oct 10 19:20:38 2017 New Revision: 324501 URL: https://svnweb.freebsd.org/changeset/base/324501 Log: Do not check whether AcpiOsGetTimer() is called during boot. From ACPICA 20170929, AcpiOsGetTimer() should be available early because While() loop timeout mechanism was reimplemented with it. Unfortunately, it means AcpiLoadTables() may cause panic when a While() loop is executed. After having lengthy discussions with ACPICA developers, I have concluded that dummy timecounter is good enough for the purpose and it is the least intrusive solution for now. Also, they reminded me the ACPI specification implies OS timer function should be available before loading tables. Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Tue Oct 10 19:14:40 2017 (r324500) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Tue Oct 10 19:20:38 2017 (r324501) @@ -274,9 +274,6 @@ AcpiOsGetTimer(void) struct bintime bt; UINT64 t; - /* XXX During early boot there is no (decent) timer available yet. */ - KASSERT(cold == 0, ("acpi: timer op not yet supported during boot")); - binuptime(&bt); t = (uint64_t)bt.sec * 10000000; t += ((uint64_t)10000000 * (uint32_t)(bt.frac >> 32)) >> 32; From owner-svn-src-all@freebsd.org Tue Oct 10 19:33:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F8E2E3B09A; Tue, 10 Oct 2017 19:33:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id EA42669C6F; Tue, 10 Oct 2017 19:33:25 +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 v9AJXPbk048837; Tue, 10 Oct 2017 19:33:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJXORV048830; Tue, 10 Oct 2017 19:33:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201710101933.v9AJXORV048830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Oct 2017 19:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324502 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/ha... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/hardware sys/contrib/dev/ac... X-SVN-Commit-Revision: 324502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:33:26 -0000 Author: jkim Date: Tue Oct 10 19:33:24 2017 New Revision: 324502 URL: https://svnweb.freebsd.org/changeset/base/324502 Log: Merge ACPICA 20170929 (take 2). Added: head/sys/contrib/dev/acpica/compiler/aslallocate.c (contents, props changed) - copied, changed from r324104, vendor-sys/acpica/dist/source/compiler/aslallocate.c head/sys/contrib/dev/acpica/compiler/aslcache.c (contents, props changed) - copied, changed from r324104, vendor-sys/acpica/dist/source/compiler/aslcache.c Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.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/asldebug.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparseop.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acconfig.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/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/acpi_cpu.c head/usr.sbin/acpi/iasl/Makefile Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/changes.txt Tue Oct 10 19:33:24 2017 (r324502) @@ -1,4 +1,104 @@ ---------------------------------------- +29 September 2017. Summary of changes for version 20170929: + + +1) ACPICA kernel-resident subsystem: + +Redesigned and implemented an improved ASL While() loop timeout +mechanism. This mechanism is used to prevent infinite loops in the kernel +AML interpreter caused by either non-responsive hardware or incorrect AML +code. The new implementation uses AcpiOsGetTimer instead of a simple +maximum loop count, and is thus more accurate and constant across +different machines. The default timeout is currently 30 seconds, but this +may be adjusted later. + +Renamed the ACPI_AML_INFINITE_LOOP exception to AE_AML_LOOP_TIMEOUT to +better reflect the new implementation of the loop timeout mechanism. + +Updated the AcpiGetTimerDuration interface to cleanup the 64-bit support +and to fix an off-by-one error. Jung-uk Kim. + +Fixed an EFI build problem by updating the makefiles to for a new file +that was added, utstrsuppt.c + + +2) iASL Compiler/Disassembler and Tools: + +Implemented full support for the PDTT, SDEV, and TPM2 ACPI tables. This +includes support in the table disassembler, compiler, and template +generator. + +iASL: Added an exception for an illegal type of recursive method +invocation. If a method creates named objects, the first recursive call +will fail at runtime. This change adds an error detection at compile time +to catch the problem up front. Note: Marking such a method as +"serialized" will not help with this problem, because the same thread can +acquire the method mutex more than once. Example compiler and runtime +output: + + Method (MTH1) + { + Name (INT1, 1) + MTH1 () + } + + dsdt.asl 22: MTH1 () + Error 6152 - ^ Illegal recursive call to method + that creates named objects (MTH1) + +Previous runtime exception: + ACPI Error: [INT1] Namespace lookup failure, + AE_ALREADY_EXISTS (20170831/dswload2-465) + +iASL: Updated support for External() opcodes to improve namespace +management and error detection. These changes are related to issues seen +with multiple-segment namespace pathnames within External declarations, +such as below: + + External(\_SB.PCI0.GFX0, DeviceObj) + External(\_SB.PCI0.GFX0.ALSI) + +iASL: Implemented support for multi-line error/warning messages. This +enables more detailed and helpful error messages as below, from the +initial deployment for the duplicate names error: + + DSDT.iiii 1692: Device(PEG2) { + Error 6074 - ^ Name already exists in scope +(PEG2) + + Original name creation/declaration below: + DSDT.iiii 93: External(\_SB.PCI0.PEG2, DeviceObj) + +AcpiXtract: Added additional flexibility to support differing input hex +dump formats. Specifically, hex dumps that contain partial disassembly +and/or comments within the ACPI table data definition. There exist some +dump utilities seen in the field that create this type of hex dump (such +as Simics). For example: + + DSDT @ 0xdfffd0c0 (10999 bytes) + Signature DSDT + Length 10999 + Revision 1 + Checksum 0xf3 (Ok) + OEM_ID BXPC + OEM_table_id BXDSDT + OEM_revision 1 + Creator_id 1280593481 + Creator_revision 537399345 + 0000: 44 53 44 54 f7 2a 00 00 01 f3 42 58 50 43 00 00 + ... + 2af0: 5f 4c 30 46 00 a4 01 + +Test suite: Miscellaneous changes/fixes: + More cleanup and simplification of makefiles + Continue compilation of test cases after a compile failure + Do not perform binary compare unless both files actually exist + +iASL: Performed some code/module restructuring. Moved all memory +allocation functions to new modules. Two new files, aslallocate.c and +aslcache.c + +---------------------------------------- 31 August 2017. Summary of changes for version 20170831: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/adfile.c Tue Oct 10 19:33:24 2017 (r324502) @@ -314,7 +314,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst * case where we append the suffix, an added dot and the null terminator. */ - NewFilename = UtStringCacheCalloc ((ACPI_SIZE) + NewFilename = UtLocalCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -358,7 +358,7 @@ FlStrdup ( char *NewString; - NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); + NewString = UtLocalCacheCalloc ((ACPI_SIZE) strlen (String) + 1); strcpy (NewString, String); return (NewString); } Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/ahtable.c Tue Oct 10 19:33:24 2017 (r324502) @@ -232,6 +232,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_MTMR, "MID Timer Table"}, {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, + {ACPI_SIG_PDTT, "Platform Debug Trigger Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, @@ -240,6 +241,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_S3PT, "S3 Performance Table"}, {ACPI_SIG_SBST, "Smart Battery Specification Table"}, {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"}, + {ACPI_SIG_SDEV, "Secure Devices table"}, {ACPI_SIG_SLIC, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, "System Locality Information Table"}, {ACPI_SIG_SPCR, "Serial Port Console Redirection table"}, Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/dmtable.c Tue Oct 10 19:33:24 2017 (r324502) @@ -154,7 +154,6 @@ #include #include #include -#include /* This module used for application-level code only */ @@ -290,9 +289,9 @@ static const char *AcpiDmHestSubnames[] = "IA-32 Machine Check Exception", "IA-32 Corrected Machine Check", "IA-32 Non-Maskable Interrupt", - "Unknown SubTable Type", /* 3 - Reserved */ - "Unknown SubTable Type", /* 4 - Reserved */ - "Unknown SubTable Type", /* 5 - Reserved */ + "Unknown Subtable Type", /* 3 - Reserved */ + "Unknown Subtable Type", /* 4 - Reserved */ + "Unknown Subtable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -374,7 +373,7 @@ static const char *AcpiDmPmttSubnames[] = { "Socket", /* ACPI_PMTT_TYPE_SOCKET */ "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ - "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ + "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown Subtable Type" /* Reserved */ }; @@ -382,10 +381,17 @@ static const char *AcpiDmPpttSubnames[] = { "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */ "Cache Type", /* ACPI_PPTT_TYPE_CACHE */ - "ID", /* ACPI_PMTT_TYPE_ID */ + "ID", /* ACPI_PPTT_TYPE_ID */ "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmSdevSubnames[] = +{ + "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */ + "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */ + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", @@ -396,6 +402,23 @@ static const char *AcpiDmSratSubnames[] = "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmTpm2Subnames[] = +{ + "Illegal Start Method value", + "Reserved", + "ACPI Start Method", + "Reserved", + "Reserved", + "Reserved", + "Memory Mapped I/O", + "Command Response Buffer", + "Command Response Buffer with ACPI Start Method", + "Reserved", + "Reserved", + "Command Response Buffer with ARM SMC", + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmIvrsSubnames[] = { "Hardware Definition Block", @@ -487,6 +510,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, + {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt}, {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf}, @@ -494,6 +518,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei}, + {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit}, {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr}, @@ -501,7 +526,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat}, {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao}, {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, - {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2}, + {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet}, @@ -917,6 +942,7 @@ AcpiDmDumpTable ( case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: + case ACPI_DMT_SDEV: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -948,6 +974,7 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_LPIT: + case ACPI_DMT_TPM2: ByteLength = 4; break; @@ -1583,6 +1610,20 @@ AcpiDmDumpTable ( CurrentOffset, NULL); break; + case ACPI_DMT_SDEV: + + /* SDEV subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_SDEV_TYPE_RESERVED) + { + Temp8 = ACPI_SDEV_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmSdevSubnames[Temp8]); + break; + case ACPI_DMT_SRAT: /* SRAT subtable types */ @@ -1596,6 +1637,22 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); break; + + case ACPI_DMT_TPM2: + + /* TPM2 Start Method types */ + + Temp8 = *Target; + if (Temp8 > ACPI_TPM2_RESERVED) + { + Temp8 = ACPI_TPM2_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmTpm2Subnames[Temp8]); + break; + + case ACPI_DMT_FADTPM: Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Oct 10 19:33:24 2017 (r324502) @@ -623,7 +623,7 @@ AcpiDmDumpAsf ( { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *SubTable; + ACPI_ASF_INFO *Subtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT8 *DataTable = NULL; @@ -636,13 +636,13 @@ AcpiDmDumpAsf ( /* No main table, only subtables */ - SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Header.Length, AcpiDmTableInfoAsfHdr); + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Subtable->Header.Length, AcpiDmTableInfoAsfHdr); if (ACPI_FAILURE (Status)) { return; @@ -650,7 +650,7 @@ AcpiDmDumpAsf ( /* The actual type is the lower 7 bits of Type */ - Type = (UINT8) (SubTable->Header.Type & 0x7F); + Type = (UINT8) (Subtable->Header.Type & 0x7F); switch (Type) { @@ -663,9 +663,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -673,9 +673,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -687,20 +687,20 @@ AcpiDmDumpAsf ( case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; default: AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - SubTable->Header.Type); + Subtable->Header.Type); return; } - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Header.Length, InfoTable); + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Subtable->Header.Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -762,15 +762,15 @@ AcpiDmDumpAsf ( /* Point to next subtable */ - if (!SubTable->Header.Length) + if (!Subtable->Header.Length) { AcpiOsPrintf ("Invalid zero subtable header length\n"); return; } - Offset += SubTable->Header.Length; - SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, - SubTable->Header.Length); + Offset += Subtable->Header.Length; + Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, + Subtable->Header.Length); } } @@ -793,7 +793,7 @@ AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CPEP_POLLING *SubTable; + ACPI_CPEP_POLLING *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CPEP); @@ -808,12 +808,12 @@ AcpiDmDumpCpep ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Header.Length, AcpiDmTableInfoCpep0); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -821,9 +821,9 @@ AcpiDmDumpCpep ( /* Point to next subtable */ - Offset += SubTable->Header.Length; - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, - SubTable->Header.Length); + Offset += Subtable->Header.Length; + Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, + Subtable->Header.Length); } } @@ -846,9 +846,9 @@ AcpiDmDumpCsrt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CSRT_GROUP *SubTable; + ACPI_CSRT_GROUP *Subtable; ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubTable; + ACPI_CSRT_DESCRIPTOR *SubSubtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CSRT); UINT32 SubOffset; @@ -860,14 +860,14 @@ AcpiDmDumpCsrt ( /* Subtables (Resource Groups) */ - SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); while (Offset < Table->Length) { /* Resource group subtable */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoCsrt0); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCsrt0); if (ACPI_FAILURE (Status)) { return; @@ -887,19 +887,19 @@ AcpiDmDumpCsrt ( return; } - SubOffset += SubTable->SharedInfoLength; + SubOffset += Subtable->SharedInfoLength; /* Sub-Subtables (Resource Descriptors) */ - SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, + SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, Offset + SubOffset); - while ((SubOffset < SubTable->Length) && + while ((SubOffset < Subtable->Length) && ((Offset + SubOffset) < Table->Length)) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable, - SubSubTable->Length, AcpiDmTableInfoCsrt2); + Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, + SubSubtable->Length, AcpiDmTableInfoCsrt2); if (ACPI_FAILURE (Status)) { return; @@ -909,7 +909,7 @@ AcpiDmDumpCsrt ( /* Resource-specific info buffer */ - InfoLength = SubSubTable->Length - SubSubOffset; + InfoLength = SubSubtable->Length - SubSubOffset; if (InfoLength) { Status = AcpiDmDumpTable (Length, @@ -924,16 +924,16 @@ AcpiDmDumpCsrt ( /* Point to next sub-subtable */ - SubOffset += SubSubTable->Length; - SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable, - SubSubTable->Length); + SubOffset += SubSubtable->Length; + SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, + SubSubtable->Length); } /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, + Subtable->Length); } } @@ -956,7 +956,7 @@ AcpiDmDumpDbg2 ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DBG2_DEVICE *SubTable; + ACPI_DBG2_DEVICE *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DBG2); UINT32 i; @@ -975,12 +975,12 @@ AcpiDmDumpDbg2 ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoDbg2Device); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoDbg2Device); if (ACPI_FAILURE (Status)) { return; @@ -988,15 +988,15 @@ AcpiDmDumpDbg2 ( /* Dump the BaseAddress array */ - for (i = 0; i < SubTable->RegisterCount; i++) + for (i = 0; i < Subtable->RegisterCount; i++) { - ArrayOffset = SubTable->BaseAddressOffset + + ArrayOffset = Subtable->BaseAddressOffset + (sizeof (ACPI_GENERIC_ADDRESS) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Addr); + Subtable->Length, AcpiDmTableInfoDbg2Addr); if (ACPI_FAILURE (Status)) { return; @@ -1005,15 +1005,15 @@ AcpiDmDumpDbg2 ( /* Dump the AddressSize array */ - for (i = 0; i < SubTable->RegisterCount; i++) + for (i = 0; i < Subtable->RegisterCount; i++) { - ArrayOffset = SubTable->AddressSizeOffset + + ArrayOffset = Subtable->AddressSizeOffset + (sizeof (UINT32) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Size); + Subtable->Length, AcpiDmTableInfoDbg2Size); if (ACPI_FAILURE (Status)) { return; @@ -1023,12 +1023,12 @@ AcpiDmDumpDbg2 ( /* Dump the Namestring (required) */ AcpiOsPrintf ("\n"); - ArrayOffset = SubTable->NamepathOffset; + ArrayOffset = Subtable->NamepathOffset; AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Name); + Subtable->Length, AcpiDmTableInfoDbg2Name); if (ACPI_FAILURE (Status)) { return; @@ -1036,10 +1036,10 @@ AcpiDmDumpDbg2 ( /* Dump the OemData (optional) */ - if (SubTable->OemDataOffset) + if (Subtable->OemDataOffset) { - Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset, - Table, SubTable->OemDataLength, + Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, + Table, Subtable->OemDataLength, AcpiDmTableInfoDbg2OemData); if (ACPI_FAILURE (Status)) { @@ -1049,9 +1049,9 @@ AcpiDmDumpDbg2 ( /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, + Subtable->Length); } } @@ -1074,7 +1074,7 @@ AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DMAR_HEADER *SubTable; + ACPI_DMAR_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DMAR); ACPI_DMTABLE_INFO *InfoTable; @@ -1094,14 +1094,14 @@ AcpiDmDumpDmar ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoDmarHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoDmarHdr); if (ACPI_FAILURE (Status)) { return; @@ -1109,7 +1109,7 @@ AcpiDmDumpDmar ( AcpiOsPrintf ("\n"); - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: @@ -1144,12 +1144,12 @@ AcpiDmDumpDmar ( default: AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - SubTable->Type); + Subtable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1158,16 +1158,16 @@ AcpiDmDumpDmar ( /* * Dump the optional device scope entries */ - if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE)) + if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || + (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) { /* These types do not support device scopes */ goto NextSubtable; } - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); - while (ScopeOffset < SubTable->Length) + ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); + while (ScopeOffset < Subtable->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, @@ -1208,9 +1208,9 @@ AcpiDmDumpDmar ( NextSubtable: /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, + Subtable->Length); } } @@ -1343,7 +1343,7 @@ AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *SubTable; + ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_EINJ); @@ -1358,11 +1358,11 @@ AcpiDmDumpEinj ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); if (ACPI_FAILURE (Status)) { @@ -1372,7 +1372,7 @@ AcpiDmDumpEinj ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1396,7 +1396,7 @@ AcpiDmDumpErst ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *SubTable; + ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_ERST); @@ -1411,11 +1411,11 @@ AcpiDmDumpErst ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { @@ -1425,7 +1425,7 @@ AcpiDmDumpErst ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1449,7 +1449,7 @@ AcpiDmDumpFpdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_FPDT_HEADER *SubTable; + ACPI_FPDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_FPDT); ACPI_DMTABLE_INFO *InfoTable; @@ -1459,20 +1459,20 @@ AcpiDmDumpFpdt ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoFpdtHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoFpdtHdr); if (ACPI_FAILURE (Status)) { return; } - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_FPDT_TYPE_BOOT: @@ -1487,31 +1487,31 @@ AcpiDmDumpFpdt ( default: AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - SubTable->Type); + Subtable->Type); /* Attempt to continue */ - if (!SubTable->Length) + if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } - goto NextSubTable; + goto NextSubtable; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } -NextSubTable: +NextSubtable: /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, + Subtable->Length); } } @@ -1534,11 +1534,11 @@ AcpiDmDumpGtdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_GTDT_HEADER *SubTable; + ACPI_GTDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_GTDT); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubTableLength; + UINT32 SubtableLength; UINT32 GtCount; ACPI_GTDT_TIMER_ENTRY *GtxTable; @@ -1553,34 +1553,34 @@ AcpiDmDumpGtdt ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoGtdtHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoGtdtHdr); if (ACPI_FAILURE (Status)) { return; } GtCount = 0; - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: - SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); + SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, - SubTable))->TimerCount; + Subtable))->TimerCount; InfoTable = AcpiDmTableInfoGtdt0; break; case ACPI_GTDT_TYPE_WATCHDOG: - SubTableLength = sizeof (ACPI_GTDT_WATCHDOG); + SubtableLength = sizeof (ACPI_GTDT_WATCHDOG); InfoTable = AcpiDmTableInfoGtdt1; break; @@ -1590,12 +1590,12 @@ AcpiDmDumpGtdt ( /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", - SubTable->Type); + Subtable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1603,15 +1603,15 @@ AcpiDmDumpGtdt ( /* Point to end of current subtable (each subtable above is of fixed length) */ - Offset += SubTableLength; + Offset += SubtableLength; /* If there are any Gt Timer Blocks from above, dump them now */ if (GtCount) { GtxTable = ACPI_ADD_PTR ( - ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength); - SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); + ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength); + SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); while (GtCount) { @@ -1630,7 +1630,7 @@ AcpiDmDumpGtdt ( /* Point to next subtable */ - SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength); + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength); } } @@ -1653,11 +1653,11 @@ AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_HEST_HEADER *SubTable; + ACPI_HEST_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_HEST); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubTableLength; + UINT32 SubtableLength; UINT32 BankCount; ACPI_HEST_IA_ERROR_BANK *BankTable; @@ -1672,70 +1672,70 @@ AcpiDmDumpHest ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); while (Offset < Table->Length) { BankCount = 0; - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_HEST_TYPE_IA32_CHECK: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Oct 10 20:08:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E4FE3B8EC; Tue, 10 Oct 2017 20:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C506AB53; Tue, 10 Oct 2017 20:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AK8Uws061416; Tue, 10 Oct 2017 20:08:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AK8U6V061415; Tue, 10 Oct 2017 20:08:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102008.v9AK8U6V061415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 20:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324503 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 324503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 20:08:32 -0000 Author: emaste Date: Tue Oct 10 20:08:30 2017 New Revision: 324503 URL: https://svnweb.freebsd.org/changeset/base/324503 Log: uart: detect 256-byte FIFOs Submitted by: Zakary Nafziger Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Tue Oct 10 19:33:24 2017 (r324502) +++ head/sys/dev/uart/uart_dev_ns8250.c Tue Oct 10 20:08:30 2017 (r324503) @@ -873,7 +873,7 @@ ns8250_bus_probe(struct uart_softc *sc) count = 0; goto describe; } - } while ((lsr & LSR_OE) == 0 && count < 130); + } while ((lsr & LSR_OE) == 0 && count < 260); count--; uart_setreg(bas, REG_MCR, mcr); @@ -894,6 +894,9 @@ ns8250_bus_probe(struct uart_softc *sc) } else if (count >= 112 && count <= 128) { sc->sc_rxfifosz = 128; device_set_desc(sc->sc_dev, "16950 or compatible"); + } else if (count >= 224 && count <= 256) { + sc->sc_rxfifosz = 256; + device_set_desc(sc->sc_dev, "16x50 with 256 byte FIFO"); } else { sc->sc_rxfifosz = 16; device_set_desc(sc->sc_dev, From owner-svn-src-all@freebsd.org Tue Oct 10 20:45:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A8BE3C71E; Tue, 10 Oct 2017 20:45:47 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB0BA6BF9F; Tue, 10 Oct 2017 20:45:46 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AKjjRH077766; Tue, 10 Oct 2017 20:45:45 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AKjjRI077764; Tue, 10 Oct 2017 20:45:45 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710102045.v9AKjjRI077764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 Oct 2017 20:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324504 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 20:45:47 -0000 Author: davidcs Date: Tue Oct 10 20:45:45 2017 New Revision: 324504 URL: https://svnweb.freebsd.org/changeset/base/324504 Log: Revert Commit r324290 Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:08:30 2017 (r324503) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:45:45 2017 (r324504) @@ -2374,16 +2374,6 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } - for (i = 0; i < num_tx_cmds; i++) { - if (NULL != ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head) { - QL_ASSERT(ha, 0, \ - ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, txr_idx, (tx_idx+i),\ - ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head)); - return (EINVAL); - } - } - tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:08:30 2017 (r324503) +++ head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:45:45 2017 (r324504) @@ -1232,17 +1232,6 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; - - if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { - QL_ASSERT(ha, 0, ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, txr_idx, tx_idx,\ - ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); - if (m_head) - m_freem(m_head); - *m_headp = NULL; - return (ret); - } - map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, From owner-svn-src-all@freebsd.org Tue Oct 10 21:04:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDD0FE3CF54; Tue, 10 Oct 2017 21:04:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B18616CB5D; Tue, 10 Oct 2017 21:04:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AL4eYU085911; Tue, 10 Oct 2017 21:04:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AL4eSM085909; Tue, 10 Oct 2017 21:04:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201710102104.v9AL4eSM085909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 Oct 2017 21:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324505 - in stable/10/lib/libc: gen tests/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in stable/10/lib/libc: gen tests/gen X-SVN-Commit-Revision: 324505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 21:04:42 -0000 Author: pfg Date: Tue Oct 10 21:04:40 2017 New Revision: 324505 URL: https://svnweb.freebsd.org/changeset/base/324505 Log: MFC r322368, r322371: fnmatch(3): improve POSIX conformance. In a recent interpretation[1], "\\" shall return a non-zero value (indicating either no match or an error). The fix involves a change over r254091 and now the behavior matches the Sun/IBM/HP closed source implementations and also likely musl libc. Submitted by: Joerg Schilling [1] http://austingroupbugs.net/view.php?id=806 Modified: stable/10/lib/libc/gen/fnmatch.c stable/10/lib/libc/tests/gen/fnmatch_testcases.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/fnmatch.c ============================================================================== --- stable/10/lib/libc/gen/fnmatch.c Tue Oct 10 20:45:45 2017 (r324504) +++ stable/10/lib/libc/gen/fnmatch.c Tue Oct 10 21:04:40 2017 (r324505) @@ -188,7 +188,8 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, if (!(flags & FNM_NOESCAPE)) { pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs); - if (pclen == (size_t)-1 || pclen == (size_t)-2) + if (pclen == 0 || pclen == (size_t)-1 || + pclen == (size_t)-2) return (FNM_NOMATCH); pattern += pclen; } Modified: stable/10/lib/libc/tests/gen/fnmatch_testcases.h ============================================================================== --- stable/10/lib/libc/tests/gen/fnmatch_testcases.h Tue Oct 10 20:45:45 2017 (r324504) +++ stable/10/lib/libc/tests/gen/fnmatch_testcases.h Tue Oct 10 21:04:40 2017 (r324505) @@ -131,7 +131,7 @@ struct testcase { { "\\(", "\\(", 0, FNM_NOMATCH }, { "\\a", "\\a", 0, FNM_NOMATCH }, { "\\", "\\", 0, FNM_NOMATCH }, - { "\\", "", 0, 0 }, + { "\\", "", 0, FNM_NOMATCH }, { "\\*", "\\*", FNM_NOESCAPE, 0 }, { "\\?", "\\?", FNM_NOESCAPE, 0 }, { "\\", "\\", FNM_NOESCAPE, 0 }, From owner-svn-src-all@freebsd.org Tue Oct 10 21:05:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EAEE3CFC8; Tue, 10 Oct 2017 21:05:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40E006CCA2; Tue, 10 Oct 2017 21:05:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AL5e4c085991; Tue, 10 Oct 2017 21:05:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AL5eCu085989; Tue, 10 Oct 2017 21:05:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710102105.v9AL5eCu085989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 10 Oct 2017 21:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324506 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 324506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 21:05:41 -0000 Author: rmacklem Date: Tue Oct 10 21:05:40 2017 New Revision: 324506 URL: https://svnweb.freebsd.org/changeset/base/324506 Log: Fix forced dismount when a pNFS mount is hung on a DS. When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS, a forced dismount wouldn't work, because the RPC socket for the DS was not being closed. This patch fixes this. This will only affect "pnfs" mounts where the pNFS server's DS is unresponsive (crashed or network partitioned or...). Found during testing of the pNFS server. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfsclstate.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Oct 10 21:04:40 2017 (r324505) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Oct 10 21:05:40 2017 (r324506) @@ -1121,9 +1121,29 @@ nfsmout: int newnfs_nmcancelreqs(struct nfsmount *nmp) { + struct nfsclds *dsp; + struct __rpc_client *cl; if (nmp->nm_sockreq.nr_client != NULL) CLNT_CLOSE(nmp->nm_sockreq.nr_client); +lookformore: + NFSLOCKMNT(nmp); + TAILQ_FOREACH(dsp, &nmp->nm_sess, nfsclds_list) { + NFSLOCKDS(dsp); + if (dsp != TAILQ_FIRST(&nmp->nm_sess) && + (dsp->nfsclds_flags & NFSCLDS_CLOSED) == 0 && + dsp->nfsclds_sockp != NULL && + dsp->nfsclds_sockp->nr_client != NULL) { + dsp->nfsclds_flags |= NFSCLDS_CLOSED; + cl = dsp->nfsclds_sockp->nr_client; + NFSUNLOCKDS(dsp); + NFSUNLOCKMNT(nmp); + CLNT_CLOSE(cl); + goto lookformore; + } + NFSUNLOCKDS(dsp); + } + NFSUNLOCKMNT(nmp); return (0); } Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Tue Oct 10 21:04:40 2017 (r324505) +++ head/sys/fs/nfs/nfsclstate.h Tue Oct 10 21:05:40 2017 (r324506) @@ -91,6 +91,7 @@ struct nfsclds { #define NFSCLDS_HASWRITEVERF 0x0001 #define NFSCLDS_MDS 0x0002 #define NFSCLDS_DS 0x0004 +#define NFSCLDS_CLOSED 0x0008 struct nfsclclient { LIST_ENTRY(nfsclclient) nfsc_list; From owner-svn-src-all@freebsd.org Tue Oct 10 21:16:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95FBE3D3DF; Tue, 10 Oct 2017 21:16:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6CCF6D2D5; Tue, 10 Oct 2017 21:16:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9ALG7hW090014; Tue, 10 Oct 2017 21:16:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ALG77m090013; Tue, 10 Oct 2017 21:16:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102116.v9ALG77m090013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 21:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324507 - head/sbin/growfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sbin/growfs X-SVN-Commit-Revision: 324507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 21:16:09 -0000 Author: emaste Date: Tue Oct 10 21:16:07 2017 New Revision: 324507 URL: https://svnweb.freebsd.org/changeset/base/324507 Log: growfs: ANSIfy cgckhash() The build was broken on GCC-using architectures with: growfs.c: In function 'cgckhash': growfs.c:1753: warning: old-style function definition Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Oct 10 21:05:40 2017 (r324506) +++ head/sbin/growfs/growfs.c Tue Oct 10 21:16:07 2017 (r324507) @@ -1748,8 +1748,7 @@ mount_reload(const struct statfs *stfs) * Calculate the check-hash of the cylinder group. */ static void -cgckhash(cgp) - struct cg *cgp; +cgckhash(struct cg *cgp) { if ((sblock.fs_metackhash & CK_CYLGRP) == 0) From owner-svn-src-all@freebsd.org Tue Oct 10 22:21:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA83E3ED1E; Tue, 10 Oct 2017 22:21:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF2D16F508; Tue, 10 Oct 2017 22:21:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AML5xK015783; Tue, 10 Oct 2017 22:21:05 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AML554015782; Tue, 10 Oct 2017 22:21:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710102221.v9AML554015782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 22:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324508 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 22:21:07 -0000 Author: sbruno Date: Tue Oct 10 22:21:05 2017 New Revision: 324508 URL: https://svnweb.freebsd.org/changeset/base/324508 Log: match sendfile() error handling to send(). Sendfile() should match the error checking order of send() which is currently: SBS_CANTSENDMORE so_error SS_ISCONNECTED Submitted by: Jason Eggleston Reviewed by: glebius MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12633 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Oct 10 21:16:07 2017 (r324507) +++ head/sys/kern/kern_sendfile.c Tue Oct 10 22:21:05 2017 (r324508) @@ -507,8 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if (((*so)->so_state & SS_ISCONNECTED) == 0) - return (ENOTCONN); return (0); } @@ -617,6 +615,12 @@ retry_space: SOCKBUF_UNLOCK(&so->so_snd); goto done; } + if ((so->so_state & SS_ISCONNECTED) == 0) { + SOCKBUF_UNLOCK(&so->so_snd); + error = ENOTCONN; + goto done; + } + space = sbspace(&so->so_snd); if (space < rem && (space <= 0 || From owner-svn-src-all@freebsd.org Tue Oct 10 23:54:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889E9E40B38; Tue, 10 Oct 2017 23:54:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5645671B46; Tue, 10 Oct 2017 23:54:26 +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 v9ANsPZA056335; Tue, 10 Oct 2017 23:54:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ANsPk4056334; Tue, 10 Oct 2017 23:54:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102354.v9ANsPk4056334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 23:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324509 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 324509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 23:54:26 -0000 Author: emaste Date: Tue Oct 10 23:54:25 2017 New Revision: 324509 URL: https://svnweb.freebsd.org/changeset/base/324509 Log: sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR Reported by: Shawn Webb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Tue Oct 10 22:21:05 2017 (r324508) +++ head/share/man/man9/sysctl.9 Tue Oct 10 23:54:25 2017 (r324509) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2016 +.Dd October 10, 2017 .Dt SYSCTL 9 .Os .Sh NAME @@ -668,6 +668,10 @@ Additionally, any of the following optional flags may .Bl -tag -width ".Dv CTLFLAG_ANYBODY" .It Dv CTLFLAG_ANYBODY Any user or process can write to this sysctl. +.It Dv CTLFLAG_CAPRD +A process in capability mode can read from this sysctl. +.It Dv CTLFLAG_CAPWR +A process in capability mode can write to this sysctl. .It Dv CTLFLAG_SECURE This sysctl can be written to only if the effective securelevel of the process is \[<=] 0. From owner-svn-src-all@freebsd.org Wed Oct 11 00:31:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8503DE41673; Wed, 11 Oct 2017 00:31: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 mx1.freebsd.org (Postfix) with ESMTPS id 413F272942; Wed, 11 Oct 2017 00:31: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 v9B0Vs8g072087; Wed, 11 Oct 2017 00:31:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B0VsNT072086; Wed, 11 Oct 2017 00:31:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710110031.v9B0VsNT072086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Oct 2017 00:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324510 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 324510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 00:31:55 -0000 Author: emaste Date: Wed Oct 11 00:31:54 2017 New Revision: 324510 URL: https://svnweb.freebsd.org/changeset/base/324510 Log: MFC r309151: Use explicit 0x200000 for the amd64 kernel physaddr (instead of MAXPAGESIZE) MAXPAGESIZE is not well defined by the GNU ld documentation. Different linkers, and different versions of the same linker, use different MAXPAGESIZE values. Current versions of GNU gold and LLVM's lld use 4K. When set to 4K the kernel panics at boot due to an issue with x86bios. Here we want the kernel physaddr to be the amd64 superpage size, so use that value (2MB) explicitly. With this change GNU gold and LLVM lld can link a working amd64 kernel. PR: 214718 (x86bios) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/ldscript.amd64 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/ldscript.amd64 ============================================================================== --- stable/11/sys/conf/ldscript.amd64 Tue Oct 10 23:54:25 2017 (r324509) +++ stable/11/sys/conf/ldscript.amd64 Wed Oct 11 00:31:54 2017 (r324510) @@ -6,7 +6,7 @@ SEARCH_DIR("/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - kernphys = CONSTANT (MAXPAGESIZE); + kernphys = 0x200000; . = kernbase + kernphys + SIZEOF_HEADERS; /* * Use the AT keyword in order to set the right LMA that contains From owner-svn-src-all@freebsd.org Wed Oct 11 02:39:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE870E43ED6; Wed, 11 Oct 2017 02:39:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7C12475AA3; Wed, 11 Oct 2017 02:39:21 +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 v9B2dKB8022589; Wed, 11 Oct 2017 02:39:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B2dKlx022588; Wed, 11 Oct 2017 02:39:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710110239.v9B2dKlx022588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 11 Oct 2017 02:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324511 - head/contrib/binutils/bfd X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/binutils/bfd X-SVN-Commit-Revision: 324511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 02:39:21 -0000 Author: jhibbits Date: Wed Oct 11 02:39:20 2017 New Revision: 324511 URL: https://svnweb.freebsd.org/changeset/base/324511 Log: Do exception offset computations in 64 bits, not 32. This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step closer to a clang-built world. The same change was made in later upstream binutils. Submitted by: rdivacky MFC after: 2 weeks Modified: head/contrib/binutils/bfd/elf-eh-frame.c Modified: head/contrib/binutils/bfd/elf-eh-frame.c ============================================================================== --- head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 00:31:54 2017 (r324510) +++ head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 02:39:20 2017 (r324511) @@ -1344,7 +1344,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, val = read_value (abfd, buf, per_width, get_DW_EH_PE_signed (per_encoding)); - val += ent->offset - ent->new_offset; + val += (bfd_vma)ent->offset - ent->new_offset; val -= extra_string + extra_data; write_value (abfd, buf, val, per_width); action &= ~4; @@ -1400,7 +1400,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, } break; case DW_EH_PE_pcrel: - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; address += sec->output_section->vma + ent->offset + 8; break; } @@ -1428,7 +1428,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, if (value) { if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel) - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; else if (ent->cie_inf->need_lsda_relative) value -= (sec->output_section->vma + ent->new_offset + 8 + ent->lsda_offset); From owner-svn-src-all@freebsd.org Wed Oct 11 03:50:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA6A1E451DB; Wed, 11 Oct 2017 03:50:45 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B48D777D81; Wed, 11 Oct 2017 03:50:45 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B3oivu052679; Wed, 11 Oct 2017 03:50:44 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B3oiEn052678; Wed, 11 Oct 2017 03:50:44 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201710110350.v9B3oiEn052678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 11 Oct 2017 03:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324512 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 324512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 03:50:46 -0000 Author: lidl Date: Wed Oct 11 03:50:44 2017 New Revision: 324512 URL: https://svnweb.freebsd.org/changeset/base/324512 Log: Don't use a non-zero argument for __builtin_frame_address Mirror the change made for powerpc64 in r323687. With this change, gcc 6.4.0 can successfully compile and link a kernel that runs on sparc64. MFC after: 2 weeks Modified: head/sys/sparc64/sparc64/stack_machdep.c Modified: head/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/stack_machdep.c Wed Oct 11 02:39:20 2017 (r324511) +++ head/sys/sparc64/sparc64/stack_machdep.c Wed Oct 11 03:50:44 2017 (r324512) @@ -93,5 +93,5 @@ void stack_save(struct stack *st) { - stack_capture(st, (struct frame *)__builtin_frame_address(1)); + stack_capture(st, (struct frame *)__builtin_frame_address(0)); } From owner-svn-src-all@freebsd.org Wed Oct 11 05:02:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71DDCE466EE; Wed, 11 Oct 2017 05:02:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2747DA3B; Wed, 11 Oct 2017 05:02:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B52a6r084343; Wed, 11 Oct 2017 05:02:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B52akI084342; Wed, 11 Oct 2017 05:02:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710110502.v9B52akI084342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 11 Oct 2017 05:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324513 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 324513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:02:37 -0000 Author: cy Date: Wed Oct 11 05:02:36 2017 New Revision: 324513 URL: https://svnweb.freebsd.org/changeset/base/324513 Log: MFC r323945 and 323962 Fix misspellings, typos and /* border misalignments. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Oct 11 03:50:44 2017 (r324512) +++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Oct 11 05:02:36 2017 (r324513) @@ -6093,8 +6093,8 @@ ipf_nat_icmpquerytype(icmptype) { case ICMP_ECHOREPLY: case ICMP_ECHO: - /* route aedvertisement/solliciation is currently unsupported: */ - /* it would require rewriting the ICMP data section */ + /* route advertisement/solicitation is currently unsupported: */ + /* it would require rewriting the ICMP data section */ case ICMP_TSTAMP: case ICMP_TSTAMPREPLY: case ICMP_IREQ: From owner-svn-src-all@freebsd.org Wed Oct 11 05:02:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA86EE466F4; Wed, 11 Oct 2017 05:02:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 872DF7DA3D; Wed, 11 Oct 2017 05:02:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B52ak3084349; Wed, 11 Oct 2017 05:02:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B52ahl084348; Wed, 11 Oct 2017 05:02:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710110502.v9B52ahl084348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 11 Oct 2017 05:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324513 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 324513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:02:37 -0000 Author: cy Date: Wed Oct 11 05:02:36 2017 New Revision: 324513 URL: https://svnweb.freebsd.org/changeset/base/324513 Log: MFC r323945 and 323962 Fix misspellings, typos and /* border misalignments. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Oct 11 03:50:44 2017 (r324512) +++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Oct 11 05:02:36 2017 (r324513) @@ -6098,8 +6098,8 @@ ipf_nat_icmpquerytype(icmptype) { case ICMP_ECHOREPLY: case ICMP_ECHO: - /* route aedvertisement/solliciation is currently unsupported: */ - /* it would require rewriting the ICMP data section */ + /* route advertisement/solicitation is currently unsupported: */ + /* it would require rewriting the ICMP data section */ case ICMP_TSTAMP: case ICMP_TSTAMPREPLY: case ICMP_IREQ: From owner-svn-src-all@freebsd.org Wed Oct 11 05:07:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A633FE46864; Wed, 11 Oct 2017 05:07:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6607DDCE; Wed, 11 Oct 2017 05:07:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B57bQY084608; Wed, 11 Oct 2017 05:07:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B57bOU084607; Wed, 11 Oct 2017 05:07:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710110507.v9B57bOU084607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 11 Oct 2017 05:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324515 - in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Commit-Revision: 324515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:07:38 -0000 Author: cy Date: Wed Oct 11 05:07:37 2017 New Revision: 324515 URL: https://svnweb.freebsd.org/changeset/base/324515 Log: MFC r324249, 324260, and 324277 Clarify the wording describing the stayopen flag and style fixes. Modified: stable/11/lib/libc/net/gethostbyname.3 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/net/gethostbyname.3 Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/net/gethostbyname.3 ============================================================================== --- stable/11/lib/libc/net/gethostbyname.3 Wed Oct 11 05:04:46 2017 (r324514) +++ stable/11/lib/libc/net/gethostbyname.3 Wed Oct 11 05:07:37 2017 (r324515) @@ -28,7 +28,7 @@ .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd May 12, 2006 +.Dd October 4, 2017 .Dt GETHOSTBYNAME 3 .Os .Sh NAME @@ -189,19 +189,20 @@ function may be used to request the use of a connected .Tn TCP socket for queries. +Queries will by default use +.Tn UDP +datagrams. If the .Fa stayopen -flag is non-zero, -this sets the option to send all queries to the name server using +flag is non-zero, a .Tn TCP -and to retain the connection after each call to +connection to the name server will be used. +It will remain open after calls to .Fn gethostbyname , .Fn gethostbyname2 or -.Fn gethostbyaddr . -Otherwise, queries are performed using -.Tn UDP -datagrams. +.Fn gethostbyaddr +have completed. .Pp The .Fn endhostent From owner-svn-src-all@freebsd.org Wed Oct 11 05:07:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B93E2E46865; Wed, 11 Oct 2017 05:07:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8747D7DDCF; Wed, 11 Oct 2017 05:07:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B57blt084614; Wed, 11 Oct 2017 05:07:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B57b06084613; Wed, 11 Oct 2017 05:07:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710110507.v9B57b06084613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 11 Oct 2017 05:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324515 - in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Commit-Revision: 324515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:07:38 -0000 Author: cy Date: Wed Oct 11 05:07:37 2017 New Revision: 324515 URL: https://svnweb.freebsd.org/changeset/base/324515 Log: MFC r324249, 324260, and 324277 Clarify the wording describing the stayopen flag and style fixes. Modified: stable/10/lib/libc/net/gethostbyname.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/net/gethostbyname.3 Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/net/gethostbyname.3 ============================================================================== --- stable/10/lib/libc/net/gethostbyname.3 Wed Oct 11 05:04:46 2017 (r324514) +++ stable/10/lib/libc/net/gethostbyname.3 Wed Oct 11 05:07:37 2017 (r324515) @@ -28,7 +28,7 @@ .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd May 12, 2006 +.Dd October 4, 2017 .Dt GETHOSTBYNAME 3 .Os .Sh NAME @@ -189,19 +189,20 @@ function may be used to request the use of a connected .Tn TCP socket for queries. +Queries will by default use +.Tn UDP +datagrams. If the .Fa stayopen -flag is non-zero, -this sets the option to send all queries to the name server using +flag is non-zero, a .Tn TCP -and to retain the connection after each call to +connection to the name server will be used. +It will remain open after calls to .Fn gethostbyname , .Fn gethostbyname2 or -.Fn gethostbyaddr . -Otherwise, queries are performed using -.Tn UDP -datagrams. +.Fn gethostbyaddr +have completed. .Pp The .Fn endhostent From owner-svn-src-all@freebsd.org Wed Oct 11 05:15:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 606D1E46BFC; Wed, 11 Oct 2017 05:15:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B7937E45B; Wed, 11 Oct 2017 05:15:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5FnRQ088735; Wed, 11 Oct 2017 05:15:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5Fn0o088732; Wed, 11 Oct 2017 05:15:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110515.v9B5Fn0o088732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324516 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:15:50 -0000 Author: sephe Date: Wed Oct 11 05:15:49 2017 New Revision: 324516 URL: https://svnweb.freebsd.org/changeset/base/324516 Log: hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF. The background was described in r324489. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Wed Oct 11 05:15:49 2017 (r324516) @@ -521,6 +521,10 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; sc->hn_rss_hcap = hash_func | hash_types; + if (sc->hn_caps & HN_CAP_UDPHASH) { + /* UDP 4-tuple hash is unconditionally enabled. */ + sc->hn_rss_hcap |= NDIS_HASH_UDP_IPV4_X; + } *rxr_cnt0 = rxr_cnt; return (0); } @@ -760,8 +764,10 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) ("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); /* XXX only one can be specified through, popcnt? */ - KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), ("no hash func")); - KASSERT((sc->hn_rss_hash & NDIS_HASH_TYPE_MASK), ("no hash types")); + KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), + ("no hash func %08x", sc->hn_rss_hash)); + KASSERT((sc->hn_rss_hash & NDIS_HASH_STD), + ("no standard hash types %08x", sc->hn_rss_hash)); KASSERT(sc->hn_rss_ind_size > 0, ("no indirect table size")); if (bootverbose) { @@ -780,7 +786,8 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = rss_size; prm->ndis_flags = flags; - prm->ndis_hash = sc->hn_rss_hash; + prm->ndis_hash = sc->hn_rss_hash & + (NDIS_HASH_FUNCTION_MASK | NDIS_HASH_STD); prm->ndis_indsize = sizeof(rss->rss_ind[0]) * sc->hn_rss_ind_size; prm->ndis_indoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_ind[0]); Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:15:49 2017 (r324516) @@ -1424,6 +1424,8 @@ hn_rss_type_fromndis(uint32_t rss_hash) types |= RSS_TYPE_TCP_IPV6; if (rss_hash & NDIS_HASH_TCP_IPV6_EX) types |= RSS_TYPE_TCP_IPV6_EX; + if (rss_hash & NDIS_HASH_UDP_IPV4_X) + types |= RSS_TYPE_UDP_IPV4; return (types); } @@ -1432,9 +1434,8 @@ hn_rss_type_tondis(uint32_t types) { uint32_t rss_hash = 0; - KASSERT((types & - (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, - ("UDP4, UDP6 and UDP6EX are not supported")); + KASSERT((types & (RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP6 and UDP6EX are not supported")); if (types & RSS_TYPE_IPV4) rss_hash |= NDIS_HASH_IPV4; @@ -1448,6 +1449,8 @@ hn_rss_type_tondis(uint32_t types) rss_hash |= NDIS_HASH_TCP_IPV6; if (types & RSS_TYPE_TCP_IPV6_EX) rss_hash |= NDIS_HASH_TCP_IPV6_EX; + if (types & RSS_TYPE_UDP_IPV4) + rss_hash |= NDIS_HASH_UDP_IPV4_X; return (rss_hash); } @@ -1546,6 +1549,13 @@ hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) * NOTE: * We don't disable the hash type, but stop delivery the hash * value/type through mbufs on RX path. + * + * XXX If HN_CAP_UDPHASH is set in hn_caps, then UDP 4-tuple + * hash is delivered with type of TCP_IPV4. This means if + * UDP_IPV4 is enabled, then TCP_IPV4 should be forced, at + * least to hn_mbuf_hash. However, given that _all_ of the + * NICs implement TCP_IPV4, this will _not_ impose any issues + * here. */ if ((my_types & RSS_TYPE_IPV4) && (diff_types & ifrh.ifrh_types & @@ -3582,7 +3592,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int &l3proto, &l4proto); } if (l3proto == ETHERTYPE_IP) { - if (l4proto == IPPROTO_UDP) { + if (l4proto == IPPROTO_UDP && + (rxr->hn_mbuf_hash & + NDIS_HASH_UDP_IPV4_X)) { hash_type = M_HASHTYPE_RSS_UDP_IPV4; do_lro = 0; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/ndis.h Wed Oct 11 05:15:49 2017 (r324516) @@ -56,17 +56,26 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 +#define NDIS_HASH_UDP_IPV4_X 0x00004000 /* XXX non-standard */ #define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ NDIS_HASH_TCP_IPV4 | \ NDIS_HASH_IPV6 | \ NDIS_HASH_IPV6_EX | \ NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX |\ + NDIS_HASH_UDP_IPV4_X) + +#define NDIS_HASH_STD (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ - "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX" + "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX\17UDP4_X" #define NDIS_HASH_KEYSIZE_TOEPLITZ 40 #define NDIS_HASH_INDCNT 128 From owner-svn-src-all@freebsd.org Wed Oct 11 05:28:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEDB3E4702B; Wed, 11 Oct 2017 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6877EAC6; Wed, 11 Oct 2017 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5SpI2092908; Wed, 11 Oct 2017 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5SpMB092907; Wed, 11 Oct 2017 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110528.v9B5SpMB092907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324517 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:28:52 -0000 Author: sephe Date: Wed Oct 11 05:28:51 2017 New Revision: 324517 URL: https://svnweb.freebsd.org/changeset/base/324517 Log: hyperv/hn: Enable transparent VF by default. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:15:49 2017 (r324516) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:28:51 2017 (r324517) @@ -584,7 +584,7 @@ SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLT 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); /* Transparent VF */ -static int hn_xpnt_vf = 0; +static int hn_xpnt_vf = 1; SYSCTL_INT(_hw_hn, OID_AUTO, vf_transparent, CTLFLAG_RDTUN, &hn_xpnt_vf, 0, "Transparent VF mod"); From owner-svn-src-all@freebsd.org Wed Oct 11 05:55:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C3DE4773E; Wed, 11 Oct 2017 05:55:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA627F7FF; Wed, 11 Oct 2017 05:55:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5tq5Q005575; Wed, 11 Oct 2017 05:55:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5tqGL005572; Wed, 11 Oct 2017 05:55:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110555.v9B5tqGL005572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324518 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 324518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:55:53 -0000 Author: sephe Date: Wed Oct 11 05:55:52 2017 New Revision: 324518 URL: https://svnweb.freebsd.org/changeset/base/324518 Log: ixgbe: Remove never defined UDP_IPV4_EX Reviewed by: sbruno Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12454 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe_rss.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/if_ix.c Wed Oct 11 05:55:52 2017 (r324518) @@ -469,9 +469,6 @@ ixgbe_initialize_rss_mapping(struct adapter *adapter) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) - device_printf(adapter->dev, "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, but not supported\n", - __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/if_ixv.c Wed Oct 11 05:55:52 2017 (r324518) @@ -1403,9 +1403,6 @@ ixv_initialize_rss_mapping(struct adapter *adapter) __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) - device_printf(adapter->dev, "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, but not supported\n", - __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) Modified: head/sys/dev/ixgbe/ixgbe_rss.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_rss.h Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/ixgbe_rss.h Wed Oct 11 05:55:52 2017 (r324518) @@ -49,7 +49,6 @@ #define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) #define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) #define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) -#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) From owner-svn-src-all@freebsd.org Wed Oct 11 06:08:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E7EE479CA; Wed, 11 Oct 2017 06:08:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90EF97FCAD; Wed, 11 Oct 2017 06:08:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B681a9009595; Wed, 11 Oct 2017 06:08:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B681LO009593; Wed, 11 Oct 2017 06:08:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110608.v9B681LO009593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 06:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324519 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 324519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 06:08:02 -0000 Author: sephe Date: Wed Oct 11 06:08:01 2017 New Revision: 324519 URL: https://svnweb.freebsd.org/changeset/base/324519 Log: rss: Remove never defined UDP_IPV4_EX Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12455 Modified: head/sys/net/rss_config.c head/sys/net/rss_config.h Modified: head/sys/net/rss_config.c ============================================================================== --- head/sys/net/rss_config.c Wed Oct 11 05:55:52 2017 (r324518) +++ head/sys/net/rss_config.c Wed Oct 11 06:08:01 2017 (r324519) @@ -489,7 +489,6 @@ rss_gethashconfig(void) | RSS_HASHTYPE_RSS_TCP_IPV6_EX #if 0 | RSS_HASHTYPE_RSS_UDP_IPV4 - | RSS_HASHTYPE_RSS_UDP_IPV4_EX | RSS_HASHTYPE_RSS_UDP_IPV6 | RSS_HASHTYPE_RSS_UDP_IPV6_EX #endif Modified: head/sys/net/rss_config.h ============================================================================== --- head/sys/net/rss_config.h Wed Oct 11 05:55:52 2017 (r324518) +++ head/sys/net/rss_config.h Wed Oct 11 06:08:01 2017 (r324519) @@ -66,7 +66,6 @@ #define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) /* IPv6 2-tuple + ext hdrs */ #define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) /* TCPv6 4-tiple + ext hdrs */ #define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) /* IPv4 UDP 4-tuple */ -#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) /* IPv4 UDP 4-tuple + ext hdrs */ #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) /* IPv6 UDP 4-tuple */ #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) /* IPv6 UDP 4-tuple + ext hdrs */ From owner-svn-src-all@freebsd.org Wed Oct 11 06:28:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00BDAE47F40; Wed, 11 Oct 2017 06:28:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1DED80594; Wed, 11 Oct 2017 06:28:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B6SkJv018020; Wed, 11 Oct 2017 06:28:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B6SkLN018019; Wed, 11 Oct 2017 06:28:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110628.v9B6SkLN018019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 06:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324520 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 324520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 06:28:48 -0000 Author: sephe Date: Wed Oct 11 06:28:46 2017 New Revision: 324520 URL: https://svnweb.freebsd.org/changeset/base/324520 Log: MFC 324050 tcp: Don't "negotiate" MSS. _NO_ OSes actually "negotiate" MSS. RFC 879: "... This Maximum Segment Size (MSS) announcement (often mistakenly called a negotiation) ..." This negotiation behaviour was introduced 11 years ago by r159955 without any explaination about why FreeBSD had to "negotiate" MSS: In syncache_respond() do not reply with a MSS that is larger than what the peer announced to us but make it at least tcp_minmss in size. Sponsored by: TCP/IP Optimization Fundraise 2005 The tcp_minmss behaviour is still kept. Syncookie fix was prodded by tuexen, who also helped to test this patch w/ packetdrill. Reviewed by: tuexen, karels, bz (previous version) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12430 Modified: stable/10/sys/netinet/tcp_syncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Wed Oct 11 06:08:01 2017 (r324519) +++ stable/10/sys/netinet/tcp_syncache.c Wed Oct 11 06:28:46 2017 (r324520) @@ -1551,9 +1551,7 @@ syncache_respond(struct syncache *sc, const struct mbu tlen = hlen + sizeof(struct tcphdr); /* Determine MSS we advertize to other end of connection. */ - mssopt = tcp_mssopt(&sc->sc_inc); - if (sc->sc_peer_mss) - mssopt = max( min(sc->sc_peer_mss, mssopt), V_tcp_minmss); + mssopt = max(tcp_mssopt(&sc->sc_inc), V_tcp_minmss); /* XXX: Assume that the entire packet will fit in a header mbuf. */ KASSERT(max_linkhdr + tlen + TCP_MAXOLEN <= MHLEN, @@ -1896,7 +1894,7 @@ syncookie_mac(struct in_conninfo *inc, tcp_seq irs, ui static tcp_seq syncookie_generate(struct syncache_head *sch, struct syncache *sc) { - u_int i, mss, secbit, wscale; + u_int i, secbit, wscale; uint32_t iss, hash; uint8_t *secbits; union syncookie cookie; @@ -1906,9 +1904,8 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ - mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); for (i = sizeof(tcp_sc_msstab) / sizeof(*tcp_sc_msstab) - 1; - tcp_sc_msstab[i] > mss && i > 0; + tcp_sc_msstab[i] > sc->sc_peer_mss && i > 0; i--) ; cookie.flags.mss_idx = i; From owner-svn-src-all@freebsd.org Wed Oct 11 06:46:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D770E4833B; Wed, 11 Oct 2017 06:46:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A68E80C87; Wed, 11 Oct 2017 06:46:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B6kdAe025842; Wed, 11 Oct 2017 06:46:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B6kdCE025841; Wed, 11 Oct 2017 06:46:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110646.v9B6kdCE025841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 06:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324521 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 324521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 06:46:40 -0000 Author: sephe Date: Wed Oct 11 06:46:39 2017 New Revision: 324521 URL: https://svnweb.freebsd.org/changeset/base/324521 Log: MFC 324050 tcp: Don't "negotiate" MSS. _NO_ OSes actually "negotiate" MSS. RFC 879: "... This Maximum Segment Size (MSS) announcement (often mistakenly called a negotiation) ..." This negotiation behaviour was introduced 11 years ago by r159955 without any explaination about why FreeBSD had to "negotiate" MSS: In syncache_respond() do not reply with a MSS that is larger than what the peer announced to us but make it at least tcp_minmss in size. Sponsored by: TCP/IP Optimization Fundraise 2005 The tcp_minmss behaviour is still kept. Syncookie fix was prodded by tuexen, who also helped to test this patch w/ packetdrill. Reviewed by: tuexen, karels, bz (previous version) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12430 Modified: stable/11/sys/netinet/tcp_syncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Wed Oct 11 06:28:46 2017 (r324520) +++ stable/11/sys/netinet/tcp_syncache.c Wed Oct 11 06:46:39 2017 (r324521) @@ -1612,9 +1612,7 @@ syncache_respond(struct syncache *sc, struct syncache_ tlen = hlen + sizeof(struct tcphdr); /* Determine MSS we advertize to other end of connection. */ - mssopt = tcp_mssopt(&sc->sc_inc); - if (sc->sc_peer_mss) - mssopt = max( min(sc->sc_peer_mss, mssopt), V_tcp_minmss); + mssopt = max(tcp_mssopt(&sc->sc_inc), V_tcp_minmss); /* XXX: Assume that the entire packet will fit in a header mbuf. */ KASSERT(max_linkhdr + tlen + TCP_MAXOLEN <= MHLEN, @@ -1963,7 +1961,7 @@ syncookie_mac(struct in_conninfo *inc, tcp_seq irs, ui static tcp_seq syncookie_generate(struct syncache_head *sch, struct syncache *sc) { - u_int i, mss, secbit, wscale; + u_int i, secbit, wscale; uint32_t iss, hash; uint8_t *secbits; union syncookie cookie; @@ -1973,8 +1971,8 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ - mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); - for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0; + for (i = nitems(tcp_sc_msstab) - 1; + tcp_sc_msstab[i] > sc->sc_peer_mss && i > 0; i--) ; cookie.flags.mss_idx = i; From owner-svn-src-all@freebsd.org Wed Oct 11 10:01:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2406BE26D9F; Wed, 11 Oct 2017 10:01:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9E4E21BB; Wed, 11 Oct 2017 10:00:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BA0xuc004787; Wed, 11 Oct 2017 10:00:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BA0wvP004783; Wed, 11 Oct 2017 10:00:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111000.v9BA0wvP004783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324522 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 324522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:01:00 -0000 Author: hselasky Date: Wed Oct 11 10:00:58 2017 New Revision: 324522 URL: https://svnweb.freebsd.org/changeset/base/324522 Log: MFC r324202: Make sure the doorbell lock is valid for the i386 version of the mlx5en(4) driver. Tested by: gallatin @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Wed Oct 11 06:46:39 2017 (r324521) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Wed Oct 11 10:00:58 2017 (r324522) @@ -800,12 +800,12 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe, int } static inline void -mlx5e_cq_arm(struct mlx5e_cq *cq) +mlx5e_cq_arm(struct mlx5e_cq *cq, spinlock_t *dblock) { struct mlx5_core_cq *mcq; mcq = &cq->mcq; - mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, NULL, cq->wq.cc); + mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, dblock, cq->wq.cc); } extern const struct ethtool_ops mlx5e_ethtool_ops; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 11 06:46:39 2017 (r324521) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 11 10:00:58 2017 (r324522) @@ -1408,7 +1408,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_p if (err) return (err); - mlx5e_cq_arm(cq); + mlx5e_cq_arm(cq, MLX5_GET_DOORBELL_LOCK(&cq->priv->doorbell_lock)); return (0); } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Oct 11 06:46:39 2017 (r324521) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Oct 11 10:00:58 2017 (r324522) @@ -430,7 +430,7 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq) mlx5e_post_rx_wqes(rq); } mlx5e_post_rx_wqes(rq); - mlx5e_cq_arm(&rq->cq); + mlx5e_cq_arm(&rq->cq, MLX5_GET_DOORBELL_LOCK(&rq->channel->priv->doorbell_lock)); tcp_lro_flush_all(&rq->lro); mtx_unlock(&rq->mtx); } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 11 06:46:39 2017 (r324521) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 11 10:00:58 2017 (r324522) @@ -574,7 +574,7 @@ mlx5e_tx_cq_comp(struct mlx5_core_cq *mcq) mtx_lock(&sq->comp_lock); mlx5e_poll_tx_cq(sq, MLX5E_BUDGET_MAX); - mlx5e_cq_arm(&sq->cq); + mlx5e_cq_arm(&sq->cq, MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); mtx_unlock(&sq->comp_lock); } From owner-svn-src-all@freebsd.org Wed Oct 11 10:04:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B057E270E2; Wed, 11 Oct 2017 10:04:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 42F3E2669; Wed, 11 Oct 2017 10:04:19 +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 v9BA4I6P007772; Wed, 11 Oct 2017 10:04:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BA4Ifr007768; Wed, 11 Oct 2017 10:04:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111004.v9BA4Ifr007768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324523 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 324523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:04:19 -0000 Author: hselasky Date: Wed Oct 11 10:04:17 2017 New Revision: 324523 URL: https://svnweb.freebsd.org/changeset/base/324523 Log: MFC r324202: Make sure the doorbell lock is valid for the i386 version of the mlx5en(4) driver. Tested by: gallatin @ Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Wed Oct 11 10:00:58 2017 (r324522) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Wed Oct 11 10:04:17 2017 (r324523) @@ -810,12 +810,12 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe, int } static inline void -mlx5e_cq_arm(struct mlx5e_cq *cq) +mlx5e_cq_arm(struct mlx5e_cq *cq, spinlock_t *dblock) { struct mlx5_core_cq *mcq; mcq = &cq->mcq; - mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, NULL, cq->wq.cc); + mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, dblock, cq->wq.cc); } extern const struct ethtool_ops mlx5e_ethtool_ops; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 11 10:00:58 2017 (r324522) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 11 10:04:17 2017 (r324523) @@ -1415,7 +1415,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_p if (err) return (err); - mlx5e_cq_arm(cq); + mlx5e_cq_arm(cq, MLX5_GET_DOORBELL_LOCK(&cq->priv->doorbell_lock)); return (0); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Oct 11 10:00:58 2017 (r324522) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Oct 11 10:04:17 2017 (r324523) @@ -445,7 +445,7 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq) mlx5e_post_rx_wqes(rq); } mlx5e_post_rx_wqes(rq); - mlx5e_cq_arm(&rq->cq); + mlx5e_cq_arm(&rq->cq, MLX5_GET_DOORBELL_LOCK(&rq->channel->priv->doorbell_lock)); #ifdef HAVE_TURBO_LRO tcp_tlro_flush(&rq->lro, 1); #endif Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 11 10:00:58 2017 (r324522) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 11 10:04:17 2017 (r324523) @@ -574,7 +574,7 @@ mlx5e_tx_cq_comp(struct mlx5_core_cq *mcq) mtx_lock(&sq->comp_lock); mlx5e_poll_tx_cq(sq, MLX5E_BUDGET_MAX); - mlx5e_cq_arm(&sq->cq); + mlx5e_cq_arm(&sq->cq, MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); mtx_unlock(&sq->comp_lock); } From owner-svn-src-all@freebsd.org Wed Oct 11 10:12:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 139D3E27409; Wed, 11 Oct 2017 10:12:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id CB01B2ADC; Wed, 11 Oct 2017 10:12:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BACMkB012042; Wed, 11 Oct 2017 10:12:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BACMvK012041; Wed, 11 Oct 2017 10:12:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111012.v9BACMvK012041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324524 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 324524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:12:24 -0000 Author: hselasky Date: Wed Oct 11 10:12:22 2017 New Revision: 324524 URL: https://svnweb.freebsd.org/changeset/base/324524 Log: MFC r315405, r323351 and r323364: Add helper function similar to ip_dev_find() to the LinuxKPI to lookup a network device by its IPv6 address in the given VNET. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h Wed Oct 11 10:04:17 2017 (r324523) +++ stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h Wed Oct 11 10:12:22 2017 (r324524) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,40 @@ ip_dev_find(struct net *net, uint32_t addr) if_ref(ifp); ifa_free(ifa); } + return (ifp); +} + +static inline struct net_device * +ip6_dev_find(struct vnet *vnet, struct in6_addr addr) +{ + struct sockaddr_in6 sin6; + struct ifaddr *ifa = NULL; + struct ifnet *ifp = NULL; + int x; + + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_addr = addr; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_family = AF_INET6; + CURVNET_SET_QUIET(vnet); + if (IN6_IS_SCOPE_LINKLOCAL(&addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&addr)) { + /* XXX need to search all scope ID's */ + for (x = 0; x <= V_if_index && x < 65536; x++) { + sin6.sin6_addr.s6_addr16[1] = htons(x); + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + if (ifa != NULL) + break; + } + } else { + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + } + if (ifa != NULL) { + ifp = ifa->ifa_ifp; + if_ref(ifp); + ifa_free(ifa); + } + CURVNET_RESTORE(); return (ifp); } From owner-svn-src-all@freebsd.org Wed Oct 11 10:20:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73BC9E277B2; Wed, 11 Oct 2017 10:20:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3FE112EFE; Wed, 11 Oct 2017 10:20:54 +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 v9BAKr26013057; Wed, 11 Oct 2017 10:20:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BAKr8v013056; Wed, 11 Oct 2017 10:20:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111020.v9BAKr8v013056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324525 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/include/linux X-SVN-Commit-Revision: 324525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:20:54 -0000 Author: hselasky Date: Wed Oct 11 10:20:53 2017 New Revision: 324525 URL: https://svnweb.freebsd.org/changeset/base/324525 Log: MFC r315405, r323351 and r323364: Add helper function similar to ip_dev_find() to the LinuxKPI to lookup a network device by its IPv6 address in the given VNET. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/inetdevice.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/inetdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/inetdevice.h Wed Oct 11 10:12:22 2017 (r324524) +++ stable/10/sys/ofed/include/linux/inetdevice.h Wed Oct 11 10:20:53 2017 (r324525) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,6 +25,7 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * */ #ifndef _LINUX_INETDEVICE_H_ @@ -51,6 +52,40 @@ ip_dev_find(struct net *net, uint32_t addr) if_ref(ifp); ifa_free(ifa); } + return (ifp); +} + +static inline struct net_device * +ip6_dev_find(struct vnet *vnet, struct in6_addr addr) +{ + struct sockaddr_in6 sin6; + struct ifaddr *ifa = NULL; + struct ifnet *ifp = NULL; + int x; + + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_addr = addr; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_family = AF_INET6; + CURVNET_SET_QUIET(vnet); + if (IN6_IS_SCOPE_LINKLOCAL(&addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&addr)) { + /* XXX need to search all scope ID's */ + for (x = 0; x <= V_if_index && x < 65536; x++) { + sin6.sin6_addr.s6_addr16[1] = htons(x); + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + if (ifa != NULL) + break; + } + } else { + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + } + if (ifa != NULL) { + ifp = ifa->ifa_ifp; + if_ref(ifp); + ifa_free(ifa); + } + CURVNET_RESTORE(); return (ifp); } From owner-svn-src-all@freebsd.org Wed Oct 11 10:36:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E79C4E27FFB; Wed, 11 Oct 2017 10:36:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id A8CD93A41; Wed, 11 Oct 2017 10:36:41 +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 v9BAae4e020306; Wed, 11 Oct 2017 10:36:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BAae64020302; Wed, 11 Oct 2017 10:36:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111036.v9BAae64020302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324526 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src ofed/drivers/infiniband/core X-SVN-Commit-Revision: 324526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:36:42 -0000 Author: hselasky Date: Wed Oct 11 10:36:40 2017 New Revision: 324526 URL: https://svnweb.freebsd.org/changeset/base/324526 Log: MFC r315404: Add basic support for VIMAGE to the LinuxKPI and ibcore. Support is implemented by mapping Linux's "struct net" into FreeBSD's "struct vnet". Currently only vnet0 is supported by ibcore. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h stable/11/sys/compat/linuxkpi/common/include/linux/netdevice.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/ofed/drivers/infiniband/core/addr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h Wed Oct 11 10:20:53 2017 (r324525) +++ stable/11/sys/compat/linuxkpi/common/include/linux/inetdevice.h Wed Oct 11 10:36:40 2017 (r324526) @@ -34,23 +34,25 @@ #include static inline struct net_device * -ip_dev_find(struct net *net, uint32_t addr) +ip_dev_find(struct vnet *vnet, uint32_t addr) { struct sockaddr_in sin; struct ifaddr *ifa; struct ifnet *ifp; - ifp = NULL; memset(&sin, 0, sizeof(sin)); sin.sin_addr.s_addr = addr; - sin.sin_port = 0; sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; + CURVNET_SET_QUIET(vnet); ifa = ifa_ifwithaddr((struct sockaddr *)&sin); + CURVNET_RESTORE(); if (ifa) { ifp = ifa->ifa_ifp; if_ref(ifp); ifa_free(ifa); + } else { + ifp = NULL; } return (ifp); } Modified: stable/11/sys/compat/linuxkpi/common/include/linux/netdevice.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/netdevice.h Wed Oct 11 10:20:53 2017 (r324525) +++ stable/11/sys/compat/linuxkpi/common/include/linux/netdevice.h Wed Oct 11 10:36:40 2017 (r324526) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,25 +40,38 @@ #include #include +#include #include #include #include #include #include -struct net { -}; +#ifdef VIMAGE +#define init_net *vnet0 +#else +#define init_net *((struct vnet *)0) +#endif -extern struct net init_net; - #define MAX_ADDR_LEN 20 #define net_device ifnet -#define dev_get_by_index(n, idx) ifnet_byindex_ref((idx)) -#define dev_hold(d) if_ref((d)) -#define dev_put(d) if_rele((d)) -#define dev_net(d) (&init_net) +static inline struct ifnet * +dev_get_by_index(struct vnet *vnet, int if_index) +{ + struct ifnet *retval; + + CURVNET_SET(vnet); + retval = ifnet_byindex_ref(if_index); + CURVNET_RESTORE(); + + return (retval); +} + +#define dev_hold(d) if_ref(d) +#define dev_put(d) if_rele(d) +#define dev_net(d) ((d)->if_vnet) #define net_eq(a,b) ((a) == (b)) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Oct 11 10:20:53 2017 (r324525) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Oct 11 10:36:40 2017 (r324526) @@ -94,7 +94,6 @@ struct device linux_root_device; struct class linux_class_misc; struct list_head pci_drivers; struct list_head pci_devices; -struct net init_net; spinlock_t pci_lock; struct sx linux_global_rcu_lock; Modified: stable/11/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/addr.c Wed Oct 11 10:20:53 2017 (r324525) +++ stable/11/sys/ofed/drivers/infiniband/core/addr.c Wed Oct 11 10:36:40 2017 (r324526) @@ -161,7 +161,9 @@ int rdma_translate_ip(struct sockaddr *addr, struct rd scope_id = sin6->sin6_scope_id; if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) SCOPE_ID_CACHE(scope_id, sin6); + CURVNET_SET_QUIET(&init_net); ifa = ifa_ifwithaddr(addr); + CURVNET_RESTORE(); sin6->sin6_port = port; if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) SCOPE_ID_RESTORE(scope_id, sin6); @@ -231,6 +233,9 @@ static int addr_resolve(struct sockaddr *src_in, int bcast; int is_gw = 0; int error = 0; + + CURVNET_SET_QUIET(&init_net); + /* * Determine whether the address is unicast, multicast, or broadcast * and whether the source interface is valid. @@ -271,7 +276,9 @@ static int addr_resolve(struct sockaddr *src_in, * up first and verify that it is a local * interface: */ + CURVNET_SET_QUIET(&init_net); ifa = ifa_ifwithaddr(src_in); + CURVNET_RESTORE(); sin->sin_port = port; if (ifa == NULL) { error = ENETUNREACH; @@ -312,7 +319,9 @@ static int addr_resolve(struct sockaddr *src_in, * up first and verify that it is a local * interface: */ + CURVNET_SET_QUIET(&init_net); ifa = ifa_ifwithaddr(src_in); + CURVNET_RESTORE(); sin6->sin6_port = port; if (ifa == NULL) { error = ENETUNREACH; @@ -426,6 +435,8 @@ done: #endif if (error == EWOULDBLOCK) error = ENODATA; + + CURVNET_RESTORE(); return -error; } From owner-svn-src-all@freebsd.org Wed Oct 11 10:57:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A6AAE284E2; Wed, 11 Oct 2017 10:57:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5205263634; Wed, 11 Oct 2017 10:57:01 +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 v9BAv0RR028669; Wed, 11 Oct 2017 10:57:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BAv0uB028665; Wed, 11 Oct 2017 10:57:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710111057.v9BAv0uB028665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Oct 2017 10:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324527 - in stable/10/sys/ofed: drivers/infiniband/core include/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/ofed: drivers/infiniband/core include/linux X-SVN-Commit-Revision: 324527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 10:57:01 -0000 Author: hselasky Date: Wed Oct 11 10:56:59 2017 New Revision: 324527 URL: https://svnweb.freebsd.org/changeset/base/324527 Log: MFC r315404: Add basic support for VIMAGE to the LinuxKPI and ibcore. Support is implemented by mapping Linux's "struct net" into FreeBSD's "struct vnet". Currently only vnet0 is supported by ibcore. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/core/addr.c stable/10/sys/ofed/include/linux/inetdevice.h stable/10/sys/ofed/include/linux/linux_compat.c stable/10/sys/ofed/include/linux/netdevice.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/addr.c Wed Oct 11 10:36:40 2017 (r324526) +++ stable/10/sys/ofed/drivers/infiniband/core/addr.c Wed Oct 11 10:56:59 2017 (r324527) @@ -172,7 +172,9 @@ int rdma_translate_ip(struct sockaddr *addr, struct rd sin6 = (struct sockaddr_in6 *)addr; port = sin6->sin6_port; sin6->sin6_port = 0; + CURVNET_SET_QUIET(&init_net); ifa = ifa_ifwithaddr(addr); + CURVNET_RESTORE(); sin6->sin6_port = port; if (ifa == NULL) { ret = -ENODEV; @@ -339,7 +341,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, #else #include -static int addr_resolve(struct sockaddr *src_in, +static int addr_resolve_sub(struct sockaddr *src_in, struct sockaddr *dst_in, struct rdma_dev_addr *addr) { @@ -487,6 +489,18 @@ mcast: return -error; } +static int addr_resolve(struct sockaddr *src_in, + struct sockaddr *dst_in, + struct rdma_dev_addr *addr) +{ + int error; + + CURVNET_SET_QUIET(&init_net); + error = addr_resolve_sub(src_in, dst_in, addr); + CURVNET_RESTORE(); + + return (error); +} #endif static void process_req(struct work_struct *work) Modified: stable/10/sys/ofed/include/linux/inetdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/inetdevice.h Wed Oct 11 10:36:40 2017 (r324526) +++ stable/10/sys/ofed/include/linux/inetdevice.h Wed Oct 11 10:56:59 2017 (r324527) @@ -34,23 +34,25 @@ #include static inline struct net_device * -ip_dev_find(struct net *net, uint32_t addr) +ip_dev_find(struct vnet *vnet, uint32_t addr) { struct sockaddr_in sin; struct ifaddr *ifa; struct ifnet *ifp; - ifp = NULL; memset(&sin, 0, sizeof(sin)); sin.sin_addr.s_addr = addr; - sin.sin_port = 0; sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; + CURVNET_SET_QUIET(vnet); ifa = ifa_ifwithaddr((struct sockaddr *)&sin); + CURVNET_RESTORE(); if (ifa) { ifp = ifa->ifa_ifp; if_ref(ifp); ifa_free(ifa); + } else { + ifp = NULL; } return (ifp); } Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Wed Oct 11 10:36:40 2017 (r324526) +++ stable/10/sys/ofed/include/linux/linux_compat.c Wed Oct 11 10:56:59 2017 (r324527) @@ -80,7 +80,6 @@ struct device linux_rootdev; struct class miscclass; struct list_head pci_drivers; struct list_head pci_devices; -struct net init_net; spinlock_t pci_lock; unsigned long linux_timer_hz_mask; Modified: stable/10/sys/ofed/include/linux/netdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/netdevice.h Wed Oct 11 10:36:40 2017 (r324526) +++ stable/10/sys/ofed/include/linux/netdevice.h Wed Oct 11 10:56:59 2017 (r324527) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,24 +38,40 @@ #include #include +#include #include #include #include #include #include -struct net { -}; +#ifdef VIMAGE +#define init_net *vnet0 +#else +#define init_net *((struct vnet *)0) +#endif -extern struct net init_net; - #define MAX_ADDR_LEN 20 #define net_device ifnet -#define dev_get_by_index(n, idx) ifnet_byindex_ref((idx)) -#define dev_hold(d) if_ref((d)) -#define dev_put(d) if_rele((d)) +static inline struct ifnet * +dev_get_by_index(struct vnet *vnet, int if_index) +{ + struct ifnet *retval; + + CURVNET_SET(vnet); + retval = ifnet_byindex_ref(if_index); + CURVNET_RESTORE(); + + return (retval); +} + +#define dev_hold(d) if_ref(d) +#define dev_put(d) if_rele(d) +#define dev_net(d) ((d)->if_vnet) + +#define net_eq(a,b) ((a) == (b)) #define netif_running(dev) !!((dev)->if_drv_flags & IFF_DRV_RUNNING) #define netif_oper_up(dev) !!((dev)->if_flags & IFF_UP) From owner-svn-src-all@freebsd.org Wed Oct 11 11:03:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F51E28787; Wed, 11 Oct 2017 11:03:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D488963A17; Wed, 11 Oct 2017 11:03:12 +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 v9BB3BC0032702; Wed, 11 Oct 2017 11:03:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BB3Bew032701; Wed, 11 Oct 2017 11:03:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710111103.v9BB3Bew032701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Oct 2017 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324528 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 11:03:13 -0000 Author: kib Date: Wed Oct 11 11:03:11 2017 New Revision: 324528 URL: https://svnweb.freebsd.org/changeset/base/324528 Log: The th_bintime, th_microtime and th_nanotime members of the timehand all cache the last system time (uptime + boottime). Only the format differs. Do not re-calculate the bintime and simply use the value used to calculate the microtime and nanotime. Group all the updates under the relevant comment. Remove obsoleted XXX part. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Oct 11 10:56:59 2017 (r324527) +++ head/sys/kern/kern_tc.c Wed Oct 11 11:03:11 2017 (r324528) @@ -1413,10 +1413,8 @@ tc_windup(struct bintime *new_boottimebin) if (bt.sec != t) th->th_boottime.sec += bt.sec - t; } - th->th_bintime = th->th_offset; - bintime_add(&th->th_bintime, &th->th_boottime); /* Update the UTC timestamps used by the get*() functions. */ - /* XXX shouldn't do this here. Should force non-`get' versions. */ + th->th_bintime = bt; bintime2timeval(&bt, &th->th_microtime); bintime2timespec(&bt, &th->th_nanotime); From owner-svn-src-all@freebsd.org Wed Oct 11 13:20:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9148E2C0F6; Wed, 11 Oct 2017 13:20:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A62E967A3D; Wed, 11 Oct 2017 13:20:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BDKOHC087332; Wed, 11 Oct 2017 13:20:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BDKOLN087331; Wed, 11 Oct 2017 13:20:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710111320.v9BDKOLN087331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 11 Oct 2017 13:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324529 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 324529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 13:20:26 -0000 Author: rmacklem Date: Wed Oct 11 13:20:24 2017 New Revision: 324529 URL: https://svnweb.freebsd.org/changeset/base/324529 Log: MFC: r324074 Fix a memory leak that occurred in the pNFS client. When a "pnfs" NFSv4.1 mount was unmounted, it didn't free up the layouts and deviceinfo structures. This leak only affects "pnfs" mounts and only when the mount is umounted. Found while testing the pNFS Flexible File layout client code. Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Wed Oct 11 11:03:11 2017 (r324528) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Wed Oct 11 13:20:24 2017 (r324529) @@ -1627,6 +1627,14 @@ nfscl_cleanclient(struct nfsclclient *clp) { struct nfsclowner *owp, *nowp; struct nfsclopen *op, *nop; + struct nfscllayout *lyp, *nlyp; + struct nfscldevinfo *dip, *ndip; + + TAILQ_FOREACH_SAFE(lyp, &clp->nfsc_layout, nfsly_list, nlyp) + nfscl_freelayout(lyp); + + LIST_FOREACH_SAFE(dip, &clp->nfsc_devinfo, nfsdi_list, ndip) + nfscl_freedevinfo(dip); /* Now, all the OpenOwners, etc. */ LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { From owner-svn-src-all@freebsd.org Wed Oct 11 14:34:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5F0E2D945; Wed, 11 Oct 2017 14:34:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 998F16A1C8; Wed, 11 Oct 2017 14:34:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BEY6HL020263; Wed, 11 Oct 2017 14:34:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEY64u020262; Wed, 11 Oct 2017 14:34:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710111434.v9BEY64u020262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Oct 2017 14:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324531 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 324531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:34:07 -0000 Author: emaste Date: Wed Oct 11 14:34:06 2017 New Revision: 324531 URL: https://svnweb.freebsd.org/changeset/base/324531 Log: OptionalObsoleteFiles: remove diff from MK_GNU_DIFF=no block diff (and man page) are not from GNU, as of r317209, and should not be deleted if WITHOUT_GNU_DIFF is set. (WITHOUT_GNU_DIFF still controls whether diff3 is built.) Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 13:33:11 2017 (r324530) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:34:06 2017 (r324531) @@ -2480,9 +2480,7 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz .endif .if ${MK_GNU_DIFF} == no -OLD_FILES+=usr/bin/diff OLD_FILES+=usr/bin/diff3 -OLD_FILES+=usr/share/man/man1/diff.1.gz OLD_FILES+=usr/share/man/man1/diff3.1.gz OLD_FILES+=usr/share/man/man7/diff.7.gz .endif From owner-svn-src-all@freebsd.org Wed Oct 11 14:41:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3EEE2DE1C; Wed, 11 Oct 2017 14:41:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF116A808; Wed, 11 Oct 2017 14:41:12 +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 v9BEfC0K023024; Wed, 11 Oct 2017 14:41:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEfCOC023023; Wed, 11 Oct 2017 14:41:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710111441.v9BEfCOC023023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Oct 2017 14:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324532 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 324532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:41:13 -0000 Author: bapt Date: Wed Oct 11 14:41:11 2017 New Revision: 324532 URL: https://svnweb.freebsd.org/changeset/base/324532 Log: Do not try to remove diff.7 optionaly has it is always removed since GNU diff(1) has been replaced with BSD diff(1) Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:34:06 2017 (r324531) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:41:11 2017 (r324532) @@ -2482,7 +2482,6 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz .if ${MK_GNU_DIFF} == no OLD_FILES+=usr/bin/diff3 OLD_FILES+=usr/share/man/man1/diff3.1.gz -OLD_FILES+=usr/share/man/man7/diff.7.gz .endif .if ${MK_GNU_GREP} == no From owner-svn-src-all@freebsd.org Wed Oct 11 14:59:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115EFE2E79A; Wed, 11 Oct 2017 14:59:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D325E6B3A5; Wed, 11 Oct 2017 14:59:05 +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 v9BEx4v2028776; Wed, 11 Oct 2017 14:59:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEx492028775; Wed, 11 Oct 2017 14:59:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710111459.v9BEx492028775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324533 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:59:06 -0000 Author: cem Date: Wed Oct 11 14:59:04 2017 New Revision: 324533 URL: https://svnweb.freebsd.org/changeset/base/324533 Log: hwpmc(4): Force sufficiently wide type for left shift Ordinary input to this macro comes from pe_code, which is uint16_t. Coverity points out that shifting such a value discards the result of a 24 bit shift, which is not what we want. A follow-up to r324291. CID: 1381676 Sponsored by: Dell EMC Isilon Modified: head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:41:11 2017 (r324532) +++ head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:59:04 2017 (r324533) @@ -67,7 +67,7 @@ #define AMD_PMC_EVENTMASK 0xF000000FF #define AMD_PMC_TO_UNITMASK(x) (((x) << 8) & AMD_PMC_UNITMASK) -#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((x) & 0xF00) << 24)) +#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 0xF00) << 24)) #define AMD_VALID_BITS (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | \ AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE | \ AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK) From owner-svn-src-all@freebsd.org Wed Oct 11 15:13:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47067E2EFA2; Wed, 11 Oct 2017 15:13:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D7D6BC30; Wed, 11 Oct 2017 15:13:41 +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 v9BFDe9A036997; Wed, 11 Oct 2017 15:13:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BFDepN036996; Wed, 11 Oct 2017 15:13:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710111513.v9BFDepN036996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 15:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324534 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 15:13:41 -0000 Author: cem Date: Wed Oct 11 15:13:40 2017 New Revision: 324534 URL: https://svnweb.freebsd.org/changeset/base/324534 Log: hwpmc(4): Actually use a sufficiently wide type jhibbits@ points out that left shifting bits 8-11 24 bits won't fit in a 32-bit integer either. Corrects r324533. Submitted by: jhibbits Sponsored by: Dell EMC Isilon Modified: head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:59:04 2017 (r324533) +++ head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 15:13:40 2017 (r324534) @@ -67,7 +67,7 @@ #define AMD_PMC_EVENTMASK 0xF000000FF #define AMD_PMC_TO_UNITMASK(x) (((x) << 8) & AMD_PMC_UNITMASK) -#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 0xF00) << 24)) +#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint64_t)(x) & 0xF00) << 24)) #define AMD_VALID_BITS (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | \ AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE | \ AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK) From owner-svn-src-all@freebsd.org Wed Oct 11 18:25:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04808E33296; Wed, 11 Oct 2017 18:25:07 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C547E71970; Wed, 11 Oct 2017 18:25:06 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BIP5m7016814; Wed, 11 Oct 2017 18:25:05 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BIP5Sf016812; Wed, 11 Oct 2017 18:25:05 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710111825.v9BIP5Sf016812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 11 Oct 2017 18:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324535 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:25:07 -0000 Author: davidcs Date: Wed Oct 11 18:25:05 2017 New Revision: 324535 URL: https://svnweb.freebsd.org/changeset/base/324535 Log: Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 15:13:40 2017 (r324534) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 18:25:05 2017 (r324535) @@ -2374,6 +2374,20 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } + for (i = 0; i < num_tx_cmds; i++) { + int j; + + j = (tx_idx+i) & (NUM_TX_DESCRIPTORS - 1); + + if (NULL != ha->tx_ring[txr_idx].tx_buf[j].m_head) { + QL_ASSERT(ha, 0, \ + ("%s [%d]: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, __LINE__, txr_idx, j,\ + ha->tx_ring[txr_idx].tx_buf[j].m_head)); + return (EINVAL); + } + } + tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 15:13:40 2017 (r324534) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 18:25:05 2017 (r324535) @@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; + + if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + if (m_head) + m_freem(m_head); + *m_headp = NULL; + return (ret); + } + map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, From owner-svn-src-all@freebsd.org Wed Oct 11 18:30:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE04E3339F; Wed, 11 Oct 2017 18:30:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98FFE71B3D; Wed, 11 Oct 2017 18:30:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9B39510AF3A; Wed, 11 Oct 2017 14:30:06 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r324471 - head/sys/boot Date: Wed, 11 Oct 2017 10:47:07 -0700 Message-ID: <2024262.CuRUiD5dcO@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Oct 2017 14:30:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:30:09 -0000 On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote: > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. > > DO NOT MAKE ANY COMMITS TO sys/boot. > > BACK OFF. > > Seriously, though, extra changes create extra friction, and these changes > aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a > conflict when I update. > > So please, do not make any edits to sys/boot whatsoever, no matter how > trivial. > > At least until I'm done. > > Thanks. Umm, I know you are working on sys/boot but I never saw any mail or headsup claiming a lock on that part of the tree. It would be a reasonable assumption for someone based on the public commits that you had finished a milestone for now. I only knew about you wanting to remove LIBSAU via a private reply you sent to my earlier mail, but there was no public mention that you have more work. To that end I think this mail was a bit harsh. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Oct 11 18:44:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0578CE337EF for ; Wed, 11 Oct 2017 18:44:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCB7072473 for ; Wed, 11 Oct 2017 18:44:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id c3so4252898itc.3 for ; Wed, 11 Oct 2017 11:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1haOTKd9dgcE+RK4Bn1feCLIXjIjy1n5+fjiRVIwMtE=; b=YrXJnZeBwPMP1npDUzoGO8/7IBQGhteS+GmNkNselPOHP7ePYZkxBkAN8xZ12sLKE2 FMbc5yedYlnpHY+0Ez5mqP9444KCMssmvoxZajMHTWXtDhUwD9q3HqKsiU05BIH9ccRh 6z6ndsRBfqSzQI8IwjFAP0BN58rnMZ0kZI3CFSwbnfJkEMCsiHRynaEtPSdanCPKyStH zCZlb3HmRujQobpnwRbBYApvS9336gRW3LN2Rh67BYskTKTPfa9u86O/iFJYk8t2mCc6 XCUTxelp2/A/iU/X5KDypYoytYU31RLL0tkxz0GffimecP+7MaemDj7l6CYUWwXeLEkD O2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1haOTKd9dgcE+RK4Bn1feCLIXjIjy1n5+fjiRVIwMtE=; b=LIqoMOayGzrtk3HJ7S5yZZVW0Uwx01J/34v4ji6MoQGqFA5yRni305SU3CfT748EWh QmDsvjQib7SBrjNgjjokrA84u8KbnJqKupJmMmtn5WnD9oBUjeoLSYR0V0isXJVLGKyI xfXOSPWhc1sRwPAsod8GFkYNKlKTzOx3OhIT95+aOuJpXxqhTsSi+7Bfj7j/eL2XAjkN Rh9w6Uu8a+ZGvh6XXE9nMjtUoc4QXrCti4/k1aoMrmIcYZFk0KF10kaOk88Z42GFgFXz OtQPEgAhh9RRhd2p2/mRwWlQrO+QrG1gOrGWupb6R8pCAkZTY0ZMnBaw/QGgFhIChekO l2CA== X-Gm-Message-State: AMCzsaW4SOoJ3u23UNyb2C7Wj+kFbhFCHQ3xbl+X1H2z+ziQAsLrS7Ca tk33QvU2OcfGrYJOnDnZY2XBRcp9rT80PHfuUGnuJg== X-Google-Smtp-Source: AOwi7QCsC8xu/XX7FX8hawHu4Dqg8PA6FUlCeKay1FfVUp/ojBKaWw5WN7xk8bUFhpEsrtDexsyjpSb/yVhC9hlpjLY= X-Received: by 10.36.203.3 with SMTP id u3mr652153itg.136.1507747471069; Wed, 11 Oct 2017 11:44:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Wed, 11 Oct 2017 11:44:30 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:9015:f13b:4510:443e] In-Reply-To: <2024262.CuRUiD5dcO@ralph.baldwin.cx> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> <2024262.CuRUiD5dcO@ralph.baldwin.cx> From: Warner Losh Date: Wed, 11 Oct 2017 12:44:30 -0600 X-Google-Sender-Auth: IiW6466wRy52OafzF0uzIZSIG2g Message-ID: Subject: Re: svn commit: r324471 - head/sys/boot To: John Baldwin Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:44:32 -0000 On Wed, Oct 11, 2017 at 11:47 AM, John Baldwin wrote: > On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote: > > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. > > > > DO NOT MAKE ANY COMMITS TO sys/boot. > > > > BACK OFF. > > > > Seriously, though, extra changes create extra friction, and these changes > > aren't worth any friction at all. I'm deleting LIBSAU and this > guarantees a > > conflict when I update. > > > > So please, do not make any edits to sys/boot whatsoever, no matter how > > trivial. > > > > At least until I'm done. > > > > Thanks. > > Umm, I know you are working on sys/boot but I never saw any mail or headsup > claiming a lock on that part of the tree. It would be a reasonable > assumption > for someone based on the public commits that you had finished a milestone > for > now. I only knew about you wanting to remove LIBSAU via a private reply > you > sent to my earlier mail, but there was no public mention that you have more > work. To that end I think this mail was a bit harsh. > The specific issue was that several people had made suggestions in this area, some of which were conflicting, and I was mulling over what the right thing to commit was. They were made to me, but in a public forum, in response to my original commit. Since I had other changes in flight, I wasn't sure the right way to roll them in. Then with no warning or heads up, the issue was forced by ngie committing changes to something that I'd just touched without even so much as a heads up. And it didn't help that the friction this created wasted 10 minutes of my time dealing with git svn rebase tripping over 3 or 4 commits in my queue. So I was harsh. Perhaps a bit too harsh and too public, but this wasn't a first offense. I'll try to moderate that in the future. Warner From owner-svn-src-all@freebsd.org Wed Oct 11 19:26:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5F5E34D0E; Wed, 11 Oct 2017 19:26:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904D074150; Wed, 11 Oct 2017 19:26:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BJQdq2041827; Wed, 11 Oct 2017 19:26:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BJQdNa041824; Wed, 11 Oct 2017 19:26:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710111926.v9BJQdNa041824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Oct 2017 19:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324536 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/projects/libunwind/src X-SVN-Commit-Revision: 324536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 19:26:40 -0000 Author: emaste Date: Wed Oct 11 19:26:39 2017 New Revision: 324536 URL: https://svnweb.freebsd.org/changeset/base/324536 Log: libunwind: use upstream patch to disable executable stacks arm uses '@' as a comment character, and cannot use @progbits in the .section directive. Apply the upstream noexec stach change which avoids this issue. Obtained from: LLVM r277868 Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S head/contrib/llvm/projects/libunwind/src/assembly.h Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Wed Oct 11 19:26:39 2017 (r324536) @@ -528,4 +528,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Regis #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Wed Oct 11 19:26:39 2017 (r324536) @@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: head/contrib/llvm/projects/libunwind/src/assembly.h ============================================================================== --- head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 19:26:39 2017 (r324536) @@ -35,19 +35,34 @@ #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) #if defined(__APPLE__) + #define SYMBOL_IS_FUNC(name) +#define NO_EXEC_STACK_DIRECTIVE + #elif defined(__ELF__) + #if defined(__arm__) #define SYMBOL_IS_FUNC(name) .type name,%function #else #define SYMBOL_IS_FUNC(name) .type name,@function #endif + +#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__) +#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else +#define NO_EXEC_STACK_DIRECTIVE +#endif + +#else + #define SYMBOL_IS_FUNC(name) \ .def name SEPARATOR \ .scl 2 SEPARATOR \ .type 32 SEPARATOR \ .endef + +#define NO_EXEC_STACK_DIRECTIVE + #endif #define DEFINE_LIBUNWIND_FUNCTION(name) \ From owner-svn-src-all@freebsd.org Wed Oct 11 20:04:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F460E35E30; Wed, 11 Oct 2017 20:04:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B697650D; Wed, 11 Oct 2017 20:04:31 +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 v9BK4VJZ060403; Wed, 11 Oct 2017 20:04:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BK4VVR060402; Wed, 11 Oct 2017 20:04:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710112004.v9BK4VVR060402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 20:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324537 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 324537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:04:32 -0000 Author: cem Date: Wed Oct 11 20:04:30 2017 New Revision: 324537 URL: https://svnweb.freebsd.org/changeset/base/324537 Log: crypto(9): Print flags in more useful hex Sponsored by: Dell EMC Isilon Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Wed Oct 11 19:26:39 2017 (r324536) +++ head/sys/opencrypto/crypto.c Wed Oct 11 20:04:30 2017 (r324537) @@ -572,7 +572,7 @@ crypto_get_driverid(device_t dev, int flags) crypto_drivers[i].cc_dev = dev; crypto_drivers[i].cc_flags = flags; if (bootverbose) - printf("crypto: assign %s driver id %u, flags %u\n", + printf("crypto: assign %s driver id %u, flags 0x%x\n", device_get_nameunit(dev), i, flags); CRYPTO_DRIVER_UNLOCK(); From owner-svn-src-all@freebsd.org Wed Oct 11 20:22:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A52E362D0; Wed, 11 Oct 2017 20:22:03 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B540F76C8B; Wed, 11 Oct 2017 20:22:02 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BKM1DR068887; Wed, 11 Oct 2017 20:22:01 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BKM1g2068880; Wed, 11 Oct 2017 20:22:01 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710112022.v9BKM1g2068880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 11 Oct 2017 20:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324538 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:22:03 -0000 Author: davidcs Date: Wed Oct 11 20:22:01 2017 New Revision: 324538 URL: https://svnweb.freebsd.org/changeset/base/324538 Log: Added support driver state capture/retrieval MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_def.h Wed Oct 11 20:22:01 2017 (r324538) @@ -201,7 +201,6 @@ struct qla_host { qla_rx_buf_t *rxb_free; uint32_t rxb_free_count; - volatile uint32_t posting; /* stats */ uint32_t err_m_getcl; Modified: head/sys/dev/qlxgbe/ql_glbl.h ============================================================================== --- head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:22:01 2017 (r324538) @@ -112,4 +112,8 @@ extern unsigned int ql83xx_resetseq_len; extern unsigned char ql83xx_minidump[]; extern unsigned int ql83xx_minidump_len; +extern void ql_alloc_drvr_state_buffer(qla_host_t *ha); +extern void ql_free_drvr_state_buffer(qla_host_t *ha); +extern void ql_capture_drvr_state(qla_host_t *ha); + #endif /* #ifndef_QL_GLBL_H_ */ Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:22:01 2017 (r324538) @@ -1703,6 +1703,9 @@ typedef struct _qla_hw { uint32_t mdump_buffer_size; void *mdump_template; uint32_t mdump_template_size; + + /* driver state related */ + void *drvr_state; } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ Modified: head/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:22:01 2017 (r324538) @@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$"); #include "ql_inline.h" #include "ql_glbl.h" #include "ql_ioctl.h" +#include "ql_ver.h" +#include "ql_dbg.h" +static int ql_drvr_state(qla_host_t *ha, qla_driver_state_t *drvr_state); +static uint32_t ql_drvr_state_size(qla_host_t *ha); static int ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td); @@ -279,6 +283,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, rval = ENXIO; break; + case QLA_RD_DRVR_STATE: + rval = ql_drvr_state(ha, (qla_driver_state_t *)data); + break; + case QLA_RD_PCI_IDS: pci_ids = (qla_rd_pci_ids_t *)data; pci_ids->ven_id = pci_get_vendor(pci_dev); @@ -293,5 +301,225 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } return rval; +} + + +static int +ql_drvr_state(qla_host_t *ha, qla_driver_state_t *state) +{ + int rval = 0; + uint32_t drvr_state_size; + qla_drvr_state_hdr_t *hdr; + + drvr_state_size = ql_drvr_state_size(ha); + + if (state->buffer == NULL) { + state->size = drvr_state_size; + return (0); + } + + if (state->size < drvr_state_size) + return (ENXIO); + + if (ha->hw.drvr_state == NULL) + return (ENOMEM); + + hdr = ha->hw.drvr_state; + + if (!hdr->drvr_version_major) + ql_capture_drvr_state(ha); + + rval = copyout(ha->hw.drvr_state, state->buffer, drvr_state_size); + + bzero(ha->hw.drvr_state, drvr_state_size); + + return (rval); +} + +static uint32_t +ql_drvr_state_size(qla_host_t *ha) +{ + uint32_t drvr_state_size; + uint32_t size; + + size = sizeof (qla_drvr_state_hdr_t); + drvr_state_size = QL_ALIGN(size, 64); + + size = ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS * ha->hw.num_tx_rings; + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS * ha->hw.num_rds_rings; + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_stat_desc_t) * NUM_STATUS_DESCRIPTORS * + ha->hw.num_sds_rings; + drvr_state_size += QL_ALIGN(size, 64); + + return (drvr_state_size); +} + +static void +ql_get_tx_state(qla_host_t *ha, qla_drvr_state_tx_t *tx_state) +{ + int i; + + for (i = 0; i < ha->hw.num_tx_rings; i++) { + tx_state->base_p_addr = ha->hw.tx_cntxt[i].tx_ring_paddr; + tx_state->cons_p_addr = ha->hw.tx_cntxt[i].tx_cons_paddr; + tx_state->tx_prod_reg = ha->hw.tx_cntxt[i].tx_prod_reg; + tx_state->tx_cntxt_id = ha->hw.tx_cntxt[i].tx_cntxt_id; + tx_state->txr_free = ha->hw.tx_cntxt[i].txr_free; + tx_state->txr_next = ha->hw.tx_cntxt[i].txr_next; + tx_state->txr_comp = ha->hw.tx_cntxt[i].txr_comp; + tx_state++; + } + return; +} + +static void +ql_get_rx_state(qla_host_t *ha, qla_drvr_state_rx_t *rx_state) +{ + int i; + + for (i = 0; i < ha->hw.num_rds_rings; i++) { + rx_state->prod_std = ha->hw.rds[i].prod_std; + rx_state->rx_next = ha->hw.rds[i].rx_next; + rx_state++; + } + return; +} + +static void +ql_get_sds_state(qla_host_t *ha, qla_drvr_state_sds_t *sds_state) +{ + int i; + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + sds_state->sdsr_next = ha->hw.sds[i].sdsr_next; + sds_state->sds_consumer = ha->hw.sds[i].sds_consumer; + sds_state++; + } + return; +} + +void +ql_capture_drvr_state(qla_host_t *ha) +{ + uint8_t *state_buffer; + uint8_t *ptr; + uint32_t drvr_state_size; + qla_drvr_state_hdr_t *hdr; + uint32_t size; + int i; + + drvr_state_size = ql_drvr_state_size(ha); + + state_buffer = ha->hw.drvr_state; + + if (state_buffer == NULL) + return; + + bzero(state_buffer, drvr_state_size); + + hdr = (qla_drvr_state_hdr_t *)state_buffer; + + hdr->drvr_version_major = QLA_VERSION_MAJOR; + hdr->drvr_version_minor = QLA_VERSION_MINOR; + hdr->drvr_version_build = QLA_VERSION_BUILD; + + bcopy(ha->hw.mac_addr, hdr->mac_addr, ETHER_ADDR_LEN); + + hdr->link_speed = ha->hw.link_speed; + hdr->cable_length = ha->hw.cable_length; + hdr->cable_oui = ha->hw.cable_oui; + hdr->link_up = ha->hw.link_up; + hdr->module_type = ha->hw.module_type; + hdr->link_faults = ha->hw.link_faults; + hdr->rcv_intr_coalesce = ha->hw.rcv_intr_coalesce; + hdr->xmt_intr_coalesce = ha->hw.xmt_intr_coalesce; + + size = sizeof (qla_drvr_state_hdr_t); + hdr->tx_state_offset = QL_ALIGN(size, 64); + + ptr = state_buffer + hdr->tx_state_offset; + + ql_get_tx_state(ha, (qla_drvr_state_tx_t *)ptr); + + size = ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t)); + hdr->rx_state_offset = hdr->tx_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->rx_state_offset; + + ql_get_rx_state(ha, (qla_drvr_state_rx_t *)ptr); + + size = ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t)); + hdr->sds_state_offset = hdr->rx_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->sds_state_offset; + + ql_get_sds_state(ha, (qla_drvr_state_sds_t *)ptr); + + size = ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t)); + hdr->txr_offset = hdr->sds_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->txr_offset; + + hdr->num_tx_rings = ha->hw.num_tx_rings; + hdr->txr_size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS; + hdr->txr_entries = NUM_TX_DESCRIPTORS; + + size = hdr->num_tx_rings * hdr->txr_size; + bcopy(ha->hw.dma_buf.tx_ring.dma_b, ptr, size); + + hdr->rxr_offset = hdr->txr_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->rxr_offset; + + hdr->rxr_size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS; + hdr->rxr_entries = NUM_RX_DESCRIPTORS; + hdr->num_rx_rings = ha->hw.num_rds_rings; + + for (i = 0; i < ha->hw.num_rds_rings; i++) { + bcopy(ha->hw.dma_buf.rds_ring[i].dma_b, ptr, hdr->rxr_size); + ptr += hdr->rxr_size; + } + + size = hdr->rxr_size * hdr->num_rx_rings; + hdr->sds_offset = hdr->rxr_offset + QL_ALIGN(size, 64); + hdr->sds_ring_size = sizeof(q80_stat_desc_t) * NUM_STATUS_DESCRIPTORS; + hdr->sds_entries = NUM_STATUS_DESCRIPTORS; + hdr->num_sds_rings = ha->hw.num_sds_rings; + + ptr = state_buffer + hdr->sds_offset; + for (i = 0; i < ha->hw.num_sds_rings; i++) { + bcopy(ha->hw.dma_buf.sds_ring[i].dma_b, ptr, hdr->sds_ring_size); + ptr += hdr->sds_ring_size; + } + return; +} + +void +ql_alloc_drvr_state_buffer(qla_host_t *ha) +{ + uint32_t drvr_state_size; + + drvr_state_size = ql_drvr_state_size(ha); + + ha->hw.drvr_state = malloc(drvr_state_size, M_QLA83XXBUF, M_NOWAIT); + + return; +} + +void +ql_free_drvr_state_buffer(qla_host_t *ha) +{ + if (ha->hw.drvr_state != NULL) + free(ha->hw.drvr_state, M_QLA83XXBUF); + return; } Modified: head/sys/dev/qlxgbe/ql_ioctl.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ioctl.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ioctl.h Wed Oct 11 20:22:01 2017 (r324538) @@ -93,6 +93,72 @@ struct qla_rd_fw_dump { }; typedef struct qla_rd_fw_dump qla_rd_fw_dump_t; +struct qla_drvr_state_tx { + uint64_t base_p_addr; + uint64_t cons_p_addr; + uint32_t tx_prod_reg; + uint32_t tx_cntxt_id; + uint32_t txr_free; + uint32_t txr_next; + uint32_t txr_comp; +}; +typedef struct qla_drvr_state_tx qla_drvr_state_tx_t; + +struct qla_drvr_state_sds { + uint32_t sdsr_next; /* next entry in SDS ring to process */ + uint32_t sds_consumer; +}; +typedef struct qla_drvr_state_sds qla_drvr_state_sds_t; + +struct qla_drvr_state_rx { + uint32_t prod_std; + uint32_t rx_next; /* next standard rcv ring to arm fw */; +}; +typedef struct qla_drvr_state_rx qla_drvr_state_rx_t; + +struct qla_drvr_state_hdr { + uint32_t drvr_version_major; + uint32_t drvr_version_minor; + uint32_t drvr_version_build; + + uint8_t mac_addr[ETHER_ADDR_LEN]; + uint16_t link_speed; + uint16_t cable_length; + uint32_t cable_oui; + uint8_t link_up; + uint8_t module_type; + uint8_t link_faults; + uint32_t rcv_intr_coalesce; + uint32_t xmt_intr_coalesce; + + uint32_t tx_state_offset;/* size = sizeof (qla_drvr_state_tx_t) * num_tx_rings */ + uint32_t rx_state_offset;/* size = sizeof (qla_drvr_state_rx_t) * num_rx_rings */ + uint32_t sds_state_offset;/* size = sizeof (qla_drvr_state_sds_t) * num_sds_rings */ + + uint32_t num_tx_rings; /* number of tx rings */ + uint32_t txr_size; /* size of each tx ring in bytes */ + uint32_t txr_entries; /* number of descriptors in each tx ring */ + uint32_t txr_offset; /* start of tx ring [0 - #rings] content */ + + uint32_t num_rx_rings; /* number of rx rings */ + uint32_t rxr_size; /* size of each rx ring in bytes */ + uint32_t rxr_entries; /* number of descriptors in each rx ring */ + uint32_t rxr_offset; /* start of rx ring [0 - #rings] content */ + + uint32_t num_sds_rings; /* number of sds rings */ + uint32_t sds_ring_size; /* size of each sds ring in bytes */ + uint32_t sds_entries; /* number of descriptors in each sds ring */ + uint32_t sds_offset; /* start of sds ring [0 - #rings] content */ +}; + +typedef struct qla_drvr_state_hdr qla_drvr_state_hdr_t; + +struct qla_driver_state { + uint32_t size; + void *buffer; +}; +typedef struct qla_driver_state qla_driver_state_t; + /* * Read/Write Register */ @@ -132,5 +198,11 @@ typedef struct qla_rd_fw_dump qla_rd_fw_dump_t; * Read Minidump Template */ #define QLA_RD_FW_DUMP _IOWR('q', 8, qla_rd_fw_dump_t) + +/* + * Read Driver State + */ +#define QLA_RD_DRVR_STATE _IOWR('q', 9, qla_driver_state_t) + #endif /* #ifndef _QL_IOCTL_H_ */ Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 20:22:01 2017 (r324538) @@ -492,6 +492,7 @@ qla_pci_attach(device_t dev) device_printf(dev, "%s: ql_minidump_init failed\n", __func__); goto qla_pci_attach_err; } + ql_alloc_drvr_state_buffer(ha); /* create the o.s ethernet interface */ qla_init_ifnet(dev, ha); @@ -645,6 +646,7 @@ qla_release(qla_host_t *ha) if (ha->ifp != NULL) ether_ifdetach(ha->ifp); + ql_free_drvr_state_buffer(ha); ql_free_dma(ha); qla_free_parent_dma_tag(ha); Modified: head/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ver.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ver.h Wed Oct 11 20:22:01 2017 (r324538) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 34 +#define QLA_VERSION_BUILD 35 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Wed Oct 11 20:36:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66CDE36907; Wed, 11 Oct 2017 20:36:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B27B47732F; Wed, 11 Oct 2017 20:36:10 +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 v9BKa9NC073118; Wed, 11 Oct 2017 20:36:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BKa9hE073113; Wed, 11 Oct 2017 20:36:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710112036.v9BKa9hE073113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 11 Oct 2017 20:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324539 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 324539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:36:11 -0000 Author: glebius Date: Wed Oct 11 20:36:09 2017 New Revision: 324539 URL: https://svnweb.freebsd.org/changeset/base/324539 Log: Declare more TCP globals in tcp_var.h, so that alternative TCP stacks can use them. Gather all TCP tunables in tcp_var.h in one place and alphabetically sort them, to ease maintainance of the list. Don't copy and paste declarations in tcp_stacks/fastpath.c. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_input.c Wed Oct 11 20:36:09 2017 (r324539) @@ -145,7 +145,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFL "Delay ACK to try and piggyback it onto a data packet"); VNET_DEFINE(int, drop_synfin) = 0; -#define V_drop_synfin VNET(drop_synfin) SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); @@ -156,7 +155,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLF "Use calculated pipe/in-flight bytes per RFC 6675"); VNET_DEFINE(int, tcp_do_rfc3042) = 1; -#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3042), 0, "Enable RFC 3042 (Limited Transmit)"); @@ -194,13 +192,11 @@ SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CT "Max retries before giving up on ECN"); VNET_DEFINE(int, tcp_insecure_syn) = 0; -#define V_tcp_insecure_syn VNET(tcp_insecure_syn) SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_syn), 0, "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets"); VNET_DEFINE(int, tcp_insecure_rst) = 0; -#define V_tcp_insecure_rst VNET(tcp_insecure_rst) SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow RFC793 instead of RFC5961 criteria for accepting RST packets"); @@ -211,19 +207,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) 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; -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, "Max size of automatic receive buffer"); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_output.c Wed Oct 11 20:36:09 2017 (r324539) @@ -102,7 +102,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery "Enable Path MTU Discovery"); VNET_DEFINE(int, tcp_do_tso) = 1; -#define V_tcp_do_tso VNET(tcp_do_tso) SYSCTL_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); @@ -113,19 +112,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, &VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size"); VNET_DEFINE(int, tcp_do_autosndbuf) = 1; -#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autosndbuf), 0, "Enable automatic send buffer sizing"); VNET_DEFINE(int, tcp_autosndbuf_inc) = 8*1024; -#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; -#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_sack.c Wed Oct 11 20:36:09 2017 (r324539) @@ -133,19 +133,16 @@ SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFL &VNET_NAME(tcp_do_sack), 0, "Enable/Disable TCP SACK support"); VNET_DEFINE(int, tcp_sack_maxholes) = 128; -#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_maxholes), 0, "Maximum number of TCP SACK holes allowed per connection"); VNET_DEFINE(int, tcp_sack_globalmaxholes) = 65536; -#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalmaxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_globalmaxholes), 0, "Global maximum number of TCP SACK holes"); VNET_DEFINE(int, tcp_sack_globalholes) = 0; -#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 11 20:36:09 2017 (r324539) @@ -120,21 +120,6 @@ __FBSDID("$FreeBSD$"); #include -VNET_DECLARE(int, tcp_autorcvbuf_inc); -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) -VNET_DECLARE(int, tcp_autorcvbuf_max); -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -VNET_DECLARE(int, tcp_do_rfc3042); -#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) -VNET_DECLARE(int, tcp_do_autorcvbuf); -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) -VNET_DECLARE(int, tcp_insecure_rst); -#define V_tcp_insecure_rst VNET(tcp_insecure_rst) -VNET_DECLARE(int, tcp_insecure_syn); -#define V_tcp_insecure_syn VNET(tcp_insecure_syn) -VNET_DECLARE(int, drop_synfin); -#define V_drop_synfin VNET(drop_synfin) - static void tcp_do_segment_fastslow(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t, int); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_var.h Wed Oct 11 20:36:09 2017 (r324539) @@ -201,12 +201,6 @@ struct tcpcb { #endif /* _KERNEL || _WANT_TCPCB */ #ifdef _KERNEL -/* - * Kernel variables for tcp. - */ -VNET_DECLARE(int, tcp_do_rfc1323); -#define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) - struct tcptemp { u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ struct tcphdr tt_t; @@ -701,49 +695,82 @@ SYSCTL_DECL(_net_inet_tcp_sack); MALLOC_DECLARE(M_TCPLOG); #endif -VNET_DECLARE(struct inpcbhead, tcb); /* queue of active tcpcb's */ -VNET_DECLARE(struct inpcbinfo, tcbinfo); extern int tcp_log_in_vain; -VNET_DECLARE(int, tcp_mssdflt); /* XXX */ -VNET_DECLARE(int, tcp_minmss); + +/* + * Global TCP tunables shared between different stacks. + * Please keep the list sorted. + */ +VNET_DECLARE(int, drop_synfin); +VNET_DECLARE(int, path_mtu_discovery); +VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(int, tcp_autorcvbuf_inc); +VNET_DECLARE(int, tcp_autorcvbuf_max); +VNET_DECLARE(int, tcp_autosndbuf_inc); +VNET_DECLARE(int, tcp_autosndbuf_max); VNET_DECLARE(int, tcp_delack_enabled); +VNET_DECLARE(int, tcp_do_autorcvbuf); +VNET_DECLARE(int, tcp_do_autosndbuf); +VNET_DECLARE(int, tcp_do_ecn); +VNET_DECLARE(int, tcp_do_rfc1323); +VNET_DECLARE(int, tcp_do_rfc3042); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_rfc3465); +VNET_DECLARE(int, tcp_do_rfc6675_pipe); +VNET_DECLARE(int, tcp_do_sack); +VNET_DECLARE(int, tcp_do_tso); +VNET_DECLARE(int, tcp_ecn_maxretries); VNET_DECLARE(int, tcp_initcwnd_segments); -VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(int, tcp_insecure_rst); +VNET_DECLARE(int, tcp_insecure_syn); +VNET_DECLARE(int, tcp_minmss); +VNET_DECLARE(int, tcp_mssdflt); VNET_DECLARE(int, tcp_recvspace); -VNET_DECLARE(int, path_mtu_discovery); -VNET_DECLARE(int, tcp_do_rfc3465); -VNET_DECLARE(int, tcp_abc_l_var); -#define V_tcb VNET(tcb) -#define V_tcbinfo VNET(tcbinfo) -#define V_tcp_mssdflt VNET(tcp_mssdflt) -#define V_tcp_minmss VNET(tcp_minmss) -#define V_tcp_delack_enabled VNET(tcp_delack_enabled) -#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) -#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) -#define V_tcp_sendspace VNET(tcp_sendspace) -#define V_tcp_recvspace VNET(tcp_recvspace) -#define V_path_mtu_discovery VNET(path_mtu_discovery) -#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) -#define V_tcp_abc_l_var VNET(tcp_abc_l_var) +VNET_DECLARE(int, tcp_sack_globalholes); +VNET_DECLARE(int, tcp_sack_globalmaxholes); +VNET_DECLARE(int, tcp_sack_maxholes); +VNET_DECLARE(int, tcp_sc_rst_sock_fail); +VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(struct inpcbhead, tcb); +VNET_DECLARE(struct inpcbinfo, tcbinfo); -VNET_DECLARE(int, tcp_do_sack); /* SACK enabled/disabled */ -VNET_DECLARE(int, tcp_sc_rst_sock_fail); /* RST on sock alloc failure */ -#define V_tcp_do_sack VNET(tcp_do_sack) -#define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) +#define V_drop_synfin VNET(drop_synfin) +#define V_path_mtu_discovery VNET(path_mtu_discovery) +#define V_tcb VNET(tcb) +#define V_tcbinfo VNET(tcbinfo) +#define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) +#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) +#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) +#define V_tcp_delack_enabled VNET(tcp_delack_enabled) +#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) +#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) +#define V_tcp_do_ecn VNET(tcp_do_ecn) +#define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) +#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) +#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) +#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) +#define V_tcp_do_sack VNET(tcp_do_sack) +#define V_tcp_do_tso VNET(tcp_do_tso) +#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) +#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) +#define V_tcp_insecure_rst VNET(tcp_insecure_rst) +#define V_tcp_insecure_syn VNET(tcp_insecure_syn) +#define V_tcp_minmss VNET(tcp_minmss) +#define V_tcp_mssdflt VNET(tcp_mssdflt) +#define V_tcp_recvspace VNET(tcp_recvspace) +#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) +#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) +#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) +#define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) +#define V_tcp_sendspace VNET(tcp_sendspace) -VNET_DECLARE(int, tcp_do_ecn); /* TCP ECN enabled/disabled */ -VNET_DECLARE(int, tcp_ecn_maxretries); -#define V_tcp_do_ecn VNET(tcp_do_ecn) -#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) - #ifdef TCP_HHOOK VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) #endif - -VNET_DECLARE(int, tcp_do_rfc6675_pipe); -#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo); From owner-svn-src-all@freebsd.org Wed Oct 11 20:36:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA16E36943; Wed, 11 Oct 2017 20:36:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B1A773E5; Wed, 11 Oct 2017 20:36:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BKaMj1073177; Wed, 11 Oct 2017 20:36:22 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BKaMSe073176; Wed, 11 Oct 2017 20:36:22 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201710112036.v9BKaMSe073176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 11 Oct 2017 20:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r324540 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: marius X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 324540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:36:23 -0000 Author: marius Date: Wed Oct 11 20:36:22 2017 New Revision: 324540 URL: https://svnweb.freebsd.org/changeset/base/324540 Log: Hand releng/10.4 over to so@. Approved by: re (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Wed Oct 11 20:36:09 2017 (r324539) +++ svnadmin/conf/approvers Wed Oct 11 20:36:22 2017 (r324540) @@ -18,11 +18,9 @@ # #^head/ re #^stable/11/ re -#^stable/10/ re ^release/ re ^releng/11.[0-1]/ (security-officer|so) -^releng/10.4/ re -^releng/10.[0-3]/ (security-officer|so) +^releng/10.[0-4]/ (security-officer|so) ^releng/9.[0-3]/ (security-officer|so) ^releng/8.[0-4]/ (security-officer|so) ^releng/7.[0-4]/ (security-officer|so) From owner-svn-src-all@freebsd.org Wed Oct 11 21:53:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418AEE38390; Wed, 11 Oct 2017 21:53:52 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C31F7E3CC; Wed, 11 Oct 2017 21:53:52 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BLrpsv007327; Wed, 11 Oct 2017 21:53:51 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BLroeR007323; Wed, 11 Oct 2017 21:53:50 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710112153.v9BLroeR007323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Wed, 11 Oct 2017 21:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 324541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 21:53:52 -0000 Author: mjoras Date: Wed Oct 11 21:53:50 2017 New Revision: 324541 URL: https://svnweb.freebsd.org/changeset/base/324541 Log: Add clearing function for unr(9). Previously before you could call unrhdr_delete you needed to individually free every allocated unit. It is useful to be able to tear down the unr without having to go through this process, as it is significantly faster than freeing the individual units. Reviewed by: cem, lidl Approved by: rstone (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12591 Modified: head/share/man/man9/Makefile head/share/man/man9/unr.9 head/sys/kern/subr_unit.c head/sys/sys/systm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Oct 11 20:36:22 2017 (r324540) +++ head/share/man/man9/Makefile Wed Oct 11 21:53:50 2017 (r324541) @@ -414,6 +414,7 @@ MAN= accept_filter.9 \ MLINKS= unr.9 alloc_unr.9 \ unr.9 alloc_unrl.9 \ unr.9 alloc_unr_specific.9 \ + unr.9 clear_unrhdr.9 \ unr.9 delete_unrhdr.9 \ unr.9 free_unr.9 \ unr.9 new_unrhdr.9 Modified: head/share/man/man9/unr.9 ============================================================================== --- head/share/man/man9/unr.9 Wed Oct 11 20:36:22 2017 (r324540) +++ head/share/man/man9/unr.9 Wed Oct 11 21:53:50 2017 (r324541) @@ -24,11 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2010 +.Dd October 4, 2017 .Dt UNR 9 .Os .Sh NAME .Nm new_unrhdr , +.Nm clear_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , .Nm alloc_unr_specific , @@ -39,6 +40,8 @@ .Ft "struct unrhdr *" .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" .Ft void +.Fn clear_unrhdr "struct unrhdr *uh" +.Ft void .Fn delete_unrhdr "struct unrhdr *uh" .Ft int .Fn alloc_unr "struct unrhdr *uh" @@ -70,8 +73,16 @@ is not .Dv NULL , it is used for locking when allocating and freeing units. Otherwise, internal mutex is used. +.It Fn clear_unrhdr uh +Clear all units from the specified unit number allocator entity. +This function resets the entity as if it were just initialized with +.Fn new_unrhdr . .It Fn delete_unrhdr uh -Destroy specified unit number allocator entity. +Delete specified unit number allocator entity. +This function frees the memory associated with the entity, it does not free +any units. +To free all units use +.Fn clear_unrhdr . .It Fn alloc_unr uh Return a new unit number. The lowest free number is always allocated. Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) Free(uh); } +void +clear_unrhdr(struct unrhdr *uh) +{ + struct unr *up, *uq; + + KASSERT(TAILQ_EMPTY(&uh->ppfree), + ("unrhdr has postponed item for free")); + up = TAILQ_FIRST(&uh->head); + while (up != NULL) { + uq = TAILQ_NEXT(up, list); + if (up->ptr != uh) { + Free(up->ptr); + } + Free(up); + up = uq; + } + TAILQ_INIT(&uh->head); + uh->busy = 0; + uh->alloc = 0; +} + static __inline int is_bitmap(struct unrhdr *uh, struct unr *up) { Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Oct 11 20:36:22 2017 (r324540) +++ head/sys/sys/systm.h Wed Oct 11 21:53:50 2017 (r324541) @@ -450,6 +450,7 @@ struct unrhdr; struct unrhdr *new_unrhdr(int low, int high, struct mtx *mutex); void init_unrhdr(struct unrhdr *uh, int low, int high, struct mtx *mutex); void delete_unrhdr(struct unrhdr *uh); +void clear_unrhdr(struct unrhdr *uh); void clean_unrhdr(struct unrhdr *uh); void clean_unrhdrl(struct unrhdr *uh); int alloc_unr(struct unrhdr *uh); From owner-svn-src-all@freebsd.org Wed Oct 11 21:53:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CD19E3839D; Wed, 11 Oct 2017 21:53:55 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01BC7E3CD; Wed, 11 Oct 2017 21:53:54 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BLrsS5007374; Wed, 11 Oct 2017 21:53:54 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BLrrID007371; Wed, 11 Oct 2017 21:53:53 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710112153.v9BLrrID007371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Wed, 11 Oct 2017 21:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324542 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 324542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 21:53:55 -0000 Author: mjoras Date: Wed Oct 11 21:53:53 2017 New Revision: 324542 URL: https://svnweb.freebsd.org/changeset/base/324542 Log: When unmounting a tmpfs, do not call free_unr. tmpfs uses unr(9) to allocate inodes. Previously when unmounting it would individually free the units when it freed each vnode. This is unnecessary as we can use the newly-added unrhdr_clear function to clear out the unr in onde go. This measurably reduces the time to unmount a tmpfs with many files. Reviewed by: cem, lidl Approved by: rstone (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12591 Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Oct 11 21:53:50 2017 (r324541) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Oct 11 21:53:53 2017 (r324542) @@ -362,7 +362,13 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - free_unr(tmp->tm_ino_unr, node->tn_id); + /* + * If we are unmounting there is no need for going through the overhead + * of freeing the inodes from the unr individually, so free them all in + * one go later. + */ + if (!detach) + free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Oct 11 21:53:50 2017 (r324541) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Oct 11 21:53:53 2017 (r324542) @@ -317,6 +317,8 @@ tmpfs_unmount(struct mount *mp, int mntflags) TMPFS_NODE_UNLOCK(node); } + clear_unrhdr(tmp->tm_ino_unr); + mp->mnt_data = NULL; tmpfs_free_tmp(tmp); vfs_write_resume(mp, VR_START_WRITE); From owner-svn-src-all@freebsd.org Wed Oct 11 23:21:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1400E3A0F9; Wed, 11 Oct 2017 23:21:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE1981AD9; Wed, 11 Oct 2017 23:21:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BNLORd043875; Wed, 11 Oct 2017 23:21:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BNLORw043874; Wed, 11 Oct 2017 23:21:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710112321.v9BNLORw043874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 11 Oct 2017 23:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324543 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 324543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 23:21:25 -0000 Author: rmacklem Date: Wed Oct 11 23:21:24 2017 New Revision: 324543 URL: https://svnweb.freebsd.org/changeset/base/324543 Log: MFC: r323689 Fix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change. The code in nfscl_doflayoutio() bogusly used FREAD instead of NFSV4OPEN_ACCESSREAD. Since both happen to be defined as "1", this worked and the patch doesn't result in a functional change. Found by inspection during development of Flex File Layout support. Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Wed Oct 11 21:53:53 2017 (r324542) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Wed Oct 11 23:21:24 2017 (r324543) @@ -5766,7 +5766,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i np->n_flag &= ~NDSCOMMIT; mtx_unlock(&np->n_mtx); } - } else if (rwflag == FREAD) + } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, io_off, xfer, fhp, cred, p); else { From owner-svn-src-all@freebsd.org Wed Oct 11 23:33:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56C0E3A4A3; Wed, 11 Oct 2017 23:33:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A352A8211E; Wed, 11 Oct 2017 23:33:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BNXovZ048858; Wed, 11 Oct 2017 23:33:50 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BNXoZI048857; Wed, 11 Oct 2017 23:33:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710112333.v9BNXoZI048857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 11 Oct 2017 23:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324544 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 324544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 23:33:52 -0000 Author: rmacklem Date: Wed Oct 11 23:33:50 2017 New Revision: 324544 URL: https://svnweb.freebsd.org/changeset/base/324544 Log: MFC: r323978 Change a panic to an error return. There was a panic() in the NFS server's write operation that didn't need to be a panic() and could just be an error return. This patch makes that change. Found by code inspection during development of the pNFS service. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Wed Oct 11 23:21:24 2017 (r324543) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Wed Oct 11 23:33:50 2017 (r324544) @@ -910,7 +910,7 @@ nfsrvd_write(struct nfsrv_descript *nd, __unused int i nd->nd_md, nd->nd_dpos, nd->nd_cred, p); error = nfsm_advance(nd, NFSM_RNDUP(retlen), -1); if (error) - panic("nfsrv_write mbuf"); + goto nfsmout; } if (nd->nd_flag & ND_NFSV4) aftat_ret = 0; From owner-svn-src-all@freebsd.org Wed Oct 11 23:42:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ABF7E3A66D; Wed, 11 Oct 2017 23:42:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E61B6824FF; Wed, 11 Oct 2017 23:42:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BNgUlT052894; Wed, 11 Oct 2017 23:42:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BNgUjn052893; Wed, 11 Oct 2017 23:42:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710112342.v9BNgUjn052893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 11 Oct 2017 23:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324545 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 324545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 23:42:31 -0000 Author: rmacklem Date: Wed Oct 11 23:42:29 2017 New Revision: 324545 URL: https://svnweb.freebsd.org/changeset/base/324545 Log: MFC: r324074 Fix a memory leak that occurred in the pNFS client. When a "pnfs" NFSv4.1 mount was unmounted, it didn't free up the layouts and deviceinfo structures. This leak only affects "pnfs" mounts and only when the mount is umounted. Found while testing the pNFS Flexible File layout client code. Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clstate.c Wed Oct 11 23:33:50 2017 (r324544) +++ stable/10/sys/fs/nfsclient/nfs_clstate.c Wed Oct 11 23:42:29 2017 (r324545) @@ -1627,6 +1627,14 @@ nfscl_cleanclient(struct nfsclclient *clp) { struct nfsclowner *owp, *nowp; struct nfsclopen *op, *nop; + struct nfscllayout *lyp, *nlyp; + struct nfscldevinfo *dip, *ndip; + + TAILQ_FOREACH_SAFE(lyp, &clp->nfsc_layout, nfsly_list, nlyp) + nfscl_freelayout(lyp); + + LIST_FOREACH_SAFE(dip, &clp->nfsc_devinfo, nfsdi_list, ndip) + nfscl_freedevinfo(dip); /* Now, all the OpenOwners, etc. */ LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { From owner-svn-src-all@freebsd.org Thu Oct 12 08:27:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44AF4E47FEE; Thu, 12 Oct 2017 08:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 129026C7F0; Thu, 12 Oct 2017 08:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9C8RwMs068108; Thu, 12 Oct 2017 08:27:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9C8Rwwj068105; Thu, 12 Oct 2017 08:27:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710120827.v9C8Rwwj068105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Oct 2017 08:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324546 - in stable/11: lib/libcuse sys/fs/cuse X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: lib/libcuse sys/fs/cuse X-SVN-Commit-Revision: 324546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 08:27:59 -0000 Author: hselasky Date: Thu Oct 12 08:27:57 2017 New Revision: 324546 URL: https://svnweb.freebsd.org/changeset/base/324546 Log: MFC r324320: Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE. This error code is useful when emulating Linux input event devices from userspace. PR: 218626 Submitted by: jan.kokemueller@gmail.com Sponsored by: Mellanox Technologies Modified: stable/11/lib/libcuse/cuse.3 stable/11/sys/fs/cuse/cuse.c stable/11/sys/fs/cuse/cuse_defs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcuse/cuse.3 ============================================================================== --- stable/11/lib/libcuse/cuse.3 Wed Oct 11 23:42:29 2017 (r324545) +++ stable/11/lib/libcuse/cuse.3 Thu Oct 12 08:27:57 2017 (r324546) @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 6, 2014 +.Dd October 5, 2017 .Dt CUSE 3 .Os .Sh NAME @@ -292,6 +292,7 @@ enum { CUSE_ERR_SIGNAL CUSE_ERR_OTHER CUSE_ERR_NOT_LOADED + CUSE_ERR_NO_DEVICE CUSE_POLL_NONE CUSE_POLL_READ Modified: stable/11/sys/fs/cuse/cuse.c ============================================================================== --- stable/11/sys/fs/cuse/cuse.c Wed Oct 11 23:42:29 2017 (r324545) +++ stable/11/sys/fs/cuse/cuse.c Thu Oct 12 08:27:57 2017 (r324546) @@ -390,6 +390,8 @@ cuse_convert_error(int error) return (EFAULT); case CUSE_ERR_SIGNAL: return (EINTR); + case CUSE_ERR_NO_DEVICE: + return (ENODEV); default: return (ENXIO); } Modified: stable/11/sys/fs/cuse/cuse_defs.h ============================================================================== --- stable/11/sys/fs/cuse/cuse_defs.h Wed Oct 11 23:42:29 2017 (r324545) +++ stable/11/sys/fs/cuse/cuse_defs.h Thu Oct 12 08:27:57 2017 (r324546) @@ -27,7 +27,7 @@ #ifndef _CUSE_DEFS_H_ #define _CUSE_DEFS_H_ -#define CUSE_VERSION 0x000122 +#define CUSE_VERSION 0x000123 #define CUSE_ERR_NONE 0 #define CUSE_ERR_BUSY -1 @@ -38,6 +38,7 @@ #define CUSE_ERR_SIGNAL -6 #define CUSE_ERR_OTHER -7 #define CUSE_ERR_NOT_LOADED -8 +#define CUSE_ERR_NO_DEVICE -9 #define CUSE_POLL_NONE 0 #define CUSE_POLL_READ 1 From owner-svn-src-all@freebsd.org Thu Oct 12 13:59:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95EDE2A49D; Thu, 12 Oct 2017 13:59:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 771F87C132; Thu, 12 Oct 2017 13:59:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CDxNaB009479; Thu, 12 Oct 2017 13:59:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CDxN6X009478; Thu, 12 Oct 2017 13:59:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710121359.v9CDxN6X009478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Oct 2017 13:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324547 - head/usr.bin/xinstall X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.bin/xinstall X-SVN-Commit-Revision: 324547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 13:59:24 -0000 Author: mjg Date: Thu Oct 12 13:59:23 2017 New Revision: 324547 URL: https://svnweb.freebsd.org/changeset/base/324547 Log: xinstall: plug an infinite loop in directory creation If stat continues to fail with ENOENT and mkdir with EEXIST the code wont finish. In particular this can show up when the target path follows through a symlink to a non-existent directory. Reported by: ae MFC after: 1 week Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Oct 12 08:27:57 2017 (r324546) +++ head/usr.bin/xinstall/xinstall.c Thu Oct 12 13:59:23 2017 (r324547) @@ -1292,17 +1292,19 @@ install_dir(char *path) { char *p; struct stat sb; - int ch; + int ch, tried_mkdir; for (p = path;; ++p) if (!*p || (p != path && *p == '/')) { + tried_mkdir = 0; ch = *p; *p = '\0'; again: if (stat(path, &sb) < 0) { - if (errno != ENOENT) + if (errno != ENOENT || tried_mkdir) err(EX_OSERR, "stat %s", path); if (mkdir(path, 0755) < 0) { + tried_mkdir = 1; if (errno == EEXIST) goto again; err(EX_OSERR, "mkdir %s", path); From owner-svn-src-all@freebsd.org Thu Oct 12 14:08:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DF07E2A7A6; Thu, 12 Oct 2017 14:08:57 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE84C7C7A9; Thu, 12 Oct 2017 14:08:56 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CE8t1B013922; Thu, 12 Oct 2017 14:08:55 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CE8tac013921; Thu, 12 Oct 2017 14:08:55 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201710121408.v9CE8tac013921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 12 Oct 2017 14:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324548 - stable/11/sys/dev/smc X-SVN-Group: stable-11 X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: stable/11/sys/dev/smc X-SVN-Commit-Revision: 324548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:08:57 -0000 Author: n_hibma Date: Thu Oct 12 14:08:55 2017 New Revision: 324548 URL: https://svnweb.freebsd.org/changeset/base/324548 Log: MFC 324088: Make smc compile with DEVICE_POLLING set. smc_poll had the wrong prototype. Reviewed by: benno Modified: stable/11/sys/dev/smc/if_smc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/smc/if_smc.c ============================================================================== --- stable/11/sys/dev/smc/if_smc.c Thu Oct 12 13:59:23 2017 (r324547) +++ stable/11/sys/dev/smc/if_smc.c Thu Oct 12 14:08:55 2017 (r324548) @@ -782,7 +782,7 @@ smc_task_rx(void *context, int pending) } #ifdef DEVICE_POLLING -static void +static int smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct smc_softc *sc; @@ -792,12 +792,13 @@ smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int cou SMC_LOCK(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { SMC_UNLOCK(sc); - return; + return (0); } SMC_UNLOCK(sc); if (cmd == POLL_AND_CHECK_STATUS) taskqueue_enqueue(sc->smc_tq, &sc->smc_intr); + return (0); } #endif From owner-svn-src-all@freebsd.org Thu Oct 12 14:32:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5551E2B028; Thu, 12 Oct 2017 14:32:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A131D7D4F3; Thu, 12 Oct 2017 14:32:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEWjlI026148; Thu, 12 Oct 2017 14:32:45 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEWjCe026147; Thu, 12 Oct 2017 14:32:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201710121432.v9CEWjCe026147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Oct 2017 14:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324549 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 324549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:32:46 -0000 Author: bz Date: Thu Oct 12 14:32:45 2017 New Revision: 324549 URL: https://svnweb.freebsd.org/changeset/base/324549 Log: Previously there was a VIRT kernel to which I had added these options. With that gone they need to go into GENERIC now. Makes FreeBSD/arm usable on gem5 by default. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D12566 Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Oct 12 14:08:55 2017 (r324548) +++ head/sys/arm/conf/GENERIC Thu Oct 12 14:32:45 2017 (r324549) @@ -99,6 +99,7 @@ device ahci # AHCI-compatible SATA controllers # PCI options NEW_PCIB device pci +device pci_host_generic # PCI NICs device re # RealTek 8139C+/8169/8169S/8110S @@ -106,6 +107,7 @@ device re # RealTek 8139C+/8169/8169S/8110S # VirtIO device virtio device virtio_mmio +device virtio_pci device virtio_blk device vtnet From owner-svn-src-all@freebsd.org Thu Oct 12 14:53:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70C15E2B94C; Thu, 12 Oct 2017 14:53:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8C27E0F2; Thu, 12 Oct 2017 14:53:26 +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 v9CErP6V034838; Thu, 12 Oct 2017 14:53:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CErPiV034836; Thu, 12 Oct 2017 14:53:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121453.v9CErPiV034836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324550 - head/lib/libstand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libstand X-SVN-Commit-Revision: 324550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:53:26 -0000 Author: imp Date: Thu Oct 12 14:53:25 2017 New Revision: 324550 URL: https://svnweb.freebsd.org/changeset/base/324550 Log: Add $FreeBSD$ to ancient sources that it's missing from. Sponsored by: Netflix Modified: head/lib/libstand/bootparam.h head/lib/libstand/tftp.h Modified: head/lib/libstand/bootparam.h ============================================================================== --- head/lib/libstand/bootparam.h Thu Oct 12 14:32:45 2017 (r324549) +++ head/lib/libstand/bootparam.h Thu Oct 12 14:53:25 2017 (r324550) @@ -1,4 +1,5 @@ /* $NetBSD: bootparam.h,v 1.3 1998/01/05 19:19:41 perry Exp $ */ +/* $FreeBSD$ */ int bp_whoami(int sock); int bp_getfile(int sock, char *key, struct in_addr *addrp, char *path); Modified: head/lib/libstand/tftp.h ============================================================================== --- head/lib/libstand/tftp.h Thu Oct 12 14:32:45 2017 (r324549) +++ head/lib/libstand/tftp.h Thu Oct 12 14:53:25 2017 (r324550) @@ -30,6 +30,7 @@ * (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$ */ From owner-svn-src-all@freebsd.org Thu Oct 12 14:56:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C9BE2BA13; Thu, 12 Oct 2017 14:56:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8058B7E295; Thu, 12 Oct 2017 14:56:37 +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 v9CEuaaZ035102; Thu, 12 Oct 2017 14:56:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEuSRE035015; Thu, 12 Oct 2017 14:56:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEuSRE035015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324551 - in head: lib/libstand lib/libstand/amd64 lib/libstand/i386 lib/libstand/mips lib/libstand/powerpc lib/libstand/sparc64 sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: lib/libstand lib/libstand/amd64 lib/libstand/i386 lib/libstand/mips lib/libstand/powerpc lib/libstand/sparc64 sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 sys/boot/libsa/mips sys/b... X-SVN-Commit-Revision: 324551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:37 -0000 Author: imp Date: Thu Oct 12 14:56:28 2017 New Revision: 324551 URL: https://svnweb.freebsd.org/changeset/base/324551 Log: Move lib/libstand to sys/boot/libsa Move the sources to sys/boot. Make adjustments related to the move. Kill LIBSTAND_SRC since it's no longer needed. Sponsored by: Netflix Added: head/sys/boot/libsa/Makefile.depend (contents, props changed) - copied, changed from r324550, head/lib/libstand/Makefile.depend head/sys/boot/libsa/__main.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/__main.c head/sys/boot/libsa/amd64/ head/sys/boot/libsa/amd64/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/amd64/_setjmp.S head/sys/boot/libsa/arp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/arp.c head/sys/boot/libsa/assert.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/assert.c head/sys/boot/libsa/bcd.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bcd.c head/sys/boot/libsa/bootp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootp.c head/sys/boot/libsa/bootp.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootp.h head/sys/boot/libsa/bootparam.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootparam.c head/sys/boot/libsa/bootparam.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootparam.h head/sys/boot/libsa/bzipfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bzipfs.c head/sys/boot/libsa/cd9660.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/cd9660.c head/sys/boot/libsa/close.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/close.c head/sys/boot/libsa/closeall.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/closeall.c head/sys/boot/libsa/dev.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/dev.c head/sys/boot/libsa/dosfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/dosfs.c head/sys/boot/libsa/dosfs.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/dosfs.h head/sys/boot/libsa/environment.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/environment.c head/sys/boot/libsa/ether.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ether.c head/sys/boot/libsa/ext2fs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ext2fs.c head/sys/boot/libsa/fstat.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/fstat.c head/sys/boot/libsa/getopt.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/getopt.c head/sys/boot/libsa/gets.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/gets.c head/sys/boot/libsa/globals.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/globals.c head/sys/boot/libsa/gzipfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/gzipfs.c head/sys/boot/libsa/i386/ head/sys/boot/libsa/i386/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/i386/_setjmp.S head/sys/boot/libsa/in_cksum.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/in_cksum.c head/sys/boot/libsa/inet_ntoa.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/inet_ntoa.c head/sys/boot/libsa/ioctl.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ioctl.c head/sys/boot/libsa/iodesc.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/iodesc.h head/sys/boot/libsa/ip.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ip.c head/sys/boot/libsa/libstand.3 (contents, props changed) - copied, changed from r324550, head/lib/libstand/libstand.3 head/sys/boot/libsa/lseek.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/lseek.c head/sys/boot/libsa/mips/ head/sys/boot/libsa/mips/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/mips/_setjmp.S head/sys/boot/libsa/nandfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nandfs.c head/sys/boot/libsa/net.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/net.c head/sys/boot/libsa/net.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/net.h head/sys/boot/libsa/netif.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/netif.c head/sys/boot/libsa/netif.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/netif.h head/sys/boot/libsa/nfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nfs.c head/sys/boot/libsa/nfsv2.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/nfsv2.h head/sys/boot/libsa/nullfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nullfs.c head/sys/boot/libsa/open.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/open.c head/sys/boot/libsa/pager.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/pager.c head/sys/boot/libsa/pkgfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/pkgfs.c head/sys/boot/libsa/powerpc/ head/sys/boot/libsa/powerpc/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/powerpc/_setjmp.S head/sys/boot/libsa/powerpc/syncicache.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/powerpc/syncicache.c head/sys/boot/libsa/printf.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/printf.c head/sys/boot/libsa/qdivrem.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/qdivrem.c head/sys/boot/libsa/quad.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/quad.h head/sys/boot/libsa/random.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/random.c head/sys/boot/libsa/rarp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/rarp.c head/sys/boot/libsa/read.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/read.c head/sys/boot/libsa/readdir.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/readdir.c head/sys/boot/libsa/rpc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpc.c head/sys/boot/libsa/rpc.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpc.h head/sys/boot/libsa/rpcv2.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpcv2.h head/sys/boot/libsa/saioctl.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/saioctl.h head/sys/boot/libsa/sbrk.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/sbrk.c head/sys/boot/libsa/sparc64/ head/sys/boot/libsa/sparc64/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/sparc64/_setjmp.S head/sys/boot/libsa/splitfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/splitfs.c head/sys/boot/libsa/stand.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/stand.h head/sys/boot/libsa/stat.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/stat.c head/sys/boot/libsa/strcasecmp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strcasecmp.c head/sys/boot/libsa/strdup.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strdup.c head/sys/boot/libsa/strerror.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strerror.c head/sys/boot/libsa/strtol.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strtol.c head/sys/boot/libsa/strtoul.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strtoul.c head/sys/boot/libsa/tftp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/tftp.c head/sys/boot/libsa/tftp.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/tftp.h head/sys/boot/libsa/twiddle.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/twiddle.c head/sys/boot/libsa/udp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/udp.c head/sys/boot/libsa/ufs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ufs.c head/sys/boot/libsa/uuid_from_string.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/uuid_from_string.c head/sys/boot/libsa/uuid_to_string.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/uuid_to_string.c head/sys/boot/libsa/write.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/write.c head/sys/boot/libsa/zalloc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc.c head/sys/boot/libsa/zalloc_defs.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_defs.h head/sys/boot/libsa/zalloc_malloc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_malloc.c head/sys/boot/libsa/zalloc_mem.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_mem.h head/sys/boot/libsa/zalloc_protos.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_protos.h Deleted: head/lib/libstand/Makefile head/lib/libstand/Makefile.depend head/lib/libstand/__main.c head/lib/libstand/amd64/_setjmp.S head/lib/libstand/arp.c head/lib/libstand/assert.c head/lib/libstand/bcd.c head/lib/libstand/bootp.c head/lib/libstand/bootp.h head/lib/libstand/bootparam.c head/lib/libstand/bootparam.h head/lib/libstand/bzipfs.c head/lib/libstand/cd9660.c head/lib/libstand/close.c head/lib/libstand/closeall.c head/lib/libstand/dev.c head/lib/libstand/dosfs.c head/lib/libstand/dosfs.h head/lib/libstand/environment.c head/lib/libstand/ether.c head/lib/libstand/ext2fs.c head/lib/libstand/fstat.c head/lib/libstand/getopt.c head/lib/libstand/gets.c head/lib/libstand/globals.c head/lib/libstand/gzipfs.c head/lib/libstand/i386/_setjmp.S head/lib/libstand/in_cksum.c head/lib/libstand/inet_ntoa.c head/lib/libstand/ioctl.c head/lib/libstand/iodesc.h head/lib/libstand/ip.c head/lib/libstand/libstand.3 head/lib/libstand/lseek.c head/lib/libstand/mips/_setjmp.S head/lib/libstand/nandfs.c head/lib/libstand/net.c head/lib/libstand/net.h head/lib/libstand/netif.c head/lib/libstand/netif.h head/lib/libstand/nfs.c head/lib/libstand/nfsv2.h head/lib/libstand/nullfs.c head/lib/libstand/open.c head/lib/libstand/pager.c head/lib/libstand/pkgfs.c head/lib/libstand/powerpc/_setjmp.S head/lib/libstand/powerpc/syncicache.c head/lib/libstand/printf.c head/lib/libstand/qdivrem.c head/lib/libstand/quad.h head/lib/libstand/random.c head/lib/libstand/rarp.c head/lib/libstand/read.c head/lib/libstand/readdir.c head/lib/libstand/rpc.c head/lib/libstand/rpc.h head/lib/libstand/rpcv2.h head/lib/libstand/saioctl.h head/lib/libstand/sbrk.c head/lib/libstand/sparc64/_setjmp.S head/lib/libstand/splitfs.c head/lib/libstand/stand.h head/lib/libstand/stat.c head/lib/libstand/strcasecmp.c head/lib/libstand/strdup.c head/lib/libstand/strerror.c head/lib/libstand/strtol.c head/lib/libstand/strtoul.c head/lib/libstand/tftp.c head/lib/libstand/tftp.h head/lib/libstand/twiddle.c head/lib/libstand/udp.c head/lib/libstand/ufs.c head/lib/libstand/uuid_from_string.c head/lib/libstand/uuid_to_string.c head/lib/libstand/write.c head/lib/libstand/zalloc.c head/lib/libstand/zalloc_defs.h head/lib/libstand/zalloc_malloc.c head/lib/libstand/zalloc_mem.h head/lib/libstand/zalloc_protos.h Modified: head/sys/boot/libsa/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/userboot/libstand/Makefile Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/libsa/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -1,14 +1,161 @@ # $FreeBSD$ +# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ +# +# Notes: +# - We don't use the libc strerror/sys_errlist because the string table is +# quite large. +# +MK_PROFILE= no +MK_SSP= no + .include .include "../Makefile.inc" -LIBSTAND_SRC= ${SASRC} -LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= -INCS= -MAN= -.PATH: ${SASRC} +LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} +LIBC_SRC= ${SRCTOP}/lib/libc -.include "${SASRC}/Makefile" +LIB?= stand +NO_PIC= +WARNS?= 0 + +CFLAGS+= -I${SASRC} + +# standalone components and stuff we have modified locally +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ + sbrk.c twiddle.c zalloc.c zalloc_malloc.c + +# private (pruned) versions of libc string functions +SRCS+= strcasecmp.c + +.PATH: ${LIBC_SRC}/net + +SRCS+= ntoh.c + +# string functions from libc +.PATH: ${LIBC_SRC}/string +SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ + memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +.if ${MACHINE_CPUARCH} == "arm" +.PATH: ${LIBC_SRC}/arm/gen + +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none + +# Compiler support functions +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler +SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c +SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c + +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm/ +SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S +SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" +.PATH: ${LIBC_SRC}/${MACHINE_CPUARCH}/gen +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" +.PATH: ${LIBC_SRC}/quad +SRCS+= ashldi3.c ashrdi3.c +SRCS+= syncicache.c +.endif + +# uuid functions from libc +.PATH: ${LIBC_SRC}/uuid +SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c + +# _setjmp/_longjmp +.PATH: ${SASRC}/${LIBSTAND_CPUARCH} +SRCS+= _setjmp.S + +# decompression functionality from libbz2 +# NOTE: to actually test this functionality after libbz2 upgrade compile +# loader(8) with LOADER_BZIP2_SUPPORT defined +.PATH: ${SRCTOP}/contrib/bzip2 +CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= libstand_bzlib_private.h + +.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +CLEANFILES+= libstand_bzlib_private.h +libstand_bzlib_private.h: bzlib_private.h + sed -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} + +# decompression functionality from zlib +.PATH: ${SRCTOP}/contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib +SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h + +.for file in infback.c inffast.c inflate.c inftrees.c zutil.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed -e "s|zutil\.h|libstand_zutil.h|" \ + -e "s|gzguts\.h|libstand_gzguts.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# depend on stand.h being able to be included multiple times +.for file in zutil.h gzguts.h +CLEANFILES+= libstand_${file} +libstand_${file}: ${file} + sed -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# io routines +SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ + fstat.c close.c lseek.c open.c read.c write.c readdir.c + +# network routines +SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c + +# network info services: +SRCS+= bootp.c rarp.c bootparam.c + +# boot filesystems +SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c +SRCS+= dosfs.c ext2fs.c +SRCS+= splitfs.c +SRCS+= pkgfs.c +.if ${MK_NAND} != "no" +SRCS+= nandfs.c +.endif + +# explicit_bzero +.PATH: ${SRCTOP}/sys/libkern +SRCS+= explicit_bzero.c + +.include +.include Copied and modified: head/sys/boot/libsa/Makefile.depend (from r324550, head/lib/libstand/Makefile.depend) ============================================================================== Copied and modified: head/sys/boot/libsa/__main.c (from r324550, head/lib/libstand/__main.c) ============================================================================== Copied and modified: head/sys/boot/libsa/amd64/_setjmp.S (from r324550, head/lib/libstand/amd64/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/arp.c (from r324550, head/lib/libstand/arp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/assert.c (from r324550, head/lib/libstand/assert.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bcd.c (from r324550, head/lib/libstand/bcd.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootp.c (from r324550, head/lib/libstand/bootp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootp.h (from r324550, head/lib/libstand/bootp.h) ============================================================================== Copied and modified: head/sys/boot/libsa/bootparam.c (from r324550, head/lib/libstand/bootparam.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootparam.h (from r324550, head/lib/libstand/bootparam.h) ============================================================================== Copied and modified: head/sys/boot/libsa/bzipfs.c (from r324550, head/lib/libstand/bzipfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/cd9660.c (from r324550, head/lib/libstand/cd9660.c) ============================================================================== Copied and modified: head/sys/boot/libsa/close.c (from r324550, head/lib/libstand/close.c) ============================================================================== Copied and modified: head/sys/boot/libsa/closeall.c (from r324550, head/lib/libstand/closeall.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dev.c (from r324550, head/lib/libstand/dev.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dosfs.c (from r324550, head/lib/libstand/dosfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dosfs.h (from r324550, head/lib/libstand/dosfs.h) ============================================================================== Copied and modified: head/sys/boot/libsa/environment.c (from r324550, head/lib/libstand/environment.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ether.c (from r324550, head/lib/libstand/ether.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ext2fs.c (from r324550, head/lib/libstand/ext2fs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/fstat.c (from r324550, head/lib/libstand/fstat.c) ============================================================================== Copied and modified: head/sys/boot/libsa/getopt.c (from r324550, head/lib/libstand/getopt.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gets.c (from r324550, head/lib/libstand/gets.c) ============================================================================== Copied and modified: head/sys/boot/libsa/globals.c (from r324550, head/lib/libstand/globals.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gzipfs.c (from r324550, head/lib/libstand/gzipfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/i386/_setjmp.S (from r324550, head/lib/libstand/i386/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/in_cksum.c (from r324550, head/lib/libstand/in_cksum.c) ============================================================================== Copied and modified: head/sys/boot/libsa/inet_ntoa.c (from r324550, head/lib/libstand/inet_ntoa.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ioctl.c (from r324550, head/lib/libstand/ioctl.c) ============================================================================== Copied and modified: head/sys/boot/libsa/iodesc.h (from r324550, head/lib/libstand/iodesc.h) ============================================================================== Copied and modified: head/sys/boot/libsa/ip.c (from r324550, head/lib/libstand/ip.c) ============================================================================== Copied and modified: head/sys/boot/libsa/libstand.3 (from r324550, head/lib/libstand/libstand.3) ============================================================================== Copied and modified: head/sys/boot/libsa/lseek.c (from r324550, head/lib/libstand/lseek.c) ============================================================================== Copied and modified: head/sys/boot/libsa/mips/_setjmp.S (from r324550, head/lib/libstand/mips/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/nandfs.c (from r324550, head/lib/libstand/nandfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/net.c (from r324550, head/lib/libstand/net.c) ============================================================================== Copied and modified: head/sys/boot/libsa/net.h (from r324550, head/lib/libstand/net.h) ============================================================================== Copied and modified: head/sys/boot/libsa/netif.c (from r324550, head/lib/libstand/netif.c) ============================================================================== Copied and modified: head/sys/boot/libsa/netif.h (from r324550, head/lib/libstand/netif.h) ============================================================================== Copied and modified: head/sys/boot/libsa/nfs.c (from r324550, head/lib/libstand/nfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/nfsv2.h (from r324550, head/lib/libstand/nfsv2.h) ============================================================================== Copied and modified: head/sys/boot/libsa/nullfs.c (from r324550, head/lib/libstand/nullfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/open.c (from r324550, head/lib/libstand/open.c) ============================================================================== Copied and modified: head/sys/boot/libsa/pager.c (from r324550, head/lib/libstand/pager.c) ============================================================================== Copied and modified: head/sys/boot/libsa/pkgfs.c (from r324550, head/lib/libstand/pkgfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/powerpc/_setjmp.S (from r324550, head/lib/libstand/powerpc/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/powerpc/syncicache.c (from r324550, head/lib/libstand/powerpc/syncicache.c) ============================================================================== Copied and modified: head/sys/boot/libsa/printf.c (from r324550, head/lib/libstand/printf.c) ============================================================================== Copied and modified: head/sys/boot/libsa/qdivrem.c (from r324550, head/lib/libstand/qdivrem.c) ============================================================================== Copied and modified: head/sys/boot/libsa/quad.h (from r324550, head/lib/libstand/quad.h) ============================================================================== Copied and modified: head/sys/boot/libsa/random.c (from r324550, head/lib/libstand/random.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rarp.c (from r324550, head/lib/libstand/rarp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/read.c (from r324550, head/lib/libstand/read.c) ============================================================================== Copied and modified: head/sys/boot/libsa/readdir.c (from r324550, head/lib/libstand/readdir.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rpc.c (from r324550, head/lib/libstand/rpc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rpc.h (from r324550, head/lib/libstand/rpc.h) ============================================================================== Copied and modified: head/sys/boot/libsa/rpcv2.h (from r324550, head/lib/libstand/rpcv2.h) ============================================================================== Copied and modified: head/sys/boot/libsa/saioctl.h (from r324550, head/lib/libstand/saioctl.h) ============================================================================== Copied and modified: head/sys/boot/libsa/sbrk.c (from r324550, head/lib/libstand/sbrk.c) ============================================================================== Copied and modified: head/sys/boot/libsa/sparc64/_setjmp.S (from r324550, head/lib/libstand/sparc64/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/splitfs.c (from r324550, head/lib/libstand/splitfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/stand.h (from r324550, head/lib/libstand/stand.h) ============================================================================== Copied and modified: head/sys/boot/libsa/stat.c (from r324550, head/lib/libstand/stat.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strcasecmp.c (from r324550, head/lib/libstand/strcasecmp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strdup.c (from r324550, head/lib/libstand/strdup.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strerror.c (from r324550, head/lib/libstand/strerror.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strtol.c (from r324550, head/lib/libstand/strtol.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strtoul.c (from r324550, head/lib/libstand/strtoul.c) ============================================================================== Copied and modified: head/sys/boot/libsa/tftp.c (from r324550, head/lib/libstand/tftp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/tftp.h (from r324550, head/lib/libstand/tftp.h) ============================================================================== Copied and modified: head/sys/boot/libsa/twiddle.c (from r324550, head/lib/libstand/twiddle.c) ============================================================================== Copied and modified: head/sys/boot/libsa/udp.c (from r324550, head/lib/libstand/udp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ufs.c (from r324550, head/lib/libstand/ufs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/uuid_from_string.c (from r324550, head/lib/libstand/uuid_from_string.c) ============================================================================== Copied and modified: head/sys/boot/libsa/uuid_to_string.c (from r324550, head/lib/libstand/uuid_to_string.c) ============================================================================== Copied and modified: head/sys/boot/libsa/write.c (from r324550, head/lib/libstand/write.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc.c (from r324550, head/lib/libstand/zalloc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_defs.h (from r324550, head/lib/libstand/zalloc_defs.h) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_malloc.c (from r324550, head/lib/libstand/zalloc_malloc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_mem.h (from r324550, head/lib/libstand/zalloc_mem.h) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_protos.h (from r324550, head/lib/libstand/zalloc_protos.h) ============================================================================== Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/libstand32/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -9,8 +9,6 @@ LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -LIBSTAND_SRC= ${SASRC} -LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= INCS= MAN= Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/userboot/libstand/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -3,11 +3,6 @@ .include .include "../Makefile.inc" -LIBSTAND_SRC= ${SASRC} +.PATH: ${SASRC} -INTERNALLIB= -INCS= -MAN= -.PATH: ${LIBSTAND_SRC} - -.include "${LIBSTAND_SRC}/Makefile" +.include "${SASRC}/Makefile" From owner-svn-src-all@freebsd.org Thu Oct 12 14:56:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7BEE2BA3A; Thu, 12 Oct 2017 14:56: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 mx1.freebsd.org (Postfix) with ESMTPS id CECB57E2A7; Thu, 12 Oct 2017 14:56:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEuhje035158; Thu, 12 Oct 2017 14:56:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEugQD035155; Thu, 12 Oct 2017 14:56:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEugQD035155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324552 - in head/sys/boot: . userboot userboot/libstand userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . userboot userboot/libstand userboot/userboot X-SVN-Commit-Revision: 324552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:44 -0000 Author: imp Date: Thu Oct 12 14:56:42 2017 New Revision: 324552 URL: https://svnweb.freebsd.org/changeset/base/324552 Log: Kill the userboot copy of libstand. It's not needed (it's now identical to libsa, and seems to have been for some time). Sponsored by: Netflix Deleted: head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/libstand/Makefile.depend Modified: head/sys/boot/Makefile.inc head/sys/boot/userboot/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/Makefile.inc Thu Oct 12 14:56:42 2017 (r324552) @@ -10,8 +10,6 @@ SASRC=${SRCTOP}/lib/libstand LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a # Standalone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# Standalone library compiled for userboot -LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a CFLAGS+=-I${SASRC} Modified: head/sys/boot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/Makefile Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/userboot/Makefile Thu Oct 12 14:56:42 2017 (r324552) @@ -2,7 +2,7 @@ .include -SUBDIR= ficl libstand test zfs userboot +SUBDIR= ficl test zfs userboot .include Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/userboot/userboot/Makefile Thu Oct 12 14:56:42 2017 (r324552) @@ -58,7 +58,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} .include From owner-svn-src-all@freebsd.org Thu Oct 12 14:56:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E86E2BA6E; Thu, 12 Oct 2017 14:56:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1FEA7E340; Thu, 12 Oct 2017 14:56:49 +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 v9CEume5035216; Thu, 12 Oct 2017 14:56:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEumMv035209; Thu, 12 Oct 2017 14:56:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEumMv035209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324553 - in head/sys/boot: . libsa libsa32 libstand32 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . libsa libsa32 libstand32 X-SVN-Commit-Revision: 324553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:50 -0000 Author: imp Date: Thu Oct 12 14:56:48 2017 New Revision: 324553 URL: https://svnweb.freebsd.org/changeset/base/324553 Log: Rename libstand.a to libsa.a and libstand32.a to libsa32.a Sponsored by: Netflix Added: head/sys/boot/libsa32/ head/sys/boot/libsa32/Makefile (contents, props changed) - copied, changed from r324552, head/sys/boot/libstand32/Makefile head/sys/boot/libsa32/Makefile.depend (contents, props changed) - copied, changed from r324552, head/sys/boot/libstand32/Makefile.depend Deleted: head/sys/boot/libstand32/Makefile head/sys/boot/libstand32/Makefile.depend Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/Makefile.inc head/sys/boot/Makefile.powerpc head/sys/boot/libsa/Makefile Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.amd64 Thu Oct 12 14:56:48 2017 (r324553) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs SUBDIR+= userboot Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.i386 Thu Oct 12 14:56:48 2017 (r324553) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs .if !defined(LOADER_NO_GELI_SUPPORT) Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.inc Thu Oct 12 14:56:48 2017 (r324553) @@ -5,11 +5,11 @@ .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} -SASRC=${SRCTOP}/lib/libstand -# Normal standalone library -LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a +SASRC=${SRCTOP}/sys/boot/libsa +# Normal Standalone library +LIBSA=${OBJTOP}/sys/boot/libsa/libsa.a # Standalone library compiled for 32-bit version of the processor -LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +LIBSA32=${OBJTOP}/sys/boot/libsa32/libsa32.a CFLAGS+=-I${SASRC} Modified: head/sys/boot/Makefile.powerpc ============================================================================== --- head/sys/boot/Makefile.powerpc Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.powerpc Thu Oct 12 14:56:48 2017 (r324553) @@ -4,6 +4,6 @@ SUBDIR+= fdt .endif -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= ofw SUBDIR+= uboot Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/libsa/Makefile Thu Oct 12 14:56:48 2017 (r324553) @@ -17,7 +17,7 @@ INTERNALLIB= LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} LIBC_SRC= ${SRCTOP}/lib/libc -LIB?= stand +LIB?= sa NO_PIC= WARNS?= 0 Copied and modified: head/sys/boot/libsa32/Makefile (from r324552, head/sys/boot/libstand32/Makefile) ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Oct 12 14:56:42 2017 (r324552, copy source) +++ head/sys/boot/libsa32/Makefile Thu Oct 12 14:56:48 2017 (r324553) @@ -4,20 +4,18 @@ .include "../Makefile.inc" +LIB=sa32 .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -INTERNALLIB= -INCS= -MAN= -.PATH: ${SASRC} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif +.PATH: ${SASRC} .include "${SASRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" Copied and modified: head/sys/boot/libsa32/Makefile.depend (from r324552, head/sys/boot/libstand32/Makefile.depend) ============================================================================== From owner-svn-src-all@freebsd.org Thu Oct 12 14:56:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97E4E2BACF; Thu, 12 Oct 2017 14:56:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8868B7E3FF; Thu, 12 Oct 2017 14:56: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 v9CEutLK035279; Thu, 12 Oct 2017 14:56:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEusnF035268; Thu, 12 Oct 2017 14:56:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEusnF035268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324554 - in head/sys/boot: common i386/gptboot i386/gptzfsboot i386/zfsboot libsa uboot/lib X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common i386/gptboot i386/gptzfsboot i386/zfsboot libsa uboot/lib X-SVN-Commit-Revision: 324554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:57 -0000 Author: imp Date: Thu Oct 12 14:56:54 2017 New Revision: 324554 URL: https://svnweb.freebsd.org/changeset/base/324554 Log: Move crc32.c, util.c and gpt.c over to libsa. Sponsored by: Netflix Added: head/sys/boot/libsa/crc32.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/crc32.c head/sys/boot/libsa/crc32.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/crc32.h head/sys/boot/libsa/gpt.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/gpt.c head/sys/boot/libsa/gpt.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/gpt.h head/sys/boot/libsa/util.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/util.c head/sys/boot/libsa/util.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/util.h Deleted: head/sys/boot/common/crc32.c head/sys/boot/common/crc32.h head/sys/boot/common/gpt.c head/sys/boot/common/gpt.h head/sys/boot/common/util.c head/sys/boot/common/util.h Modified: head/sys/boot/common/Makefile.inc head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/common/Makefile.inc Thu Oct 12 14:56:54 2017 (r324554) @@ -1,5 +1,7 @@ # $FreeBSD$ +.PATH: ${SRCTOP}/sys/boot/common ${SRCTOP}/sys/boot/libsa + SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -30,7 +32,6 @@ SRCS+= dev_net.c SRCS+= disk.c part.c CFLAGS+= -DLOADER_DISK_SUPPORT .if !defined(LOADER_NO_GPT_SUPPORT) -SRCS+= crc32.c CFLAGS+= -DLOADER_GPT_SUPPORT .endif .if !defined(LOADER_NO_MBR_SUPPORT) Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,7 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.include "../Makefile.inc" +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${SASRC} + FILES= gptboot MAN= gptboot.8 @@ -20,7 +22,7 @@ GPTBOOT_UFS?= UFS1_AND_UFS2 #GPTBOOT_UFS?= UFS2_ONLY #GPTBOOT_UFS?= UFS1_ONLY -CFLAGS= -DBOOTPROG=\"gptboot\" \ +CFLAGS+=-DBOOTPROG=\"gptboot\" \ -O1 \ -DGPT \ -D${GPTBOOT_UFS} \ Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,10 +1,10 @@ # $FreeBSD$ -.include +.include "../Makefile.inc" .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= gptzfsboot MAN= gptzfsboot.8 @@ -19,7 +19,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ +CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -O1 \ -DGPT -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,7 +1,9 @@ # $FreeBSD$ +.include "../Makefile.inc" + .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= zfsboot MAN= zfsboot.8 Copied and modified: head/sys/boot/libsa/crc32.c (from r324553, head/sys/boot/common/crc32.c) ============================================================================== Copied and modified: head/sys/boot/libsa/crc32.h (from r324553, head/sys/boot/common/crc32.h) ============================================================================== Copied and modified: head/sys/boot/libsa/gpt.c (from r324553, head/sys/boot/common/gpt.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gpt.h (from r324553, head/sys/boot/common/gpt.h) ============================================================================== Copied and modified: head/sys/boot/libsa/util.c (from r324553, head/sys/boot/common/util.c) ============================================================================== Copied and modified: head/sys/boot/libsa/util.h (from r324553, head/sys/boot/common/util.h) ============================================================================== Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/uboot/lib/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -8,7 +8,7 @@ LIB= uboot INTERNALLIB= WARNS?= 2 -SRCS= crc32.c console.c copy.c devicename.c elf_freebsd.c glue.c +SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float From owner-svn-src-all@freebsd.org Thu Oct 12 14:57:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29C2E2BB1F; Thu, 12 Oct 2017 14:57:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 901787E482; Thu, 12 Oct 2017 14:57:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEv05P035337; Thu, 12 Oct 2017 14:57:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEv0Ye035336; Thu, 12 Oct 2017 14:57:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121457.v9CEv0Ye035336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324555 - head/sys/boot/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/i386/zfsboot X-SVN-Commit-Revision: 324555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:57:01 -0000 Author: imp Date: Thu Oct 12 14:57:00 2017 New Revision: 324555 URL: https://svnweb.freebsd.org/changeset/base/324555 Log: Honor CFLAGS modifications in Makefile.inc by using += here. There's no hyper-small space constraints, so there's no reason to tightly control it. Sponsored by: Netflix Modified: head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) +++ head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:57:00 2017 (r324555) @@ -18,7 +18,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x2000 -CFLAGS= -DBOOTPROG=\"zfsboot\" \ +CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -O1 \ -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ From owner-svn-src-all@freebsd.org Thu Oct 12 14:57:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A859E2BB72; Thu, 12 Oct 2017 14:57:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F587E534; Thu, 12 Oct 2017 14:57:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEv6Xp035395; Thu, 12 Oct 2017 14:57:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEv5Ct035389; Thu, 12 Oct 2017 14:57:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121457.v9CEv5Ct035389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324556 - in head/sys/boot: common efi/boot1 i386/gptboot libsa powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common efi/boot1 i386/gptboot libsa powerpc/boot1.chrp sparc64/boot1 X-SVN-Commit-Revision: 324556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:57:07 -0000 Author: imp Date: Thu Oct 12 14:57:05 2017 New Revision: 324556 URL: https://svnweb.freebsd.org/changeset/base/324556 Log: Move ufsread.c Move ufsread.c from sys/boot/common (which used to be all the common files for /boot/loader, but grew to be all the common files for sys/boot, but that's now sys/boot/libsa's job) to sys/boot/libsa. Sponsored by: Netflix Added: head/sys/boot/libsa/ufsread.c (contents, props changed) - copied, changed from r324555, head/sys/boot/common/ufsread.c Deleted: head/sys/boot/common/ufsread.c Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/efi/boot1/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -2,7 +2,7 @@ MAN= -.include +.include "../Makefile.inc" MK_SSP= no @@ -120,7 +120,7 @@ boot1.efi: ${PROG} -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c # The following inserts our objects into a template FAT file system # created by generate-fat.sh Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -78,7 +78,7 @@ gptboot.bin: gptboot.out gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} -gptboot.o: ${.CURDIR}/../../common/ufsread.c +gptboot.o: ${SASRC}/ufsread.c .if ${MACHINE_CPUARCH} == "amd64" beforedepend gptboot.o: machine Copied and modified: head/sys/boot/libsa/ufsread.c (from r324555, head/sys/boot/common/ufsread.c) ============================================================================== Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -17,7 +17,8 @@ CFLAGS= -ffreestanding -msoft-float \ -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N -.include "${.CURDIR}/../Makefile.inc" +.include "../Makefile.inc" + .PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS @@ -36,7 +37,7 @@ boot1.hfs: boot1.elf bootinfo.txt CLEANFILES= boot1.hfs -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c .include Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/sparc64/boot1/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include "../Makefile.inc" + PROG= boot1.elf INTERNALPROG= MAN= @@ -25,6 +27,6 @@ ${FILES}: boot1.aout boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c .include From owner-svn-src-all@freebsd.org Thu Oct 12 15:16:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1727E2C656; Thu, 12 Oct 2017 15:16:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD4037FFF2; Thu, 12 Oct 2017 15:16:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFGGOQ045932; Thu, 12 Oct 2017 15:16:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGGkY045929; Thu, 12 Oct 2017 15:16:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGGkY045929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324557 - in head/sys/boot/efi: include loader loader/arch/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include loader loader/arch/i386 X-SVN-Commit-Revision: 324557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:18 -0000 Author: imp Date: Thu Oct 12 15:16:16 2017 New Revision: 324557 URL: https://svnweb.freebsd.org/changeset/base/324557 Log: Rename exit to efi_exit to avoid clashing with libsa exit definition Rename exit to efi_exit. It doesn't have the proper signature and conflicts with standard definition. Provide the standard definition as well. Sponsored by: Netflix Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/loader/arch/i386/exec.c head/sys/boot/efi/loader/efi_main.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/include/efilib.h Thu Oct 12 15:16:16 2017 (r324557) @@ -95,7 +95,7 @@ void efi_time_fini(void); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); EFI_STATUS main(int argc, CHAR16 *argv[]); -void exit(EFI_STATUS status) __dead2; +void efi_exit(EFI_STATUS status) __dead2; void delay(int usecs); /* EFI environment initialization. */ Modified: head/sys/boot/efi/loader/arch/i386/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/exec.c Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/loader/arch/i386/exec.c Thu Oct 12 15:16:16 2017 (r324557) @@ -36,12 +36,6 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; -/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ -static void -exit(int x) -{ -} - void __v86int() { Modified: head/sys/boot/efi/loader/efi_main.c ============================================================================== --- head/sys/boot/efi/loader/efi_main.c Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/loader/efi_main.c Thu Oct 12 15:16:16 2017 (r324557) @@ -36,13 +36,20 @@ static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize; void -exit(EFI_STATUS exit_code) +efi_exit(EFI_STATUS exit_code) { BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); BS->Exit(IH, exit_code, 0, NULL); } +void +exit(int status) +{ + + efi_exit(EFI_LOAD_ERROR); +} + static CHAR16 * arg_skipsep(CHAR16 *argp) { @@ -92,11 +99,11 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); - /* Use exit() from here on... */ + /* Use efi_exit() from here on... */ status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); if (status != EFI_SUCCESS) - exit(status); + efi_exit(status); /* * Pre-process the (optional) load options. If the option string @@ -176,6 +183,6 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy argv[argc] = NULL; status = main(argc, argv); - exit(status); + efi_exit(status); return (status); } From owner-svn-src-all@freebsd.org Thu Oct 12 15:16:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08827E2C67D; Thu, 12 Oct 2017 15:16:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5AF880031; Thu, 12 Oct 2017 15:16:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFGNB9045990; Thu, 12 Oct 2017 15:16:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGMeI045985; Thu, 12 Oct 2017 15:16:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGMeI045985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324558 - in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Commit-Revision: 324558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:24 -0000 Author: imp Date: Thu Oct 12 15:16:22 2017 New Revision: 324558 URL: https://svnweb.freebsd.org/changeset/base/324558 Log: Define prototype for exit and ensure references Define a prototype for exit in stand.h. Provide a reference to exit in a few conf.c files to ensure that its definition gets pulled in early. Since exit() is a MD routine, it isn't defined in libsa. However, libsa tends to be listed last and will soon have panic() in it which calls exit(). The reference to exit early ensures that the MD exit is available to satisfy linking for static libraries. Modified: head/sys/boot/arm/uboot/conf.c head/sys/boot/libsa/stand.h head/sys/boot/mips/uboot/conf.c head/sys/boot/powerpc/ofw/conf.c head/sys/boot/powerpc/uboot/conf.c Modified: head/sys/boot/arm/uboot/conf.c ============================================================================== --- head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/libsa/stand.h ============================================================================== --- head/sys/boot/libsa/stand.h Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/libsa/stand.h Thu Oct 12 15:16:22 2017 (r324558) @@ -376,6 +376,7 @@ extern int null_readdir(struct open_file *f, struct di * Machine dependent functions and data, must be provided or stubbed by * the consumer */ +extern void exit(int); extern int getchar(void); extern int ischar(void); extern void putchar(int); Modified: head/sys/boot/mips/uboot/conf.c ============================================================================== --- head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/powerpc/ofw/conf.c ============================================================================== --- head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into Modified: head/sys/boot/powerpc/uboot/conf.c ============================================================================== --- head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into From owner-svn-src-all@freebsd.org Thu Oct 12 15:16:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A2D7E2C6B8; Thu, 12 Oct 2017 15:16:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F43800AE; Thu, 12 Oct 2017 15:16:29 +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 v9CFGSmi046046; Thu, 12 Oct 2017 15:16:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGROI046043; Thu, 12 Oct 2017 15:16:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGROI046043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324559 - in head/sys/boot: common libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common libsa X-SVN-Commit-Revision: 324559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:29 -0000 Author: imp Date: Thu Oct 12 15:16:27 2017 New Revision: 324559 URL: https://svnweb.freebsd.org/changeset/base/324559 Log: Move panic back into libsa. It's documented in libstand(3) to belong there. Sponsored by: Netflix Added: head/sys/boot/libsa/panic.c (contents, props changed) - copied, changed from r324558, head/sys/boot/common/panic.c Deleted: head/sys/boot/common/panic.c Modified: head/sys/boot/common/Makefile.inc head/sys/boot/libsa/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Thu Oct 12 15:16:22 2017 (r324558) +++ head/sys/boot/common/Makefile.inc Thu Oct 12 15:16:27 2017 (r324559) @@ -4,7 +4,7 @@ SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c -SRCS+= module.c panic.c +SRCS+= module.c .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 15:16:22 2017 (r324558) +++ head/sys/boot/libsa/Makefile Thu Oct 12 15:16:27 2017 (r324559) @@ -25,8 +25,8 @@ CFLAGS+= -I${SASRC} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c + globals.c pager.c panic.c printf.c strdup.c strerror.c strtol.c strtoul.c \ + random.c sbrk.c twiddle.c zalloc.c zalloc_malloc.c # private (pruned) versions of libc string functions SRCS+= strcasecmp.c Copied and modified: head/sys/boot/libsa/panic.c (from r324558, head/sys/boot/common/panic.c) ============================================================================== From owner-svn-src-all@freebsd.org Thu Oct 12 15:45:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CB6E2D2C8; Thu, 12 Oct 2017 15:45:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51E4C81582; Thu, 12 Oct 2017 15:45:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFjraJ058744; Thu, 12 Oct 2017 15:45:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFjrOu058741; Thu, 12 Oct 2017 15:45:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121545.v9CFjrOu058741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 15:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324560 - in head: lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern X-SVN-Commit-Revision: 324560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:45:54 -0000 Author: emaste Date: Thu Oct 12 15:45:53 2017 New Revision: 324560 URL: https://svnweb.freebsd.org/changeset/base/324560 Log: allow posix_fallocate in capability mode posix_fallocate is logically equivalent to writing zero blocks to the desired file size and there is no reason to prevent calling it in capability mode. posix_fallocate already checked for the CAP_WRITE right, so we merely need to list it in capabilities.conf. Reviewed by: allanjude MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12640 Modified: head/lib/libc/sys/posix_fallocate.2 head/sys/kern/capabilities.conf head/sys/kern/vfs_syscalls.c Modified: head/lib/libc/sys/posix_fallocate.2 ============================================================================== --- head/lib/libc/sys/posix_fallocate.2 Thu Oct 12 15:16:27 2017 (r324559) +++ head/lib/libc/sys/posix_fallocate.2 Thu Oct 12 15:45:53 2017 (r324560) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd January 23, 2014 +.Dd October 12, 2017 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -118,6 +118,10 @@ argument does not refer to a regular file. .It Bq Er ENOSPC There is insufficient free space remaining on the file system storage media. +.It Bq Er ENOTCAPABLE +The file descriptor +.Fa fd +has insufficient rights. .It Bq Er ESPIPE The .Fa fd Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Thu Oct 12 15:16:27 2017 (r324559) +++ head/sys/kern/capabilities.conf Thu Oct 12 15:45:53 2017 (r324560) @@ -488,6 +488,7 @@ poll ## ## Allow I/O-related file descriptors, subject to capability rights. ## +posix_fallocate pread preadv Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Oct 12 15:16:27 2017 (r324559) +++ head/sys/kern/vfs_syscalls.c Thu Oct 12 15:45:53 2017 (r324560) @@ -4400,7 +4400,7 @@ kern_posix_fallocate(struct thread *td, int fd, off_t if (offset > OFF_MAX - len) return (EFBIG); AUDIT_ARG_FD(fd); - error = fget(td, fd, cap_rights_init(&rights, CAP_WRITE), &fp); + error = fget(td, fd, cap_rights_init(&rights, CAP_PWRITE), &fp); if (error != 0) return (error); AUDIT_ARG_FILE(td->td_proc, fp); From owner-svn-src-all@freebsd.org Thu Oct 12 15:48:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D709E2D378; Thu, 12 Oct 2017 15:48:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C67D8175A; Thu, 12 Oct 2017 15:48:38 +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 v9CFmbdB058886; Thu, 12 Oct 2017 15:48:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFmbxj058885; Thu, 12 Oct 2017 15:48:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121548.v9CFmbxj058885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 15:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324561 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:48:38 -0000 Author: emaste Date: Thu Oct 12 15:48:37 2017 New Revision: 324561 URL: https://svnweb.freebsd.org/changeset/base/324561 Log: regen init_sysent.c r324560 Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Oct 12 15:45:53 2017 (r324560) +++ head/sys/kern/init_sysent.c Thu Oct 12 15:48:37 2017 (r324561) @@ -581,7 +581,7 @@ struct sysent sysent[] = { { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ - { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ + { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = posix_fallocate */ { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ { AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = wait6 */ { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 533 = cap_rights_limit */ From owner-svn-src-all@freebsd.org Thu Oct 12 15:53:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E795DE2DAB9; Thu, 12 Oct 2017 15:53:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B557681F83; Thu, 12 Oct 2017 15:53:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFrs37063026; Thu, 12 Oct 2017 15:53:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFrsmP063024; Thu, 12 Oct 2017 15:53:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201710121553.v9CFrsmP063024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Oct 2017 15:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324562 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 324562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:53:56 -0000 Author: bz Date: Thu Oct 12 15:53:54 2017 New Revision: 324562 URL: https://svnweb.freebsd.org/changeset/base/324562 Log: Add rev16 instruction to the disassembler. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D12645 Modified: head/sys/arm/arm/disassem.c Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Thu Oct 12 15:48:37 2017 (r324561) +++ head/sys/arm/arm/disassem.c Thu Oct 12 15:53:54 2017 (r324562) @@ -131,6 +131,7 @@ static const struct arm32_insn arm32_i[] = { { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, #if __ARM_ARCH >= 6 + { 0x0fff0ff0, 0x06bf0fb0, "rev16", "dm" }, { 0xffffffff, 0xf57ff01f, "clrex", "c" }, { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, From owner-svn-src-all@freebsd.org Thu Oct 12 18:00:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBEEFE3078B; Thu, 12 Oct 2017 18:00:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED0071D0B; Thu, 12 Oct 2017 18:00:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CI0U2Z016842; Thu, 12 Oct 2017 18:00:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CI0Ujt016841; Thu, 12 Oct 2017 18:00:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710121800.v9CI0Ujt016841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 12 Oct 2017 18:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324563 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:00:31 -0000 Author: manu Date: Thu Oct 12 18:00:29 2017 New Revision: 324563 URL: https://svnweb.freebsd.org/changeset/base/324563 Log: a10_ehci: Remove the passby code It doesn't seems to be needed anymore and this make ehci working again on the Pine64. Thanks to jmcneill@ for the help. Tested on: Pine64 (A64), OrangePi One (H3), BananapiM2 (A31s) Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Thu Oct 12 15:53:54 2017 (r324562) +++ head/sys/arm/allwinner/a10_ehci.c Thu Oct 12 18:00:29 2017 (r324563) @@ -65,17 +65,10 @@ __FBSDID("$FreeBSD$"); #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" -#define SW_USB_PMU_IRQ_ENABLE 0x800 - #define SW_SDRAM_REG_HPCR_USB1 (0x250 + ((1 << 2) * 4)) #define SW_SDRAM_REG_HPCR_USB2 (0x250 + ((1 << 2) * 5)) #define SW_SDRAM_BP_HPCR_ACCESS (1 << 0) -#define SW_ULPI_BYPASS (1 << 0) -#define SW_AHB_INCRX_ALIGN (1 << 8) -#define SW_AHB_INCR4 (1 << 9) -#define SW_AHB_INCR8 (1 << 10) - #define USB_CONF(d) \ (void *)ofw_bus_search_compatible((d), compat_data)->ocd_data @@ -124,7 +117,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-ehci", (uintptr_t)&a10_ehci_conf }, { "allwinner,sun8i-a83t-ehci", (uintptr_t)&a31_ehci_conf }, { "allwinner,sun8i-h3-ehci", (uintptr_t)&a31_ehci_conf }, - /* { "allwinner,sun50i-a64-ehci", (uintptr_t)&a31_ehci_conf }, */ + { "allwinner,sun50i-a64-ehci", (uintptr_t)&a31_ehci_conf }, { NULL, (uintptr_t)NULL } }; @@ -254,14 +247,6 @@ a10_ehci_attach(device_t self) } } - /* Enable passby */ - reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); - reg_value |= SW_AHB_INCR8; /* AHB INCR8 enable */ - reg_value |= SW_AHB_INCR4; /* AHB burst type INCR4 enable */ - reg_value |= SW_AHB_INCRX_ALIGN; /* AHB INCRX align enable */ - reg_value |= SW_ULPI_BYPASS; /* ULPI bypass enable */ - A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); - /* Configure port */ if (conf->sdram_init) { reg_value = A10_READ_4(sc, SW_SDRAM_REG_HPCR_USB2); @@ -332,14 +317,6 @@ a10_ehci_detach(device_t self) reg_value &= ~SW_SDRAM_BP_HPCR_ACCESS; A10_WRITE_4(sc, SW_SDRAM_REG_HPCR_USB2, reg_value); } - - /* Disable passby */ - reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); - reg_value &= ~SW_AHB_INCR8; /* AHB INCR8 disable */ - reg_value &= ~SW_AHB_INCR4; /* AHB burst type INCR4 disable */ - reg_value &= ~SW_AHB_INCRX_ALIGN; /* AHB INCRX align disable */ - reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ - A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); /* Disable clock */ TAILQ_FOREACH_SAFE(clk, &aw_sc->clk_list, next, clk_tmp) { From owner-svn-src-all@freebsd.org Thu Oct 12 18:11:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C04F5E30E50; Thu, 12 Oct 2017 18:11:14 +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 4D68B27A0; Thu, 12 Oct 2017 18:11:14 +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 v9CIB9xJ065299 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 12 Oct 2017 21:11:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v9CIB9xJ065299 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v9CIB9dw065298; Thu, 12 Oct 2017 21:11:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Oct 2017 21:11:09 +0300 From: Konstantin Belousov To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324560 - in head: lib/libc/sys sys/kern Message-ID: <20171012181109.GE2473@kib.kiev.ua> References: <201710121545.v9CFjrOu058741@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710121545.v9CFjrOu058741@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:11:14 -0000 On Thu, Oct 12, 2017 at 03:45:53PM +0000, Ed Maste wrote: > Author: emaste > Date: Thu Oct 12 15:45:53 2017 > New Revision: 324560 > URL: https://svnweb.freebsd.org/changeset/base/324560 > > Log: > allow posix_fallocate in capability mode > > posix_fallocate is logically equivalent to writing zero blocks to the > desired file size and there is no reason to prevent calling it in > capability mode. posix_fallocate already checked for the CAP_WRITE > right, so we merely need to list it in capabilities.conf. > > Reviewed by: allanjude > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D12640 > > Modified: > head/lib/libc/sys/posix_fallocate.2 > head/sys/kern/capabilities.conf You should also update compat/freebsd32. > head/sys/kern/vfs_syscalls.c From owner-svn-src-all@freebsd.org Thu Oct 12 18:30:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76B6E3153E; Thu, 12 Oct 2017 18:30: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 mx1.freebsd.org (Postfix) with ESMTPS id 8754F3369; Thu, 12 Oct 2017 18:30: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 v9CIUseR029280; Thu, 12 Oct 2017 18:30:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CIUsvS029279; Thu, 12 Oct 2017 18:30:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121830.v9CIUsvS029279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 18:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324564 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 324564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:30:55 -0000 Author: emaste Date: Thu Oct 12 18:30:54 2017 New Revision: 324564 URL: https://svnweb.freebsd.org/changeset/base/324564 Log: allow posix_fallocate in 32-bit compat capability mode Reported by: kib MFC after: 2 weeks MFC with: r324560 Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/freebsd32/capabilities.conf Modified: head/sys/compat/freebsd32/capabilities.conf ============================================================================== --- head/sys/compat/freebsd32/capabilities.conf Thu Oct 12 18:00:29 2017 (r324563) +++ head/sys/compat/freebsd32/capabilities.conf Thu Oct 12 18:30:54 2017 (r324564) @@ -200,6 +200,7 @@ pdkill freebsd32_pipe pipe2 poll +freebsd32_posix_fallocate freebsd32_pread freebsd32_preadv profil From owner-svn-src-all@freebsd.org Thu Oct 12 18:31:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D754E316E5; Thu, 12 Oct 2017 18:31:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E132B3541; Thu, 12 Oct 2017 18:31:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CIVTHi030023; Thu, 12 Oct 2017 18:31:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CIVTip030022; Thu, 12 Oct 2017 18:31:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121831.v9CIVTip030022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 18:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324565 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 324565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:31:30 -0000 Author: emaste Date: Thu Oct 12 18:31:28 2017 New Revision: 324565 URL: https://svnweb.freebsd.org/changeset/base/324565 Log: regen freebsd32_sysent.c after r324564 (freebsd32_posix_fallocate) Modified: head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Oct 12 18:30:54 2017 (r324564) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Oct 12 18:31:28 2017 (r324565) @@ -602,11 +602,11 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ #ifdef PAD64_REQUIRED - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #else - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #endif From owner-svn-src-all@freebsd.org Thu Oct 12 19:58:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 570D5E3341F; Thu, 12 Oct 2017 19:58:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C2265007; Thu, 12 Oct 2017 19:58:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CJwLJn067067; Thu, 12 Oct 2017 19:58:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CJwLTx067066; Thu, 12 Oct 2017 19:58:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201710121958.v9CJwLTx067066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Oct 2017 19:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324566 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 324566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 19:58:22 -0000 Author: bdrewery Date: Thu Oct 12 19:58:21 2017 New Revision: 324566 URL: https://svnweb.freebsd.org/changeset/base/324566 Log: Fix shadowed variable hidden by WARNS changing to 3 in r313006. Sponsored by: Dell EMC Isilon MFC after: 1 week Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Oct 12 18:31:28 2017 (r324565) +++ head/tests/sys/kern/ptrace_test.c Thu Oct 12 19:58:21 2017 (r324566) @@ -3084,7 +3084,7 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc) ATF_REQUIRE((child = fork()) != -1); if (child == 0) { pthread_t t[2]; - int error, cfd; + int cfd; error = pthread_barrier_wait(&barrier); if (error != 0 && error != PTHREAD_BARRIER_SERIAL_THREAD) From owner-svn-src-all@freebsd.org Thu Oct 12 20:04:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCAA8E33702; Thu, 12 Oct 2017 20:04:12 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 805A9654C1; Thu, 12 Oct 2017 20:04:11 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: by vlakno.cz (Postfix, from userid 1002) id D14BBDF7DBB; Thu, 12 Oct 2017 21:53:17 +0200 (CEST) Date: Thu, 12 Oct 2017 21:53:17 +0200 From: Roman Divacky To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324511 - head/contrib/binutils/bfd Message-ID: <20171012195317.GA3199@vlakno.cz> References: <201710110239.v9B2dKlx022588@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710110239.v9B2dKlx022588@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 20:04:12 -0000 Note that this allows to use C++ EH on a gcc built PPC64 world for applications built by clang++. Roman On Wed, Oct 11, 2017 at 02:39:20AM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Oct 11 02:39:20 2017 > New Revision: 324511 > URL: https://svnweb.freebsd.org/changeset/base/324511 > > Log: > Do exception offset computations in 64 bits, not 32. > > This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step > closer to a clang-built world. The same change was made in later upstream > binutils. > > Submitted by: rdivacky > MFC after: 2 weeks > > Modified: > head/contrib/binutils/bfd/elf-eh-frame.c > > Modified: head/contrib/binutils/bfd/elf-eh-frame.c > ============================================================================== > --- head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 00:31:54 2017 (r324510) > +++ head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 02:39:20 2017 (r324511) > @@ -1344,7 +1344,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > > val = read_value (abfd, buf, per_width, > get_DW_EH_PE_signed (per_encoding)); > - val += ent->offset - ent->new_offset; > + val += (bfd_vma)ent->offset - ent->new_offset; > val -= extra_string + extra_data; > write_value (abfd, buf, val, per_width); > action &= ~4; > @@ -1400,7 +1400,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > } > break; > case DW_EH_PE_pcrel: > - value += ent->offset - ent->new_offset; > + value += (bfd_vma)ent->offset - ent->new_offset; > address += sec->output_section->vma + ent->offset + 8; > break; > } > @@ -1428,7 +1428,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > if (value) > { > if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel) > - value += ent->offset - ent->new_offset; > + value += (bfd_vma)ent->offset - ent->new_offset; > else if (ent->cie_inf->need_lsda_relative) > value -= (sec->output_section->vma + ent->new_offset + 8 > + ent->lsda_offset); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Thu Oct 12 20:31:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF1DE33EA1; Thu, 12 Oct 2017 20:31:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 591A465F80; Thu, 12 Oct 2017 20:31:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CKVAfh079601; Thu, 12 Oct 2017 20:31:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CKVAnh079600; Thu, 12 Oct 2017 20:31:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710122031.v9CKVAnh079600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 12 Oct 2017 20:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324567 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 324567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 20:31:11 -0000 Author: gjb Date: Thu Oct 12 20:31:10 2017 New Revision: 324567 URL: https://svnweb.freebsd.org/changeset/base/324567 Log: Add arm/armv7 checks to env_check(). Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Thu Oct 12 19:58:21 2017 (r324566) +++ head/release/release.sh Thu Oct 12 20:31:10 2017 (r324567) @@ -148,7 +148,7 @@ env_check() { WITH_COMPRESSED_IMAGES= NODOC=yes case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in - arm:armv6|arm64:aarch64) + arm:armv6|arm:armv7|arm64:aarch64) chroot_build_release_cmd="chroot_arm_build_release" ;; *) From owner-svn-src-all@freebsd.org Thu Oct 12 21:25:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54072E351AE; Thu, 12 Oct 2017 21:25:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDD767A9F; Thu, 12 Oct 2017 21:25:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLPBeH004345; Thu, 12 Oct 2017 21:25:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLPBm7004344; Thu, 12 Oct 2017 21:25:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710122125.v9CLPBm7004344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Oct 2017 21:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324568 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:25:12 -0000 Author: asomers Date: Thu Oct 12 21:25:11 2017 New Revision: 324568 URL: https://svnweb.freebsd.org/changeset/base/324568 Log: Optimize zpool_read_all_labels with AIO Read all labels in parallel instead of sequentially MFC after: 3 weeks X-MFC-With: 322854 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12495 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Oct 12 20:31:10 2017 (r324567) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Oct 12 21:25:11 2017 (r324568) @@ -42,6 +42,7 @@ * using our derived config, and record the results. */ +#include #include #include #include @@ -919,13 +920,17 @@ zpool_read_label(int fd, nvlist_t **config) * Given a file descriptor, read the label information and return an nvlist * describing the configuration, if there is one. * returns the number of valid labels found + * If a label is found, returns it via config. The caller is responsible for + * freeing it. */ int zpool_read_all_labels(int fd, nvlist_t **config) { struct stat64 statbuf; + struct aiocb aiocbs[VDEV_LABELS]; + struct aiocb *aiocbps[VDEV_LABELS]; int l; - vdev_label_t *label; + vdev_label_t *labels; uint64_t state, txg, size; int nlabels = 0; @@ -935,19 +940,39 @@ zpool_read_all_labels(int fd, nvlist_t **config) return (0); size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t); - if ((label = malloc(sizeof (vdev_label_t))) == NULL) + if ((labels = calloc(VDEV_LABELS, sizeof (vdev_label_t))) == NULL) return (0); + memset(aiocbs, 0, sizeof(aiocbs)); for (l = 0; l < VDEV_LABELS; l++) { + aiocbs[l].aio_fildes = fd; + aiocbs[l].aio_offset = label_offset(size, l); + aiocbs[l].aio_buf = &labels[l]; + aiocbs[l].aio_nbytes = sizeof(vdev_label_t); + aiocbs[l].aio_lio_opcode = LIO_READ; + aiocbps[l] = &aiocbs[l]; + } + + if (lio_listio(LIO_WAIT, aiocbps, VDEV_LABELS, NULL) != 0) { + if (errno == EAGAIN || errno == EINTR || errno == EIO) { + for (l = 0; l < VDEV_LABELS; l++) { + errno = 0; + int r = aio_error(&aiocbs[l]); + if (r != EINVAL) + (void)aio_return(&aiocbs[l]); + } + } + return (0); + } + + for (l = 0; l < VDEV_LABELS; l++) { nvlist_t *temp = NULL; - /* TODO: use aio_read so we can read al 4 labels in parallel */ - if (pread64(fd, label, sizeof (vdev_label_t), - label_offset(size, l)) != sizeof (vdev_label_t)) + if (aio_return(&aiocbs[l]) != sizeof(vdev_label_t)) continue; - if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist, - sizeof (label->vl_vdev_phys.vp_nvlist), &temp, 0) != 0) + if (nvlist_unpack(labels[l].vl_vdev_phys.vp_nvlist, + sizeof (labels[l].vl_vdev_phys.vp_nvlist), &temp, 0) != 0) continue; if (nvlist_lookup_uint64(temp, ZPOOL_CONFIG_POOL_STATE, @@ -970,7 +995,7 @@ zpool_read_all_labels(int fd, nvlist_t **config) nlabels++; } - free(label); + free(labels); return (nlabels); } From owner-svn-src-all@freebsd.org Thu Oct 12 21:26:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05BBE35264; Thu, 12 Oct 2017 21:26:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF54E67C42; Thu, 12 Oct 2017 21:26:53 +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 v9CLQqpW004452; Thu, 12 Oct 2017 21:26:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLQqAm004451; Thu, 12 Oct 2017 21:26:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710122126.v9CLQqAm004451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Oct 2017 21:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324569 - head/sys/dev/dpaa X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/dpaa X-SVN-Commit-Revision: 324569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:26:54 -0000 Author: glebius Date: Thu Oct 12 21:26:52 2017 New Revision: 324569 URL: https://svnweb.freebsd.org/changeset/base/324569 Log: Fix build after r324446. Modified: head/sys/dev/dpaa/if_dtsec_rm.c Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Thu Oct 12 21:25:11 2017 (r324568) +++ head/sys/dev/dpaa/if_dtsec_rm.c Thu Oct 12 21:26:52 2017 (r324569) @@ -347,7 +347,7 @@ dtsec_rm_fqr_mext_free(struct mbuf *m) if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) bman_put_buffer(sc->sc_rx_pool, buffer); else - dtsec_rm_pool_rx_put_buffer(arg, buffer, NULL); + dtsec_rm_pool_rx_put_buffer(sc, buffer, NULL); } static e_RxStoreResponse From owner-svn-src-all@freebsd.org Thu Oct 12 21:57:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0320DE36199; Thu, 12 Oct 2017 21:57:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D23F569882; Thu, 12 Oct 2017 21:56:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLux7B017134; Thu, 12 Oct 2017 21:56:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLuwH4017132; Thu, 12 Oct 2017 21:56:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710122156.v9CLuwH4017132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 Oct 2017 21:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324570 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 324570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:57:00 -0000 Author: adrian Date: Thu Oct 12 21:56:58 2017 New Revision: 324570 URL: https://svnweb.freebsd.org/changeset/base/324570 Log: [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. The duplicate detection code currently expects A-MSDU frames to be encaped - they're decap'ed /after/ duplicate detection. However for ath10k (and iwm hardware later on) the firmware supports doing A-MSDU decap in hardware - which shows up as multiple frames with the same sequence number and IV. This is the first part of decap handling - if we see a stretch of A-MSDU frames from the driver with the MORE bit set, then don't treat them as duplicates. This isn't 100% complete as crypto sequence number handling and "A-MSDU in A-MPDU" needs handling, but it's a start. This should be a glorified no-op for everyone. Please tell me if it isn't. Modified: head/sys/net80211/ieee80211_input.h head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Thu Oct 12 21:26:52 2017 (r324569) +++ head/sys/net80211/ieee80211_input.h Thu Oct 12 21:56:58 2017 (r324570) @@ -131,7 +131,39 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } +static __inline int +ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) +{ + + return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); +} + /* + * Return 1 if the rxseq check should increment the sequence + * number. Return 0 if it's part of an AMSDU batch and it isn't + * the final frame in the decap'ed burst. + */ +static __inline int +ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) +{ + /* No state? ok */ + if (rxs == NULL) + return (1); + + /* State but no AMSDU set? ok */ + if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) + return (1); + + /* State, AMSDU set, then _MORE means "don't inc yet" */ + if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { + return (0); + } + + /* Both are set, so return ok */ + return (1); +} + +/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -238,7 +270,20 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - ni->ni_rxseqs[tid] = rxseq; + /* + * Only bump the sequence number if it's the last frame + * in a batch. That way frames in the rest of the batch + * get included, and the last frame in the batch kicks + * it next. + */ + if (ieee80211_check_rxseq_amsdu_more(rxs)) { + ni->ni_rxseqs[tid] = rxseq; + if (ieee80211_check_rxseq_amsdu(rxs)) + IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); + } else { + /* .. still waiting */ + IEEE80211_NODE_STAT(ni, rx_amsdu_more); + } return 1; Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Thu Oct 12 21:26:52 2017 (r324569) +++ head/sys/net80211/ieee80211_ioctl.h Thu Oct 12 21:56:58 2017 (r324570) @@ -84,7 +84,11 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - uint32_t ns_spare[8]; + + /* Hardware A-MSDU decode */ + uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ + uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ + uint32_t ns_spare[6]; }; /* From owner-svn-src-all@freebsd.org Thu Oct 12 21:58:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E66EE36293; Thu, 12 Oct 2017 21:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5B069A23; Thu, 12 Oct 2017 21:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLwppu017239; Thu, 12 Oct 2017 21:58:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLwpPX017238; Thu, 12 Oct 2017 21:58:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710122158.v9CLwpPX017238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 Oct 2017 21:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324571 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 324571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:58:52 -0000 Author: adrian Date: Thu Oct 12 21:58:51 2017 New Revision: 324571 URL: https://svnweb.freebsd.org/changeset/base/324571 Log: [ath] Begin using the replacement EDCA functions. As part of ath10k and other chipset support, the EDCA stuff has to be moved to potentially be per-VAP. For hardware that doesn't support it (ie, everything that we currently support) it can just fetch the "current" global EDCA parameters for the NIC. This is one of those parameters that is linked to the currently active channel context / VAP in Linux mac80211 parlance. Tested: * ath(4), STA and AP modes Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Oct 12 21:56:58 2017 (r324570) +++ head/sys/dev/ath/if_ath.c Thu Oct 12 21:58:51 2017 (r324571) @@ -4049,9 +4049,13 @@ ath_txq_update(struct ath_softc *sc, int ac) #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; struct ath_txq *txq = sc->sc_ac2q[ac]; - struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; + struct chanAccParams chp; + struct wmeParams *wmep; struct ath_hal *ah = sc->sc_ah; HAL_TXQ_INFO qi; + + ieee80211_wme_ic_getparams(ic, &chp); + wmep = &chp.cap_wmeParams[ac]; ath_hal_gettxqueueprops(ah, txq->axq_qnum, &qi); #ifdef IEEE80211_SUPPORT_TDMA From owner-svn-src-all@freebsd.org Fri Oct 13 01:53:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D1E3E3A249; Fri, 13 Oct 2017 01:53:47 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 15F5B6F6AE; Fri, 13 Oct 2017 01:53:46 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 2pAPeEYz68LPZ2pAQeSJdy; Thu, 12 Oct 2017 19:53:40 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wc-4pM-bQDIXAEspKtoA:9 a=vIDOfcrwHqujqwnU:21 a=sjZW-vsJ84S7-BPG:21 a=TocCdJf0WWuU3Xzv:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A6ECAF0; Thu, 12 Oct 2017 18:53:36 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v9D1rahI002918; Thu, 12 Oct 2017 18:53:36 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710130153.v9D1rahI002918@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324570 - head/sys/net80211 In-Reply-To: Message from Adrian Chadd of "Thu, 12 Oct 2017 21:56:58 -0000." <201710122156.v9CLuwH4017132@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Oct 2017 18:53:36 -0700 X-CMAE-Envelope: MS4wfMzYFwiCim5A2HNVmkrmEzA1+Z6m3/64w+RCuBv/jv1AsTFnHQNLZdTUp59oBQASHJ0wHcVjaMg7aTBLMJA6PPlvdHvN4D9b6pUncbkCs8CUqzjzPMZ3 pK4t/bhZWmW3GRFyr28bdpk5MQ9p0d8WgQCgoprIjasfZox3kq3odWGLAuQIpTpmCf3fnQLxwNQSZ8m0jG655qLC7Q+/EndlVf7hvU/p5p2XJ7efp1F0mSG2 syvPI3HYIDD9T2dSeZ6fMCqL+xt8dE0hfhaAQPNbt0hkSW1fBQvPqkcSCCmqVwO+ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 01:53:47 -0000 In message <201710122156.v9CLuwH4017132@repo.freebsd.org>, Adrian Chadd writes: > Author: adrian > Date: Thu Oct 12 21:56:58 2017 > New Revision: 324570 > URL: https://svnweb.freebsd.org/changeset/base/324570 > > Log: > [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. > > The duplicate detection code currently expects A-MSDU frames to be encaped > - > they're decap'ed /after/ duplicate detection. > > However for ath10k (and iwm hardware later on) the firmware supports > doing A-MSDU decap in hardware - which shows up as multiple frames with > the same sequence number and IV. > > This is the first part of decap handling - if we see a stretch of A-MSDU > frames from the driver with the MORE bit set, then don't treat them > as duplicates. > > This isn't 100% complete as crypto sequence number handling and "A-MSDU in > A-MPDU" needs handling, but it's a start. > > This should be a glorified no-op for everyone. Please tell me if it isn't. > Hi Adrian, This is causing iwn in my laptop a bit of gas. wlan0: Ethernet address: 20:6a:8a:72:03:17 <118>Created wlan(4) interfaces: wlan0. <118>Created clone interfaces: lagg0. <5>bge0: link state changed to DOWN iwn0: iwn_read_firmware: ucode rev=0x12a80601 <118>Starting wpa_supplicant. <5>lagg0: link state changed to DOWN iwn0: iwn_read_firmware: ucode rev=0x12a80601 <118>Starting dhclient. <118>lagg0: no link ... Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x4 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff8155cd59 stack pointer = 0x28:0xfffffe01491e4790 frame pointer = 0x28:0xfffffe01491e4830 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq265: iwn0) trap number = 12 panic: page fault cpuid = 0 time = 1507858438 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01491e4370 vpanic() at vpanic+0x19c/frame 0xfffffe01491e43f0 panic() at panic+0x43/frame 0xfffffe01491e4450 trap_fatal() at trap_fatal+0x34d/frame 0xfffffe01491e44a0 trap_pfault() at trap_pfault+0x49/frame 0xfffffe01491e4500 trap() at trap+0x2a9/frame 0xfffffe01491e46c0 calltrap() at calltrap+0x8/frame 0xfffffe01491e46c0 --- trap 0xc, rip = 0xffffffff8155cd59, rsp = 0xfffffe01491e4790, rbp = 0xfffffe01491e4830 --- sta_input() at sta_input+0xb89/frame 0xfffffe01491e4830 iwn_notif_intr() at iwn_notif_intr+0x15f7/frame 0xfffffe01491e4970 iwn_intr() at iwn_intr+0x5a0/frame 0xfffffe01491e49e0 intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame 0xfffffe01491e4a20 ithread_loop() at ithread_loop+0xd6/frame 0xfffffe01491e4a70 fork_exit() at fork_exit+0x85/frame 0xfffffe01491e4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01491e4ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 29s Dumping 704 out of 7978 MB:..3%..12%..21%..32%..41%..53%..62%..71%..82%..91% Loaded symbols for /boot/kernel/nullfs.ko #0 doadump (textdump=1) at pcpu.h:232 232 pcpu.h: No such file or directory. in pcpu.h (kgdb) bt #0 doadump (textdump=1) at pcpu.h:232 #1 0xffffffff80583eb6 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff805843a6 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff805841c3 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff80886a8d in trap_fatal (frame=0xfffffe01491e46d0, eva=4) at /opt/src/svn-current/sys/amd64/amd64/trap.c:799 #5 0xffffffff80886ae9 in trap_pfault (frame=0xfffffe01491e46d0, usermode=0) at pcpu.h:232 #6 0xffffffff80886339 in trap (frame=0xfffffe01491e46d0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:420 #7 0xffffffff8086acf1 in calltrap () at /opt/src/svn-current/sys/amd64/amd6 4/exception.S:237 #8 0xffffffff8155cd59 in sta_input (ni=0xfffffe0012651000, m=0xfffff80004040e00, rxs=0x0, rssi=63, nf=-95) at ieee80211_input.h:280 #9 0xffffffff81513987 in iwn_notif_intr () from /boot/kernel/if_iwn.ko #10 0xffffffff8150a270 in iwn_intr () from /boot/kernel/if_iwn.ko #11 0xffffffff80548dcc in intr_event_execute_handlers (p=, ie=0xfffff80002b06800) at /opt/src/svn-current/sys/kern/kern_intr.c:13 36 #12 0xffffffff80549496 in ithread_loop (arg=0xfffff80002b50c20) at /opt/src/svn-current/sys/kern/kern_intr.c:1349 #13 0xffffffff80546135 in fork_exit (callout=0xffffffff805493c0 , arg=0xfffff80002b50c20, frame=0xfffffe01491e4ac0) at /opt/src/svn-current/sys/kern/kern_fork.c:1044 #14 0xffffffff8086b2de in fork_trampoline () at /opt/src/svn-current/sys/amd 64/amd64/exception.S:651 #15 0x0000000000000000 in ?? () Current language: auto; currently minimal -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Oct 13 02:01:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D349E3A431; Fri, 13 Oct 2017 02:01:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC4C6F9B7; Fri, 13 Oct 2017 02:01:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D214Fb017094; Fri, 13 Oct 2017 02:01:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D2141B017093; Fri, 13 Oct 2017 02:01:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130201.v9D2141B017093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 02:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324572 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 324572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 02:01:05 -0000 Author: sephe Date: Fri Oct 13 02:01:03 2017 New Revision: 324572 URL: https://svnweb.freebsd.org/changeset/base/324572 Log: MFC 324487 hyperv/vmbus: Add tunable to pin/unpin event tasks. Event tasks are pinned to their respective CPU by default, in the same fashion as they were. Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain CPUs serve special purpose. Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Oct 12 21:58:51 2017 (r324571) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Fri Oct 13 02:01:03 2017 (r324572) @@ -129,6 +129,13 @@ static struct vmbus_softc *vmbus_sc; extern inthand_t IDTVEC(rsvd), IDTVEC(vmbus_isr); +SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V vmbus"); + +static int vmbus_pin_evttask = 1; +SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, + &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); + static const uint32_t vmbus_version[] = { VMBUS_VERSION_WIN8_1, VMBUS_VERSION_WIN8, @@ -978,13 +985,15 @@ vmbus_intr_setup(struct vmbus_softc *sc) taskqueue_start_threads(VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, "hvevent%d", cpu); - CPU_SETOF(cpu, &cpu_mask); - TASK_INIT(&cpuset_task, 0, vmbus_cpuset_setthread_task, - &cpu_mask); - taskqueue_enqueue(VMBUS_PCPU_GET(sc, event_tq, cpu), - &cpuset_task); - taskqueue_drain(VMBUS_PCPU_GET(sc, event_tq, cpu), - &cpuset_task); + if (vmbus_pin_evttask) { + CPU_SETOF(cpu, &cpu_mask); + TASK_INIT(&cpuset_task, 0, vmbus_cpuset_setthread_task, + &cpu_mask); + taskqueue_enqueue(VMBUS_PCPU_GET(sc, event_tq, cpu), + &cpuset_task); + taskqueue_drain(VMBUS_PCPU_GET(sc, event_tq, cpu), + &cpuset_task); + } /* * Setup tasks and taskqueues to handle messages. From owner-svn-src-all@freebsd.org Fri Oct 13 02:16:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAB6E3A7FC; Fri, 13 Oct 2017 02:16:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF5A70068; Fri, 13 Oct 2017 02:16:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D2Gajr024443; Fri, 13 Oct 2017 02:16:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D2GaKd024441; Fri, 13 Oct 2017 02:16:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130216.v9D2GaKd024441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 02:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324573 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/10/sys/dev/hyperv: include vmbus X-SVN-Commit-Revision: 324573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 02:16:37 -0000 Author: sephe Date: Fri Oct 13 02:16:35 2017 New Revision: 324573 URL: https://svnweb.freebsd.org/changeset/base/324573 Log: MFC 324488 hyperv/vmbus: Expose Hyper-V major version. Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/vmbus/hyperv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Oct 13 02:01:03 2017 (r324572) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Oct 13 02:16:35 2017 (r324573) @@ -90,6 +90,7 @@ int hyperv_guid2str(const struct hyperv_guid *, char */ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +extern u_int hyperv_ver_major; #endif /* _KERNEL */ Modified: stable/10/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv.c Fri Oct 13 02:01:03 2017 (r324572) +++ stable/10/sys/dev/hyperv/vmbus/hyperv.c Fri Oct 13 02:16:35 2017 (r324573) @@ -77,6 +77,8 @@ static u_int hyperv_get_timecount(struct timecounter static bool hyperv_identify(void); static void hypercall_memfree(void); +u_int hyperv_ver_major; + u_int hyperv_features; u_int hyperv_recommends; @@ -169,8 +171,9 @@ hyperv_identify(void) hyperv_features3 = regs[3]; do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + hyperv_ver_major = regs[1] >> 16; printf("Hyper-V Version: %d.%d.%d [SP%d]\n", - regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020" From owner-svn-src-all@freebsd.org Fri Oct 13 02:26:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACC87E3AB69; Fri, 13 Oct 2017 02:26:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 679F7704DA; Fri, 13 Oct 2017 02:26:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D2QejK028441; Fri, 13 Oct 2017 02:26:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D2QeEH028436; Fri, 13 Oct 2017 02:26:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130226.v9D2QeEH028436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 02:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324574 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 02:26:41 -0000 Author: sephe Date: Fri Oct 13 02:26:39 2017 New Revision: 324574 URL: https://svnweb.freebsd.org/changeset/base/324574 Log: MFC 324489,324516 324489 hyperv/hn: Workaround erroneous hash type observed on WS2016. Background: - UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016, which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS. - Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as TCP_IPV4. Currently this erroneous behavior only applies to WS2016/Windows10. Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4, and the Hyper-V is running on WS2016/Windows10. If the RXed packet is UDP datagram, adjust mbuf hash type to UDP_IPV4. Sponsored by: Microsoft 324516 hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF. The background was described in r324489. Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Fri Oct 13 02:16:35 2017 (r324573) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Fri Oct 13 02:26:39 2017 (r324574) @@ -601,6 +601,11 @@ hn_nvs_attach(struct hn_softc *sc, int mtu) { int error; + if (hyperv_ver_major >= 10) { + /* UDP 4-tuple hash is enforced. */ + sc->hn_caps |= HN_CAP_UDPHASH; + } + /* * Initialize NVS. */ Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Fri Oct 13 02:16:35 2017 (r324573) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Fri Oct 13 02:26:39 2017 (r324574) @@ -522,6 +522,10 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; sc->hn_rss_hcap = hash_func | hash_types; + if (sc->hn_caps & HN_CAP_UDPHASH) { + /* UDP 4-tuple hash is unconditionally enabled. */ + sc->hn_rss_hcap |= NDIS_HASH_UDP_IPV4_X; + } *rxr_cnt0 = rxr_cnt; return (0); } @@ -761,8 +765,10 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) ("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); /* XXX only one can be specified through, popcnt? */ - KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), ("no hash func")); - KASSERT((sc->hn_rss_hash & NDIS_HASH_TYPE_MASK), ("no hash types")); + KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), + ("no hash func %08x", sc->hn_rss_hash)); + KASSERT((sc->hn_rss_hash & NDIS_HASH_STD), + ("no standard hash types %08x", sc->hn_rss_hash)); KASSERT(sc->hn_rss_ind_size > 0, ("no indirect table size")); if (bootverbose) { @@ -781,7 +787,8 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = rss_size; prm->ndis_flags = flags; - prm->ndis_hash = sc->hn_rss_hash; + prm->ndis_hash = sc->hn_rss_hash & + (NDIS_HASH_FUNCTION_MASK | NDIS_HASH_STD); prm->ndis_indsize = sizeof(rss->rss_ind[0]) * sc->hn_rss_ind_size; prm->ndis_indoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_ind[0]); Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 02:16:35 2017 (r324573) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 02:26:39 2017 (r324574) @@ -119,6 +119,11 @@ __FBSDID("$FreeBSD$"); #define HN_IFSTART_SUPPORT +/* NOTE: M_HASHTYPE_RSS_UDP_IPV4 is not available on stable/10. */ +#ifndef M_HASHTYPE_RSS_UDP_IPV4 +#define M_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_OPAQUE +#endif + #define HN_RING_CNT_DEF_MAX 8 #define HN_VFMAP_SIZE_DEF 8 @@ -378,6 +383,7 @@ static void hn_link_status(struct hn_softc *); static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); +static void hn_rxpkt_proto(const struct mbuf *, int *, int *); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); @@ -392,6 +398,7 @@ static int hn_tx_ring_create(struct hn_softc *, int) static void hn_tx_ring_destroy(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *, int); static void hn_fixup_tx_data(struct hn_softc *); +static void hn_fixup_rx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); static void hn_txdesc_gc(struct hn_tx_ring *, @@ -1413,6 +1420,8 @@ hn_rss_type_fromndis(uint32_t rss_hash) types |= RSS_TYPE_TCP_IPV6; if (rss_hash & NDIS_HASH_TCP_IPV6_EX) types |= RSS_TYPE_TCP_IPV6_EX; + if (rss_hash & NDIS_HASH_UDP_IPV4_X) + types |= RSS_TYPE_UDP_IPV4; return (types); } @@ -1421,9 +1430,8 @@ hn_rss_type_tondis(uint32_t types) { uint32_t rss_hash = 0; - KASSERT((types & - (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, - ("UDP4, UDP6 and UDP6EX are not supported")); + KASSERT((types & (RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP6 and UDP6EX are not supported")); if (types & RSS_TYPE_IPV4) rss_hash |= NDIS_HASH_IPV4; @@ -1437,6 +1445,8 @@ hn_rss_type_tondis(uint32_t types) rss_hash |= NDIS_HASH_TCP_IPV6; if (types & RSS_TYPE_TCP_IPV6_EX) rss_hash |= NDIS_HASH_TCP_IPV6_EX; + if (types & RSS_TYPE_UDP_IPV4) + rss_hash |= NDIS_HASH_UDP_IPV4_X; return (rss_hash); } @@ -1535,6 +1545,13 @@ hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) * NOTE: * We don't disable the hash type, but stop delivery the hash * value/type through mbufs on RX path. + * + * XXX If HN_CAP_UDPHASH is set in hn_caps, then UDP 4-tuple + * hash is delivered with type of TCP_IPV4. This means if + * UDP_IPV4 is enabled, then TCP_IPV4 should be forced, at + * least to hn_mbuf_hash. However, given that _all_ of the + * NICs implement TCP_IPV4, this will _not_ impose any issues + * here. */ if ((my_types & RSS_TYPE_IPV4) && (diff_types & ifrh.ifrh_types & @@ -2225,9 +2242,10 @@ hn_attach(device_t dev) #endif /* - * Fixup TX stuffs after synthetic parts are attached. + * Fixup TX/RX stuffs after synthetic parts are attached. */ hn_fixup_tx_data(sc); + hn_fixup_rx_data(sc); ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -3371,6 +3389,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int struct mbuf *m_new; int size, do_lro = 0, do_csum = 1, is_vf = 0; int hash_type = M_HASHTYPE_NONE; + int l3proto = ETHERTYPE_MAX, l4proto = IPPROTO_DONE; ifp = hn_ifp; if (rxr->hn_rxvf_ifp != NULL) { @@ -3470,31 +3489,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; } else { - const struct ether_header *eh; - uint16_t etype; - int hoff; - - hoff = sizeof(*eh); - /* Checked at the beginning of this function. */ - KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); - - eh = mtod(m_new, struct ether_header *); - etype = ntohs(eh->ether_type); - if (etype == ETHERTYPE_VLAN) { - const struct ether_vlan_header *evl; - - hoff = sizeof(*evl); - if (m_new->m_len < hoff) - goto skip; - evl = mtod(m_new, struct ether_vlan_header *); - etype = ntohs(evl->evl_proto); - } - - if (etype == ETHERTYPE_IP) { - int pr; - - pr = hn_check_iplen(m_new, hoff); - if (pr == IPPROTO_TCP) { + hn_rxpkt_proto(m_new, &l3proto, &l4proto); + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_TCP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { @@ -3505,7 +3502,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int m_new->m_pkthdr.csum_data = 0xffff; } do_lro = 1; - } else if (pr == IPPROTO_UDP) { + } else if (l4proto == IPPROTO_UDP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { @@ -3515,7 +3512,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } - } else if (pr != IPPROTO_DONE && do_csum && + } else if (l4proto != IPPROTO_DONE && do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= @@ -3523,7 +3520,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int } } } -skip: + if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( NDIS_VLAN_INFO_ID(info->vlan_info), @@ -3578,6 +3575,37 @@ skip: case NDIS_HASH_TCP_IPV4: hash_type = M_HASHTYPE_RSS_TCP_IPV4; + if (rxr->hn_rx_flags & HN_RX_FLAG_UDP_HASH) { + int def_htype = M_HASHTYPE_OPAQUE; + + if (is_vf) + def_htype = M_HASHTYPE_NONE; + + /* + * UDP 4-tuple hash is delivered as + * TCP 4-tuple hash. + */ + if (l3proto == ETHERTYPE_MAX) { + hn_rxpkt_proto(m_new, + &l3proto, &l4proto); + } + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_UDP && + (rxr->hn_mbuf_hash & + NDIS_HASH_UDP_IPV4_X)) { + hash_type = + M_HASHTYPE_RSS_UDP_IPV4; + do_lro = 0; + } else if (l4proto != + IPPROTO_TCP) { + hash_type = def_htype; + do_lro = 0; + } + } else { + hash_type = def_htype; + do_lro = 0; + } + } break; case NDIS_HASH_IPV6: @@ -4823,6 +4851,36 @@ hn_check_iplen(const struct mbuf *m, int hoff) return ip->ip_p; } +static void +hn_rxpkt_proto(const struct mbuf *m_new, int *l3proto, int *l4proto) +{ + const struct ether_header *eh; + uint16_t etype; + int hoff; + + hoff = sizeof(*eh); + /* Checked at the beginning of this function. */ + KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); + + eh = mtod(m_new, const struct ether_header *); + etype = ntohs(eh->ether_type); + if (etype == ETHERTYPE_VLAN) { + const struct ether_vlan_header *evl; + + hoff = sizeof(*evl); + if (m_new->m_len < hoff) + return; + evl = mtod(m_new, const struct ether_vlan_header *); + etype = ntohs(evl->evl_proto); + } + *l3proto = etype; + + if (etype == ETHERTYPE_IP) + *l4proto = hn_check_iplen(m_new, hoff); + else + *l4proto = IPPROTO_DONE; +} + static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { @@ -5531,6 +5589,18 @@ hn_fixup_tx_data(struct hn_softc *sc) if_printf(sc->hn_ifp, "support HASHVAL pktinfo\n"); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; + } +} + +static void +hn_fixup_rx_data(struct hn_softc *sc) +{ + + if (sc->hn_caps & HN_CAP_UDPHASH) { + int i; + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags |= HN_RX_FLAG_UDP_HASH; } } Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 13 02:16:35 2017 (r324573) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 13 02:26:39 2017 (r324574) @@ -97,6 +97,7 @@ struct hn_rx_ring { #define HN_RX_FLAG_ATTACHED 0x0001 #define HN_RX_FLAG_BR_REF 0x0002 #define HN_RX_FLAG_XPNT_VF 0x0004 +#define HN_RX_FLAG_UDP_HASH 0x0008 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -305,11 +306,12 @@ do { \ #define HN_CAP_TSO4 0x0080 #define HN_CAP_TSO6 0x0100 #define HN_CAP_HASHVAL 0x0200 +#define HN_CAP_UDPHASH 0x0400 /* Capability description for use with printf(9) %b identifier. */ #define HN_CAP_BITS \ "\020\1VLAN\2MTU\3IPCS\4TCP4CS\5TCP6CS" \ - "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL" + "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL\13UDPHASH" #define HN_LINK_FLAG_LINKUP 0x0001 #define HN_LINK_FLAG_NETCHG 0x0002 Modified: stable/10/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/ndis.h Fri Oct 13 02:16:35 2017 (r324573) +++ stable/10/sys/dev/hyperv/netvsc/ndis.h Fri Oct 13 02:26:39 2017 (r324574) @@ -56,17 +56,26 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 +#define NDIS_HASH_UDP_IPV4_X 0x00004000 /* XXX non-standard */ #define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ NDIS_HASH_TCP_IPV4 | \ NDIS_HASH_IPV6 | \ NDIS_HASH_IPV6_EX | \ NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX |\ + NDIS_HASH_UDP_IPV4_X) + +#define NDIS_HASH_STD (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ - "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX" + "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX\17UDP4_X" #define NDIS_HASH_KEYSIZE_TOEPLITZ 40 #define NDIS_HASH_INDCNT 128 From owner-svn-src-all@freebsd.org Fri Oct 13 02:29:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74520E3AC85; Fri, 13 Oct 2017 02:29:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430267065F; Fri, 13 Oct 2017 02:29:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D2Thhi028603; Fri, 13 Oct 2017 02:29:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D2Thhq028602; Fri, 13 Oct 2017 02:29:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130229.v9D2Thhq028602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 02:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324575 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 02:29:44 -0000 Author: sephe Date: Fri Oct 13 02:29:43 2017 New Revision: 324575 URL: https://svnweb.freebsd.org/changeset/base/324575 Log: MFC 324517 hyperv/hn: Enable transparent VF by default. Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 02:26:39 2017 (r324574) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 02:29:43 2017 (r324575) @@ -582,7 +582,7 @@ SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLT 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); /* Transparent VF */ -static int hn_xpnt_vf = 0; +static int hn_xpnt_vf = 1; SYSCTL_INT(_hw_hn, OID_AUTO, vf_transparent, CTLFLAG_RDTUN, &hn_xpnt_vf, 0, "Transparent VF mod"); From owner-svn-src-all@freebsd.org Fri Oct 13 04:55:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D605E3CED2; Fri, 13 Oct 2017 04:55:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEB273942; Fri, 13 Oct 2017 04:55:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D4tsac090709; Fri, 13 Oct 2017 04:55:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D4ts1D090708; Fri, 13 Oct 2017 04:55:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130455.v9D4ts1D090708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 04:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324576 - stable/11/sys/dev/hyperv/vmbus X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 324576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 04:55:55 -0000 Author: sephe Date: Fri Oct 13 04:55:54 2017 New Revision: 324576 URL: https://svnweb.freebsd.org/changeset/base/324576 Log: MFC 324487 hyperv/vmbus: Add tunable to pin/unpin event tasks. Event tasks are pinned to their respective CPU by default, in the same fashion as they were. Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain CPUs serve special purpose. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/vmbus/vmbus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus.c Fri Oct 13 02:29:43 2017 (r324575) +++ stable/11/sys/dev/hyperv/vmbus/vmbus.c Fri Oct 13 04:55:54 2017 (r324576) @@ -128,6 +128,13 @@ static void vmbus_event_proc_dummy(struct vmbus_soft static struct vmbus_softc *vmbus_sc; +SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V vmbus"); + +static int vmbus_pin_evttask = 1; +SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, + &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); + extern inthand_t IDTVEC(vmbus_isr); static const uint32_t vmbus_version[] = { @@ -905,10 +912,16 @@ vmbus_intr_setup(struct vmbus_softc *sc) VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast( "hyperv event", M_WAITOK, taskqueue_thread_enqueue, VMBUS_PCPU_PTR(sc, event_tq, cpu)); - CPU_SETOF(cpu, &cpu_mask); - taskqueue_start_threads_cpuset( - VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask, - "hvevent%d", cpu); + if (vmbus_pin_evttask) { + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); + } else { + taskqueue_start_threads( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + "hvevent%d", cpu); + } /* * Setup tasks and taskqueues to handle messages. From owner-svn-src-all@freebsd.org Fri Oct 13 05:02:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E94ABE3D0CA; Fri, 13 Oct 2017 05:02:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5EE273D08; Fri, 13 Oct 2017 05:02:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D52dia094599; Fri, 13 Oct 2017 05:02:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D52dct094597; Fri, 13 Oct 2017 05:02:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130502.v9D52dct094597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 05:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324577 - in stable/11/sys/dev/hyperv: include vmbus X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in stable/11/sys/dev/hyperv: include vmbus X-SVN-Commit-Revision: 324577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 05:02:41 -0000 Author: sephe Date: Fri Oct 13 05:02:39 2017 New Revision: 324577 URL: https://svnweb.freebsd.org/changeset/base/324577 Log: MFC 324488 hyperv/vmbus: Expose Hyper-V major version. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/include/hyperv.h stable/11/sys/dev/hyperv/vmbus/hyperv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/11/sys/dev/hyperv/include/hyperv.h Fri Oct 13 04:55:54 2017 (r324576) +++ stable/11/sys/dev/hyperv/include/hyperv.h Fri Oct 13 05:02:39 2017 (r324577) @@ -90,6 +90,7 @@ int hyperv_guid2str(const struct hyperv_guid *, char */ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +extern u_int hyperv_ver_major; #endif /* _KERNEL */ Modified: stable/11/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/hyperv.c Fri Oct 13 04:55:54 2017 (r324576) +++ stable/11/sys/dev/hyperv/vmbus/hyperv.c Fri Oct 13 05:02:39 2017 (r324577) @@ -77,6 +77,8 @@ static u_int hyperv_get_timecount(struct timecounter static bool hyperv_identify(void); static void hypercall_memfree(void); +u_int hyperv_ver_major; + u_int hyperv_features; u_int hyperv_recommends; @@ -169,8 +171,9 @@ hyperv_identify(void) hyperv_features3 = regs[3]; do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + hyperv_ver_major = regs[1] >> 16; printf("Hyper-V Version: %d.%d.%d [SP%d]\n", - regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020" From owner-svn-src-all@freebsd.org Fri Oct 13 05:09:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2BE4E3D18E; Fri, 13 Oct 2017 05:09:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37F673E8B; Fri, 13 Oct 2017 05:09:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D59uPY094892; Fri, 13 Oct 2017 05:09:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D59uLC094887; Fri, 13 Oct 2017 05:09:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130509.v9D59uLC094887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 05:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324578 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 05:09:58 -0000 Author: sephe Date: Fri Oct 13 05:09:56 2017 New Revision: 324578 URL: https://svnweb.freebsd.org/changeset/base/324578 Log: MFC 324489,324516 324489 hyperv/hn: Workaround erroneous hash type observed on WS2016. Background: - UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016, which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS. - Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as TCP_IPV4. Currently this erroneous behavior only applies to WS2016/Windows10. Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4, and the Hyper-V is running on WS2016/Windows10. If the RXed packet is UDP datagram, adjust mbuf hash type to UDP_IPV4. Sponsored by: Microsoft 324516 hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF. The background was described in r324489. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c stable/11/sys/dev/hyperv/netvsc/hn_rndis.c stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h stable/11/sys/dev/hyperv/netvsc/ndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Fri Oct 13 05:02:39 2017 (r324577) +++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Fri Oct 13 05:09:56 2017 (r324578) @@ -601,6 +601,11 @@ hn_nvs_attach(struct hn_softc *sc, int mtu) { int error; + if (hyperv_ver_major >= 10) { + /* UDP 4-tuple hash is enforced. */ + sc->hn_caps |= HN_CAP_UDPHASH; + } + /* * Initialize NVS. */ Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Fri Oct 13 05:02:39 2017 (r324577) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Fri Oct 13 05:09:56 2017 (r324578) @@ -521,6 +521,10 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; sc->hn_rss_hcap = hash_func | hash_types; + if (sc->hn_caps & HN_CAP_UDPHASH) { + /* UDP 4-tuple hash is unconditionally enabled. */ + sc->hn_rss_hcap |= NDIS_HASH_UDP_IPV4_X; + } *rxr_cnt0 = rxr_cnt; return (0); } @@ -760,8 +764,10 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) ("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); /* XXX only one can be specified through, popcnt? */ - KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), ("no hash func")); - KASSERT((sc->hn_rss_hash & NDIS_HASH_TYPE_MASK), ("no hash types")); + KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), + ("no hash func %08x", sc->hn_rss_hash)); + KASSERT((sc->hn_rss_hash & NDIS_HASH_STD), + ("no standard hash types %08x", sc->hn_rss_hash)); KASSERT(sc->hn_rss_ind_size > 0, ("no indirect table size")); if (bootverbose) { @@ -780,7 +786,8 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = rss_size; prm->ndis_flags = flags; - prm->ndis_hash = sc->hn_rss_hash; + prm->ndis_hash = sc->hn_rss_hash & + (NDIS_HASH_FUNCTION_MASK | NDIS_HASH_STD); prm->ndis_indsize = sizeof(rss->rss_ind[0]) * sc->hn_rss_ind_size; prm->ndis_indoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_ind[0]); Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 05:02:39 2017 (r324577) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 05:09:56 2017 (r324578) @@ -385,6 +385,7 @@ static void hn_link_status(struct hn_softc *); static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); +static void hn_rxpkt_proto(const struct mbuf *, int *, int *); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); @@ -399,6 +400,7 @@ static int hn_tx_ring_create(struct hn_softc *, int) static void hn_tx_ring_destroy(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *, int); static void hn_fixup_tx_data(struct hn_softc *); +static void hn_fixup_rx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); static void hn_txdesc_gc(struct hn_tx_ring *, @@ -1422,6 +1424,8 @@ hn_rss_type_fromndis(uint32_t rss_hash) types |= RSS_TYPE_TCP_IPV6; if (rss_hash & NDIS_HASH_TCP_IPV6_EX) types |= RSS_TYPE_TCP_IPV6_EX; + if (rss_hash & NDIS_HASH_UDP_IPV4_X) + types |= RSS_TYPE_UDP_IPV4; return (types); } @@ -1430,9 +1434,8 @@ hn_rss_type_tondis(uint32_t types) { uint32_t rss_hash = 0; - KASSERT((types & - (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, - ("UDP4, UDP6 and UDP6EX are not supported")); + KASSERT((types & (RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP6 and UDP6EX are not supported")); if (types & RSS_TYPE_IPV4) rss_hash |= NDIS_HASH_IPV4; @@ -1446,6 +1449,8 @@ hn_rss_type_tondis(uint32_t types) rss_hash |= NDIS_HASH_TCP_IPV6; if (types & RSS_TYPE_TCP_IPV6_EX) rss_hash |= NDIS_HASH_TCP_IPV6_EX; + if (types & RSS_TYPE_UDP_IPV4) + rss_hash |= NDIS_HASH_UDP_IPV4_X; return (rss_hash); } @@ -1544,6 +1549,13 @@ hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) * NOTE: * We don't disable the hash type, but stop delivery the hash * value/type through mbufs on RX path. + * + * XXX If HN_CAP_UDPHASH is set in hn_caps, then UDP 4-tuple + * hash is delivered with type of TCP_IPV4. This means if + * UDP_IPV4 is enabled, then TCP_IPV4 should be forced, at + * least to hn_mbuf_hash. However, given that _all_ of the + * NICs implement TCP_IPV4, this will _not_ impose any issues + * here. */ if ((my_types & RSS_TYPE_IPV4) && (diff_types & ifrh.ifrh_types & @@ -2238,9 +2250,10 @@ hn_attach(device_t dev) #endif /* - * Fixup TX stuffs after synthetic parts are attached. + * Fixup TX/RX stuffs after synthetic parts are attached. */ hn_fixup_tx_data(sc); + hn_fixup_rx_data(sc); ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -3378,6 +3391,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int struct mbuf *m_new; int size, do_lro = 0, do_csum = 1, is_vf = 0; int hash_type = M_HASHTYPE_NONE; + int l3proto = ETHERTYPE_MAX, l4proto = IPPROTO_DONE; ifp = hn_ifp; if (rxr->hn_rxvf_ifp != NULL) { @@ -3477,31 +3491,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; } else { - const struct ether_header *eh; - uint16_t etype; - int hoff; - - hoff = sizeof(*eh); - /* Checked at the beginning of this function. */ - KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); - - eh = mtod(m_new, struct ether_header *); - etype = ntohs(eh->ether_type); - if (etype == ETHERTYPE_VLAN) { - const struct ether_vlan_header *evl; - - hoff = sizeof(*evl); - if (m_new->m_len < hoff) - goto skip; - evl = mtod(m_new, struct ether_vlan_header *); - etype = ntohs(evl->evl_proto); - } - - if (etype == ETHERTYPE_IP) { - int pr; - - pr = hn_check_iplen(m_new, hoff); - if (pr == IPPROTO_TCP) { + hn_rxpkt_proto(m_new, &l3proto, &l4proto); + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_TCP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { @@ -3512,7 +3504,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int m_new->m_pkthdr.csum_data = 0xffff; } do_lro = 1; - } else if (pr == IPPROTO_UDP) { + } else if (l4proto == IPPROTO_UDP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { @@ -3522,7 +3514,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } - } else if (pr != IPPROTO_DONE && do_csum && + } else if (l4proto != IPPROTO_DONE && do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= @@ -3530,7 +3522,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int } } } -skip: + if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( NDIS_VLAN_INFO_ID(info->vlan_info), @@ -3585,6 +3577,37 @@ skip: case NDIS_HASH_TCP_IPV4: hash_type = M_HASHTYPE_RSS_TCP_IPV4; + if (rxr->hn_rx_flags & HN_RX_FLAG_UDP_HASH) { + int def_htype = M_HASHTYPE_OPAQUE_HASH; + + if (is_vf) + def_htype = M_HASHTYPE_NONE; + + /* + * UDP 4-tuple hash is delivered as + * TCP 4-tuple hash. + */ + if (l3proto == ETHERTYPE_MAX) { + hn_rxpkt_proto(m_new, + &l3proto, &l4proto); + } + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_UDP && + (rxr->hn_mbuf_hash & + NDIS_HASH_UDP_IPV4_X)) { + hash_type = + M_HASHTYPE_RSS_UDP_IPV4; + do_lro = 0; + } else if (l4proto != + IPPROTO_TCP) { + hash_type = def_htype; + do_lro = 0; + } + } else { + hash_type = def_htype; + do_lro = 0; + } + } break; case NDIS_HASH_IPV6: @@ -4835,6 +4858,36 @@ hn_check_iplen(const struct mbuf *m, int hoff) return ip->ip_p; } +static void +hn_rxpkt_proto(const struct mbuf *m_new, int *l3proto, int *l4proto) +{ + const struct ether_header *eh; + uint16_t etype; + int hoff; + + hoff = sizeof(*eh); + /* Checked at the beginning of this function. */ + KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); + + eh = mtod(m_new, const struct ether_header *); + etype = ntohs(eh->ether_type); + if (etype == ETHERTYPE_VLAN) { + const struct ether_vlan_header *evl; + + hoff = sizeof(*evl); + if (m_new->m_len < hoff) + return; + evl = mtod(m_new, const struct ether_vlan_header *); + etype = ntohs(evl->evl_proto); + } + *l3proto = etype; + + if (etype == ETHERTYPE_IP) + *l4proto = hn_check_iplen(m_new, hoff); + else + *l4proto = IPPROTO_DONE; +} + static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { @@ -5543,6 +5596,18 @@ hn_fixup_tx_data(struct hn_softc *sc) if_printf(sc->hn_ifp, "support HASHVAL pktinfo\n"); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; + } +} + +static void +hn_fixup_rx_data(struct hn_softc *sc) +{ + + if (sc->hn_caps & HN_CAP_UDPHASH) { + int i; + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags |= HN_RX_FLAG_UDP_HASH; } } Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 13 05:02:39 2017 (r324577) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 13 05:09:56 2017 (r324578) @@ -97,6 +97,7 @@ struct hn_rx_ring { #define HN_RX_FLAG_ATTACHED 0x0001 #define HN_RX_FLAG_BR_REF 0x0002 #define HN_RX_FLAG_XPNT_VF 0x0004 +#define HN_RX_FLAG_UDP_HASH 0x0008 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -304,11 +305,12 @@ do { \ #define HN_CAP_TSO4 0x0080 #define HN_CAP_TSO6 0x0100 #define HN_CAP_HASHVAL 0x0200 +#define HN_CAP_UDPHASH 0x0400 /* Capability description for use with printf(9) %b identifier. */ #define HN_CAP_BITS \ "\020\1VLAN\2MTU\3IPCS\4TCP4CS\5TCP6CS" \ - "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL" + "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL\13UDPHASH" #define HN_LINK_FLAG_LINKUP 0x0001 #define HN_LINK_FLAG_NETCHG 0x0002 Modified: stable/11/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/ndis.h Fri Oct 13 05:02:39 2017 (r324577) +++ stable/11/sys/dev/hyperv/netvsc/ndis.h Fri Oct 13 05:09:56 2017 (r324578) @@ -56,17 +56,26 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 +#define NDIS_HASH_UDP_IPV4_X 0x00004000 /* XXX non-standard */ #define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ NDIS_HASH_TCP_IPV4 | \ NDIS_HASH_IPV6 | \ NDIS_HASH_IPV6_EX | \ NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX |\ + NDIS_HASH_UDP_IPV4_X) + +#define NDIS_HASH_STD (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ - "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX" + "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX\17UDP4_X" #define NDIS_HASH_KEYSIZE_TOEPLITZ 40 #define NDIS_HASH_INDCNT 128 From owner-svn-src-all@freebsd.org Fri Oct 13 05:14:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4B7EE3D3A8; Fri, 13 Oct 2017 05:14:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A14C774237; Fri, 13 Oct 2017 05:14:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D5Es9T099013; Fri, 13 Oct 2017 05:14:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D5Esn1099012; Fri, 13 Oct 2017 05:14:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710130514.v9D5Esn1099012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 13 Oct 2017 05:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324579 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 05:14:55 -0000 Author: sephe Date: Fri Oct 13 05:14:54 2017 New Revision: 324579 URL: https://svnweb.freebsd.org/changeset/base/324579 Log: MFC 324517 hyperv/hn: Enable transparent VF by default. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 05:09:56 2017 (r324578) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Fri Oct 13 05:14:54 2017 (r324579) @@ -584,7 +584,7 @@ SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLT 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); /* Transparent VF */ -static int hn_xpnt_vf = 0; +static int hn_xpnt_vf = 1; SYSCTL_INT(_hw_hn, OID_AUTO, vf_transparent, CTLFLAG_RDTUN, &hn_xpnt_vf, 0, "Transparent VF mod"); From owner-svn-src-all@freebsd.org Fri Oct 13 06:45:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B5FE3E986; Fri, 13 Oct 2017 06:45:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C759976107; Fri, 13 Oct 2017 06:45:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id k4so18896769wmc.1; Thu, 12 Oct 2017 23:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LkFOsrHRWcFPKf+urX4HANpxEusyo47Vy3x7sa4GzK0=; b=NHmqBKg+mcGkclG36WVbvTNN/iNOiHCP5/dFjWC0x4xyyT9sD/zXNPUEm6n/1EKTaN dahUw7BU2vdMdge1PSrldbeBR3St9KF3A05DDmmjttoQ+5Hw0Eomc5KWWPq6JZYVwJme GR2Yc/QcnuZjXaj365mT1ngI9TaUOPKKojJ+5Tuy43aEqZEP3OCa4t+EFFTHkIO9GfbH 8xeP8b585kGQpHCVvV1bNJSm7SjWIea+SBXVW1BCaDxsI86lM8y7D0CfBOXjpkWZHxOt LBxIII8dzT8XexCmMeAGVkb+F6GvZ7OeV676DRX2zlt1YWztgVY5biQ4d5FnFLVbhvly gSGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LkFOsrHRWcFPKf+urX4HANpxEusyo47Vy3x7sa4GzK0=; b=tJjZPLXZDcUYRFYlsZqwiLXS3k4x/4w5e8mgYLsrgcrkYmlfkVnbGWcBpPHfGVJdmw oGS/6bX0IbOEwlRdSUNa67ijP1yR3RqtxUBu2YB6ZvhZf83VwZyKWFmlSVZ8BNpMNFqs P+vkCyAFJhH9KK9jgNj08/DLOG2Qj+SGWieoXXuffEHPSNyyWbrHmWR+E1GeNjkdsppL yUnttgumhYIJyxLLF6mpPpI6HFqEV156ya2R6schEs/S+nXS7dWTAuvcBnnzr9Sia6J2 Rxp4HQiTB0lgwJ+yc0Vm+5QKoOmbfESy+UF9ouiJphKgORkKPq0hf09iADsW9ifhALKh p8Pw== X-Gm-Message-State: AMCzsaVBoPF6v63DTy4kjt0qAzREXzDIS/kW/BwRdaxR8BlPiTu08Bm3 h2A68syccTZVH7zlBG3U+RxiGsPgvMIcltC4/NeewA== X-Google-Smtp-Source: AOwi7QC7Xx3swapV3Va7lYtGm9TMwKiFY9/IgUkbQaBTu63am3uasbq+kyXNW53XGXfEcBRgMEnTzs+G97ILTpLZBrU= X-Received: by 10.223.138.231 with SMTP id z36mr456520wrz.154.1507877136237; Thu, 12 Oct 2017 23:45:36 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.86.70 with HTTP; Thu, 12 Oct 2017 23:45:35 -0700 (PDT) In-Reply-To: <201710130153.v9D1rahI002918@slippy.cwsent.com> References: <201710122156.v9CLuwH4017132@repo.freebsd.org> <201710130153.v9D1rahI002918@slippy.cwsent.com> From: Adrian Chadd Date: Thu, 12 Oct 2017 23:45:35 -0700 X-Google-Sender-Auth: 9vsK9DtVncoQM-i96_olem1Uc6w Message-ID: Subject: Re: svn commit: r324570 - head/sys/net80211 To: Cy Schubert Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 06:45:38 -0000 god damnit. lemme go look at what's going on. thanks for the heads up! -a On 12 October 2017 at 18:53, Cy Schubert wrote: > In message <201710122156.v9CLuwH4017132@repo.freebsd.org>, Adrian Chadd > writes: >> Author: adrian >> Date: Thu Oct 12 21:56:58 2017 >> New Revision: 324570 >> URL: https://svnweb.freebsd.org/changeset/base/324570 >> >> Log: >> [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. >> >> The duplicate detection code currently expects A-MSDU frames to be encaped >> - >> they're decap'ed /after/ duplicate detection. >> >> However for ath10k (and iwm hardware later on) the firmware supports >> doing A-MSDU decap in hardware - which shows up as multiple frames with >> the same sequence number and IV. >> >> This is the first part of decap handling - if we see a stretch of A-MSDU >> frames from the driver with the MORE bit set, then don't treat them >> as duplicates. >> >> This isn't 100% complete as crypto sequence number handling and "A-MSDU in >> A-MPDU" needs handling, but it's a start. >> >> This should be a glorified no-op for everyone. Please tell me if it isn't. >> > > Hi Adrian, > > This is causing iwn in my laptop a bit of gas. > > wlan0: Ethernet address: 20:6a:8a:72:03:17 > <118>Created wlan(4) interfaces: wlan0. > <118>Created clone interfaces: lagg0. > <5>bge0: link state changed to DOWN > iwn0: iwn_read_firmware: ucode rev=0x12a80601 > <118>Starting wpa_supplicant. > <5>lagg0: link state changed to DOWN > iwn0: iwn_read_firmware: ucode rev=0x12a80601 > <118>Starting dhclient. > <118>lagg0: no link ... > > > Fatal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0x4 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff8155cd59 > stack pointer = 0x28:0xfffffe01491e4790 > frame pointer = 0x28:0xfffffe01491e4830 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 12 (irq265: iwn0) > trap number = 12 > panic: page fault > cpuid = 0 > time = 1507858438 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe01491e4370 > vpanic() at vpanic+0x19c/frame 0xfffffe01491e43f0 > panic() at panic+0x43/frame 0xfffffe01491e4450 > trap_fatal() at trap_fatal+0x34d/frame 0xfffffe01491e44a0 > trap_pfault() at trap_pfault+0x49/frame 0xfffffe01491e4500 > trap() at trap+0x2a9/frame 0xfffffe01491e46c0 > calltrap() at calltrap+0x8/frame 0xfffffe01491e46c0 > --- trap 0xc, rip = 0xffffffff8155cd59, rsp = 0xfffffe01491e4790, rbp = > 0xfffffe01491e4830 --- > sta_input() at sta_input+0xb89/frame 0xfffffe01491e4830 > iwn_notif_intr() at iwn_notif_intr+0x15f7/frame 0xfffffe01491e4970 > iwn_intr() at iwn_intr+0x5a0/frame 0xfffffe01491e49e0 > intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame > 0xfffffe01491e4a20 > ithread_loop() at ithread_loop+0xd6/frame 0xfffffe01491e4a70 > fork_exit() at fork_exit+0x85/frame 0xfffffe01491e4ab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01491e4ab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Uptime: 29s > Dumping 704 out of 7978 MB:..3%..12%..21%..32%..41%..53%..62%..71%..82%..91% > > > Loaded symbols for /boot/kernel/nullfs.ko > #0 doadump (textdump=1) at pcpu.h:232 > 232 pcpu.h: No such file or directory. > in pcpu.h > (kgdb) bt > #0 doadump (textdump=1) at pcpu.h:232 > #1 0xffffffff80583eb6 in kern_reboot (howto=260) at > /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff805843a6 in vpanic (fmt=, ap= optimized out>) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff805841c3 in panic (fmt=) at > /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff80886a8d in trap_fatal (frame=0xfffffe01491e46d0, eva=4) at > /opt/src/svn-current/sys/amd64/amd64/trap.c:799 > #5 0xffffffff80886ae9 in trap_pfault (frame=0xfffffe01491e46d0, > usermode=0) at pcpu.h:232 > #6 0xffffffff80886339 in trap (frame=0xfffffe01491e46d0) at > /opt/src/svn-current/sys/amd64/amd64/trap.c:420 > #7 0xffffffff8086acf1 in calltrap () at /opt/src/svn-current/sys/amd64/amd6 > 4/exception.S:237 > #8 0xffffffff8155cd59 in sta_input (ni=0xfffffe0012651000, > m=0xfffff80004040e00, rxs=0x0, rssi=63, nf=-95) at ieee80211_input.h:280 > #9 0xffffffff81513987 in iwn_notif_intr () from /boot/kernel/if_iwn.ko > #10 0xffffffff8150a270 in iwn_intr () from /boot/kernel/if_iwn.ko > #11 0xffffffff80548dcc in intr_event_execute_handlers (p= out>, ie=0xfffff80002b06800) at /opt/src/svn-current/sys/kern/kern_intr.c:13 > 36 > #12 0xffffffff80549496 in ithread_loop (arg=0xfffff80002b50c20) at > /opt/src/svn-current/sys/kern/kern_intr.c:1349 > #13 0xffffffff80546135 in fork_exit (callout=0xffffffff805493c0 > , arg=0xfffff80002b50c20, frame=0xfffffe01491e4ac0) at > /opt/src/svn-current/sys/kern/kern_fork.c:1044 > #14 0xffffffff8086b2de in fork_trampoline () at /opt/src/svn-current/sys/amd > 64/amd64/exception.S:651 > #15 0x0000000000000000 in ?? () > Current language: auto; currently minimal > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > > > From owner-svn-src-all@freebsd.org Fri Oct 13 06:49:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9F87E3EA80; Fri, 13 Oct 2017 06:49:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78BB07628E; Fri, 13 Oct 2017 06:49:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D6n7aP036283; Fri, 13 Oct 2017 06:49:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D6n7cI036282; Fri, 13 Oct 2017 06:49:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710130649.v9D6n7cI036282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Oct 2017 06:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324580 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 324580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 06:49:08 -0000 Author: adrian Date: Fri Oct 13 06:49:07 2017 New Revision: 324580 URL: https://svnweb.freebsd.org/changeset/base/324580 Log: [net80211] don't try to follow a NULL rxs pointer down the sink. It's smelly, and we already checked earlier whether we needed to. Modified: head/sys/net80211/ieee80211_input.h Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Fri Oct 13 05:14:54 2017 (r324579) +++ head/sys/net80211/ieee80211_input.h Fri Oct 13 06:49:07 2017 (r324580) @@ -278,7 +278,7 @@ ok: */ if (ieee80211_check_rxseq_amsdu_more(rxs)) { ni->ni_rxseqs[tid] = rxseq; - if (ieee80211_check_rxseq_amsdu(rxs)) + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); } else { /* .. still waiting */ From owner-svn-src-all@freebsd.org Fri Oct 13 07:13:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A2E5E3F39B; Fri, 13 Oct 2017 07:13:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 E6A6177410; Fri, 13 Oct 2017 07:13:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 C56CD260444; Fri, 13 Oct 2017 09:13:40 +0200 (CEST) Subject: Re: svn commit: r324580 - head/sys/net80211 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 13 Oct 2017 09:11:04 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710130649.v9D6n7cI036282@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:13:50 -0000 On 10/13/17 08:49, Adrian Chadd wrote: > if (ieee80211_check_rxseq_amsdu_more(rxs)) { ^^^ does this line also need a NULL check? > ni->ni_rxseqs[tid] = rxseq; > - if (ieee80211_check_rxseq_amsdu(rxs)) > + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) > IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); --HPS From owner-svn-src-all@freebsd.org Fri Oct 13 07:45:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C3EE3FA82; Fri, 13 Oct 2017 07:45:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAF587C0FF; Fri, 13 Oct 2017 07:45:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id q132so19257715wmd.2; Fri, 13 Oct 2017 00:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zn7+OzUVGR/0au3MSGLTP9Mls9+yX1oTJHpRWt5Rkaw=; b=rodULI+76OxMwFi1Xbk9ovnvShrsWsQoe5kq3k3F+E924fa/IAUtCceOAudTv0POxZ wHgP0EgtwqKRmLfl2qDQOJCf2ABXg/T4a9vW4cg8PogKTlMGWntdYEeakVN0V6y5jl2b C4exgKVkxxjBE+6E/omKcUzGiturJPWMWDv/Pk8C3P4T7v3edI/Ma57pSP/kXqpmn/Sx P2ALF85jtxu1EHlsPWChxjdsdZpBScBnX+AEGSqyKkgCQOdqTCPSPIqDGSH/Oer5diNk 2zx3LaNeggQiY39yDCNSLeueXc3zBXQyZGoXYx0a357njogJ6pnv0EE9OFvm30/cpvzr fQPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zn7+OzUVGR/0au3MSGLTP9Mls9+yX1oTJHpRWt5Rkaw=; b=Id4Wwtv0uuXo2Zca0G8Ly5rcO6XeP9IMvQaSKicQvPZ1edjytuySoDrU3T4XgdpR06 g0kGnEcNk5Yl/J0d2XUB604E/Hq1/VoVqQeMz23cDUS4onFj8GgQjLOSZ8MDDLrghiR8 iOhv0BAybnjqMxyvwA2GNGPWq9rjDSZSdH0nYNs/Uj/+FywZ7eplhKGITRyfezv9fVZc g+YW8eB41uAw9ZexzmNGeX4M4iOif5zJ5yIxxYnwEBAGrNSOwGIjyOEHptzijv9yTj1E Ct3t4WGBInB75/d3L8OCCm61M7mexJg9o7DV2U8MPjzV3kqqlfNT5ZeiX4NUTlXC73jV Hl+Q== X-Gm-Message-State: AMCzsaXu4t7U6JbrnMqpbKezsfsNdmbsMB+LiAVwF2w7cUTiDVhrdiPA sKa2pt0Z5UwmDOQKvUDgyfxd0NaRhLXHPrcqAX+Ylw== X-Google-Smtp-Source: AOwi7QCBox+IaU2uYQCatatZGdiULVMFdjpKGOeTJUncjdvKYjHUNF2ube3hT2EsR1arAvHOIHTbevarkfsdzVXC+MY= X-Received: by 10.223.157.141 with SMTP id p13mr606051wre.92.1507880724146; Fri, 13 Oct 2017 00:45:24 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.86.70 with HTTP; Fri, 13 Oct 2017 00:45:23 -0700 (PDT) In-Reply-To: References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Adrian Chadd Date: Fri, 13 Oct 2017 00:45:23 -0700 X-Google-Sender-Auth: DUnEJCUbfJCmB2sjE1jQyEnyId0 Message-ID: Subject: Re: svn commit: r324580 - head/sys/net80211 To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:45:26 -0000 no, it checks it. -a On 13 October 2017 at 00:11, Hans Petter Selasky wrote: > On 10/13/17 08:49, Adrian Chadd wrote: >> >> if (ieee80211_check_rxseq_amsdu_more(rxs)) { > > ^^^ does this line also need a NULL check? > > >> ni->ni_rxseqs[tid] = rxseq; >> - if (ieee80211_check_rxseq_amsdu(rxs)) >> + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) >> IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); > > > --HPS From owner-svn-src-all@freebsd.org Fri Oct 13 07:50:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5184BE3FCD3; Fri, 13 Oct 2017 07:50:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C4D17C2C7; Fri, 13 Oct 2017 07:50:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D7ojMP062052; Fri, 13 Oct 2017 07:50:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D7oitE062045; Fri, 13 Oct 2017 07:50:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710130750.v9D7oitE062045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Oct 2017 07:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324581 - stable/11/contrib/mdocml X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/contrib/mdocml X-SVN-Commit-Revision: 324581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:50:46 -0000 Author: bapt Date: Fri Oct 13 07:50:44 2017 New Revision: 324581 URL: https://svnweb.freebsd.org/changeset/base/324581 Log: MFC: r324362 Import mandoc 1.14.3 Modified: stable/11/contrib/mdocml/Makefile stable/11/contrib/mdocml/NEWS stable/11/contrib/mdocml/man_term.c stable/11/contrib/mdocml/mansearch.c stable/11/contrib/mdocml/mdoc_validate.c stable/11/contrib/mdocml/tbl_html.c stable/11/contrib/mdocml/tbl_term.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/mdocml/Makefile ============================================================================== --- stable/11/contrib/mdocml/Makefile Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/Makefile Fri Oct 13 07:50:44 2017 (r324581) @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.14.2 +VERSION = 1.14.3 # === LIST OF FILES ==================================================== Modified: stable/11/contrib/mdocml/NEWS ============================================================================== --- stable/11/contrib/mdocml/NEWS Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/NEWS Fri Oct 13 07:50:44 2017 (r324581) @@ -2,6 +2,21 @@ $Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ This file lists the most important changes in the mandoc.bsd.lv distribution. +Changes in version 1.14.3, released on August 5, 2017 + + --- BUG FIXES --- + * man(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line immediately precedes .SS or .SH. + * mdoc(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line precede the first .Sh macro. + * tbl(7): Ignore explicitly specified negative column widths rather than + wrapping around to huge numbers and risking memory exhaustion. + * man(1): No longer use names that only occur in the SYNOPSIS section. + Gets rid of some surprising behaviour and bogus warnings. + --- THANKS TO --- + Leah Neukirchen (Void Linux), Markus Waldeck (Debian), + Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports. + Changes in version 1.14.2, released on July 28, 2017 --- MAJOR NEW FEATURES --- Modified: stable/11/contrib/mdocml/man_term.c ============================================================================== --- stable/11/contrib/mdocml/man_term.c Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/man_term.c Fri Oct 13 07:50:44 2017 (r324581) @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */ +/* $Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -673,7 +673,7 @@ pre_SS(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) break; @@ -735,7 +735,7 @@ pre_SH(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) break; Modified: stable/11/contrib/mdocml/mansearch.c ============================================================================== --- stable/11/contrib/mdocml/mansearch.c Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/mansearch.c Fri Oct 13 07:50:44 2017 (r324581) @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013-2017 Ingo Schwarze @@ -171,7 +171,9 @@ mansearch(const struct mansearch *search, page = dbm_page_get(rp->page); if (lstmatch(search->sec, page->sect) == 0 || - lstmatch(search->arch, page->arch) == 0) + lstmatch(search->arch, page->arch) == 0 || + (search->argmode == ARG_NAME && + rp->bits <= (int32_t)(NAME_SYN & NAME_MASK))) continue; if (res == NULL) { @@ -452,14 +454,28 @@ lstlen(const char *cp, size_t sep) { size_t sz; - for (sz = 0;; sz++) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; - sz += sep - 1; - } else if (cp[0] < ' ') - sz--; - cp++; + for (sz = 0; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (sz) + sz += sep; + + /* Copy one string. */ + while (*cp != '\0') { + sz++; + cp++; + } } return sz; } @@ -471,19 +487,34 @@ lstlen(const char *cp, size_t sep) static void lstcat(char *buf, size_t *i, const char *cp, const char *sep) { - const char *s; + const char *s; + size_t i_start; - for (;;) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; + for (i_start = *i; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (*i > i_start) { s = sep; while (*s != '\0') buf[(*i)++] = *s++; - } else if (cp[0] >= ' ') - buf[(*i)++] = cp[0]; - cp++; + } + + /* Copy one string. */ + while (*cp != '\0') + buf[(*i)++] = *cp++; } + } /* Modified: stable/11/contrib/mdocml/mdoc_validate.c ============================================================================== --- stable/11/contrib/mdocml/mdoc_validate.c Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/mdoc_validate.c Fri Oct 13 07:50:44 2017 (r324581) @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.350 2017/07/20 12:54:02 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.352 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -1137,8 +1137,6 @@ post_fname(POST_ARGS) if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*'))) mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse, n->line, n->pos + pos, n->string); - if (n->sec == SEC_SYNOPSIS && mdoc->meta.msec != NULL) - mandoc_xr_add(mdoc->meta.msec, n->string, -1, -1); } static void @@ -1205,9 +1203,8 @@ post_nm(POST_ARGS) n = mdoc->last; - if ((n->sec == SEC_NAME || n->sec == SEC_SYNOPSIS) && - n->child != NULL && n->child->type == ROFFT_TEXT && - mdoc->meta.msec != NULL) + if (n->sec == SEC_NAME && n->child != NULL && + n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); if (n->last != NULL && @@ -1931,7 +1928,7 @@ post_root(POST_ARGS) /* Check that we begin with a proper `Sh'. */ n = mdoc->first->child; - while (n != NULL && n->tok != TOKEN_NONE && + while (n != NULL && n->tok >= MDOC_Dd && mdoc_macros[n->tok].flags & MDOC_PROLOGUE) n = n->next; Modified: stable/11/contrib/mdocml/tbl_html.c ============================================================================== --- stable/11/contrib/mdocml/tbl_html.c Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/tbl_html.c Fri Oct 13 07:50:44 2017 (r324581) @@ -1,4 +1,4 @@ -/* $Id: tbl_html.c,v 1.22 2017/06/12 20:14:18 schwarze Exp $ */ +/* $Id: tbl_html.c,v 1.23 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze @@ -49,6 +49,9 @@ html_tbl_strlen(const char *p, void *arg) static size_t html_tbl_sulen(const struct roffsu *su, void *arg) { + if (su->scale < 0.0) + return 0; + switch (su->unit) { case SCALE_FS: /* 2^16 basic units */ return su->scale * 65536.0 / 24.0; Modified: stable/11/contrib/mdocml/tbl_term.c ============================================================================== --- stable/11/contrib/mdocml/tbl_term.c Fri Oct 13 06:49:07 2017 (r324580) +++ stable/11/contrib/mdocml/tbl_term.c Fri Oct 13 07:50:44 2017 (r324581) @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.56 2017/07/08 13:43:15 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.57 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze @@ -51,7 +51,10 @@ static void tbl_word(struct termp *, const struct tbl_ static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { - return term_hen((const struct termp *)arg, su); + int i; + + i = term_hen((const struct termp *)arg, su); + return i > 0 ? i : 0; } static size_t From owner-svn-src-all@freebsd.org Fri Oct 13 07:51:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28D07E3FE28; Fri, 13 Oct 2017 07:51:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 D386D7C4FC; Fri, 13 Oct 2017 07:51:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 AFBE5260444; Fri, 13 Oct 2017 09:51:42 +0200 (CEST) Subject: Re: svn commit: r324580 - head/sys/net80211 To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 13 Oct 2017 09:49:06 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:51:45 -0000 On 10/13/17 09:45, Adrian Chadd wrote: > no, it checks it. > > > -a > > > On 13 October 2017 at 00:11, Hans Petter Selasky wrote: >> On 10/13/17 08:49, Adrian Chadd wrote: >>> >>> if (ieee80211_check_rxseq_amsdu_more(rxs)) { >> >> ^^^ does this line also need a NULL check? >> >> >>> ni->ni_rxseqs[tid] = rxseq; >>> - if (ieee80211_check_rxseq_amsdu(rxs)) >>> + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) >>> IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); >> >> >> --HPS > > Then why are you checking that pointer twice? Why not make ieee80211_check_rxseq_amsdu_more() return false, if rxs is NULL? --HPS From owner-svn-src-all@freebsd.org Fri Oct 13 09:05:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA64E41F8B; Fri, 13 Oct 2017 09:05:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A2787EF30; Fri, 13 Oct 2017 09:05:20 +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 v9D95Kx7096670; Fri, 13 Oct 2017 09:05:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D95KUs096669; Fri, 13 Oct 2017 09:05:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130905.v9D95KUs096669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324582 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:05:21 -0000 Author: avg Date: Fri Oct 13 09:05:20 2017 New Revision: 324582 URL: https://svnweb.freebsd.org/changeset/base/324582 Log: MFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 07:50:44 2017 (r324581) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:05:20 2017 (r324582) @@ -20,6 +20,7 @@ */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov @@ -872,7 +873,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co /* make sure libshare initialized */ if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, + return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } From owner-svn-src-all@freebsd.org Fri Oct 13 09:05:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389E5E41FCC; Fri, 13 Oct 2017 09:05:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049B37EFE4; Fri, 13 Oct 2017 09:05:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D95XeC096728; Fri, 13 Oct 2017 09:05:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D95XTE096727; Fri, 13 Oct 2017 09:05:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130905.v9D95XTE096727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324583 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:05:34 -0000 Author: avg Date: Fri Oct 13 09:05:32 2017 New Revision: 324583 URL: https://svnweb.freebsd.org/changeset/base/324583 Log: MFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:05:20 2017 (r324582) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:05:32 2017 (r324583) @@ -20,6 +20,7 @@ */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov @@ -872,7 +873,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co /* make sure libshare initialized */ if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, + return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } From owner-svn-src-all@freebsd.org Fri Oct 13 09:06:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6903E42106; Fri, 13 Oct 2017 09:06:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B35FE7F379; Fri, 13 Oct 2017 09:06:58 +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 v9D96v80097139; Fri, 13 Oct 2017 09:06:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D96vKh097138; Fri, 13 Oct 2017 09:06:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130906.v9D96vKh097138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324584 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:06:59 -0000 Author: avg Date: Fri Oct 13 09:06:57 2017 New Revision: 324584 URL: https://svnweb.freebsd.org/changeset/base/324584 Log: MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:05:32 2017 (r324583) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:06:57 2017 (r324584) @@ -24,6 +24,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov + * Copyright 2017 RackTop Systems. */ /* @@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, c zfs_share_proto_t); /* - * The share protocols table must be in the same order as the zfs_share_prot_t + * The share protocols table must be in the same order as the zfs_share_proto_t * enum in libzfs_impl.h */ typedef struct { @@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co /* make sure libshare initialized */ if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } @@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co if (share != NULL) { err = zfs_sa_disable_share(share, proto_table[proto].p_name); if (err != SA_OK) { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, + proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } } else { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"), name)); } From owner-svn-src-all@freebsd.org Fri Oct 13 09:07:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 962A5E421BF; Fri, 13 Oct 2017 09:07:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62E4E7F4DC; Fri, 13 Oct 2017 09:07:59 +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 v9D97wpk097243; Fri, 13 Oct 2017 09:07:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D97wkh097242; Fri, 13 Oct 2017 09:07:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130907.v9D97wkh097242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324585 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:07:59 -0000 Author: avg Date: Fri Oct 13 09:07:58 2017 New Revision: 324585 URL: https://svnweb.freebsd.org/changeset/base/324585 Log: MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:06:57 2017 (r324584) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:07:58 2017 (r324585) @@ -24,6 +24,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov + * Copyright 2017 RackTop Systems. */ /* @@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, c zfs_share_proto_t); /* - * The share protocols table must be in the same order as the zfs_share_prot_t + * The share protocols table must be in the same order as the zfs_share_proto_t * enum in libzfs_impl.h */ typedef struct { @@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co /* make sure libshare initialized */ if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } @@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co if (share != NULL) { err = zfs_sa_disable_share(share, proto_table[proto].p_name); if (err != SA_OK) { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, + proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } } else { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"), name)); } From owner-svn-src-all@freebsd.org Fri Oct 13 09:10:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DBF0E422BA; Fri, 13 Oct 2017 09:10:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094537F687; Fri, 13 Oct 2017 09:10:38 +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 v9D9Ac3S097418; Fri, 13 Oct 2017 09:10:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9AcG2097417; Fri, 13 Oct 2017 09:10:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130910.v9D9AcG2097417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324586 - stable/11/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 324586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:10:39 -0000 Author: avg Date: Fri Oct 13 09:10:37 2017 New Revision: 324586 URL: https://svnweb.freebsd.org/changeset/base/324586 Log: MFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global panicstr Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 13 09:07:58 2017 (r324585) +++ stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 13 09:10:37 2017 (r324586) @@ -735,11 +735,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n" void vpanic(const char *fmt, va_list adx) { - (void) fprintf(stderr, "error: "); - (void) vfprintf(stderr, fmt, adx); - (void) fprintf(stderr, "\n"); - - abort(); /* think of it as a "user-level crash dump" */ + char buf[512]; + (void) vsnprintf(buf, 512, fmt, adx); + assfail(buf, NULL, 0); } void From owner-svn-src-all@freebsd.org Fri Oct 13 09:11:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26A8E42341; Fri, 13 Oct 2017 09:11:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4B57F857; Fri, 13 Oct 2017 09:11:25 +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 v9D9BOEB099863; Fri, 13 Oct 2017 09:11:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9BOmr099862; Fri, 13 Oct 2017 09:11:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130911.v9D9BOmr099862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324587 - stable/10/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 324587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:11:25 -0000 Author: avg Date: Fri Oct 13 09:11:24 2017 New Revision: 324587 URL: https://svnweb.freebsd.org/changeset/base/324587 Log: MFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global panicstr Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 13 09:10:37 2017 (r324586) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 13 09:11:24 2017 (r324587) @@ -727,11 +727,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n" void vpanic(const char *fmt, va_list adx) { - (void) fprintf(stderr, "error: "); - (void) vfprintf(stderr, fmt, adx); - (void) fprintf(stderr, "\n"); - - abort(); /* think of it as a "user-level crash dump" */ + char buf[512]; + (void) vsnprintf(buf, 512, fmt, adx); + assfail(buf, NULL, 0); } void From owner-svn-src-all@freebsd.org Fri Oct 13 09:13:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB500E42541; Fri, 13 Oct 2017 09:13:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B96787FBAE; Fri, 13 Oct 2017 09:13:09 +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 v9D9D8JW001649; Fri, 13 Oct 2017 09:13:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9D8qQ001647; Fri, 13 Oct 2017 09:13:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130913.v9D9D8qQ001647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324588 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/geom/mirror X-SVN-Commit-Revision: 324588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:13:10 -0000 Author: avg Date: Fri Oct 13 09:13:08 2017 New Revision: 324588 URL: https://svnweb.freebsd.org/changeset/base/324588 Log: MFC r323612: gmirror: treat ENXIO as disk disconnect, not media error Modified: stable/11/sys/geom/mirror/g_mirror.c stable/11/sys/geom/mirror/g_mirror.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Fri Oct 13 09:11:24 2017 (r324587) +++ stable/11/sys/geom/mirror/g_mirror.c Fri Oct 13 09:13:08 2017 (r324588) @@ -982,7 +982,13 @@ g_mirror_regular_request(struct bio *bp) if (g_mirror_disconnect_on_failure && g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1) { - sc->sc_bump_id |= G_MIRROR_BUMP_GENID; + if (bp->bio_error == ENXIO && + bp->bio_cmd == BIO_READ) + sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID; + else if (bp->bio_error == ENXIO) + sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID_NOW; + else + sc->sc_bump_id |= G_MIRROR_BUMP_GENID; g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DISCONNECTED, G_MIRROR_EVENT_DONTWAIT); @@ -2505,6 +2511,10 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) { sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID; g_mirror_bump_genid(sc); + } + if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID_NOW) != 0) { + sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID_NOW; + g_mirror_bump_syncid(sc); } break; default: Modified: stable/11/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.h Fri Oct 13 09:11:24 2017 (r324587) +++ stable/11/sys/geom/mirror/g_mirror.h Fri Oct 13 09:13:08 2017 (r324588) @@ -169,9 +169,11 @@ struct g_mirror_event { #define G_MIRROR_TYPE_AUTOMATIC 1 /* Bump syncid on first write. */ -#define G_MIRROR_BUMP_SYNCID 0x1 +#define G_MIRROR_BUMP_SYNCID 0x1 /* Bump genid immediately. */ -#define G_MIRROR_BUMP_GENID 0x2 +#define G_MIRROR_BUMP_GENID 0x2 +/* Bump syncid immediately. */ +#define G_MIRROR_BUMP_SYNCID_NOW 0x4 struct g_mirror_softc { u_int sc_type; /* Device type (manual/automatic). */ u_int sc_state; /* Device state. */ From owner-svn-src-all@freebsd.org Fri Oct 13 09:14:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7750EE425C8; Fri, 13 Oct 2017 09:14:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44B8E7FCEF; Fri, 13 Oct 2017 09:14:06 +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 v9D9E5jh001746; Fri, 13 Oct 2017 09:14:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9E5YZ001744; Fri, 13 Oct 2017 09:14:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130914.v9D9E5YZ001744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324589 - stable/10/sys/geom/mirror X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/geom/mirror X-SVN-Commit-Revision: 324589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:14:06 -0000 Author: avg Date: Fri Oct 13 09:14:05 2017 New Revision: 324589 URL: https://svnweb.freebsd.org/changeset/base/324589 Log: MFC r323612: gmirror: treat ENXIO as disk disconnect, not media error Modified: stable/10/sys/geom/mirror/g_mirror.c stable/10/sys/geom/mirror/g_mirror.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Fri Oct 13 09:13:08 2017 (r324588) +++ stable/10/sys/geom/mirror/g_mirror.c Fri Oct 13 09:14:05 2017 (r324589) @@ -975,7 +975,13 @@ g_mirror_regular_request(struct bio *bp) if (g_mirror_disconnect_on_failure && g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1) { - sc->sc_bump_id |= G_MIRROR_BUMP_GENID; + if (bp->bio_error == ENXIO && + bp->bio_cmd == BIO_READ) + sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID; + else if (bp->bio_error == ENXIO) + sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID_NOW; + else + sc->sc_bump_id |= G_MIRROR_BUMP_GENID; g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DISCONNECTED, G_MIRROR_EVENT_DONTWAIT); @@ -2479,6 +2485,10 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) { sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID; g_mirror_bump_genid(sc); + } + if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID_NOW) != 0) { + sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID_NOW; + g_mirror_bump_syncid(sc); } break; default: Modified: stable/10/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.h Fri Oct 13 09:13:08 2017 (r324588) +++ stable/10/sys/geom/mirror/g_mirror.h Fri Oct 13 09:14:05 2017 (r324589) @@ -166,9 +166,11 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_STATE_RUNNING 1 /* Bump syncid on first write. */ -#define G_MIRROR_BUMP_SYNCID 0x1 +#define G_MIRROR_BUMP_SYNCID 0x1 /* Bump genid immediately. */ -#define G_MIRROR_BUMP_GENID 0x2 +#define G_MIRROR_BUMP_GENID 0x2 +/* Bump syncid immediately. */ +#define G_MIRROR_BUMP_SYNCID_NOW 0x4 struct g_mirror_softc { u_int sc_state; /* Device state. */ uint32_t sc_slice; /* Slice size. */ From owner-svn-src-all@freebsd.org Fri Oct 13 09:21:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA093E42A38; Fri, 13 Oct 2017 09:21:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A471C807EB; Fri, 13 Oct 2017 09:21:42 +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 v9D9LfP9003052; Fri, 13 Oct 2017 09:21:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9Lf7d003050; Fri, 13 Oct 2017 09:21:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130921.v9D9Lf7d003050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324590 - head/usr.sbin/i2c X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/usr.sbin/i2c X-SVN-Commit-Revision: 324590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:21:42 -0000 Author: avg Date: Fri Oct 13 09:21:41 2017 New Revision: 324590 URL: https://svnweb.freebsd.org/changeset/base/324590 Log: i2c(8): clean up and clarify read operation The code went to a lot of trouble to issue either a start+stop condition or a repeated start condition only to follow it with a stop condition and a read(2) call that issues a new start condition. So, fix the read in I2C_MODE_REPEATED_START mode by using I2CREAD ioctl within the running transaction. This obviously requires that the slave address has the read bit set which was not required before. Another problem was with width parameter of zero and I2C_MODE_REPEATED_START mode. In that case we issued a repeated start without any preceding start. While here, remove the redundant (unused) argument to I2CSTOP throughout the program. Also, clarify the meaning of -w option, especially "-w 0", in the manual page. Reviewed by: no one Differential Revision: https://reviews.freebsd.org/D12331 Modified: head/usr.sbin/i2c/i2c.8 head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:14:05 2017 (r324589) +++ head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:21:41 2017 (r324590) @@ -83,6 +83,10 @@ using selected addresses 'a:b:c'. This option is avail used. .It Fl o Ar offset offset within the device for data transfer (hex). +The default is zero. +Use +.Dq -w 0 +to disable writing of the offset to the slave. .It Fl r reset the controller. .It Fl s @@ -91,6 +95,12 @@ scan the bus for devices. be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). +This is used to determine how to pass +.Ar offset +specified with +.Fl o +to the slave. +Zero means that the offset is ignored and not passed to the slave at all. .El .Sh WARNINGS Great care must be taken when manipulating slave I2C devices with the Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri Oct 13 09:14:05 2017 (r324589) +++ head/usr.sbin/i2c/i2c.c Fri Oct 13 09:21:41 2017 (r324590) @@ -212,15 +212,14 @@ start_over: use_read_xfer = 1; goto start_over; } - cmd.slave = i << 1; - cmd.last = 1; - ioctl(fd, I2CSTOP, &cmd); + ioctl(fd, I2CSTOP); } if (error == 0) { ++num_found; printf("%02x ", i); } } + /* * If we found nothing, maybe START is not supported and returns a * generic error code such as EIO or ENXIO, so try again using reads. @@ -355,7 +354,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c } } - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "ioctl: error sending stop condition"; goto err2; @@ -439,8 +438,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c } break; } - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "ioctl: error sending stop condition"; goto err2; @@ -450,8 +448,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c return (0); err1: - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) fprintf(stderr, "error sending stop condition\n"); err2: @@ -466,7 +463,7 @@ static int i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) { struct iiccmd cmd; - int i, fd, error, bufsize; + int fd, error, bufsize; char *err_msg, data = 0, *buf; fd = open(dev, O_RDWR); @@ -503,23 +500,22 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_ } if (i2c_opt.mode == I2C_MODE_STOP_START) { - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "error sending stop condition"; goto err2; } } } - cmd.slave = i2c_opt.addr; + cmd.slave = i2c_opt.addr | 1; cmd.count = 1; cmd.last = 0; cmd.buf = &data; - if (i2c_opt.mode == I2C_MODE_STOP_START) { + if (i2c_opt.mode == I2C_MODE_STOP_START || i2c_opt.width == 0) { error = ioctl(fd, I2CSTART, &cmd); if (error == -1) { err_msg = "ioctl: error sending start condition"; - goto err1; + goto err2; } } else if (i2c_opt.mode == I2C_MODE_REPEATED_START) { error = ioctl(fd, I2CRPTSTART, &cmd); @@ -529,26 +525,27 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_ goto err1; } } - error = ioctl(fd, I2CSTOP, &cmd); + + cmd.count = i2c_opt.count; + cmd.buf = i2c_buf; + cmd.last = 1; + error = ioctl(fd, I2CREAD, &cmd); if (error == -1) { - err_msg = "error sending stop condition"; - goto err2; + err_msg = "ioctl: error while reading"; + goto err1; } - for (i = 0; i < i2c_opt.count; i++) { - error = read(fd, &i2c_buf[i], 1); - if (error == -1) { - err_msg = "ioctl: error while reading"; - goto err1; - } + error = ioctl(fd, I2CSTOP); + if (error == -1) { + err_msg = "error sending stop condtion\n"; + goto err2; } close(fd); return (0); err1: - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) fprintf(stderr, "error sending stop condition\n"); err2: From owner-svn-src-all@freebsd.org Fri Oct 13 09:42:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6157E42F20; Fri, 13 Oct 2017 09:42:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 922D780F7B; Fri, 13 Oct 2017 09:42:06 +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 v9D9g5D6014352; Fri, 13 Oct 2017 09:42:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9g5oS014351; Fri, 13 Oct 2017 09:42:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130942.v9D9g5oS014351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324591 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:42:06 -0000 Author: avg Date: Fri Oct 13 09:42:05 2017 New Revision: 324591 URL: https://svnweb.freebsd.org/changeset/base/324591 Log: remove process and jail directory machinations from dounmount The manipulations done by mountcheckdirs() are not that useful during the unmount, they can bring about unexpected security consequences. Thic change effectively reverts the change in r73241. The change also allows to simplify the handling of rootvnode global variable. Discussed with: mckusick, mjg, kib Reviewed by: trasz MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12366 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Oct 13 09:21:41 2017 (r324590) +++ head/sys/kern/vfs_mount.c Fri Oct 13 09:42:05 2017 (r324591) @@ -1262,7 +1262,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove int dounmount(struct mount *mp, int flags, struct thread *td) { - struct vnode *coveredvp, *fsrootvp; + struct vnode *coveredvp; int error; uint64_t async_flag; int mnt_gen_r; @@ -1364,22 +1364,6 @@ dounmount(struct mount *mp, int flags, struct thread * MNT_IUNLOCK(mp); cache_purgevfs(mp, false); /* remove cache entries for this file sys */ vfs_deallocate_syncvnode(mp); - /* - * For forced unmounts, move process cdir/rdir refs on the fs root - * vnode to the covered vnode. For non-forced unmounts we want - * such references to cause an EBUSY error. - */ - if ((flags & MNT_FORCE) && - VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL && - (mp->mnt_flag & MNT_IGNORE) == 0) - mountcheckdirs(fsrootvp, mp->mnt_vnodecovered); - if (fsrootvp == rootvnode) { - vrele(rootvnode); - rootvnode = NULL; - } - vput(fsrootvp); - } if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 || (error = VFS_SYNC(mp, MNT_WAIT)) == 0) error = VFS_UNMOUNT(mp, flags); @@ -1391,17 +1375,6 @@ dounmount(struct mount *mp, int flags, struct thread * * it doesn't exist anymore. */ if (error && error != ENXIO) { - if ((flags & MNT_FORCE) && - VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL && - (mp->mnt_flag & MNT_IGNORE) == 0) - mountcheckdirs(mp->mnt_vnodecovered, fsrootvp); - if (rootvnode == NULL) { - rootvnode = fsrootvp; - vref(rootvnode); - } - vput(fsrootvp); - } MNT_ILOCK(mp); mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ; if ((mp->mnt_flag & MNT_RDONLY) == 0) { @@ -1432,6 +1405,10 @@ dounmount(struct mount *mp, int flags, struct thread * VOP_UNLOCK(coveredvp, 0); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); + if (rootvnode != NULL && mp == rootvnode->v_mount) { + vrele(rootvnode); + rootvnode = NULL; + } if (mp == rootdevmp) rootdevmp = NULL; vfs_mount_destroy(mp); From owner-svn-src-all@freebsd.org Fri Oct 13 11:01:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 444D6E447C1; Fri, 13 Oct 2017 11:01:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11B3383682; Fri, 13 Oct 2017 11:01:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DB1XaO047033; Fri, 13 Oct 2017 11:01:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DB1XGl047032; Fri, 13 Oct 2017 11:01:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201710131101.v9DB1XGl047032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Oct 2017 11:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324592 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 324592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 11:01:34 -0000 Author: ae Date: Fri Oct 13 11:01:33 2017 New Revision: 324592 URL: https://svnweb.freebsd.org/changeset/base/324592 Log: Return 'errno' value from the table_do_modify_record(), it is expected by table_modify_record(). This makes quiet operations with tables really quiet. PR: 222953 MFC after: 1 week Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Fri Oct 13 09:42:05 2017 (r324591) +++ head/sbin/ipfw/tables.c Fri Oct 13 11:01:33 2017 (r324592) @@ -885,6 +885,8 @@ table_do_modify_record(int cmd, ipfw_obj_header *oh, sz += sizeof(*oh); error = do_get3(cmd, &oh->opheader, &sz); + if (error != 0) + error = errno; tent = (ipfw_obj_tentry *)(ctlv + 1); /* Copy result back to provided buffer */ memcpy(tent_base, ctlv + 1, sizeof(*tent) * count); From owner-svn-src-all@freebsd.org Fri Oct 13 11:11:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30509E44B2A; Fri, 13 Oct 2017 11:11:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F1983E98; Fri, 13 Oct 2017 11:11:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DBBsb5051271; Fri, 13 Oct 2017 11:11:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DBBsPl051270; Fri, 13 Oct 2017 11:11:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201710131111.v9DBBsPl051270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Oct 2017 11:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324593 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 324593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 11:11:55 -0000 Author: ae Date: Fri Oct 13 11:11:53 2017 New Revision: 324593 URL: https://svnweb.freebsd.org/changeset/base/324593 Log: Fix regression in handling O_FORWARD_IP opcode after r279948. To properly handle 'fwd tablearg,port' opcode, copy sin_port value from sockaddr_in structure stored in the opcode into corresponding hopstore field. PR: 222953 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Oct 13 11:01:33 2017 (r324592) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Oct 13 11:11:53 2017 (r324593) @@ -2442,6 +2442,7 @@ do { \ sa6->sin6_len = sizeof(*sa6); sa6->sin6_addr = TARG_VAL( chain, tablearg, nh6); + sa6->sin6_port = sa->sin_port; /* * Set sin6_scope_id only for * link-local unicast addresses. @@ -2455,6 +2456,8 @@ do { \ } else #endif { + args->hopstore.sin_port = + sa->sin_port; sa = args->next_hop = &args->hopstore; sa->sin_family = AF_INET; From owner-svn-src-all@freebsd.org Fri Oct 13 13:47:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA5AE48B11; Fri, 13 Oct 2017 13:47:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C84164FA9; Fri, 13 Oct 2017 13:47:56 +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 v9DDltE8015909; Fri, 13 Oct 2017 13:47:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DDltxP015908; Fri, 13 Oct 2017 13:47:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131347.v9DDltxP015908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 13:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324594 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 324594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 13:47:56 -0000 Author: emaste Date: Fri Oct 13 13:47:55 2017 New Revision: 324594 URL: https://svnweb.freebsd.org/changeset/base/324594 Log: truss: mention 'H' in usage r295930 introduced the 'H' option to display thread IDs, but did not add the option to usage(). PR: 222837 Submitted by: Oliver Kiddle MFC after: 1 week Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Fri Oct 13 11:11:53 2017 (r324593) +++ head/usr.bin/truss/main.c Fri Oct 13 13:47:55 2017 (r324594) @@ -57,8 +57,8 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n", - "usage: truss [-cfaedDS] [-o file] [-s strsize] -p pid", - " truss [-cfaedDS] [-o file] [-s strsize] command [args]"); + "usage: truss [-cfaedDHS] [-o file] [-s strsize] -p pid", + " truss [-cfaedDHS] [-o file] [-s strsize] command [args]"); exit(1); } From owner-svn-src-all@freebsd.org Fri Oct 13 13:53:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7034E48DE8; Fri, 13 Oct 2017 13:53:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A49AE654A5; Fri, 13 Oct 2017 13:53:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DDrJjA019843; Fri, 13 Oct 2017 13:53:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DDrJgm019842; Fri, 13 Oct 2017 13:53:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131353.v9DDrJgm019842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 13:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324595 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 13:53:21 -0000 Author: emaste Date: Fri Oct 13 13:53:19 2017 New Revision: 324595 URL: https://svnweb.freebsd.org/changeset/base/324595 Log: ANSIfy vm_kern.c PR: 222673 Submitted by: ota@j.email.ne.jp MFC after: 1 week Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Oct 13 13:47:55 2017 (r324594) +++ head/sys/vm/vm_kern.c Fri Oct 13 13:53:19 2017 (r324595) @@ -122,8 +122,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA * a mapping on demand through vm_fault() will result in a panic. */ vm_offset_t -kva_alloc(size) - vm_size_t size; +kva_alloc(vm_size_t size) { vm_offset_t addr; @@ -144,9 +143,7 @@ kva_alloc(size) * This routine may not block on kernel maps. */ void -kva_free(addr, size) - vm_offset_t addr; - vm_size_t size; +kva_free(vm_offset_t addr, vm_size_t size) { size = round_page(size); @@ -433,9 +430,7 @@ kmem_free(struct vmem *vmem, vm_offset_t addr, vm_size * This routine may block. */ vm_offset_t -kmap_alloc_wait(map, size) - vm_map_t map; - vm_size_t size; +kmap_alloc_wait(vm_map_t map, vm_size_t size) { vm_offset_t addr; @@ -473,10 +468,7 @@ kmap_alloc_wait(map, size) * waiting for memory in that map. */ void -kmap_free_wakeup(map, addr, size) - vm_map_t map; - vm_offset_t addr; - vm_size_t size; +kmap_free_wakeup(vm_map_t map, vm_offset_t addr, vm_size_t size) { vm_map_lock(map); @@ -520,8 +512,7 @@ kmem_init_zero_region(void) * `start' as allocated, and the range between `start' and `end' as free. */ void -kmem_init(start, end) - vm_offset_t start, end; +kmem_init(vm_offset_t start, vm_offset_t end) { vm_map_t m; From owner-svn-src-all@freebsd.org Fri Oct 13 13:56:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E004E48EB2; Fri, 13 Oct 2017 13:56: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 mx1.freebsd.org (Postfix) with ESMTPS id 4C50C6567C; Fri, 13 Oct 2017 13:56: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 v9DDuiHP020048; Fri, 13 Oct 2017 13:56:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DDuiOP020046; Fri, 13 Oct 2017 13:56:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710131356.v9DDuiOP020046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Oct 2017 13:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324596 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 324596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 13:56:45 -0000 Author: markj Date: Fri Oct 13 13:56:44 2017 New Revision: 324596 URL: https://svnweb.freebsd.org/changeset/base/324596 Log: MFC r324373: Avoid adding an extra "0x" prefix before pointer formats. Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Fri Oct 13 13:53:19 2017 (r324595) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Fri Oct 13 13:56:44 2017 (r324596) @@ -434,7 +434,7 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp) ulong_t i = 0; char type[DT_TYPE_NAMELEN]; - (void) fprintf(fp, "\nDIFO 0x%p returns %s\n", (void *)dp, + (void) fprintf(fp, "\nDIFO %p returns %s\n", (void *)dp, dt_dis_typestr(&dp->dtdo_rtype, type, sizeof (type))); (void) fprintf(fp, "%-3s %-8s %s\n", Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Oct 13 13:53:19 2017 (r324595) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Oct 13 13:56:44 2017 (r324596) @@ -377,7 +377,7 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg ctf_id_t rtype; if (ctf_array_info(ctfp, base, &car) == CTF_ERR) { - (void) fprintf(fp, "0x%p", (void *)addr); + (void) fprintf(fp, "%p", (void *)addr); return; } From owner-svn-src-all@freebsd.org Fri Oct 13 14:14:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5DB0E494B4; Fri, 13 Oct 2017 14:14:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94CDA66326; Fri, 13 Oct 2017 14:14:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DEEkOU028015; Fri, 13 Oct 2017 14:14:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DEEk4p028014; Fri, 13 Oct 2017 14:14:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710131414.v9DEEk4p028014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 Oct 2017 14:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324597 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 324597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 14:14:47 -0000 Author: hselasky Date: Fri Oct 13 14:14:46 2017 New Revision: 324597 URL: https://svnweb.freebsd.org/changeset/base/324597 Log: Don't call selrecord() outside the select system call in the LinuxKPI, because then td->td_sel is NULL and this will result in a segfault inside selrecord(). This happens when only using kqueue() to poll for read and write events. If select() and kqueue() is mixed there won't be a segfault. Reported by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Oct 13 13:56:44 2017 (r324596) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Oct 13 14:14:46 2017 (r324597) @@ -1021,6 +1021,8 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int return (error); } +#define LINUX_POLL_TABLE_NORMAL ((poll_table *)1) + static int linux_dev_poll(struct cdev *dev, int events, struct thread *td) { @@ -1037,7 +1039,7 @@ linux_dev_poll(struct cdev *dev, int events, struct th filp->f_flags = file->f_flag; linux_set_current(td); if (filp->f_op->poll != NULL) - revents = filp->f_op->poll(filp, NULL) & events; + revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; else revents = 0; @@ -1094,7 +1096,9 @@ linux_poll_wait(struct linux_file *filp, wait_queue_he [LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_QUEUED, }; - selrecord(curthread, &filp->f_selinfo); + /* check if we are called inside the select system call */ + if (p == LINUX_POLL_TABLE_NORMAL) + selrecord(curthread, &filp->f_selinfo); switch (linux_poll_wakeup_state(&filp->f_wait_queue.state, state)) { case LINUX_FWQ_STATE_INIT: @@ -1438,10 +1442,9 @@ linux_file_poll(struct file *file, int events, struct filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll != NULL) { - selrecord(td, &filp->f_selinfo); - revents = filp->f_op->poll(filp, NULL) & events; - } else + if (filp->f_op->poll != NULL) + revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; + else revents = 0; return (revents); From owner-svn-src-all@freebsd.org Fri Oct 13 14:36:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEFB9E49C44; Fri, 13 Oct 2017 14:36:13 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 63F69673CB; Fri, 13 Oct 2017 14:36:12 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 314Le3T7LDJTW314NeZzv5; Fri, 13 Oct 2017 08:36:11 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qwL64G1b1rMNB4V27MIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 9D3A8109; Fri, 13 Oct 2017 07:36:09 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v9DEa9Je003290; Fri, 13 Oct 2017 07:36:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710131436.v9DEa9Je003290@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324580 - head/sys/net80211 In-Reply-To: Message from Adrian Chadd of "Fri, 13 Oct 2017 06:49:07 -0000." <201710130649.v9D6n7cI036282@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Oct 2017 07:36:09 -0700 X-CMAE-Envelope: MS4wfGkw6bqRHkBxsAhx6E4xrKgOTZdla7vS3Y7/a38JEfeCrYssCjDjoPi8M65XvZgrbljRhk4owz39R867a83a29X6RRQrV1Y3nqmGO4vuoMbQKnz+TasH /d58wvntz2izWw5bvTz+uW9XvZszQbhrVdWudQPn7d/xl4ES/SxqNOjtkz9njDRbxj8kv2Tog5Rq3BNKcERNW0IpJ79VxYv/qU1wwsgDwu4n9+HOZr0M9AyL SmFJyYr1xcvpGDUgiRGj67SHPiPiq/kB5zOIqvKo/smweBhzYKGdvqIGZn7gKu4A X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 14:36:13 -0000 In message <201710130649.v9D6n7cI036282@repo.freebsd.org>, Adrian Chadd writes: > Author: adrian > Date: Fri Oct 13 06:49:07 2017 > New Revision: 324580 > URL: https://svnweb.freebsd.org/changeset/base/324580 > > Log: > [net80211] don't try to follow a NULL rxs pointer down the sink. > > It's smelly, and we already checked earlier whether we needed to. > > Modified: > head/sys/net80211/ieee80211_input.h > > Modified: head/sys/net80211/ieee80211_input.h > ============================================================================= > = > --- head/sys/net80211/ieee80211_input.h Fri Oct 13 05:14:54 2017 > (r324579) > +++ head/sys/net80211/ieee80211_input.h Fri Oct 13 06:49:07 2017 > (r324580) > @@ -278,7 +278,7 @@ ok: > */ > if (ieee80211_check_rxseq_amsdu_more(rxs)) { > ni->ni_rxseqs[tid] = rxseq; > - if (ieee80211_check_rxseq_amsdu(rxs)) > + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) > IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); > } else { > /* .. still waiting */ > Thank you. This fixes it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Oct 13 15:02:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD17EE4A5E7; Fri, 13 Oct 2017 15:02:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995DB683B6; Fri, 13 Oct 2017 15:02:30 +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 v9DF2T7Z050516; Fri, 13 Oct 2017 15:02:29 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DF2TmN050513; Fri, 13 Oct 2017 15:02:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <201710131502.v9DF2TmN050513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Oct 2017 15:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324598 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 15:02:30 -0000 Author: br Date: Fri Oct 13 15:02:29 2017 New Revision: 324598 URL: https://svnweb.freebsd.org/changeset/base/324598 Log: o Support for Kabylake CPU PMCs (fall down to PMC_CPU_INTEL_SKYLAKE). o Fix bugs in events descriptions for Skylake, Skylake Xeon and Haswell. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12654 Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 15:02:29 2017 (r324598) @@ -720,8 +720,8 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), - IAPDESCR(0DH_01H, 0x0D, 0x80, IAP_F_FM | IAP_F_SLX), - IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | + IAPDESCR(0DH_01H, 0x0D, 0x01, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL | IAP_F_SLX), @@ -1142,7 +1142,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_BW | IAP_F_BWX ), IAPDESCR(63H_02H, 0x63, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX), + IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(64H, 0x64, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(64H_40H, 0x64, 0x40, IAP_F_FM | IAP_F_CC), @@ -1425,11 +1425,11 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_02H, 0xA6, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_04H, 0xA6, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_08H, 0xA6, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_10H, 0xA6, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_40H, 0xA6, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ), @@ -1446,7 +1446,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(ABH_02H, 0xAB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | - IAP_F_SLX), + IAP_F_SL | IAP_F_SLX), IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_SL), IAPDESCR(ACH_08H, 0xAC, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1486,7 +1486,8 @@ static struct iap_event_descr iap_events[] = { IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SLX), + IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | + IAP_F_SLX), IAPDESCR(B1H_1FH, 0xB1, 0x1F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_20H, 0xB1, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_3FH, 0xB1, 0x3F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1495,7 +1496,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_WM), IAPDESCR(B2H_01H, 0xB2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_SBX | IAP_F_SLX), + IAP_F_SB | IAP_F_SBX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B3H_01H, 0xB3, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_I7O), @@ -1656,7 +1657,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | - IAP_F_BWX | IAP_F_SLX), + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Oct 13 15:02:29 2017 (r324598) @@ -179,8 +179,12 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_IVYBRIDGE_XEON; nclasses = 3; break; + /* Skylake */ case 0x4e: case 0x5e: + /* Kabylake */ + case 0x8E: /* Per Intel document 325462-063US July 2017. */ + case 0x9E: /* Per Intel document 325462-063US July 2017. */ cputype = PMC_CPU_INTEL_SKYLAKE; nclasses = 3; break; Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/pmc_events.h Fri Oct 13 15:02:29 2017 (r324598) @@ -2030,7 +2030,7 @@ __PMC_EV_ALIAS("L2_RQSTS.PF_HIT", IAP_EVENT_24H_D8H) __PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_F7H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_E7H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \ __PMC_EV_ALIAS("L2_RQSTS.REFERENCES", IAP_EVENT_24H_EFH) \ __PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \ From owner-svn-src-all@freebsd.org Fri Oct 13 15:16:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4376E4AA84; Fri, 13 Oct 2017 15:16:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E42769225; Fri, 13 Oct 2017 15:16:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DFGwOl055692; Fri, 13 Oct 2017 15:16:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DFGve3055680; Fri, 13 Oct 2017 15:16:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710131516.v9DFGve3055680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 13 Oct 2017 15:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324599 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 15:16:59 -0000 Author: gjb Date: Fri Oct 13 15:16:57 2017 New Revision: 324599 URL: https://svnweb.freebsd.org/changeset/base/324599 Log: Increase the arm/armv6 and arm/armv7 images from 2.5GB to 3GB, since the RPI2 (at least) does not fit in 2.5GB. While here, add a missing BOARDNAME to RPI2.conf. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BANANAPI.conf head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/RPI2.conf head/release/arm/WANDBOARD.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/BANANAPI.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-bananapi" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/BEAGLEBONE.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBIEBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBIEBOARD2.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/GUMSTIX.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-duovero" KERNEL="GUMSTIX" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/PANDABOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/RPI-B.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi" KERNEL="RPI-B" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/RPI2.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,12 +9,13 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="RPI2" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" Modified: head/release/arm/WANDBOARD.conf ============================================================================== --- head/release/arm/WANDBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/WANDBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" From owner-svn-src-all@freebsd.org Fri Oct 13 15:53:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EEFCE25897; Fri, 13 Oct 2017 15:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF8286A91E; Fri, 13 Oct 2017 15:53:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x234.google.com with SMTP id p87so10743804pfj.3; Fri, 13 Oct 2017 08:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=e/ohyng964TPSBH4oUBa5V3+hwsQgiNR0xMrCDmj4+c=; b=Eb6sqsX1dDa+RERYw4DUUr/KenwglQdWW2x1l8voZW1uDqE4OG3UsUikNSSRrOJHcn jMR1ppTVP3kChNthwggESGzsuKDrR7EkxF858lpBGGXIHyW+OiKOL0si6ReDLaElWb49 nI6WHG5onCDyukm5lJp4kHcQn22GQ6ZhxVeb3i9D+VCOLhLCj2s5PBYQKiaG4zdOaOFc zptcdcZpPsXjYvvZ+Nb8oydeYditA14ICee3ssnKS5+tYI+zMg3W+1KikLCzGlmA4vNF kI+Y91Uq1PfusDm1/zsTzvwxDjLjXhwdj7ael/DTjP+koGFTAUw6YPYbBaxm2LKzNREt V3rw== 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=e/ohyng964TPSBH4oUBa5V3+hwsQgiNR0xMrCDmj4+c=; b=fL/uhUhSg5EzTxqG8z8JMsYO70zkJS5So2YXVUhBuhK+4OvdMTHadIp3iQtaDJBY2o wMzJXil12tn9OQxCGjFYpK4I+tJrCZCjWbsAYyDJQdBGDJEYnP7lYcSNDt2DmWkVZA6w W2eIDl36L0LutVBiT8c7kkbbV61e01OPv0/+3P56Vaem3ZlkVNBebpam9bAS4cXvWejM R1Wst39zYaNW5u3mn/fqDOV/KZCPzYQy2B4eKtxXvrSVNGtur3SD9ThFCulAk1q3giN6 XHX2sLqoxcjYGu5SIgap2WAN3xgYgqEZXoTEBsFIT9mPt+HXXJeIRCJ7WVBv4+yNLSb7 8zVA== X-Gm-Message-State: AMCzsaViSFvWW/aloUnnlIexqyv/NmmVJTojQujBuXBeRaQ8l/1bTGNW h0SsVr3gptuHlash4IQU0YMvxEpr X-Google-Smtp-Source: AOwi7QAgWDi/Fl0Qd5M9GAagJjjFZE4MwVd1zGds6uitw0wrxDkoHWiXvx82AUgnx/w1H+Lgr/aMQg== X-Received: by 10.99.45.67 with SMTP id t64mr1706558pgt.62.1507910032873; Fri, 13 Oct 2017 08:53:52 -0700 (PDT) Received: from ?IPv6:2607:fb90:8126:a250:5921:4fdb:c0b6:5bc4? ([2607:fb90:8126:a250:5921:4fdb:c0b6:5bc4]) by smtp.gmail.com with ESMTPSA id l1sm3042387pff.77.2017.10.13.08.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 08:53:51 -0700 (PDT) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324471 - head/sys/boot From: Ngie Cooper X-Mailer: iPhone Mail (15A421) In-Reply-To: Date: Fri, 13 Oct 2017 08:53:46 -0700 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 15:53:54 -0000 > On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya) wrote: >=20 >=20 >> On Oct 9, 2017, at 21:56, Warner Losh wrote: >>=20 >> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >>=20 >> DO NOT MAKE ANY COMMITS TO sys/boot. >>=20 >> BACK OFF. >>=20 >> Seriously, though, extra changes create extra friction, and these changes= aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a= conflict when I update. >>=20 >> So please, do not make any edits to sys/boot whatsoever, no matter how tr= ivial. >>=20 >> At least until I'm done. >=20 > Ok So... what=81fs the status? -Ngie= From owner-svn-src-all@freebsd.org Fri Oct 13 16:23:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63789E26489; Fri, 13 Oct 2017 16:23:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32BFA6B956; Fri, 13 Oct 2017 16:23:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DGN5cq085449; Fri, 13 Oct 2017 16:23:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DGN5gr085448; Fri, 13 Oct 2017 16:23:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710131623.v9DGN5gr085448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Oct 2017 16:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324600 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 16:23:06 -0000 Author: kib Date: Fri Oct 13 16:23:05 2017 New Revision: 324600 URL: https://svnweb.freebsd.org/changeset/base/324600 Log: Evaluate the real size of the sblk_zone. Submitted by: ota@j.email.ne.jp PR: 221356 Reviewed by: alc, markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D12660 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Oct 13 15:16:57 2017 (r324599) +++ head/sys/vm/swap_pager.c Fri Oct 13 16:23:05 2017 (r324600) @@ -541,6 +541,14 @@ swap_pager_swap_init(void) */ n -= ((n + 2) / 3); } while (n > 0); + + /* + * Often uma_zone_reserve_kva() cannot reserve exactly the + * requested size. Account for the difference when + * calculating swap_maxpages. + */ + n = uma_zone_get_max(swblk_zone); + if (n2 != n) printf("Swap blk zone entries reduced from %lu to %lu.\n", n2, n); From owner-svn-src-all@freebsd.org Fri Oct 13 16:31:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57600E269D8; Fri, 13 Oct 2017 16:31:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276016C286; Fri, 13 Oct 2017 16:31:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DGVoSA089001; Fri, 13 Oct 2017 16:31:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DGVoLf089000; Fri, 13 Oct 2017 16:31:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710131631.v9DGVoLf089000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 13 Oct 2017 16:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324601 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 16:31:51 -0000 Author: alc Date: Fri Oct 13 16:31:50 2017 New Revision: 324601 URL: https://svnweb.freebsd.org/changeset/base/324601 Log: Address two problems with sendfile(..., SF_NOCACHE) and apply one "optimization". First, sendfile(..., SF_NOCACHE) frees pages without checking whether those pages are mapped. This can leave the system with mappings to free or repurposed pages. Second, a page can be busied between the time of the current busy test and acquiring the object lock. Essentially, the test performed before the object lock is acquired can only be regarded as an optimization to short-circuit further work on the page. It cannot, however, be relied upon to prove that it is safe to free the page. Third, when sendfile(..., SF_NOCACHE) was originally implemented, vm_page_deactivate_noreuse() did not yet exist. Use vm_page_deactivate_noreuse() instead of vm_page_deactivate(), because it comes closer to freeing the page. In collaboration with: glebius Discussed with: gallatin, kib, markj X-MFC after: r324448 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Fri Oct 13 16:23:05 2017 (r324600) +++ head/sys/kern/kern_sendfile.c Fri Oct 13 16:31:50 2017 (r324601) @@ -143,10 +143,23 @@ sendfile_free_page(vm_page_t pg, bool nocache) vm_page_free(pg); else if (nocache) { if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - vm_page_free(pg); + bool freed; + + /* Only free unmapped pages. */ + if (obj->ref_count == 0 || + !pmap_page_is_mapped(pg)) + /* + * The busy test before the object is + * locked cannot be relied upon. + */ + freed = vm_page_try_to_free(pg); + else + freed = false; VM_OBJECT_WUNLOCK(obj); + if (!freed) + vm_page_deactivate_noreuse(pg); } else - vm_page_deactivate(pg); + vm_page_deactivate_noreuse(pg); } } vm_page_unlock(pg); From owner-svn-src-all@freebsd.org Fri Oct 13 17:11:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EA99E27842; Fri, 13 Oct 2017 17:11:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8DE6D771; Fri, 13 Oct 2017 17:11:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DHB92i003588; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DHB94r003587; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710131711.v9DHB94r003587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324602 - in stable: 10/sys/vm 11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/vm 11/sys/vm X-SVN-Commit-Revision: 324602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 17:11:10 -0000 Author: jhb Date: Fri Oct 13 17:11:08 2017 New Revision: 324602 URL: https://svnweb.freebsd.org/changeset/base/324602 Log: MFC 324072: Add UMA_ALIGNOF(). This is a wrapper around _Alignof() that sets the alignment for a zone to the alignment required by a given type. This allows the compiler to determine the proper alignment rather than having the programmer try to guess. Modified: stable/11/sys/vm/uma.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/vm/uma.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/vm/uma.h ============================================================================== --- stable/11/sys/vm/uma.h Fri Oct 13 16:31:50 2017 (r324601) +++ stable/11/sys/vm/uma.h Fri Oct 13 17:11:08 2017 (r324602) @@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ #define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ +#define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ /* * Destroys an empty uma zone. If the zone is not empty uma complains loudly. From owner-svn-src-all@freebsd.org Fri Oct 13 17:11:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120DEE2783B; Fri, 13 Oct 2017 17:11:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD35B6D770; Fri, 13 Oct 2017 17:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DHB9hr003582; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DHB9rt003581; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710131711.v9DHB9rt003581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324602 - in stable: 10/sys/vm 11/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/vm 11/sys/vm X-SVN-Commit-Revision: 324602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 17:11:10 -0000 Author: jhb Date: Fri Oct 13 17:11:08 2017 New Revision: 324602 URL: https://svnweb.freebsd.org/changeset/base/324602 Log: MFC 324072: Add UMA_ALIGNOF(). This is a wrapper around _Alignof() that sets the alignment for a zone to the alignment required by a given type. This allows the compiler to determine the proper alignment rather than having the programmer try to guess. Modified: stable/10/sys/vm/uma.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/vm/uma.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/vm/uma.h ============================================================================== --- stable/10/sys/vm/uma.h Fri Oct 13 16:31:50 2017 (r324601) +++ stable/10/sys/vm/uma.h Fri Oct 13 17:11:08 2017 (r324602) @@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ #define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ +#define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ /* * Destroys an empty uma zone. If the zone is not empty uma complains loudly. From owner-svn-src-all@freebsd.org Fri Oct 13 17:15:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220A1E27BE3; Fri, 13 Oct 2017 17:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A0D6DC9C; Fri, 13 Oct 2017 17:15:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DHFIe1007519; Fri, 13 Oct 2017 17:15:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DHFIKH007518; Fri, 13 Oct 2017 17:15:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131715.v9DHFIKH007518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 17:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324603 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 17:15:19 -0000 Author: emaste Date: Fri Oct 13 17:15:17 2017 New Revision: 324603 URL: https://svnweb.freebsd.org/changeset/base/324603 Log: ObsoleteFiles.inc: correct year on libstand removal Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 13 17:11:08 2017 (r324602) +++ head/ObsoleteFiles.inc Fri Oct 13 17:15:17 2017 (r324603) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20161010: Remove libstand +# 20171010: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a OLD_FILES+=usr/include/stand.h From owner-svn-src-all@freebsd.org Fri Oct 13 18:23:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C30B2E296FA; Fri, 13 Oct 2017 18:23:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A38700AF; Fri, 13 Oct 2017 18:23:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DIN86w036614; Fri, 13 Oct 2017 18:23:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DIN8j3036613; Fri, 13 Oct 2017 18:23:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131823.v9DIN8j3036613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 18:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324604 - head/targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/targets/pseudo/userland/gnu X-SVN-Commit-Revision: 324604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 18:23:09 -0000 Author: emaste Date: Fri Oct 13 18:23:08 2017 New Revision: 324604 URL: https://svnweb.freebsd.org/changeset/base/324604 Log: Remove additional groff leftovers (r319664) Modified: head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 17:15:17 2017 (r324603) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:23:08 2017 (r324604) @@ -43,53 +43,6 @@ DIRDEPS = \ gnu/usr.bin/gperf/doc \ gnu/usr.bin/grep \ gnu/usr.bin/grep/doc \ - gnu/usr.bin/groff/contrib/mm \ - gnu/usr.bin/groff/doc \ - gnu/usr.bin/groff/font/devX100 \ - gnu/usr.bin/groff/font/devX100-12 \ - gnu/usr.bin/groff/font/devX75 \ - gnu/usr.bin/groff/font/devX75-12 \ - gnu/usr.bin/groff/font/devascii \ - gnu/usr.bin/groff/font/devcp1047 \ - gnu/usr.bin/groff/font/devdvi \ - gnu/usr.bin/groff/font/devhtml \ - gnu/usr.bin/groff/font/devkoi8-r \ - gnu/usr.bin/groff/font/devlatin1 \ - gnu/usr.bin/groff/font/devlbp \ - gnu/usr.bin/groff/font/devlj4 \ - gnu/usr.bin/groff/font/devps \ - gnu/usr.bin/groff/font/devutf8 \ - gnu/usr.bin/groff/man \ - gnu/usr.bin/groff/src/devices/grodvi \ - gnu/usr.bin/groff/src/devices/grohtml \ - gnu/usr.bin/groff/src/devices/grolbp \ - gnu/usr.bin/groff/src/devices/grolj4 \ - gnu/usr.bin/groff/src/devices/grops \ - gnu/usr.bin/groff/src/devices/grotty \ - gnu/usr.bin/groff/src/libs/libbib \ - gnu/usr.bin/groff/src/libs/libdriver \ - gnu/usr.bin/groff/src/libs/libgroff \ - gnu/usr.bin/groff/src/preproc/eqn \ - gnu/usr.bin/groff/src/preproc/grn \ - gnu/usr.bin/groff/src/preproc/html \ - gnu/usr.bin/groff/src/preproc/pic \ - gnu/usr.bin/groff/src/preproc/refer \ - gnu/usr.bin/groff/src/preproc/soelim \ - gnu/usr.bin/groff/src/preproc/tbl \ - gnu/usr.bin/groff/src/roff/groff \ - gnu/usr.bin/groff/src/roff/grog \ - gnu/usr.bin/groff/src/roff/nroff \ - gnu/usr.bin/groff/src/roff/psroff \ - gnu/usr.bin/groff/src/roff/troff \ - gnu/usr.bin/groff/src/utils/addftinfo \ - gnu/usr.bin/groff/src/utils/afmtodit \ - gnu/usr.bin/groff/src/utils/hpftodit \ - gnu/usr.bin/groff/src/utils/indxbib \ - gnu/usr.bin/groff/src/utils/lkbib \ - gnu/usr.bin/groff/src/utils/lookbib \ - gnu/usr.bin/groff/src/utils/pfbtops \ - gnu/usr.bin/groff/src/utils/tfmtodit \ - gnu/usr.bin/groff/tmac \ gnu/usr.bin/rcs/ci \ gnu/usr.bin/rcs/co \ gnu/usr.bin/rcs/ident \ From owner-svn-src-all@freebsd.org Fri Oct 13 18:30:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499D3E2985D; Fri, 13 Oct 2017 18:30:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 182BB70399; Fri, 13 Oct 2017 18:30:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DIUWFo036910; Fri, 13 Oct 2017 18:30:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DIUW0I036909; Fri, 13 Oct 2017 18:30:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131830.v9DIUW0I036909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 18:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324605 - head/targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/targets/pseudo/userland/gnu X-SVN-Commit-Revision: 324605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 18:30:33 -0000 Author: emaste Date: Fri Oct 13 18:30:32 2017 New Revision: 324605 URL: https://svnweb.freebsd.org/changeset/base/324605 Log: clean up remnants of removed GPL software send-pr r267486 texinfo r276551 ranlib r286332 sdiff r298823 rcs r307351 diff r317209 Modified: head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:23:08 2017 (r324604) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:30:32 2017 (r324605) @@ -28,10 +28,7 @@ DIRDEPS = \ gnu/usr.bin/binutils/libiberty \ gnu/usr.bin/binutils/libopcodes \ gnu/usr.bin/binutils/objdump \ - gnu/usr.bin/binutils/ranlib \ gnu/usr.bin/dialog \ - gnu/usr.bin/diff \ - gnu/usr.bin/diff/doc \ gnu/usr.bin/diff3 \ gnu/usr.bin/gdb/doc \ gnu/usr.bin/gdb/gdb \ @@ -43,26 +40,6 @@ DIRDEPS = \ gnu/usr.bin/gperf/doc \ gnu/usr.bin/grep \ gnu/usr.bin/grep/doc \ - gnu/usr.bin/rcs/ci \ - gnu/usr.bin/rcs/co \ - gnu/usr.bin/rcs/ident \ - gnu/usr.bin/rcs/lib \ - gnu/usr.bin/rcs/merge \ - gnu/usr.bin/rcs/rcs \ - gnu/usr.bin/rcs/rcsclean \ - gnu/usr.bin/rcs/rcsdiff \ - gnu/usr.bin/rcs/rcsfreeze \ - gnu/usr.bin/rcs/rcsmerge \ - gnu/usr.bin/rcs/rlog \ - gnu/usr.bin/sdiff \ - gnu/usr.bin/send-pr/doc \ - gnu/usr.bin/texinfo/doc \ - gnu/usr.bin/texinfo/info \ - gnu/usr.bin/texinfo/infokey \ - gnu/usr.bin/texinfo/install-info \ - gnu/usr.bin/texinfo/libtxi \ - gnu/usr.bin/texinfo/makeinfo \ - gnu/usr.bin/texinfo/texindex \ .if ${MK_GPL_DTC} != "no" DIRDEPS+= gnu/usr.bin/dtc From owner-svn-src-all@freebsd.org Fri Oct 13 19:27:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF05DE2ABC0; Fri, 13 Oct 2017 19:27:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE2A671C78; Fri, 13 Oct 2017 19:27:34 +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 v9DJRXW7061956; Fri, 13 Oct 2017 19:27:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DJRXth061955; Fri, 13 Oct 2017 19:27:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710131927.v9DJRXth061955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Oct 2017 19:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324606 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 324606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 19:27:35 -0000 Author: markj Date: Fri Oct 13 19:27:33 2017 New Revision: 324606 URL: https://svnweb.freebsd.org/changeset/base/324606 Log: Make the PHOLD in linux_wait_event_common() unconditional. After some in-progress work is committed, this would otherwise be the only instance of #if(n)def NO_SWAPPING in the tree. Moreover, the requisite opt_vm.h include was missing, so the PHOLD/PRELE calls were always being compiled in anyway. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Oct 13 18:30:32 2017 (r324605) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Oct 13 19:27:33 2017 (r324606) @@ -232,9 +232,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q * Our wait queue entry is on the stack - make sure it doesn't * get swapped out while we sleep. */ -#ifndef NO_SWAPPING PHOLD(task->task_thread->td_proc); -#endif sleepq_lock(task); if (atomic_load_acq_int(&task->state) != TASK_WAKING) { ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); @@ -242,9 +240,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q sleepq_release(task); ret = linux_signal_pending_state(state, task) ? -ERESTARTSYS : 0; } -#ifndef NO_SWAPPING PRELE(task->task_thread->td_proc); -#endif PICKUP_GIANT(); From owner-svn-src-all@freebsd.org Fri Oct 13 19:41:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 765C6E2B31A; Fri, 13 Oct 2017 19:41:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AB1722EF; Fri, 13 Oct 2017 19:41:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DJfZHc068157; Fri, 13 Oct 2017 19:41:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DJfZBt068155; Fri, 13 Oct 2017 19:41:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710131941.v9DJfZBt068155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Oct 2017 19:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324607 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 324607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 19:41:36 -0000 Author: kp Date: Fri Oct 13 19:41:35 2017 New Revision: 324607 URL: https://svnweb.freebsd.org/changeset/base/324607 Log: Support the D-Link DWM-222 LTE Dongle Submitted by: Daniel Hänschke Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Oct 13 19:27:33 2017 (r324606) +++ head/sys/dev/usb/serial/u3g.c Fri Oct 13 19:41:35 2017 (r324607) @@ -236,6 +236,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(DLINK, DWR510, 0), U3G_DEV(DLINK, DWM157_CD, U3GINIT_SCSIEJECT), U3G_DEV(DLINK, DWM157, 0), + U3G_DEV(DLINK, DWM222_CD, U3GINIT_SCSIEJECT), + U3G_DEV(DLINK, DWM222, 0), U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Oct 13 19:27:33 2017 (r324606) +++ head/sys/dev/usb/usbdevs Fri Oct 13 19:41:35 2017 (r324607) @@ -1673,8 +1673,10 @@ product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DUB1312 0x4a00 10/100/1000 Ethernet product DLINK DWM157 0x7d02 DWM-157 product DLINK DWR510 0x7e12 DWR-510 +product DLINK DWM222 0x7e35 DWM-222 product DLINK DWM157_CD 0xa707 DWM-157 CD-ROM Mode product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode +product DLINK DWM222_CD 0xab00 DWM-222 CD-ROM Mode product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK2 RTL8192SU_1 0x3300 RTL8192SU From owner-svn-src-all@freebsd.org Fri Oct 13 20:29:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5029E2C02B; Fri, 13 Oct 2017 20:29:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7436873AD5; Fri, 13 Oct 2017 20:29:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DKTZG4088096; Fri, 13 Oct 2017 20:29:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DKTZqE088095; Fri, 13 Oct 2017 20:29:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710132029.v9DKTZqE088095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Oct 2017 20:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324608 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 324608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 20:29:36 -0000 Author: kp Date: Fri Oct 13 20:29:35 2017 New Revision: 324608 URL: https://svnweb.freebsd.org/changeset/base/324608 Log: Regenerate usb.conf Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Fri Oct 13 19:41:35 2017 (r324607) +++ head/etc/devd/usb.conf Fri Oct 13 20:29:35 2017 (r324608) @@ -4744,6 +4744,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7205"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -5097,7 +5105,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x7d02|0x7e12|0xa707|0xa805)"; + match "product" "(0x7d02|0x7e12|0x7e35|0xa707|0xa805|0xab00)"; action "kldload -n u3g"; }; @@ -5905,5 +5913,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2754 USB entries processed +# 2757 USB entries processed From owner-svn-src-all@freebsd.org Fri Oct 13 20:31:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3624E2C228; Fri, 13 Oct 2017 20:31:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830FE73E0E; Fri, 13 Oct 2017 20:31:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DKVuBD089010; Fri, 13 Oct 2017 20:31:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DKVueS089009; Fri, 13 Oct 2017 20:31:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710132031.v9DKVueS089009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Oct 2017 20:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324609 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 20:31:57 -0000 Author: mjg Date: Fri Oct 13 20:31:56 2017 New Revision: 324609 URL: https://svnweb.freebsd.org/changeset/base/324609 Log: mtx: change MTX_UNOWNED from 4 to 0 The value is spread all over the kernel and zeroing a register is cheaper/shorter than setting it up to an arbitrary value. Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. MFC after: 1 week Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri Oct 13 20:29:35 2017 (r324608) +++ head/sys/sys/mutex.h Fri Oct 13 20:31:56 2017 (r324609) @@ -65,15 +65,11 @@ * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this, * with the exception of MTX_UNOWNED, applies to spin locks. */ +#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */ #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ -#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED) - -/* - * Value stored in mutex->mtx_lock to denote a destroyed mutex. - */ -#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) +#define MTX_DESTROYED 0x00000004 /* lock destroyed */ +#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED) /* * Prototypes From owner-svn-src-all@freebsd.org Fri Oct 13 20:54:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC697E2CAD7 for ; Fri, 13 Oct 2017 20:54:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 BDE1074940 for ; Fri, 13 Oct 2017 20:54:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9dff4aeb-b058-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 9dff4aeb-b058-11e7-b50b-53dc5ecda239; Fri, 13 Oct 2017 20:53:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9DKsRQ7001870; Fri, 13 Oct 2017 14:54:27 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507928067.8386.84.camel@freebsd.org> Subject: Re: svn commit: r324609 - head/sys/sys From: Ian Lepore To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 13 Oct 2017 14:54:27 -0600 In-Reply-To: <201710132031.v9DKVueS089009@repo.freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 20:54:36 -0000 On Fri, 2017-10-13 at 20:31 +0000, Mateusz Guzik wrote: > Author: mjg > Date: Fri Oct 13 20:31:56 2017 > New Revision: 324609 > URL: https://svnweb.freebsd.org/changeset/base/324609 > > Log: >   mtx: change MTX_UNOWNED from 4 to 0 >    >   The value is spread all over the kernel and zeroing a register is >   cheaper/shorter than setting it up to an arbitrary value. >    >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. >    >   MFC after: 1 week > If you MFC this, won't that break the ABI for modules compiled against earlier versions of the branch? Also, won't this trigger a need to recompile out of tree modules such as video drivers, virtualbox, etc?  Does that need an UPDATING entry? -- Ian From owner-svn-src-all@freebsd.org Fri Oct 13 21:01:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C723E2CD70; Fri, 13 Oct 2017 21:01:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13DF374D88; Fri, 13 Oct 2017 21:01:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id m189so6537777qke.4; Fri, 13 Oct 2017 14:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g1a3zljyY/QJKiwyaoLYoGd+HUjU436xp0AdzzAJw/8=; b=u6jkEWsL8STll8u6LxjukvT4Kijhu4GCO4RYkY3cwJnaJvTSV1KLFB0j0xjvj+b5vv A9drLQIqnji8ANvYme/N2J/sPhOhCTGyL3Zq68dQmhB+G3FbtHOsu355F4SYvyNVUh0E 3AQcAuNRFEqh7fraUoyvqlHRXQtjJ18Z2d12poi5RgUWeApov1eEqLnCj6OiDzX8PH2D /v1zDXrbDGkopNrQiCdREWGbiJyc6XEkyPKB9/DpUKrdQ5P6IaJ88JqrVKPDnZ6FRjrM rBtpYqXDhnks2q5UUwx0ACmT4tmhgvRXHZ9zr2N9UO3S/5be9gts8uyqWihjmGW8404F rKEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g1a3zljyY/QJKiwyaoLYoGd+HUjU436xp0AdzzAJw/8=; b=Vijz3Sz2jmdm2xvBzx8yN/cEXWLgAW1A5AI4ikEoT+GH//KIiVw0GLwb0YcowVzEhk 3o7ZHg6waP/UaJ2n9ir9wilG4RvK2hnK//AevXWXDYCOB42mPLYWtTP5lwcQqpC3VniE Q+lvz3bEXFN0R7IedoqAKoYV5p8DskzhMgDKTGLfho2aV0NVNJVCk/djWMy13gNxAE4J fk6EPP3I2p2oU/ZPX6rUd6/KrJrraZN8U/JGfnvulJt6i4Bf5wKJCwq3iKk8+uX9wTKR HSDGGq0RWd7ayzUL9ZlKAgA2BPubriCWxnCEm4/4+N2q0a1pT5WvL4gSC290Dx64Yeb2 HV/Q== X-Gm-Message-State: AMCzsaVXPaBqF1hmgvOlsjmVxu44LwQUVXuDJ9mS1a1tjTHKarEB+QPH gfp9NZT5V46gIYDVxrSG3tDHBco7wCNGIrFRKYdTjg== X-Google-Smtp-Source: ABhQp+SOyNEUMSNMIVAx6Ur1M+9SB/Ow+TUoTHDYr7ifq4RmTlJkJfs7eyFjyjZ2yVrApJuqj/Y4z8koxcZVoDT86LM= X-Received: by 10.55.204.157 with SMTP id n29mr3604197qkl.243.1507928505814; Fri, 13 Oct 2017 14:01:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.51.167 with HTTP; Fri, 13 Oct 2017 14:01:45 -0700 (PDT) In-Reply-To: <1507928067.8386.84.camel@freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507928067.8386.84.camel@freebsd.org> From: Mateusz Guzik Date: Fri, 13 Oct 2017 23:01:45 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Ian Lepore Cc: Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:01:47 -0000 On Fri, Oct 13, 2017 at 10:54 PM, Ian Lepore wrote: > On Fri, 2017-10-13 at 20:31 +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Fri Oct 13 20:31:56 2017 > > New Revision: 324609 > > URL: https://svnweb.freebsd.org/changeset/base/324609 > > > > Log: > > mtx: change MTX_UNOWNED from 4 to 0 > > > > The value is spread all over the kernel and zeroing a register is > > cheaper/shorter than setting it up to an arbitrary value. > > > > Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > > > MFC after: 1 week > > > > If you MFC this, won't that break the ABI for modules compiled against > earlier versions of the branch? > > Also, won't this trigger a need to recompile out of tree modules such > as video drivers, virtualbox, etc? Does that need an UPDATING entry? > > -- Ian > > All modules (even ones provided with base) always call dedicated primitives, i.e. they never inspect the lock value. The only non-opaque part of locks (and annoying at that) is placememnt of the lock word, which right not is at the very end. This happens to matter when passing the lock around to funcs like _sleep which automagically determine what it is. I am considering a change for head which moves the word to the beginning instead and that probably wont be MFCable unless I come up with a reasonably non-terrible kludge. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Fri Oct 13 21:38:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99E4E2D71D; Fri, 13 Oct 2017 21:38:05 +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 D74CE75AEF; Fri, 13 Oct 2017 21:38:05 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=56550 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1e35uF-000CVH-Er; Fri, 13 Oct 2017 19:46:03 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324471 - head/sys/boot From: Devin Teske In-Reply-To: Date: Fri, 13 Oct 2017 14:38:03 -0700 Cc: Devin Teske , Warner Losh , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <41ECAC77-1DCF-4107-A2EC-52141540013E@freebsd.org> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:38:06 -0000 > On Oct 13, 2017, at 8:53 AM, Ngie Cooper = wrote: >=20 >=20 >> On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>=20 >>> On Oct 9, 2017, at 21:56, Warner Losh wrote: >>>=20 >>> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >>>=20 >>> DO NOT MAKE ANY COMMITS TO sys/boot. >>>=20 >>> BACK OFF. >>>=20 >>> Seriously, though, extra changes create extra friction, and these = changes aren't worth any friction at all. I'm deleting LIBSAU and this = guarantees a conflict when I update. >>>=20 >>> So please, do not make any edits to sys/boot whatsoever, no matter = how trivial. >>>=20 >>> At least until I'm done. >>=20 >> Ok >=20 > So... what=E2=80=99s the status? Your typo gave me an idea for a new tool ... Usage: whatfs path ... Return unique list of filesystems containing list of paths. Lol ;D E.g., "whatfs / /usr /usr/local /foo /bar" would list minimal filesystem = mountpoints containing all given paths --=20 Devin= From owner-svn-src-all@freebsd.org Fri Oct 13 21:54:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8584FE2DF3B; Fri, 13 Oct 2017 21:54:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FCDC76453; Fri, 13 Oct 2017 21:54:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DLsYrl026417; Fri, 13 Oct 2017 21:54:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DLsYeC026414; Fri, 13 Oct 2017 21:54:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710132154.v9DLsYeC026414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Oct 2017 21:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324610 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 324610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:54:35 -0000 Author: mjg Date: Fri Oct 13 21:54:34 2017 New Revision: 324610 URL: https://svnweb.freebsd.org/changeset/base/324610 Log: Reduce traffic on vm_cnt.v_free_count The variable is modified with the highly contended page free queue lock. It unnecessarily shares a cacheline with purely read-only fields and is re-read after the lock is dropped in the page allocation code making the hold time longer. Pad the variable just like the others and store the value as found with the lock held instead of re-reading. Provides a modest 1%-ish speed up in concurrent page faults. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D12665 Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_page.c head/sys/vm/vm_phys.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/sys/vmmeter.h Fri Oct 13 21:54:34 2017 (r324610) @@ -131,7 +131,6 @@ struct vmmeter { u_int v_free_reserved; /* (c) pages reserved for deadlock */ u_int v_free_target; /* (c) pages desired free */ u_int v_free_min; /* (c) pages desired free */ - u_int v_free_count; /* (f) pages free */ u_int v_inactive_target; /* (c) pages desired inactive */ u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ @@ -141,6 +140,7 @@ struct vmmeter { u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for laundering */ + u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ @@ -208,10 +208,10 @@ vm_paging_target(void) * Returns TRUE if the pagedaemon needs to be woken up. */ static inline int -vm_paging_needed(void) +vm_paging_needed(u_int free_count) { - return (vm_cnt.v_free_count < vm_pageout_wakeup_thresh); + return (free_count < vm_pageout_wakeup_thresh); } /* Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/vm/vm_page.c Fri Oct 13 21:54:34 2017 (r324610) @@ -1588,6 +1588,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi { vm_page_t m; int flags, req_class; + u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1655,7 +1656,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); mtx_unlock(&vm_page_queue_free_mtx); vm_page_alloc_check(m); @@ -1713,7 +1714,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * Don't wakeup too often - wakeup the pageout daemon when * we would be nearly out of memory. */ - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); @@ -1899,7 +1900,7 @@ retry: pmap_page_set_memattr(m, memattr); pindex++; } - if (vm_paging_needed()) + if (vm_paging_needed(vm_cnt.v_free_count)) pagedaemon_wakeup(); return (m_ret); } @@ -1948,7 +1949,7 @@ vm_page_t vm_page_alloc_freelist(int flind, int req) { vm_page_t m; - u_int flags; + u_int flags, free_count; int req_class; req_class = req & VM_ALLOC_CLASS_MASK; @@ -1980,7 +1981,7 @@ vm_page_alloc_freelist(int flind, int req) mtx_unlock(&vm_page_queue_free_mtx); return (NULL); } - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); mtx_unlock(&vm_page_queue_free_mtx); vm_page_alloc_check(m); @@ -2002,7 +2003,7 @@ vm_page_alloc_freelist(int flind, int req) } /* Unmanaged pages don't use "act_count". */ m->oflags = VPO_UNMANAGED; - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); } Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/vm/vm_phys.h Fri Oct 13 21:54:34 2017 (r324610) @@ -112,13 +112,13 @@ vm_phys_domain(vm_page_t m) #endif } -static inline void +static inline u_int vm_phys_freecnt_adj(vm_page_t m, int adj) { mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - vm_cnt.v_free_count += adj; vm_phys_domain(m)->vmd_free_count += adj; + return (vm_cnt.v_free_count += adj); } #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Oct 13 21:58:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A56E9E2E1BA; Fri, 13 Oct 2017 21:58:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73884766DB; Fri, 13 Oct 2017 21:58:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DLwiv2026673; Fri, 13 Oct 2017 21:58:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DLwih1026672; Fri, 13 Oct 2017 21:58:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710132158.v9DLwih1026672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 21:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324611 - in stable: 10/sys/kern 11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 11/sys/kern X-SVN-Commit-Revision: 324611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:58:45 -0000 Author: jhb Date: Fri Oct 13 21:58:44 2017 New Revision: 324611 URL: https://svnweb.freebsd.org/changeset/base/324611 Log: MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones. This fixes kernel crashes due to misaligned accesses to the 64-bit time_t embedded in struct namecache_ts in MIPS n32 kernels. Modified: stable/11/sys/kern/vfs_cache.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/vfs_cache.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/kern/vfs_cache.c ============================================================================== --- stable/11/sys/kern/vfs_cache.c Fri Oct 13 21:54:34 2017 (r324610) +++ stable/11/sys/kern/vfs_cache.c Fri Oct 13 21:58:44 2017 (r324611) @@ -1760,16 +1760,20 @@ nchinit(void *dummy __unused) cache_zone_small = uma_zcreate("S VFS Cache", sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + UMA_ZONE_ZINIT); cache_zone_small_ts = uma_zcreate("STS VFS Cache", sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + UMA_ZONE_ZINIT); cache_zone_large = uma_zcreate("L VFS Cache", sizeof(struct namecache) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + UMA_ZONE_ZINIT); cache_zone_large_ts = uma_zcreate("LTS VFS Cache", sizeof(struct namecache_ts) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1; From owner-svn-src-all@freebsd.org Fri Oct 13 21:58:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A5DE2E1B6; Fri, 13 Oct 2017 21:58:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45EC3766DA; Fri, 13 Oct 2017 21:58:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DLwidn026667; Fri, 13 Oct 2017 21:58:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DLwiVH026666; Fri, 13 Oct 2017 21:58:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710132158.v9DLwiVH026666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 21:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324611 - in stable: 10/sys/kern 11/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 11/sys/kern X-SVN-Commit-Revision: 324611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:58:45 -0000 Author: jhb Date: Fri Oct 13 21:58:44 2017 New Revision: 324611 URL: https://svnweb.freebsd.org/changeset/base/324611 Log: MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones. This fixes kernel crashes due to misaligned accesses to the 64-bit time_t embedded in struct namecache_ts in MIPS n32 kernels. Modified: stable/10/sys/kern/vfs_cache.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/vfs_cache.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/kern/vfs_cache.c ============================================================================== --- stable/10/sys/kern/vfs_cache.c Fri Oct 13 21:54:34 2017 (r324610) +++ stable/10/sys/kern/vfs_cache.c Fri Oct 13 21:58:44 2017 (r324611) @@ -907,16 +907,20 @@ nchinit(void *dummy __unused) cache_zone_small = uma_zcreate("S VFS Cache", sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + UMA_ZONE_ZINIT); cache_zone_small_ts = uma_zcreate("STS VFS Cache", sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + UMA_ZONE_ZINIT); cache_zone_large = uma_zcreate("L VFS Cache", sizeof(struct namecache) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + UMA_ZONE_ZINIT); cache_zone_large_ts = uma_zcreate("LTS VFS Cache", sizeof(struct namecache_ts) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); } From owner-svn-src-all@freebsd.org Fri Oct 13 22:40:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB5FE2F050; Fri, 13 Oct 2017 22:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67C87779D0; Fri, 13 Oct 2017 22:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DMevt5045898; Fri, 13 Oct 2017 22:40:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DMev9c045897; Fri, 13 Oct 2017 22:40:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710132240.v9DMev9c045897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 22:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324612 - in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs X-SVN-Commit-Revision: 324612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 22:40:58 -0000 Author: jhb Date: Fri Oct 13 22:40:57 2017 New Revision: 324612 URL: https://svnweb.freebsd.org/changeset/base/324612 Log: MFC 324039: Don't defer wakeup()s for completed journal workitems. Normally wakeups() are performed for completed softupdates work items in workitem_free() before the underlying memory is free()'d. complete_jseg() was clearing the "wakeup needed" flag in work items to defer the wakeup until the end of each loop iteration. However, this resulted in the item being free'd before it's address was used with wakeup(). As a result, another part of the kernel could allocate this memory from malloc() and use it as a wait channel for a different "event" with a different lock. This triggered an assertion failure when the lock passed to sleepq_add() did not match the existing lock associated with the sleep queue. Fix this by removing the code to defer the wakeup in complete_jseg() allowing the wakeup to occur slightly earlier in workitem_free() before free() is called. Modified: stable/11/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 21:58:44 2017 (r324611) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 22:40:57 2017 (r324612) @@ -3596,15 +3596,13 @@ complete_jseg(jseg) { struct worklist *wk; struct jmvref *jmvref; - int waiting; #ifdef INVARIANTS int i = 0; #endif while ((wk = LIST_FIRST(&jseg->js_entries)) != NULL) { WORKLIST_REMOVE(wk); - waiting = wk->wk_state & IOWAITING; - wk->wk_state &= ~(INPROGRESS | IOWAITING); + wk->wk_state &= ~INPROGRESS; wk->wk_state |= COMPLETE; KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", @@ -3645,8 +3643,6 @@ complete_jseg(jseg) TYPENAME(wk->wk_type)); /* NOTREACHED */ } - if (waiting) - wakeup(wk); } /* Release the self reference so the structure may be freed. */ rele_jseg(jseg); From owner-svn-src-all@freebsd.org Fri Oct 13 22:40:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C8FE2F04B; Fri, 13 Oct 2017 22:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 168CB779CE; Fri, 13 Oct 2017 22:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DMevQb045892; Fri, 13 Oct 2017 22:40:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DMev9g045891; Fri, 13 Oct 2017 22:40:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710132240.v9DMev9g045891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 22:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324612 - in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs X-SVN-Commit-Revision: 324612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 22:40:58 -0000 Author: jhb Date: Fri Oct 13 22:40:57 2017 New Revision: 324612 URL: https://svnweb.freebsd.org/changeset/base/324612 Log: MFC 324039: Don't defer wakeup()s for completed journal workitems. Normally wakeups() are performed for completed softupdates work items in workitem_free() before the underlying memory is free()'d. complete_jseg() was clearing the "wakeup needed" flag in work items to defer the wakeup until the end of each loop iteration. However, this resulted in the item being free'd before it's address was used with wakeup(). As a result, another part of the kernel could allocate this memory from malloc() and use it as a wait channel for a different "event" with a different lock. This triggered an assertion failure when the lock passed to sleepq_add() did not match the existing lock associated with the sleep queue. Fix this by removing the code to defer the wakeup in complete_jseg() allowing the wakeup to occur slightly earlier in workitem_free() before free() is called. Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 21:58:44 2017 (r324611) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 22:40:57 2017 (r324612) @@ -3594,15 +3594,13 @@ complete_jseg(jseg) { struct worklist *wk; struct jmvref *jmvref; - int waiting; #ifdef INVARIANTS int i = 0; #endif while ((wk = LIST_FIRST(&jseg->js_entries)) != NULL) { WORKLIST_REMOVE(wk); - waiting = wk->wk_state & IOWAITING; - wk->wk_state &= ~(INPROGRESS | IOWAITING); + wk->wk_state &= ~INPROGRESS; wk->wk_state |= COMPLETE; KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", @@ -3643,8 +3641,6 @@ complete_jseg(jseg) TYPENAME(wk->wk_type)); /* NOTREACHED */ } - if (waiting) - wakeup(wk); } /* Release the self reference so the structure may be freed. */ rele_jseg(jseg); From owner-svn-src-all@freebsd.org Fri Oct 13 23:23:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C098FE2FF3E; Fri, 13 Oct 2017 23:23:16 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5EAD7D237; Fri, 13 Oct 2017 23:23:15 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id l68so24329456wmd.5; Fri, 13 Oct 2017 16:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EvZHU20KIboxgZ2fZ1LTFSEBkb6+C/w8x5VJ0HZMIvw=; b=pq6BvDWtqP9UUSeF+DFyl8b+FMoXANFybHoeucacDsrtd/Th/7//slNwBIlA1f/tT4 Q2TZTgAyTmke76cuUpuC73bkhqztvMdwUXxAecEVdX+ChMxRVi8bG3QOaL3pE94cmyeB S+rsrCUatrqzzXOAEKimKb3i2TYEPFSeRq2E0RjE7SknXZa56BA9jK61XGw8muy+9ftb hl48xJN9Y4/RMvxZVRjk+WN8PSfKYoU2HUYRWTFsTaT8AOOcXNw1I58AFgeuHpfd1Bwj QJqbB/G74rQiXaRS5Hc/ZVP+dHLFJgg5xcr6tmtwSSofn1LjJZIPqzem3WwZUM6Nie8f plCg== X-Gm-Message-State: AMCzsaWVsaGkoh27J9rx4+/o4ZvcFsUrr4HZqBGvz+uliwdfRIYK9Vte VM1uTMQSuQBPe0y4iQm16FxzJw== X-Received: by 10.80.212.43 with SMTP id t43mr3650708edh.89.1507930730448; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com. [74.125.82.41]) by smtp.gmail.com with ESMTPSA id w10sm1350687edj.11.2017.10.13.14.38.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: by mail-wm0-f41.google.com with SMTP id m72so23793291wmc.1; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TZwlEfuj9jOi7FabU9neKmvrNwyQAu5XrUDyU5XOiEYBJR+2fd+msIdRvKsOGSrJ32xoCvvPJT65HYeYPeEVA= X-Received: by 10.28.111.206 with SMTP id c75mr2481479wmi.123.1507930729982; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.20 with HTTP; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) In-Reply-To: <201710132031.v9DKVueS089009@repo.freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> From: Svatopluk Kraus Date: Fri, 13 Oct 2017 23:38:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 23:23:16 -0000 MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you removed it actually. I have very bad feeling about it. But maybe, it's really possible and in that case, a very good explanation should be provided. Svata On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Oct 13 20:31:56 2017 > New Revision: 324609 > URL: https://svnweb.freebsd.org/changeset/base/324609 > > Log: > mtx: change MTX_UNOWNED from 4 to 0 > > The value is spread all over the kernel and zeroing a register is > cheaper/shorter than setting it up to an arbitrary value. > > Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > MFC after: 1 week > > Modified: > head/sys/sys/mutex.h > > Modified: head/sys/sys/mutex.h > ============================================================================== > --- head/sys/sys/mutex.h Fri Oct 13 20:29:35 2017 (r324608) > +++ head/sys/sys/mutex.h Fri Oct 13 20:31:56 2017 (r324609) > @@ -65,15 +65,11 @@ > * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this, > * with the exception of MTX_UNOWNED, applies to spin locks. > */ > +#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */ > #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ > #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ > -#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ > -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED) > - > -/* > - * Value stored in mutex->mtx_lock to denote a destroyed mutex. > - */ > -#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) > +#define MTX_DESTROYED 0x00000004 /* lock destroyed */ > +#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED) > > /* > * Prototypes > From owner-svn-src-all@freebsd.org Sat Oct 14 00:30:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB37E311BF for ; Sat, 14 Oct 2017 00:30:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 3BBB67E9DA for ; Sat, 14 Oct 2017 00:30:53 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d8281d00-b076-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id d8281d00-b076-11e7-b50b-53dc5ecda239; Sat, 14 Oct 2017 00:30:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9E0Uok2002286; Fri, 13 Oct 2017 18:30:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507941050.8386.88.camel@freebsd.org> Subject: Re: svn commit: r324609 - head/sys/sys From: Ian Lepore To: Svatopluk Kraus , Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 13 Oct 2017 18:30:50 -0600 In-Reply-To: References: <201710132031.v9DKVueS089009@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 00:30:54 -0000 On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you > removed it actually. I have very bad feeling about it. But maybe, it's > really possible and in that case, a very good explanation should be > provided. > > Svata > The part that scares me is that DESTROYED may have been defined as CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of time.  Any of the places that are testing the MTX_CONTESTED bit may have been relying somehow on the fact that a destroyed mutex has that bit set. Then again, maybe Mateusz has carefully analyzed all this stuff, and we should just relax. :) -- Ian > > On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik > wrote: > > > > Author: mjg > > Date: Fri Oct 13 20:31:56 2017 > > New Revision: 324609 > > URL: https://svnweb.freebsd.org/changeset/base/324609 > > > > Log: > >   mtx: change MTX_UNOWNED from 4 to 0 > > > >   The value is spread all over the kernel and zeroing a register is > >   cheaper/shorter than setting it up to an arbitrary value. > > > >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > > >   MFC after:    1 week > > > > Modified: > >   head/sys/sys/mutex.h > > > > Modified: head/sys/sys/mutex.h > > =================================================================== > > =========== > > --- head/sys/sys/mutex.h        Fri Oct 13 20:29:35 > > 2017        (r324608) > > +++ head/sys/sys/mutex.h        Fri Oct 13 20:31:56 > > 2017        (r324609) > > @@ -65,15 +65,11 @@ > >   * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. > > None of this, > >   * with the exception of MTX_UNOWNED, applies to spin locks. > >   */ > > +#define        MTX_UNOWNED     0x00000000      /* Cookie for free > > mutex */ > >  #define        MTX_RECURSED    0x00000001      /* lock recursed > > (for MTX_DEF only) */ > >  #define        MTX_CONTESTED   0x00000002      /* lock contested > > (for MTX_DEF only) */ > > -#define MTX_UNOWNED    0x00000004      /* Cookie for free mutex */ > > -#define        MTX_FLAGMASK    (MTX_RECURSED | MTX_CONTESTED | > > MTX_UNOWNED) > > - > > -/* > > - * Value stored in mutex->mtx_lock to denote a destroyed mutex. > > - */ > > -#define        MTX_DESTROYED   (MTX_CONTESTED | MTX_UNOWNED) > > +#define        MTX_DESTROYED   0x00000004      /* lock destroyed > > */ > > +#define        MTX_FLAGMASK    (MTX_RECURSED | MTX_CONTESTED | > > MTX_DESTROYED) > > > >  /* > >   * Prototypes > > From owner-svn-src-all@freebsd.org Sat Oct 14 00:47:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8478CE31663; Sat, 14 Oct 2017 00:47:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43FCD7F10E; Sat, 14 Oct 2017 00:47:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9E0lUwM098014; Sat, 14 Oct 2017 00:47:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9E0lUhq098013; Sat, 14 Oct 2017 00:47:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710140047.v9E0lUhq098013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Oct 2017 00:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324613 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 00:47:31 -0000 Author: mjg Date: Sat Oct 14 00:47:30 2017 New Revision: 324613 URL: https://svnweb.freebsd.org/changeset/base/324613 Log: mtx: fix up owner_mtx after r324609 Now that MTX_UNOWNED is 0 the test was alwayas false. Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Oct 13 22:40:57 2017 (r324612) +++ head/sys/kern/kern_mutex.c Sat Oct 14 00:47:30 2017 (r324613) @@ -217,7 +217,7 @@ owner_mtx(const struct lock_object *lock, struct threa m = (const struct mtx *)lock; x = m->mtx_lock; *owner = (struct thread *)(x & ~MTX_FLAGMASK); - return (x != MTX_UNOWNED); + return (*owner != NULL); } #endif From owner-svn-src-all@freebsd.org Sat Oct 14 00:48:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB0DE316E2; Sat, 14 Oct 2017 00:48:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 711EA7F25A; Sat, 14 Oct 2017 00:48:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id k123so6993450qke.3; Fri, 13 Oct 2017 17:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JYP+bGdufTSW0oHxoVMiCBMU+GO+sK6BofgAzqc4jHc=; b=Ku/Z0w0XDbD9OxyYY/gXdNzGyRNt3augkmpyx/XSrbp9UtrYZ37y5TBXHrWsnx69uE /sCGi0cepUHKjbgX/eEIA5yRpxbRl2S5uKddkKqb/UpG0QMY2O4HJtEaW/zk9Rx36YyC +3TwDFSw/wlQfuoGp/ZMrnD7bKfay7Q6jhjFv9F7+xgJYSUzOeb3Sh+ov2LjIuqn/RxW D4lD/I+X7VZh7SjgCLOSMNYVCD9CeIWLu9e7UDtzP2J9rrt5GP3wL5wUky2urnAzifwU q0zcPtCSI05zi31jnKH9FjH/7/86t+2+iBwI7qMBYbTMX+qEHjE9VdxuIclyOiLXX8Lq vEsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JYP+bGdufTSW0oHxoVMiCBMU+GO+sK6BofgAzqc4jHc=; b=fcteHWjjaVgWILqZsguoWBbYOQslA81zZQrwYDq0pIyCksYQhX+XgO/oliHyGhzQRZ kggkCah/fZt9xwnSTr/tPDDljpqUJE+EIQLl6X5liRPuwm0JDdKYcBii7VWyJr9rCFDi 8jH039BqpYc9jvdiuse9ghO4dJ/Eam++g0MoRJ9DupFu8N/IEgTM03u/0zn5fae+4uuA HJrEw7+rxh5dME+8n3HAQuxk72daCARxOo1q4EHsuyCjUsctnSulGgNT3vp44BkMpVr1 fwDFMRfIG/Pz2FuA7GwoXXErqTOY/72hY4I4tEqIm9OCztENpTOk7hYZg2qMy4RFJqJs W1sA== X-Gm-Message-State: AMCzsaX5WtOmZQT4+9E6kyHDaY092Z90TV6K5TLr5SuwiARahAe02W6o vUZyO3NjcSi0sgjYIiIh7WAyDZBawWh8UmI9ecUs9A== X-Google-Smtp-Source: AOwi7QC9OmHJxCrn6dk1TB1TITye4ytY5nMkLgp4jGq+QK8NIAm2Py9ZO7+bh3zaEZSbPWC88umxpahhLd27aZDzn6s= X-Received: by 10.55.215.22 with SMTP id m22mr4671927qki.119.1507942131329; Fri, 13 Oct 2017 17:48:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.46.107 with HTTP; Fri, 13 Oct 2017 17:48:49 -0700 (PDT) In-Reply-To: <1507941050.8386.88.camel@freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Mateusz Guzik Date: Sat, 14 Oct 2017 02:48:49 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Ian Lepore Cc: Svatopluk Kraus , Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 00:48:52 -0000 On Sat, Oct 14, 2017 at 2:30 AM, Ian Lepore wrote: > On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: > > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you > > removed it actually. I have very bad feeling about it. But maybe, it's > > really possible and in that case, a very good explanation should be > > provided. > > > > Svata > > > > The part that scares me is that DESTROYED may have been defined as > CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of > time. Any of the places that are testing the MTX_CONTESTED bit may > have been relying somehow on the fact that a destroyed mutex has that > bit set. > > Then again, maybe Mateusz has carefully analyzed all this stuff, and we > should just relax. :) > > I highly doubt there was anything clever going on. Rather, someone wanted to somehow denote a destroyed mutex, but did not want to introduce an additional flag - they are not free since the field shares the value with the address of the owner. That is, adding flags requires increasing alignment of struct thread and that adds to memory usage. Thus they combined the flags in a way which can never happen under normal circumstances. mtx_destroy explicitly sets the value to MTX_DESTROYED, so there is no change here. MTX_UNOWNED is *not* used as a flag. If you grep the tree you will see it is only used in direct comparisons. That said, I reviewed all users again and a minor bug was introduced in owner_mtx (only used by dtrace). For some reason it grabs the owner, but the instead of checking if it grabbed anything it checks the flag (fixed in r324613). So that's my bad. Justification for the change was provided in the commit message: it makes .text smaller on amd64 and probably all architectures. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Oct 14 04:27:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C8CE3C12A; Sat, 14 Oct 2017 04:27:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5186C2FB4; Sat, 14 Oct 2017 04:27:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9E4Rwjw092980; Sat, 14 Oct 2017 04:27:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9E4RwUc092979; Sat, 14 Oct 2017 04:27:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710140427.v9E4RwUc092979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Oct 2017 04:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324614 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 04:27:59 -0000 Author: mjg Date: Sat Oct 14 04:27:58 2017 New Revision: 324614 URL: https://svnweb.freebsd.org/changeset/base/324614 Log: Fix wrong v_free_count annotation - (f) instead of (a) Reported by: alc Modified: head/sys/sys/vmmeter.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Sat Oct 14 00:47:30 2017 (r324613) +++ head/sys/sys/vmmeter.h Sat Oct 14 04:27:58 2017 (r324614) @@ -140,7 +140,7 @@ struct vmmeter { u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for laundering */ - u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */ + u_int v_free_count VMMETER_ALIGNED; /* (f) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ From owner-svn-src-all@freebsd.org Sat Oct 14 05:12:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD92AE3CFC1; Sat, 14 Oct 2017 05:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 974C163606; Sat, 14 Oct 2017 05:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id 17so11882084pfn.12; Fri, 13 Oct 2017 22:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Q5LUKRAsgEXzTrvcau/RxZ79hMFdORYi51iujfOn+/c=; b=fCAqTR508n3I46XKmAFjK2qkyL1bNmtmPedciP0TunbW8tGOZK876x7mQiiHfQ6Ysv KRGbMcmQy94Eiwg+hd9f6o5vdjBYv1A+m9veBUlIWJnujrQSAEa8ppzqU9HCy6Oo+1vD dudvGU35Zfqf80V/otEhi4hU7grn6rLHZw11FXXWa2eBpVedC5fXpkM7ClvUilxv4mY4 cH/vG5afjERSiH/axuQ81SFTldN4j616xeNQY+RXg7sCfx3LlUjIJm1JD0ihxWKC7U3w XMETPDL9HKHXmuogo94Lw1OFQYsKrKn0evBytGhKScvT00vL5IGJUXzT/trEyeAjBw8u xvCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Q5LUKRAsgEXzTrvcau/RxZ79hMFdORYi51iujfOn+/c=; b=ABZASdWTw3MAz4bN8S8aNw/Vvw91oOiCUKncUKAc0T/A81m/DyNhPBiVAH54SuYDUp kXN34gLfF5ZUPA5SpYWLUCJXebCs7lJjBGpgjB8PE/zB0IltEnt9SELT9LuRkEDzPa6C HqQqAlzteAb6x9RqOWKYNsdiYKude2D28WL9mw03TCwCeOuv8JcZPi+CdLrWQSf1q4RO dfiwLO59Ke6rh2eZYT52fa3UJ/Q/EzN50DkNjPR6y9vWHs3ziHMSc2z6MDtnnHNW2cM9 hqoF9/qELfghcNtf9DNZvVTsseceXm17tckE7xuQ+QCW0KAJ8NxqTReEJ4JNVpPWIsUP TGzA== X-Gm-Message-State: AMCzsaWnITeDGrpjE+Tt6tSXR/Zjk5eDoCY8UH5Sc4qDHl3eWGMS2I8x xTdvdY5FF6ZC6BtYIEL7nqzPPmXt X-Google-Smtp-Source: AOwi7QB72wThSF6iJ9GnnBcz9W1l6ApIKkvt3KeKWiy/vR451win+wb0q45AVx3jSHwDwS6ZBAKiSQ== X-Received: by 10.99.172.83 with SMTP id z19mr3111462pgn.46.1507957937666; Fri, 13 Oct 2017 22:12:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id o128sm4730490pfg.118.2017.10.13.22.12.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 22:12:16 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201710112153.v9BLroeR007323@repo.freebsd.org> Date: Fri, 13 Oct 2017 22:12:22 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> References: <201710112153.v9BLroeR007323@repo.freebsd.org> To: Matt Joras X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 05:12:18 -0000 --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 11, 2017, at 14:53, Matt Joras wrote: >=20 > Author: mjoras > Date: Wed Oct 11 21:53:50 2017 > New Revision: 324541 > URL: https://svnweb.freebsd.org/changeset/base/324541 >=20 > Log: > Add clearing function for unr(9). >=20 > Previously before you could call unrhdr_delete you needed to > individually free every allocated unit. It is useful to be able to = tear > down the unr without having to go through this process, as it is > significantly faster than freeing the individual units. >=20 > Reviewed by: cem, lidl > Approved by: rstone (mentor) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D12591 >=20 > Modified: > head/share/man/man9/Makefile > head/share/man/man9/unr.9 > head/sys/kern/subr_unit.c > head/sys/sys/systm.h >=20 > Modified: head/share/man/man9/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/Makefile Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/share/man/man9/Makefile Wed Oct 11 21:53:50 2017 = (r324541) > @@ -414,6 +414,7 @@ MAN=3D accept_filter.9 \ > MLINKS=3D unr.9 alloc_unr.9 \ > unr.9 alloc_unrl.9 \ > unr.9 alloc_unr_specific.9 \ > + unr.9 clear_unrhdr.9 \ > unr.9 delete_unrhdr.9 \ > unr.9 free_unr.9 \ > unr.9 new_unrhdr.9 >=20 > Modified: head/share/man/man9/unr.9 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/unr.9 Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/share/man/man9/unr.9 Wed Oct 11 21:53:50 2017 = (r324541) > @@ -24,11 +24,12 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 5, 2010 > +.Dd October 4, 2017 > .Dt UNR 9 > .Os > .Sh NAME > .Nm new_unrhdr , > +.Nm clear_unrhdr , > .Nm delete_unrhdr , > .Nm alloc_unr , > .Nm alloc_unr_specific , > @@ -39,6 +40,8 @@ > .Ft "struct unrhdr *" > .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" > .Ft void > +.Fn clear_unrhdr "struct unrhdr *uh" > +.Ft void > .Fn delete_unrhdr "struct unrhdr *uh" > .Ft int > .Fn alloc_unr "struct unrhdr *uh" > @@ -70,8 +73,16 @@ is not > .Dv NULL , > it is used for locking when allocating and freeing units. > Otherwise, internal mutex is used. > +.It Fn clear_unrhdr uh > +Clear all units from the specified unit number allocator entity. > +This function resets the entity as if it were just initialized with > +.Fn new_unrhdr . > .It Fn delete_unrhdr uh > -Destroy specified unit number allocator entity. > +Delete specified unit number allocator entity. > +This function frees the memory associated with the entity, it does = not free > +any units. > +To free all units use > +.Fn clear_unrhdr . > .It Fn alloc_unr uh > Return a new unit number. > The lowest free number is always allocated. >=20 > Modified: head/sys/kern/subr_unit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 = (r324541) > @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) > Free(uh); > } >=20 > +void > +clear_unrhdr(struct unrhdr *uh) > +{ > + struct unr *up, *uq; > + > + KASSERT(TAILQ_EMPTY(&uh->ppfree), > + ("unrhdr has postponed item for free")); > + up =3D TAILQ_FIRST(&uh->head); > + while (up !=3D NULL) { Could this be done with TAILQ_FOREACH_SAFE? -Ngie --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ4Zy3AAoJEPWDqSZpMIYVK7gQAL21exfm7Dzwiv+5DPPjurWW H7YkznsfYSDNIEuSx7TJJuQ4iawtShKYh8+fyGeKSDwclwqqVaKZqeqOUqUOCYch xt4U7cA7MJbSru6l8pn8Vc3B78dEWLZw/1PrAhbhjI7nT8fWMiNJeP9Bs26Px4QE 91YYHHoopqKh/gRI3tstPFmqCTzKgBbUgvS3BsPHC/M6tlgR+AWoZw6AK2O2FuMt EU6nxbBk5Lw2WLY2Daf7I+GA19bS2homXGQO5yHO3UTtyI6NgjXoEGUgKwnJATmT ibQVRNh38gGWC+ov808VkL9KHLqzgZvc1+aXG645DdylTN3pZM4lSGw2KY8FaF0p D8AZRq8bMQS8h2GBHQXDKYX1FITkd9IbqU8P+RPVAQoOn9RW7neTc/Kja+UCP8I/ P/lIhjPqFlsH+dHKMIevU9GbCSLHKPzNnxs4uG1Rjk/doqClnHCwvl+Of1Um7KoP +gJpSiWji1Yk/TH/DD9rZ9ZWIxE8ussgLiUWMHen09y5e/doLfz7jpB4pXwbeoQ1 m88B6KJB1xTkmKnH6KUauWOe7ALxqomPwMu8BJLuqCjIo6LSgWcs6oc41qiZa1wb iByiSw6u6RCo/Rhzhzlvud3vpIA8SfcaYi7jhz1IMal2zzj2PfhFK863ARCST2nl dCfFjNoP0fNp6sScEg0v =poKv -----END PGP SIGNATURE----- --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87-- From owner-svn-src-all@freebsd.org Sat Oct 14 06:33:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCD8E3EA25; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B862A657ED; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-pf0-f179.google.com with SMTP id t188so9493341pfd.10; Fri, 13 Oct 2017 23:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VcaZbJcjay7JIjFtVGFUTdbtp43sKzMaf9hlyzHLXPc=; b=V1Tw4YBgL++KFPUy+pTMQfw30coUQcfthMsj0x/qdBG4xzAt+GtjpL5GL2yHjdLUx7 Ba9uv7fOVEflwO+/oYWH1Lq2Ndx5uM6JRBBk6p/Ra1OeBCKH6kGJpy+DGv54e/tcoTMz IMtHpM7Bkzng2wXZg1oVydU/n44WjaruF4b+5BeXFFBy1lfRSml4+XUAI1ubv/XHpaEn RlSgQJYtci8z/YbDHuhHSibpbzKRsSzHUVQTaEkMXUsJ3fgj2DZpUj+aNNzrRRVjWt2l 78bm7y6eJHkf+2oGYbh9xz36BM2tSb01kLwOSISR0f+Hav2hZIM2rRM39SLDO/bjAqh0 MUxg== X-Gm-Message-State: AMCzsaX4eHJpi99mcQyoSDu8iaaBKQ3YyvUtlOt+JtuGMUxoEwSluGZQ DffW9wrYdw662bXu33VSoRobQkZl X-Google-Smtp-Source: AOwi7QCExboDykYgUlEoHtrZ/QmzooUYm/8WXkhbZrwqRrX4dhbgf7UGQ4sgyZvL7+c7jILfOiI08g== X-Received: by 10.99.111.197 with SMTP id k188mr3175995pgc.344.1507959391308; Fri, 13 Oct 2017 22:36:31 -0700 (PDT) Received: from [192.168.2.122] (174-24-242-218.tukw.qwest.net. [174.24.242.218]) by smtp.gmail.com with ESMTPSA id s83sm4907881pfg.104.2017.10.13.22.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 22:36:30 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> From: Matt Joras Message-ID: Date: Fri, 13 Oct 2017 22:36:26 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 06:33:17 -0000 On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote: >> Modified: head/sys/kern/subr_unit.c >> ============================================================================== >> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) >> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) >> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) >> Free(uh); >> } >> >> +void >> +clear_unrhdr(struct unrhdr *uh) >> +{ >> + struct unr *up, *uq; >> + >> + KASSERT(TAILQ_EMPTY(&uh->ppfree), >> + ("unrhdr has postponed item for free")); >> + up = TAILQ_FIRST(&uh->head); >> + while (up != NULL) { > Could this be done with TAILQ_FOREACH_SAFE? > -Ngie Yes but it is arguably inferior to do so. This while loop is theoretically faster since there is no need to individually remove the elements when you intend to delete every element. Matt From owner-svn-src-all@freebsd.org Sat Oct 14 09:47:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A26BE42F4A; Sat, 14 Oct 2017 09:47:38 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 251016AA9C; Sat, 14 Oct 2017 09:47:37 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-wm0-f65.google.com with SMTP id q124so25312095wmb.0; Sat, 14 Oct 2017 02:47:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mpK+llHje6RNi7gY1C/bEDuPGt/xW0V8xLkxBh1tBlE=; b=fnQWSwj5e0V2h2a77CEilM+iJXkCA7Je0B60sTWitled1XCPfghDPd3CB8h8OlVhb5 LUbCqxUP4flKEMZkdgexcgWRCg32DrGIuBF1jko3lNEgdoA9kax2k8LouIjkkbgN3bSq dz7bGzkayMATwOsuLN4S+fQzynSlY+n9ytNR+41Nqe9TBMIlSqLGVD7h2TOZz4B9Y1cd LNBL3QFpLYrpXrXk8ptXvjkZ6sdaqhXhjFJfUX9u4lKEHXjfPva7X6vrthIwRlTIo/lV LgF9nc3qCvlkDGMOIKt2aVpiGVbayjVwU704qFrRjpUxCyLET6KyiAq+8pdJ7BCaQjZj 0G9A== X-Gm-Message-State: AMCzsaUBYXaRXKFUl9aFsRh0OQzWayyj9mR3oMzrJ4ttCYy380tzO/lJ N2LNKmJfQTVoQ5SlIos+5DUzESOV X-Received: by 10.80.203.66 with SMTP id h2mr5406195edi.54.1507973015906; Sat, 14 Oct 2017 02:23:35 -0700 (PDT) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com. [74.125.82.42]) by smtp.gmail.com with ESMTPSA id j6sm1922250edj.58.2017.10.14.02.23.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 02:23:35 -0700 (PDT) Received: by mail-wm0-f42.google.com with SMTP id q124so25248301wmb.0; Sat, 14 Oct 2017 02:23:35 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QbD7o2Q2XMN5kAqA9L7FxLsl6efFJ833w8gUKOcKtmCv3usQS5K6F/5H339isEH4mH3Wg/vG7cAIfmlYvpQVg= X-Received: by 10.28.132.69 with SMTP id g66mr3726166wmd.13.1507973014970; Sat, 14 Oct 2017 02:23:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.20 with HTTP; Sat, 14 Oct 2017 02:23:34 -0700 (PDT) In-Reply-To: References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Svatopluk Kraus Date: Sat, 14 Oct 2017 11:23:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Mateusz Guzik Cc: Ian Lepore , Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 09:47:38 -0000 On Sat, Oct 14, 2017 at 2:48 AM, Mateusz Guzik wrote: > On Sat, Oct 14, 2017 at 2:30 AM, Ian Lepore wrote: >> >> On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: >> > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you >> > removed it actually. I have very bad feeling about it. But maybe, it's >> > really possible and in that case, a very good explanation should be >> > provided. >> > >> > Svata >> > >> >> The part that scares me is that DESTROYED may have been defined as >> CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of >> time. Any of the places that are testing the MTX_CONTESTED bit may >> have been relying somehow on the fact that a destroyed mutex has that >> bit set. >> >> Then again, maybe Mateusz has carefully analyzed all this stuff, and we >> should just relax. :) >> > > I highly doubt there was anything clever going on. Rather, someone wanted > to somehow denote a destroyed mutex, but did not want to introduce an > additional flag - they are not free since the field shares the value with > the > address of the owner. That is, adding flags requires increasing alignment > of struct thread and that adds to memory usage. Thus they combined the > flags in a way which can never happen under normal circumstances. > > mtx_destroy explicitly sets the value to MTX_DESTROYED, so there is no > change here. > > MTX_UNOWNED is *not* used as a flag. If you grep the tree you will see > it is only used in direct comparisons. > > That said, I reviewed all users again and a minor bug was introduced in > owner_mtx (only used by dtrace). For some reason it grabs the owner, > but the instead of checking if it grabbed anything it checks the flag > (fixed in r324613). So that's my bad. > > Justification for the change was provided in the commit message: it makes > .text smaller on amd64 and probably all architectures. > > -- > Mateusz Guzik I did not lack an explanation why you did it, but why it's possible and safe. Something like this: ----------------- (1) MTX_UNOWNED even if defined like a flag was never used like a flag. It was used like a value set for unowned mutex and test accordingly. There is no logical operation (AND, OR, ...) done with MTX_UNOWNED in code. There are only assignments and checks for equality there. Thus, we can change its value and do not pretend that it's a flag anymore. As mutex owner thread pointer and mutex flags are kept in one variable together, setting MTX_UNOWNED value to 0 is more appropriate and brings some benefits. However, MTX_DESTROYED flag must be distinguish from MTX_CONTESTED one now, so there is no savings considering mutex flags. (2) MTX_UNONWED value is used only internally within mutex implemention, thus this change should be quite safe. ----------------- However, I suggest to do something with MTX_UNOWNED leak in sys/dev/syscons/syscons.c. i.e. to make mtx_unowned() public and use it instead. Further, MTX_DESTROYED is not used like a flag too. So, was its redefinition really needed? In other words, isn't MTX_CONTESTED flag without owner thread pointer set enough? Also, I would prefer to have some explanation to be in mutex.h about all of this. At least to not mess flags with values in definitions without explanation. Svata From owner-svn-src-all@freebsd.org Sat Oct 14 10:03:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29665E435EC; Sat, 14 Oct 2017 10:03:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0589D6B1D4; Sat, 14 Oct 2017 10:03:00 +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 v9EA30jq032716; Sat, 14 Oct 2017 10:03:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EA2xfh032706; Sat, 14 Oct 2017 10:02:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710141002.v9EA2xfh032706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 14 Oct 2017 10:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324615 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 10:03:01 -0000 Author: tuexen Date: Sat Oct 14 10:02:59 2017 New Revision: 324615 URL: https://svnweb.freebsd.org/changeset/base/324615 Log: Code cleanup, not functional change. This avoids taking a pointer of a packed structure which allows simpler compilation of the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_constants.h Sat Oct 14 10:02:59 2017 (r324615) @@ -97,10 +97,6 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_DEFAULT_VRF_SIZE 4 -/* constants for rto calc */ -#define sctp_align_safe_nocopy 0 -#define sctp_align_unsafe_makecopy 1 - /* JRS - Values defined for the HTCP algorithm */ #define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ #define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_indata.c Sat Oct 14 10:02:59 2017 (r324615) @@ -3058,7 +3058,6 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru &stcb->asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); *rto_ok = 0; } @@ -4030,7 +4029,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } @@ -4636,7 +4634,6 @@ hopeless_peer: sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_input.c Sat Oct 14 10:02:59 2017 (r324615) @@ -517,7 +517,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, + net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -639,7 +639,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk tv.tv_sec = cp->heartbeat.hb_info.time_value_1; tv.tv_usec = cp->heartbeat.hb_info.time_value_2; /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, + r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, SCTP_RTT_FROM_NON_DATA); if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; @@ -1487,6 +1487,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle struct sctp_init_ack_chunk *initack_cp, initack_buf; struct sctp_nets *net; struct mbuf *op_err; + struct timeval old; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1647,10 +1648,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * since we did not send a HB make sure we don't * double things */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; net->RTO = sctp_calculate_rto(stcb, asoc, net, - &cookie->time_entered, - sctp_align_unsafe_makecopy, + &old, SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && @@ -2367,10 +2369,13 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp != NULL) && (*netp != NULL)) { + struct timeval old; + /* calculate the RTT and set the encaps port */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_RTT_FROM_NON_DATA); + &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2936,7 +2941,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, sctp_align_safe_nocopy, + &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_output.c Sat Oct 14 10:02:59 2017 (r324615) @@ -5501,6 +5501,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct struct sctp_paramhdr *ph; union sctp_sockstore *over_addr; struct sctp_scoping scp; + struct timeval now; #ifdef INET struct sockaddr_in *dst4 = (struct sockaddr_in *)dst; struct sockaddr_in *src4 = (struct sockaddr_in *)src; @@ -5601,7 +5602,9 @@ do_a_abort: memset(&stc, 0, sizeof(struct sctp_state_cookie)); /* the time I built cookie */ - (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&now); + stc.time_entered.tv_sec = now.tv_sec; + stc.time_entered.tv_usec = now.tv_usec; /* populate any tie tags */ if (asoc != NULL) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctputil.c Sat Oct 14 10:02:59 2017 (r324615) @@ -2422,8 +2422,8 @@ uint32_t sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, - struct timeval *told, - int safe, int rtt_from_sack) + struct timeval *old, + int rtt_from_sack) { /*- * given an association and the starting time of the current RTT @@ -2432,19 +2432,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb, int32_t rtt; /* RTT in ms */ uint32_t new_rto; int first_measure = 0; - struct timeval now, then, *old; + struct timeval now; - /* Copy it out for sparc64 */ - if (safe == sctp_align_unsafe_makecopy) { - old = &then; - memcpy(&then, told, sizeof(struct timeval)); - } else if (safe == sctp_align_safe_nocopy) { - old = told; - } else { - /* error */ - SCTP_PRINTF("Huh, bad rto calc call\n"); - return (0); - } /************************/ /* 1. calculate new RTT */ /************************/ Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctputil.h Sat Oct 14 10:02:59 2017 (r324615) @@ -135,7 +135,7 @@ void uint32_t sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, - struct sctp_nets *, struct timeval *, int, int); + struct sctp_nets *, struct timeval *, int); uint32_t sctp_calculate_len(struct mbuf *); From owner-svn-src-all@freebsd.org Sat Oct 14 15:16:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70FD7E4973C; Sat, 14 Oct 2017 15:16:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20F3F72F3A; Sat, 14 Oct 2017 15:16:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x22d.google.com with SMTP id f15so24502130qtf.7; Sat, 14 Oct 2017 08:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=opTdpQUfje3NYh95R37aKLvadG2jBp5lyBKb3Fi/Vq4=; b=Nny+qOxlfNYalM2n4BRD1REAxkGZ0H2o7XW/xMPaXq8lHTpUUuzIIT8MyJVKDKceeo O/jCIO7jUpQ0k9aWpq/qdzo8VL8mcN9Z7N2nLHE+EMcaRwJVjzPXT7gGbAdZT5C2rbXg mfG/t6iLPu38XhXvQckpSXxW8OtK7zJhy0b49psEQIfSyey/rUc8KOnC8IFFz1uQ6Eac xDzYwIYGkLzTCt7Pq5G6kjp205h3+ocCEHHalKce+r6vNloGrJbXFfjZm63MGGhPEQ65 WdrEkWtc/97ZT83iNh4GGWmDbog6K8vieJN+nNmOYTSOvKwaBUgSOIrKsJCgIQWtjQdj zn2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=opTdpQUfje3NYh95R37aKLvadG2jBp5lyBKb3Fi/Vq4=; b=nmvlt2bnqCLY2F/SDiObP9F02i0icfZWOkXYGH4fu7aIFCCRzZOxEkmfDymNTLKP1l Q9tYiLNzWEqcEPSCzz37dGBRWsYaIEBIYjWePq3WjRP17xKZRvUGcyvFtnyphPQsUNF7 o0WNLsx/9PTj0ZovO+vVc2by19QvkA5HXt1LKTR6hxpqYwiS34UHM9VeptnykCSmYKqt s4ONpzT4TOxKuz5wG7UgbZec25WJeRsTYVzweoPUwsh7HDmxqfjWX/EhKCEz1DtgHZuf 0mZto2Hix2mH7XXL8vJ6tU+pXR2rK5pdhCm2lxahxjN0Nj5JobWxqJ1gKNPtmEMRdpas /xdw== X-Gm-Message-State: AMCzsaVg+WMqVC/4TYdvR6C8smIYvG/u8jTp7RHaQdx9YPWhVLVOw5bw 9gXtewYFVp8D0xU44qb7owHS++nzf4j5M6tWFy7WMQ== X-Google-Smtp-Source: ABhQp+T+naHyeVTQxCd+En91UkuMYg9h8zTXLCFG6STVwpc/Ql5mHWrkfYDe0hikvvSNY9VVnx5sQAp+dIEoA0yYM2U= X-Received: by 10.237.63.202 with SMTP id w10mr2191990qth.56.1507994169185; Sat, 14 Oct 2017 08:16:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.51.167 with HTTP; Sat, 14 Oct 2017 08:16:08 -0700 (PDT) In-Reply-To: References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Mateusz Guzik Date: Sat, 14 Oct 2017 17:16:08 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Svatopluk Kraus Cc: Ian Lepore , Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 15:16:10 -0000 On Sat, Oct 14, 2017 at 11:23 AM, Svatopluk Kraus wrote: > On Sat, Oct 14, 2017 at 2:48 AM, Mateusz Guzik wrote: > > Justification for the change was provided in the commit message: it makes > > .text smaller on amd64 and probably all architectures. > > > > I did not lack an explanation why you did it, but why it's possible > and safe. Something like this: > ----------------- > (1) MTX_UNOWNED even if defined like a flag was never used like a > flag. It was used like a value set for unowned mutex and test > accordingly. There is no logical operation (AND, OR, ...) done with > MTX_UNOWNED in code. There are only assignments and checks for > equality there. Thus, we can change its value and do not pretend that > it's a flag anymore. As mutex owner thread pointer and mutex flags are > kept in one variable together, setting MTX_UNOWNED value to 0 is more > appropriate and brings some benefits. However, MTX_DESTROYED flag must > be distinguish from MTX_CONTESTED one now, so there is no savings > considering mutex flags. > (2) MTX_UNONWED value is used only internally within mutex > implemention, thus this change should be quite safe. > ----------------- > I guess that's a fair point, I figured some people may be wondering why switching to 0 makes any difference. On the other hand anyone worried about var usage can easily grep. Next time I'll be more verbose. > > However, I suggest to do something with MTX_UNOWNED leak in > sys/dev/syscons/syscons.c. i.e. to make mtx_unowned() public and use > it instead. Further, MTX_DESTROYED is not used like a flag too. So, > was its redefinition really needed? In other words, isn't > MTX_CONTESTED flag without owner thread pointer set enough? Also, I > would prefer to have some explanation to be in mutex.h about all of > this. At least to not mess flags with values in definitions without > explanation. > > The code in syscons looks extremely fishy, I don't know what to do with it yet. Testing for ownership should be avoidable with trylock. What you are proposing is an equivalent to the previous trick, but requires reading the lock owner. All places testing for MTX_DESTROYED would have to be updated which is an avoidable churn right now. Not employing the hack makes the flags self-explanatory. If a need for a new flag arises there are still 2 free bits and if that's not enough we can alter the current code. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Oct 14 16:23:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA15E4A79E; Sat, 14 Oct 2017 16:23:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B8174654; Sat, 14 Oct 2017 16:23:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EGNPZ3092792; Sat, 14 Oct 2017 16:23:25 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EGNPDK092791; Sat, 14 Oct 2017 16:23:25 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710141623.v9EGNPDK092791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 14 Oct 2017 16:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324616 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 324616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 16:23:26 -0000 Author: brooks Date: Sat Oct 14 16:23:25 2017 New Revision: 324616 URL: https://svnweb.freebsd.org/changeset/base/324616 Log: MFC r324243: Remove an unneeded and incorrect memset(). On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv) the __libc_allocate_tls function allocates thread local storage memory with calloc(). It then copies initialization data over the portions with non-zero initial values. Before this change it would then pointlessly zero the already zeroed remainder of the storage. Unfortunately the calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *)) additional bytes. In practice, this overflow only matters if the TLS segment is sized such that calloc() allocates less than TLS_TCB_SIZE extra memory. Even then, the likely result will be zeroing part of the next bucket. This coupled with the impact being confined to Tier II platforms means there will be no security advisory for this issue. Reviewed by: kib, dfr Discussed with: security-officer (delphij) Found by: CHERI Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12547 Modified: stable/11/lib/libc/gen/tls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/tls.c ============================================================================== --- stable/11/lib/libc/gen/tls.c Sat Oct 14 10:02:59 2017 (r324615) +++ stable/11/lib/libc/gen/tls.c Sat Oct 14 16:23:25 2017 (r324616) @@ -160,9 +160,6 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size if (tls_init_size > 0) memcpy((void*)dtv[2], tls_init, tls_init_size); - if (tls_static_space > tls_init_size) - memset((void*)(dtv[2] + tls_init_size), 0, - tls_static_space - tls_init_size); } return(tcb); From owner-svn-src-all@freebsd.org Sat Oct 14 16:49:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B93E4AD52; Sat, 14 Oct 2017 16:49:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E52A7505C; Sat, 14 Oct 2017 16:49:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EGndYL001683; Sat, 14 Oct 2017 16:49:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EGnd5R001682; Sat, 14 Oct 2017 16:49:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710141649.v9EGnd5R001682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 14 Oct 2017 16:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324617 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 324617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 16:49:40 -0000 Author: brooks Date: Sat Oct 14 16:49:39 2017 New Revision: 324617 URL: https://svnweb.freebsd.org/changeset/base/324617 Log: MFC r324243: Remove an unneeded and incorrect memset(). On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv) the __libc_allocate_tls function allocates thread local storage memory with calloc(). It then copies initialization data over the portions with non-zero initial values. Before this change it would then pointlessly zero the already zeroed remainder of the storage. Unfortunately the calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *)) additional bytes. In practice, this overflow only matters if the TLS segment is sized such that calloc() allocates less than TLS_TCB_SIZE extra memory. Even then, the likely result will be zeroing part of the next bucket. This coupled with the impact being confined to Tier II platforms means there will be no security advisory for this issue. Reviewed by: kib, dfr Discussed with: security-officer (delphij) Found by: CHERI Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12547 Modified: stable/10/lib/libc/gen/tls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/tls.c ============================================================================== --- stable/10/lib/libc/gen/tls.c Sat Oct 14 16:23:25 2017 (r324616) +++ stable/10/lib/libc/gen/tls.c Sat Oct 14 16:49:39 2017 (r324617) @@ -161,9 +161,6 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size if (tls_init_size > 0) memcpy((void*)dtv[2], tls_init, tls_init_size); - if (tls_static_space > tls_init_size) - memset((void*)(dtv[2] + tls_init_size), 0, - tls_static_space - tls_init_size); } return(tcb); From owner-svn-src-all@freebsd.org Sat Oct 14 17:51:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB0BDE285DA; Sat, 14 Oct 2017 17:51:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA3276BB6; Sat, 14 Oct 2017 17:51:26 +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 v9EHpPVm027642; Sat, 14 Oct 2017 17:51:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EHpPEN027641; Sat, 14 Oct 2017 17:51:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710141751.v9EHpPEN027641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 14 Oct 2017 17:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324618 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 324618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 17:51:27 -0000 Author: markj Date: Sat Oct 14 17:51:25 2017 New Revision: 324618 URL: https://svnweb.freebsd.org/changeset/base/324618 Log: MFC r324146: Have uiomove_object_page() keep accessed pages in the active queue. Modified: stable/11/sys/kern/uipc_shm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_shm.c ============================================================================== --- stable/11/sys/kern/uipc_shm.c Sat Oct 14 16:49:39 2017 (r324617) +++ stable/11/sys/kern/uipc_shm.c Sat Oct 14 17:51:25 2017 (r324618) @@ -203,12 +203,10 @@ uiomove_object_page(vm_object_t obj, size_t len, struc } vm_page_lock(m); vm_page_hold(m); - if (m->queue == PQ_NONE) { - vm_page_deactivate(m); - } else { - /* Requeue to maintain LRU ordering. */ - vm_page_requeue(m); - } + if (m->queue != PQ_ACTIVE) + vm_page_activate(m); + else + vm_page_reference(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); From owner-svn-src-all@freebsd.org Sat Oct 14 18:03:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DDF0E28A1C; Sat, 14 Oct 2017 18:03:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6A8771AE; Sat, 14 Oct 2017 18:03:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id z11so12774798pfk.4; Sat, 14 Oct 2017 11:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CUIss13Wa8vx+Oci+FoPgz43g4shiToZEU6EoGW64+4=; b=ghgU3aR4xZo7Mb73daflc5gj3wjF1d2QMvGtJm39TX7csOxLD4e1BHzIUix/JQfNUp WMk+s7qqAZ3GzUnjhPdzn3f0551Bf3An6oC1JeIjbnIhTpKBXnjY3TX9QvIEt29o6DGb jEdymFDiwka/9tiPxFv1okHc8VZUTs6c+6q3yx3049ZFNOV0zzus+NAGEkKV8w51YbJK kmAcnRPBFB0YBBsEwkLW/sYeJzVrzFc5/LjPid2xzAMUgIV+3NtrBGljYvtEPyqvnGk1 LW6HuMzaOEDDj86zDBcrWMWiNwFmkMwwZWuazc4N9SvkVRuWGJ/CestxkQopmyZI2cu9 W2AQ== 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=CUIss13Wa8vx+Oci+FoPgz43g4shiToZEU6EoGW64+4=; b=TDR3kgqJGCYpUguirnGpNW7qcobX6oJvKRhMno4PLfPFkAfyqFj7w8aXhisleKRVc8 CPN/3qAAaQQ/WUj8UwvNsmsIGeqTlDNvsA+wlRVHvh4jSIAJbsmqbbOKCGn/fneMEu0n MjIR9Sa3uRZ5ojOKAFr7rx7d/OWu1FJBHqyiXnAMkxLCDhq+6uQ/5BOvPyPuyra9DHIT hPMO1s102geqvOWfmq3uC1FTc/lFNEtIW+EtlOBLZoil5EW1TAM8iLGS0Rn7SUNNkWLL cXBbmoGBCgQLKrY9ev0RR6pdiujQaEBMUUze10mJ2bXZ313S82gfVhf5HC8D262lzz/3 iwQA== X-Gm-Message-State: AMCzsaVYH6XNpHhrO0dA+7OUH9Zpai+xdDEt/bMv1VNe0fjfjuSHODWz CFhmR/uACX83jwUB+dx4Giz8fw== X-Google-Smtp-Source: AOwi7QBd6FiS717/dtw2AwF8biBVTsIYmF3wkX6brA5S7lBLE3+UvZpzUmpJxZT6i4uk7cpDRDsF1Q== X-Received: by 10.84.246.204 with SMTP id j12mr4598153plt.240.1508004192411; Sat, 14 Oct 2017 11:03:12 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-39-234.dsl.bell.ca. [69.159.39.234]) by smtp.gmail.com with ESMTPSA id c73sm9306691pfd.139.2017.10.14.11.03.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 11:03:10 -0700 (PDT) Sender: Mark Johnston Date: Sat, 14 Oct 2017 14:03:05 -0400 From: Mark Johnston To: Matt Joras Cc: "Ngie Cooper (yaneurabeya)" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20171014180305.GA75158@raichu> References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 18:03:13 -0000 On Fri, Oct 13, 2017 at 10:36:26PM -0700, Matt Joras wrote: > On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote: > >> Modified: head/sys/kern/subr_unit.c > >> ============================================================================== > >> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) > >> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) > >> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) > >> Free(uh); > >> } > >> > >> +void > >> +clear_unrhdr(struct unrhdr *uh) > >> +{ > >> + struct unr *up, *uq; > >> + > >> + KASSERT(TAILQ_EMPTY(&uh->ppfree), > >> + ("unrhdr has postponed item for free")); > >> + up = TAILQ_FIRST(&uh->head); > >> + while (up != NULL) { > > Could this be done with TAILQ_FOREACH_SAFE? > > -Ngie > > > Yes but it is arguably inferior to do so. This while loop is > theoretically faster since there is no need to individually remove the > elements when you intend to delete every element. TAILQ_FOREACH_SAFE just fetches the next element at the beginning of each loop iteration rather than at the end, same as the current implementation of clear_unrhdr() does. There's no change to the code generated by clang when I replace your loop with: TAILQ_FOREACH_SAFE(up, &uh->head, list, uq) { if (up->ptr != uh) { Free(up->ptr); } Free(up); } From owner-svn-src-all@freebsd.org Sat Oct 14 18:38:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C04E2964B; Sat, 14 Oct 2017 18:38:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E39D57C23E; Sat, 14 Oct 2017 18:38:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EIcbw0047311; Sat, 14 Oct 2017 18:38:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EIcaOQ047300; Sat, 14 Oct 2017 18:38:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710141838.v9EIcaOQ047300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 14 Oct 2017 18:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324619 - in head/usr.bin/procstat: . tests X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/usr.bin/procstat: . tests X-SVN-Commit-Revision: 324619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 18:38:38 -0000 Author: brooks Date: Sat Oct 14 18:38:36 2017 New Revision: 324619 URL: https://svnweb.freebsd.org/changeset/base/324619 Log: Switch procstat from subcommand flags to verbs - Use an enumerated value instead of separate flags for commands - Look for a verb if no command flag is set - Lookup the "xocontainer" value based on the command - Document the new command verbs in the man-page Submitted by: kdrakehp@zoho.com Differential Revision: https://reviews.freebsd.org/D10916 Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_auxv.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_bin.c head/usr.bin/procstat/procstat_cred.c head/usr.bin/procstat/procstat_cs.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_ptlwpinfo.c head/usr.bin/procstat/procstat_rlimit.c head/usr.bin/procstat/procstat_rusage.c head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/procstat/procstat_vm.c head/usr.bin/procstat/tests/procstat_test.sh Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.1 Sat Oct 14 18:38:36 2017 (r324619) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2017 +.Dd October 14, 2017 .Dt PROCSTAT 1 .Os .Sh NAME @@ -34,14 +34,75 @@ .Sh SYNOPSIS .Nm .Op Fl -libxo -.Op Fl CHhn +.Op Fl h .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | L | r | s | S | t | v | x -.Op Fl a | Ar pid | Ar core ... +.Ar command +.Op Ar pid ... | Ar core ... +.Nm +.Op Fl -libxo +.Fl a +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Ar command +.Nm +.Op Fl -libxo +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Oo +.Fl b | +.Fl c | +.Fl e | +.Fl f Oo Fl C Oc | +.Fl i Oo Fl n Oc | +.Fl j Oo Fl n Oc | +.Fl k Oo Fl k Oc | +.Fl l | +.Fl r Oo Fl H Oc | +.Fl s | +.Fl S | +.Fl t | +.Fl v | +.Fl x +.Oc +.Op Ar pid ... | Ar core ... +.Nm +.Op Fl -libxo +.Fl a +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Oo +.Fl b | +.Fl c | +.Fl e | +.Fl f Oo Fl C Oc | +.Fl i Oo Fl n Oc | +.Fl j Oo Fl n Oc | +.Fl k Oo Fl k Oc | +.Fl l | +.Fl r Oo Fl H Oc | +.Fl s | +.Fl S | +.Fl t | +.Fl v | +.Fl x +.Oc +.Nm +.Op Fl -libxo +.Fl L +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Ar core ... .Sh DESCRIPTION -The .Nm utility displays detailed information about the processes identified by the .Ar pid @@ -51,49 +112,89 @@ flag is used, all processes. It can also display information extracted from a process core file, if the core file is specified as the argument. .Pp -By default, basic process statistics are printed; one of the following -options may be specified in order to select more detailed process information -for printing: -.Bl -tag -width indent -.It Fl -libxo -Generate output via +If the +.Fl -libxo +flag is specified the output is generated via .Xr libxo 3 in a selection of different human and machine readable formats. See .Xr xo_parse_args 3 for details on command line arguments. -.It Fl b +.Pp +The following commands are available: +.Bl -tag -width indent +.It Ar basic +Print basic process statistics (this is the default). +.It Ar binary | Fl b Display binary information for the process. -.It Fl c +.Pp +Substring commands are accepted. +.It Ar argument(s) | Fl c Display command line arguments for the process. -.It Fl e +.Pp +Substring commands are accepted. +.It Ar environment | Fl e Display environment variables for the process. -.It Fl f +.Pp +Substring commands are accepted. +.It Ar file(s) | Ar fd(s) | Fl f Display file descriptor information for the process. -.It Fl i +.Pp +If the +.Fl C +subcommand flag is used then additional capability information is printed. +.It Ar signal(s) | Fl i Display signal pending and disposition information for the process. -.It Fl j +.Pp +If the +.Fl n +subcommand option is used, the signal numbers are shown instead of signal +names. +.Pp +Substring commands are accepted. +.It Ar tsignal(s) | Fl j Display signal pending and blocked information for the process's threads. -.It Fl k +.Pp +If the +.Fl n +subcommand option is used, the signal numbers are shown instead of signal +names. +.Pp +Substring commands are accepted. +.It Ar kstack | Fl k Display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU and threads with stacks swapped to disk. -If the flag is repeated, function offsets as well as function names are -printed. -.It Fl l +.Pp +If the +.Fl v +subcommand option is used (or the command flag is repeated), function +offsets as well as function names are printed. +.It Ar rlimit | Fl l Display resource limits for the process. -.It Fl L +.It Ar ptlwpinfo | Fl L Display LWP info for the process pertaining to its signal driven exit. -.It Fl r +.It Ar rusage | Fl r Display resource usage information for the process. -.It Fl s +.Pp +If the +.Fl v +.Pq or Fl H +subcommand flag +is used then per-thread statistics are printed, rather than per-process +statistics. +The second field in the table will list the thread ID to which the row of +information corresponds. +.It Ar credential(s) | Fl s Display security credential information for the process. -.It Fl S +.Pp +Substring commands are accepted. +.It Ar cpuset | Ar cs | Fl S Display the cpuset information for the thread. -.It Fl t +.It Ar thread(s) | Fl t Display thread information for the process. -.It Fl v +.It Ar vm | Fl v Display virtual memory mappings for the process. -.It Fl x +.It Ar auxv | Fl x Display ELF auxiliary vector for the process. .El .Pp @@ -110,23 +211,6 @@ of the requested process information. If the .Fl w flag is not specified, the output will not repeat. -.Pp -The -.Fl C -flag requests the printing of additional capability information in the file -descriptor view. -.Pp -The -.Fl H -flag may be used to request per-thread statistics rather than per-process -statistics for some options. -For those options, the second field in the table will list the thread ID -to which the row of information corresponds. -The -.Fl H -flag is implied for the -.Fl S -mode. .Pp Information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.c Sat Oct 14 18:38:36 2017 (r324619) @@ -42,37 +42,111 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag; -static int lflag, Lflag, rflag, sflag, tflag, vflag, xflag, Sflag; -int hflag, nflag, Cflag, Hflag; +enum { + PS_CMP_NORMAL = 0x00, + PS_CMP_PLURAL = 0x01, + PS_CMP_SUBSTR = 0x02 +}; +struct procstat_cmd { + const char *command; + const char *xocontainer; + const char *usage; + void (*cmd)(struct procstat *, struct kinfo_proc *); + void (*opt)(int, char * const *); + int cmp; +}; + +int procstat_opts = 0; + +static void cmdopt_none(int argc, char * const argv[]); +static void cmdopt_verbose(int argc, char * const argv[]); +static void cmdopt_signals(int argc, char * const argv[]); +static void cmdopt_rusage(int argc, char * const argv[]); +static void cmdopt_files(int argc, char * const argv[]); +static void cmdopt_cpuset(int argc, char * const argv[]); + +static const struct procstat_cmd cmd_table[] = { + { "argument", "arguments", NULL, &procstat_args, &cmdopt_none, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "auxv", "auxv", NULL, &procstat_auxv, &cmdopt_none, PS_CMP_NORMAL }, + { "basic", "basic", NULL, &procstat_basic, &cmdopt_none, + PS_CMP_NORMAL }, + { "binary", "binary", NULL, &procstat_bin, &cmdopt_none, + PS_CMP_SUBSTR }, + { "cpuset", "cs", NULL, &procstat_cs, &cmdopt_cpuset, PS_CMP_NORMAL }, + { "cs", "cs", NULL, &procstat_cs, &cmdopt_cpuset, PS_CMP_NORMAL }, + { "credential", "credentials", NULL, &procstat_cred, &cmdopt_none, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "environment", "environment", NULL, &procstat_env, &cmdopt_none, + PS_CMP_SUBSTR }, + { "fd", "files", "[-C]", &procstat_files, &cmdopt_files, + PS_CMP_PLURAL }, + { "file", "files", "[-C]", &procstat_files, &cmdopt_files, + PS_CMP_PLURAL }, + { "kstack", "kstack", "[-v]", &procstat_kstack, &cmdopt_verbose, + PS_CMP_NORMAL }, + { "ptlwpinfo", "ptlwpinfo", NULL, &procstat_ptlwpinfo, &cmdopt_none, + PS_CMP_NORMAL }, + { "rlimit", "rlimit", NULL, &procstat_rlimit, &cmdopt_none, + PS_CMP_NORMAL }, + { "rusage", "rusage", "[-Ht]", &procstat_rusage, &cmdopt_rusage, + PS_CMP_NORMAL }, + { "signal", "signals", "[-n]", &procstat_sigs, &cmdopt_signals, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "thread", "threads", NULL, &procstat_threads, &cmdopt_none, + PS_CMP_PLURAL }, + { "tsignal", "thread_signals", "[-n]", &procstat_threads_sigs, + &cmdopt_signals, PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "vm", "vm", NULL, &procstat_vm, &cmdopt_none, PS_CMP_NORMAL } +}; + static void usage(void) { + size_t i, l; + int multi; - xo_error( - "usage: procstat [--libxo] [-Hhn] [-M core] " - "[-N system] [-w interval]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " -t | -v | -x]\n" - " [-a | pid ... | core ...]\n" - " procstat [--libxo] -Cf [-hn] [-M core] " - "[-N system] [-a | pid ... | core ...]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " procstat [--libxo] -L [-hn] [-M core] " - "[-N system] [-w interval]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " -t | -v | -x]\n" - " [core ...]\n"); + xo_error("usage: procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval] command\n" + " [pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system] " + " [-w interval] command\n" + " procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x] " + "[pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x]\n" + " procstat [--libxo] -L [-h] [-M core] [-N system] core ...\n" + "Available commands:\n"); + for (i = 0, l = nitems(cmd_table); i < l; i++) { + multi = i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; + xo_error(" %s%s%s", multi ? "[" : "", + cmd_table[i].command, (cmd_table[i].cmp & PS_CMP_PLURAL) ? + "(s)" : ""); + for (; i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; + i++) + xo_error(" | %s%s", cmd_table[i + 1].command, + (cmd_table[i].cmp & PS_CMP_PLURAL) ? "(s)" : ""); + if (multi) + xo_error("]"); + if (cmd_table[i].usage != NULL) + xo_error(" %s", cmd_table[i].usage); + xo_error("\n"); + } xo_finish(); exit(EX_USAGE); } static void -procstat(struct procstat *prstat, struct kinfo_proc *kipp) +procstat(const struct procstat_cmd *cmd, struct procstat *prstat, + struct kinfo_proc *kipp) { char *pidstr = NULL; @@ -80,40 +154,7 @@ procstat(struct procstat *prstat, struct kinfo_proc *k if (pidstr == NULL) xo_errc(1, ENOMEM, "Failed to allocate memory in procstat()"); xo_open_container(pidstr); - - if (bflag) - procstat_bin(prstat, kipp); - else if (cflag) - procstat_args(prstat, kipp); - else if (eflag) - procstat_env(prstat, kipp); - else if (fflag) - procstat_files(prstat, kipp); - else if (iflag) - procstat_sigs(prstat, kipp); - else if (jflag) - procstat_threads_sigs(prstat, kipp); - else if (kflag) - procstat_kstack(prstat, kipp, kflag); - else if (lflag) - procstat_rlimit(prstat, kipp); - else if (Lflag) - procstat_ptlwpinfo(prstat); - else if (rflag) - procstat_rusage(prstat, kipp); - else if (sflag) - procstat_cred(prstat, kipp); - else if (tflag) - procstat_threads(prstat, kipp); - else if (vflag) - procstat_vm(prstat, kipp); - else if (xflag) - procstat_auxv(prstat, kipp); - else if (Sflag) - procstat_cs(prstat, kipp); - else - procstat_basic(kipp); - + cmd->cmd(prstat, kipp); xo_close_container(pidstr); free(pidstr); } @@ -157,122 +198,158 @@ kinfo_proc_thread_name(const struct kinfo_proc *kipp) return (name); } +static const struct procstat_cmd * +getcmd(const char *str) +{ + const struct procstat_cmd *cmd; + size_t i, l; + int cmp, s; + + if (str == NULL) + return (NULL); + cmd = NULL; + if ((l = strlen(str)) == 0) + return (getcmd("basic")); + s = l > 1 && strcasecmp(str + l - 1, "s") == 0; + for (i = 0; i < nitems(cmd_table); i++) { + /* + * After the first match substring matches are disabled, + * allowing subsequent full matches to take precedence. + */ + if (cmd == NULL && (cmd_table[i].cmp & PS_CMP_SUBSTR)) + cmp = strncasecmp(str, cmd_table[i].command, l - + ((cmd_table[i].cmp & PS_CMP_PLURAL) && s ? 1 : 0)); + else if ((cmd_table[i].cmp & PS_CMP_PLURAL) && s && + l == strlen(cmd_table[i].command) + 1) + cmp = strncasecmp(str, cmd_table[i].command, l - 1); + else + cmp = strcasecmp(str, cmd_table[i].command); + if (cmp == 0) + cmd = &cmd_table[i]; + } + return (cmd); +} + int main(int argc, char *argv[]) { - int ch, interval, tmp; + int ch, interval; int i; struct kinfo_proc *p; + const struct procstat_cmd *cmd; struct procstat *prstat, *cprstat; long l; pid_t pid; char *dummy; char *nlistf, *memf; - const char *xocontainer; + int aflag; int cnt; interval = 0; + cmd = NULL; memf = nlistf = NULL; + aflag = 0; argc = xo_parse_args(argc, argv); - xocontainer = "basic"; while ((ch = getopt(argc, argv, "abCcefHhijkLlM:N:nrSstvw:x")) != -1) { switch (ch) { - case 'C': - Cflag++; - break; - - case 'H': - Hflag++; - break; - - case 'M': - memf = optarg; - break; - case 'N': - nlistf = optarg; - break; - case 'S': - Sflag++; - xocontainer = "cs"; - break; case 'a': aflag++; break; - case 'b': - bflag++; - xocontainer = "binary"; + if (cmd != NULL) + usage(); + cmd = getcmd("binary"); break; - + case 'C': + procstat_opts |= PS_OPT_CAPABILITIES; + break; case 'c': - cflag++; - xocontainer = "arguments"; + if (cmd != NULL) + usage(); + cmd = getcmd("arguments"); break; - case 'e': - eflag++; - xocontainer = "environment"; + if (cmd != NULL) + usage(); + cmd = getcmd("environment"); break; - case 'f': - fflag++; - xocontainer = "files"; + if (cmd != NULL) + usage(); + cmd = getcmd("files"); break; - + case 'H': + procstat_opts |= PS_OPT_PERTHREAD; + break; + case 'h': + procstat_opts |= PS_OPT_NOHEADER; + break; case 'i': - iflag++; - xocontainer = "signals"; + if (cmd != NULL) + usage(); + cmd = getcmd("signals"); break; - case 'j': - jflag++; - xocontainer = "thread_signals"; + if (cmd != NULL) + usage(); + cmd = getcmd("tsignals"); break; - case 'k': - kflag++; - xocontainer = "kstack"; + if (cmd->cmd == procstat_kstack) { + if ((procstat_opts & PS_OPT_VERBOSE) != 0) + usage(); + procstat_opts |= PS_OPT_VERBOSE; + } else { + if (cmd != NULL) + usage(); + cmd = getcmd("kstack"); + } break; - + case 'L': + if (cmd != NULL) + usage(); + cmd = getcmd("ptlwpinfo"); + break; case 'l': - lflag++; - xocontainer = "rlimit"; + if (cmd != NULL) + usage(); + cmd = getcmd("rlimit"); break; - - case 'L': - Lflag++; - xocontainer = "ptlwpinfo"; + case 'M': + memf = optarg; break; - + case 'N': + nlistf = optarg; + break; case 'n': - nflag++; + procstat_opts |= PS_OPT_SIGNUM; break; - - case 'h': - hflag++; - break; - case 'r': - rflag++; - xocontainer = "rusage"; + if (cmd != NULL) + usage(); + cmd = getcmd("rusage"); break; - + case 'S': + if (cmd != NULL) + usage(); + cmd = getcmd("cpuset"); + break; case 's': - sflag++; - xocontainer = "credentials"; + if (cmd != NULL) + usage(); + cmd = getcmd("credentials"); break; - case 't': - tflag++; - xocontainer = "threads"; + if (cmd != NULL) + usage(); + cmd = getcmd("threads"); break; - case 'v': - vflag++; - xocontainer = "vm"; + if (cmd != NULL) + usage(); + cmd = getcmd("vm"); break; - case 'w': l = strtol(optarg, &dummy, 10); if (*dummy != '\0') @@ -281,12 +358,11 @@ main(int argc, char *argv[]) usage(); interval = l; break; - case 'x': - xflag++; - xocontainer = "auxv"; + if (cmd != NULL) + usage(); + cmd = getcmd("auxv"); break; - case '?': default: usage(); @@ -296,24 +372,31 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + rflag + sflag + tflag + vflag + xflag + Sflag; - if (!(tmp == 0 || tmp == 1)) - usage(); + if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) { + if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0) + usage(); + if (cmd->opt != NULL) { + optreset = 1; + optind = 1; + cmd->opt(argc, argv); + argc -= optind; + argv += optind; + } else { + argc -= 1; + argv += 1; + } + } else { + if (cmd == NULL) + cmd = getcmd("basic"); + if (cmd->cmd != procstat_files && + (procstat_opts & PS_OPT_CAPABILITIES) != 0) + usage(); + } - /* We allow -k to be specified up to twice, but not more. */ - if (kflag > 2) - usage(); - /* Must specify either the -a flag or a list of pids. */ if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0)) usage(); - /* Only allow -C with -f. */ - if (Cflag && !fflag) - usage(); - if (memf != NULL) prstat = procstat_open_kvm(nlistf, memf); else @@ -323,7 +406,7 @@ main(int argc, char *argv[]) do { xo_set_version(PROCSTAT_XO_VERSION); xo_open_container("procstat"); - xo_open_container(xocontainer); + xo_open_container(cmd->xocontainer); if (aflag) { p = procstat_getprocs(prstat, KERN_PROC_PROC, 0, &cnt); @@ -331,10 +414,10 @@ main(int argc, char *argv[]) xo_errx(1, "procstat_getprocs()"); kinfo_proc_sort(p, cnt); for (i = 0; i < cnt; i++) { - procstat(prstat, &p[i]); + procstat(cmd, prstat, &p[i]); /* Suppress header after first process. */ - hflag = 1; + procstat_opts |= PS_OPT_NOHEADER; xo_flush(); } procstat_freeprocs(prstat, p); @@ -351,7 +434,7 @@ main(int argc, char *argv[]) if (p == NULL) xo_errx(1, "procstat_getprocs()"); if (cnt != 0) - procstat(prstat, p); + procstat(cmd, prstat, p); procstat_freeprocs(prstat, p); } else { cprstat = procstat_open_core(argv[i]); @@ -364,15 +447,15 @@ main(int argc, char *argv[]) if (p == NULL) xo_errx(1, "procstat_getprocs()"); if (cnt != 0) - procstat(cprstat, p); + procstat(cmd, cprstat, p); procstat_freeprocs(cprstat, p); procstat_close(cprstat); } /* Suppress header after first process. */ - hflag = 1; + procstat_opts |= PS_OPT_NOHEADER; } - xo_close_container(xocontainer); + xo_close_container(cmd->xocontainer); xo_close_container("procstat"); xo_finish(); if (interval) @@ -382,4 +465,96 @@ main(int argc, char *argv[]) procstat_close(prstat); exit(0); +} + +void +cmdopt_none(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch (ch) { + case '?': + default: + usage(); + } + } +} + +void +cmdopt_verbose(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + procstat_opts |= PS_OPT_VERBOSE; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_signals(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "n")) != -1) { + switch (ch) { + case 'n': + procstat_opts |= PS_OPT_SIGNUM; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_rusage(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "Ht")) != -1) { + switch (ch) { + case 'H': + /* FALLTHROUGH */ + case 't': + procstat_opts |= PS_OPT_PERTHREAD; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_files(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "C")) != -1) { + switch (ch) { + case 'C': + procstat_opts |= PS_OPT_CAPABILITIES; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_cpuset(int argc, char * const argv[]) +{ + + procstat_opts |= PS_OPT_PERTHREAD; + cmdopt_none(argc, argv); } Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.h Sat Oct 14 18:38:36 2017 (r324619) @@ -35,23 +35,34 @@ #define PROCSTAT_XO_VERSION "1" -extern int hflag, nflag, Cflag, Hflag; +enum { + PS_OPT_CAPABILITIES = 0x01, + PS_OPT_NOHEADER = 0x02, + PS_OPT_PERTHREAD = 0x04, + PS_OPT_SIGNUM = 0x08, + PS_OPT_VERBOSE = 0x10 +}; +#define PS_SUBCOMMAND_OPTS \ + (PS_OPT_CAPABILITIES | PS_OPT_SIGNUM | \ + PS_OPT_PERTHREAD | PS_OPT_VERBOSE) + +extern int procstat_opts; + struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); const char * kinfo_proc_thread_name(const struct kinfo_proc *kipp); void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_basic(struct kinfo_proc *kipp); +void procstat_basic(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, - int kflag); -void procstat_ptlwpinfo(struct procstat *prstat); +void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_ptlwpinfo(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_args.c Sat Oct 14 18:38:36 2017 (r324619) @@ -47,7 +47,7 @@ procstat_args(struct procstat *procstat, struct kinfo_ int i; char **args; - if (!hflag) { + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ARGS"); } @@ -74,7 +74,7 @@ procstat_env(struct procstat *procstat, struct kinfo_p int i; char **envs; - if (!hflag) { + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ENVIRONMENT"); } Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_auxv.c Sat Oct 14 18:38:36 2017 (r324619) @@ -51,7 +51,7 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ u_int count, i; static char prefix[256]; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %-16s %-16s}\n", "PID", "COMM", "AUXV", "VALUE"); Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_basic.c Sat Oct 14 18:38:36 2017 (r324619) @@ -39,10 +39,10 @@ #include "procstat.h" void -procstat_basic(struct kinfo_proc *kipp) +procstat_basic(struct procstat *procstat __unused, struct kinfo_proc *kipp) { - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %5s %5s %5s %5s %3s %-8s %-9s %-13s %-12s}\n", "PID", "PPID", "PGID", "SID", "TSID", "THR", "LOGIN", "WCHAN", "EMUL", "COMM"); Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_bin.c Sat Oct 14 18:38:36 2017 (r324619) @@ -46,7 +46,7 @@ procstat_bin(struct procstat *prstat, struct kinfo_pro int osrel; static char pathname[PATH_MAX]; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %8s %s}\n", "PID", "COMM", "OSREL", "PATH"); Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_cred.c Sat Oct 14 18:38:36 2017 (r324619) @@ -48,7 +48,7 @@ procstat_cred(struct procstat *procstat, struct kinfo_ unsigned int i, ngroups; gid_t *groups; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s}\n", "PID", "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", "SVGID", "UMASK", "FLAGS", "GROUPS"); Modified: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- head/usr.bin/procstat/procstat_cs.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_cs.c Sat Oct 14 18:38:36 2017 (r324619) @@ -52,7 +52,7 @@ procstat_cs(struct procstat *procstat, struct kinfo_pr unsigned int count, i; int once, twice, lastcpu, cpu; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s}\n", "PID", "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_files.c Sat Oct 14 18:38:36 2017 (r324619) @@ -303,7 +303,8 @@ procstat_files(struct procstat *procstat, struct kinfo */ capwidth = 0; head = procstat_getfiles(procstat, kipp, 0); - if (head != NULL && Cflag) { + if (head != NULL && + (procstat_opts & PS_OPT_CAPABILITIES) != 0) { STAILQ_FOREACH(fst, head, next) { width = width_capability(&fst->fs_cap_rights); if (width > capwidth) @@ -313,8 +314,8 @@ procstat_files(struct procstat *procstat, struct kinfo capwidth = strlen("CAPABILITIES"); } - if (!hflag) { - if (Cflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { + if ((procstat_opts & PS_OPT_CAPABILITIES) != 0) xo_emit("{T:/%5s %-16s %5s %1s %-8s %-*s " "%-3s %-12s}\n", "PID", "COMM", "FD", "T", "FLAGS", capwidth, "CAPABILITIES", "PRO", @@ -417,7 +418,7 @@ procstat_files(struct procstat *procstat, struct kinfo break; } xo_emit("{d:fd_type/%1s/%s} ", str); - if (!Cflag) { + if ((procstat_opts & PS_OPT_CAPABILITIES) == 0) { str = "-"; if (fst->fs_type == PS_FST_TYPE_VNODE) { error = procstat_get_vnode_info(procstat, fst, @@ -514,7 +515,7 @@ procstat_files(struct procstat *procstat, struct kinfo xo_emit("{elq:fd_flags/lock_held}"); xo_close_list("fd_flags"); - if (!Cflag) { + if ((procstat_opts & PS_OPT_CAPABILITIES) == 0) { if (fst->fs_ref_count > -1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Oct 14 19:02:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7250DE29E4B; Sat, 14 Oct 2017 19:02:53 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E307D07E; Sat, 14 Oct 2017 19:02:53 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EJ2qJo060280; Sat, 14 Oct 2017 19:02:52 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EJ2q3G060278; Sat, 14 Oct 2017 19:02:52 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201710141902.v9EJ2q3G060278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sat, 14 Oct 2017 19:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324620 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 324620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 19:02:53 -0000 Author: fsu Date: Sat Oct 14 19:02:52 2017 New Revision: 324620 URL: https://svnweb.freebsd.org/changeset/base/324620 Log: Add extended attributes support to fuse kernel module. Author: kem Reviewed by: cem, pfg (mentor) Approved by: pfg (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12485 Modified: head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Sat Oct 14 18:38:36 2017 (r324619) +++ head/sys/fs/fuse/fuse_ipc.c Sat Oct 14 19:02:52 2017 (r324620) @@ -636,23 +636,20 @@ fuse_body_audit(struct fuse_ticket *ftick, size_t blen break; case FUSE_SETXATTR: - panic("FUSE_SETXATTR implementor has forgotten to define a" - " response body format check"); + err = (blen == 0) ? 0 : EINVAL; break; case FUSE_GETXATTR: - panic("FUSE_GETXATTR implementor has forgotten to define a" - " response body format check"); - break; - case FUSE_LISTXATTR: - panic("FUSE_LISTXATTR implementor has forgotten to define a" - " response body format check"); + /* + * These can have varying response lengths, and 0 length + * isn't necessarily invalid. + */ + err = 0; break; case FUSE_REMOVEXATTR: - panic("FUSE_REMOVEXATTR implementor has forgotten to define a" - " response body format check"); + err = (blen == 0) ? 0 : EINVAL; break; case FUSE_FLUSH: Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sat Oct 14 18:38:36 2017 (r324619) +++ head/sys/fs/fuse/fuse_vnops.c Sat Oct 14 19:02:52 2017 (r324620) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -112,10 +113,13 @@ __FBSDID("$FreeBSD$"); static vop_access_t fuse_vnop_access; static vop_close_t fuse_vnop_close; static vop_create_t fuse_vnop_create; +static vop_deleteextattr_t fuse_vnop_deleteextattr; static vop_fsync_t fuse_vnop_fsync; static vop_getattr_t fuse_vnop_getattr; +static vop_getextattr_t fuse_vnop_getextattr; static vop_inactive_t fuse_vnop_inactive; static vop_link_t fuse_vnop_link; +static vop_listextattr_t fuse_vnop_listextattr; static vop_lookup_t fuse_vnop_lookup; static vop_mkdir_t fuse_vnop_mkdir; static vop_mknod_t fuse_vnop_mknod; @@ -128,6 +132,7 @@ static vop_remove_t fuse_vnop_remove; static vop_rename_t fuse_vnop_rename; static vop_rmdir_t fuse_vnop_rmdir; static vop_setattr_t fuse_vnop_setattr; +static vop_setextattr_t fuse_vnop_setextattr; static vop_strategy_t fuse_vnop_strategy; static vop_symlink_t fuse_vnop_symlink; static vop_write_t fuse_vnop_write; @@ -140,10 +145,13 @@ struct vop_vector fuse_vnops = { .vop_access = fuse_vnop_access, .vop_close = fuse_vnop_close, .vop_create = fuse_vnop_create, + .vop_deleteextattr = fuse_vnop_deleteextattr, .vop_fsync = fuse_vnop_fsync, .vop_getattr = fuse_vnop_getattr, + .vop_getextattr = fuse_vnop_getextattr, .vop_inactive = fuse_vnop_inactive, .vop_link = fuse_vnop_link, + .vop_listextattr = fuse_vnop_listextattr, .vop_lookup = fuse_vnop_lookup, .vop_mkdir = fuse_vnop_mkdir, .vop_mknod = fuse_vnop_mknod, @@ -157,6 +165,7 @@ struct vop_vector fuse_vnops = { .vop_rename = fuse_vnop_rename, .vop_rmdir = fuse_vnop_rmdir, .vop_setattr = fuse_vnop_setattr, + .vop_setextattr = fuse_vnop_setextattr, .vop_strategy = fuse_vnop_strategy, .vop_symlink = fuse_vnop_symlink, .vop_write = fuse_vnop_write, @@ -1956,6 +1965,383 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) } } return rtvals[0]; +} + +static const char extattr_namespace_separator = '.'; + +/* + struct vop_getextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct uio *a_uio; + size_t *a_size; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_getextattr(struct vop_getextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_getxattr_in *get_xattr_in; + struct fuse_getxattr_out *get_xattr_out; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len + sizeof(*get_xattr_in)); + fdisp_make_vp(&fdi, FUSE_GETXATTR, vp, td, cred); + + get_xattr_in = fdi.indata; + /* + * Check to see whether we're querying the available size or + * issuing the actual request. If we pass in 0, we get back struct + * fuse_getxattr_out. If we pass in a non-zero size, we get back + * that much data, without the struct fuse_getxattr_out header. + */ + if (ap->a_size != NULL) + get_xattr_in->size = 0; + else + get_xattr_in->size = uio->uio_resid; + + attr_str = (char *)fdi.indata + sizeof(*get_xattr_in); + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = fdisp_wait_answ(&fdi); + + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_GETXATTR); + debug_printf("getxattr: got err=%d from daemon\n", err); + goto out; + } + + /* + * If we get to this point (i.e. no error), we should have a valid + * answer of some sort. i.e. non-zero iosize and a valid pointer. + */ + if ((fdi.answ == NULL) || (fdi.iosize == 0)) { + debug_printf("getxattr: err = 0, but answ = %p, iosize = %zu\n", + fdi.answ, fdi.iosize); + err = EINVAL; + goto out; + } + get_xattr_out = fdi.answ; + + if (ap->a_size != NULL) { + *ap->a_size = get_xattr_out->size; + } else if (fdi.iosize > 0) { + err = uiomove(fdi.answ, fdi.iosize, uio); + } else { + err = EINVAL; + } + +out: + fdisp_destroy(&fdi); + return (err); +} + +/* + struct vop_setextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct uio *a_uio; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_setextattr(struct vop_setextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_setxattr_in *set_xattr_in; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len + sizeof(*set_xattr_in) + uio->uio_resid); + fdisp_make_vp(&fdi, FUSE_SETXATTR, vp, td, cred); + + set_xattr_in = fdi.indata; + set_xattr_in->size = uio->uio_resid; + + attr_str = (char *)fdi.indata + sizeof(*set_xattr_in); + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = uiomove((char *)fdi.indata + sizeof(*set_xattr_in) + len, + uio->uio_resid, uio); + if (err != 0) { + debug_printf("setxattr: got error %d from uiomove\n", err); + goto out; + } + + err = fdisp_wait_answ(&fdi); + + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_SETXATTR); + debug_printf("setxattr: got err=%d from daemon\n", err); + goto out; + } + +out: + fdisp_destroy(&fdi); + return (err); +} + +/* + * The Linux / FUSE extended attribute list is simply a collection of + * NUL-terminated strings. The FreeBSD extended attribute list is a single + * byte length followed by a non-NUL terminated string. So, this allows + * conversion of the Linux / FUSE format to the FreeBSD format in place. + * Linux attribute names are reported with the namespace as a prefix (e.g. + * "user.attribute_name"), but in FreeBSD they are reported without the + * namespace prefix (e.g. "attribute_name"). So, we're going from: + * + * user.attr_name1\0user.attr_name2\0 + * + * to: + * + * attr_name1attr_name2 + * + * Where "" is a single byte number of characters in the attribute name. + * + * Args: + * prefix - exattr namespace prefix string + * list, list_len - input list with namespace prefixes + * bsd_list, bsd_list_len - output list compatible with bsd vfs + */ +static int +fuse_xattrlist_convert(char *prefix, const char *list, int list_len, + char *bsd_list, int *bsd_list_len) +{ + int len, pos, dist_to_next, prefix_len; + + pos = 0; + *bsd_list_len = 0; + prefix_len = strlen(prefix); + + while (pos < list_len && list[pos] != '\0') { + dist_to_next = strlen(&list[pos]) + 1; + if (bcmp(&list[pos], prefix, prefix_len) == 0 && + list[pos + prefix_len] == extattr_namespace_separator) { + len = dist_to_next - + (prefix_len + sizeof(extattr_namespace_separator)) - 1; + if (len >= EXTATTR_MAXNAMELEN) + return (ENAMETOOLONG); + + bsd_list[*bsd_list_len] = len; + memcpy(&bsd_list[*bsd_list_len + 1], + &list[pos + prefix_len + + sizeof(extattr_namespace_separator)], len); + + *bsd_list_len += len + 1; + } + + pos += dist_to_next; + } + + return (0); +} + +/* + struct vop_listextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + struct uio *a_uio; + size_t *a_size; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_listextattr(struct vop_listextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_getxattr_in *get_xattr_in; + struct fuse_getxattr_out *get_xattr_out; + struct mount *mp = vnode_mount(vp); + size_t len; + char *prefix; + char *attr_str; + char *bsd_list = NULL; + int bsd_list_len; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* + * Add space for a NUL and the period separator if enabled. + * Default to looking for user attributes. + */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + 1; + + fdisp_init(&fdi, sizeof(*get_xattr_in) + len); + fdisp_make_vp(&fdi, FUSE_LISTXATTR, vp, td, cred); + + get_xattr_in = fdi.indata; + if (ap->a_size != NULL) + get_xattr_in->size = 0; + else + get_xattr_in->size = uio->uio_resid + sizeof(*get_xattr_out); + + + attr_str = (char *)fdi.indata + sizeof(*get_xattr_in); + snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator); + + err = fdisp_wait_answ(&fdi); + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_LISTXATTR); + debug_printf("listextattr: got err=%d from daemon\n", err); + goto out; + } + + if ((fdi.answ == NULL) || (fdi.iosize == 0)) { + err = EINVAL; + goto out; + } + get_xattr_out = fdi.answ; + + if (ap->a_size != NULL) { + *ap->a_size = get_xattr_out->size; + } else if (fdi.iosize > 0) { + /* + * The Linux / FUSE attribute list format isn't the same + * as FreeBSD's format. So we need to transform it into + * FreeBSD's format before giving it to the user. + */ + bsd_list = malloc(fdi.iosize, M_TEMP, M_WAITOK); + err = fuse_xattrlist_convert(prefix, fdi.answ, fdi.iosize, + bsd_list, &bsd_list_len); + if (err != 0) + goto out; + + err = uiomove(bsd_list, bsd_list_len, uio); + } else { + debug_printf("listextattr: returned iosize %zu for %s attribute list is " + "too small\n", fdi.iosize, prefix); + err = EINVAL; + } + +out: + free(bsd_list, M_TEMP); + fdisp_destroy(&fdi); + return (err); +} + +/* + struct vop_deleteextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_deleteextattr(struct vop_deleteextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct fuse_dispatcher fdi = {0}; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len); + fdisp_make_vp(&fdi, FUSE_REMOVEXATTR, vp, td, cred); + + attr_str = fdi.indata; + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = fdisp_wait_answ(&fdi); + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_REMOVEXATTR); + debug_printf("removexattr: got err=%d from daemon\n", err); + } + + fdisp_destroy(&fdi); + return (err); } /* From owner-svn-src-all@freebsd.org Sat Oct 14 23:25:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B83E2F5A4; Sat, 14 Oct 2017 23:25:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5E4583A6A; Sat, 14 Oct 2017 23:25:45 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9ENPiHY068918; Sat, 14 Oct 2017 23:25:44 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ENPiXG068917; Sat, 14 Oct 2017 23:25:44 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710142325.v9ENPiXG068917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 14 Oct 2017 23:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324621 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 324621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 23:25:46 -0000 Author: rlibby Date: Sat Oct 14 23:25:44 2017 New Revision: 324621 URL: https://svnweb.freebsd.org/changeset/base/324621 Log: mlx4: use enum constants instead of const vars for case exprs Follow up from r324201 to fix compilation with gcc, which complains about non-ICE case expressions. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D12675 Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Sat Oct 14 19:02:52 2017 (r324620) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Sat Oct 14 23:25:44 2017 (r324621) @@ -558,26 +558,28 @@ mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_e static __inline int mlx4_en_rss_hash(__be16 status, int udp_rss) { - const __be16 status_all = cpu_to_be16( + enum { + status_all = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPV4F | MLX4_CQE_STATUS_IPV6 | MLX4_CQE_STATUS_TCP | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv4_tcp = cpu_to_be16( + MLX4_CQE_STATUS_UDP), + status_ipv4_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | - MLX4_CQE_STATUS_TCP); - const __be16 status_ipv6_tcp = cpu_to_be16( + MLX4_CQE_STATUS_TCP), + status_ipv6_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | - MLX4_CQE_STATUS_TCP); - const __be16 status_ipv4_udp = cpu_to_be16( + MLX4_CQE_STATUS_TCP), + status_ipv4_udp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv6_udp = cpu_to_be16( + MLX4_CQE_STATUS_UDP), + status_ipv6_udp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv4 = cpu_to_be16(MLX4_CQE_STATUS_IPV4); - const __be16 status_ipv6 = cpu_to_be16(MLX4_CQE_STATUS_IPV6); + MLX4_CQE_STATUS_UDP), + status_ipv4 = cpu_to_be16(MLX4_CQE_STATUS_IPV4), + status_ipv6 = cpu_to_be16(MLX4_CQE_STATUS_IPV6) + }; status &= status_all; switch (status) { From owner-svn-src-all@freebsd.org Sat Oct 14 23:34:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BC8E2F80E; Sat, 14 Oct 2017 23:34:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC12D83E5A; Sat, 14 Oct 2017 23:34:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id l23so13204530lfk.10; Sat, 14 Oct 2017 16:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dtXxX9hxzvPa5UAlCvInepabY0joi+ZZofuyX3ayniQ=; b=jR0YNG0KwE6LCfH33G5lWnQHTkAFsopXr1KQVC0IIQ2FvVY4CrEnPRky65LB6UJxqE F1ynVoax8/jDK+OuFyLC/svpEP/agLlv6s60pmSNjUmXugxit2PbkMxXp0xHQdbzeAor KpFmOM+i0hkn47pQu0Ri+bvgKzZ+v5hevV3LFIExgrZ1Ar+B+YZ+aWFx3KLGdfYsuXBv CVgT0HKbBEUj/2M3xW+FKrxNgqCe3Sj3y0JlSTe8iZwya1vvRKkpGSL63zJEc17+PtSi pcAAGRbhDDyGv4YW8nJVmKwBmFIFvVSiNnZ0kLfNM5v9Lcyd+QtFqNduy+az8FHpBbPf PNdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dtXxX9hxzvPa5UAlCvInepabY0joi+ZZofuyX3ayniQ=; b=U9ysHGQUjctrYSwO1NKh5kPzUjQ0IA/8JGXMgJFJ+jDC8+vhzrppOCPkmIYtXsMWMN 9FtisXnZpx0IivjjONhX6IRMiFYI5I2tPO+4sNXUf71VEJALZzTqMa393e0qo7yLMOFz n6WLbHfKU6AsNf02MwjoLEKd/eOVAZfUZ6mdtHPbIu3TfozsffMf6a3yKlevK9mve2T1 3ruzKYevZjPK4KjAIXzifCpXghPAjEXf7Hp8EK89ueW/SJmXzZuJvvKj3WbeT1PmYB6+ TR2d7o/emEhFOFK50J6/X/UzDu0+MeJmwtJCFwDviN34pH3RtAcYkXF0GM2qA4EDczf9 nsyg== X-Gm-Message-State: AMCzsaXu+9OaJiU8cT8meIYhPMHHT0+/gvGJ96FJyF81vZr9tYfJ8dvd gRKITBPH1JzVAmBAbB9KgO1bTR9C/7xTVN4E//E= X-Google-Smtp-Source: AOwi7QAJcP+il4lB9fVqk+MLD8qbcMU9wwivr5Yg0/A9lxVEH5xrgcuryowrf/Vx0GeJfXXSIIvEaIvknjLjyNw4gck= X-Received: by 10.46.41.6 with SMTP id u6mr2512058lje.130.1508024041568; Sat, 14 Oct 2017 16:34:01 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.7.153 with HTTP; Sat, 14 Oct 2017 16:34:00 -0700 (PDT) In-Reply-To: <201710141902.v9EJ2q3G060278@repo.freebsd.org> References: <201710141902.v9EJ2q3G060278@repo.freebsd.org> From: Alan Somers Date: Sat, 14 Oct 2017 17:34:00 -0600 X-Google-Sender-Auth: 0Nwl9HGIrgk4JAq7FLnsXv0CE9w Message-ID: Subject: Re: svn commit: r324620 - head/sys/fs/fuse To: Fedor Uporov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 23:34:05 -0000 On Sat, Oct 14, 2017 at 1:02 PM, Fedor Uporov wrote: > Author: fsu > Date: Sat Oct 14 19:02:52 2017 > New Revision: 324620 > URL: https://svnweb.freebsd.org/changeset/base/324620 > > Log: > Add extended attributes support to fuse kernel module. > > Author: kem > Reviewed by: cem, pfg (mentor) > Approved by: pfg (mentor) > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D12485 +1 Also, this should be mentioned in the release notes.