svn commit: r333241 - head/sys/amd64/amd64
Author: mjg Date: Fri May 4 04:05:07 2018 New Revision: 333241 URL: https://svnweb.freebsd.org/changeset/base/333241 Log: amd64: get rid of the pessimized bcopy in syscall arg copy The code was unnecessarily conditionally copying either 5 or 6 args. It can blindly copy 6, which also means the size is known at compilation time and the operation can be depessimized. Note the entire syscall handling code is rather slow. Tested on Skylake, sample result for getppid (calls/s): without pti: 7310106 -> 10653569 with pti: 3304843 -> 4148306 Some syscalls (like read) did not note any difference, other have typically very modest wins. Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c == --- head/sys/amd64/amd64/trap.c Fri May 4 04:00:48 2018(r333240) +++ head/sys/amd64/amd64/trap.c Fri May 4 04:05:07 2018(r333241) @@ -908,7 +908,7 @@ cpu_fetch_syscall_args(struct thread *td) error = 0; argp = >tf_rdi; argp += reg; - bcopy(argp, sa->args, sizeof(sa->args[0]) * regcnt); + bcopy(argp, sa->args, sizeof(sa->args[0]) * 6); if (sa->narg > regcnt) { KASSERT(params != NULL, ("copyin args with no params!")); error = copyin(params, >args[regcnt], ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333240 - in head/sys: powerpc/powerpc sys
Author: mjg Date: Fri May 4 04:00:48 2018 New Revision: 333240 URL: https://svnweb.freebsd.org/changeset/base/333240 Log: Allow __builtin_memmove instead of bcopy for small buffers of known size See r323329 for an explanation why this is a good idea. Modified: head/sys/powerpc/powerpc/bcopy.c head/sys/sys/systm.h Modified: head/sys/powerpc/powerpc/bcopy.c == --- head/sys/powerpc/powerpc/bcopy.cFri May 4 03:44:12 2018 (r333239) +++ head/sys/powerpc/powerpc/bcopy.cFri May 4 04:00:48 2018 (r333240) @@ -143,7 +143,7 @@ done: } void -bcopy(const void *src0, void *dst0, size_t length) +(bcopy)(const void *src0, void *dst0, size_t length) { memcpy(dst0, src0, length); Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hFri May 4 03:44:12 2018(r333239) +++ head/sys/sys/systm.hFri May 4 04:00:48 2018(r333240) @@ -259,6 +259,12 @@ void hexdump(const void *ptr, int length, const char * #define ovbcopy(f, t, l) bcopy((f), (t), (l)) void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len); +#define bcopy(from, to, len) ({\ + if (__builtin_constant_p(len) && (len) <= 64) \ + __builtin_memmove((to), (from), (len)); \ + else\ + bcopy((from), (to), (len)); \ +}) void bzero(void * _Nonnull buf, size_t len); #define bzero(buf, len) ({ \ if (__builtin_constant_p(len) && (len) <= 64) \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333239 - head/sys/fs/msdosfs
Author: pfg Date: Fri May 4 03:44:12 2018 New Revision: 333239 URL: https://svnweb.freebsd.org/changeset/base/333239 Log: msdosfs: long names of files are created incorrectly. This fixes a regression that happened in r120492 (2003) where libkiconv was introduced and we went from checking unlen to checking for '\0'. PR: 111843 Patch by: Damjan Jovanovic MFC after:1 week Modified: head/sys/fs/msdosfs/msdosfs_conv.c Modified: head/sys/fs/msdosfs/msdosfs_conv.c == --- head/sys/fs/msdosfs/msdosfs_conv.c Fri May 4 03:23:45 2018 (r333238) +++ head/sys/fs/msdosfs/msdosfs_conv.c Fri May 4 03:44:12 2018 (r333239) @@ -570,7 +570,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine if (!code) end = WIN_LAST; } - if (*un == '\0') + if (!unlen) end = WIN_LAST; wep->weCnt |= end; return !end; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333238 - head/share/man/man9
Author: kevans Date: Fri May 4 03:23:45 2018 New Revision: 333238 URL: https://svnweb.freebsd.org/changeset/base/333238 Log: style(9): add some additional useful FILES/xref information Submitted by: 0mp Reviewed by: imp Differential Revision:https://reviews.freebsd.org/D15196 Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 == --- head/share/man/man9/style.9 Fri May 4 03:17:44 2018(r333237) +++ head/share/man/man9/style.9 Fri May 4 03:23:45 2018(r333238) @@ -404,8 +404,7 @@ When convention requires a make its name match the struct tag. Avoid typedefs ending in .Dq Li _t , -except as specified in Standard C or by -.Tn POSIX . +except as specified in Standard C or by POSIX. .Bd -literal /* Make the structure name match the typedef. */ typedefstruct bar { @@ -861,11 +860,25 @@ Whenever possible, code should be run through a code c (e.g., various static analyzers or .Nm cc Fl Wall ) and produce minimal warnings. +.Sh FILES +.Bl -tag -width indent +.It Pa /usr/src/tools/tools/editing/freebsd.el +An Emacs plugin to follow the +.Fx +.Nm +indentation rules. +.It Pa /usr/src/tools/tools/editing/freebsd.vim +A Vim plugin to follow the +.Fx +.Nm +indentation rules. +.El .Sh SEE ALSO .Xr indent 1 , .Xr err 3 , .Xr warn 3 , -.Xr style.Makefile 5 +.Xr style.Makefile 5 , +.Xr style.lua 9 .Sh HISTORY This manual page is largely based on the .Pa src/admin/style/style ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333237 - head/share/man/man5
Author: kevans Date: Fri May 4 03:17:44 2018 New Revision: 333237 URL: https://svnweb.freebsd.org/changeset/base/333237 Log: Regen src.conf(5) after r333236 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Fri May 4 03:13:25 2018 (r333236) +++ head/share/man/man5/src.conf.5 Fri May 4 03:17:44 2018 (r333237) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd March 7, 2018 +.Dd May 3, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -219,9 +219,6 @@ Set to not build the BSD licensed version of cpio base .Xr libarchive 3 . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. -.It Va WITH_BSD_GREP_FASTMATCH -Set this option to use the fastmatch implementation in -.Xr bsdgrep 1 . .It Va WITHOUT_BSNMP Set to not build or install .Xr bsnmpd 1 @@ -436,18 +433,12 @@ Set to not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL Set to not build .Xr cxgbetool 8 -.It Va WITHOUT_MLX5TOOL -Set to not build -.Xr mlx5tool 8 .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 -.It Va WITH_MLX5TOOL -Set to build -.Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. @@ -965,12 +956,12 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLDB Set to not build the LLDB debugger. .Pp @@ -1022,12 +1013,12 @@ amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader and /boot/zfsloader on x86. This option is a nop on all other platforms. @@ -1182,6 +1173,18 @@ This must be set in the environment, make command line .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITHOUT_MLX5TOOL +Set to not build +.Xr mlx5tool 8 +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_MLX5TOOL +Set to build +.Xr mlx5tool 8 +.Pp +This is a default setting on +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_NAND Set to build the NAND Flash components. .It Va WITHOUT_NDIS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333236 - in head: share/mk tools/build/options usr.bin/grep usr.bin/grep/regex
Author: kevans Date: Fri May 4 03:13:25 2018 New Revision: 333236 URL: https://svnweb.freebsd.org/changeset/base/333236 Log: bsdgrep: annihilate our in-tree TRE, previously disabled by default It was an old TRE that had plenty of bugs and no performance gain over regex(3). I disabled it by default in r323615, and there was some confusion about what the knob does- likely due to poor naming on my part- to the tune of "well, it sounds like it should speed things up" (mentioned by multiple people). To compound this, I have no intention of maintaining a second regex implementation. If someone would like to step up and volunteer to maintain a lean-and-mean implementation for grep, this is OK, but we have very few volunteers to maintain even our primary regex implementation. Deleted: head/tools/build/options/WITHOUT_BSD_GREP_FASTMATCH head/tools/build/options/WITH_BSD_GREP_FASTMATCH head/usr.bin/grep/regex/ Modified: head/share/mk/bsd.prog.mk head/share/mk/src.opts.mk head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/share/mk/bsd.prog.mk == --- head/share/mk/bsd.prog.mk Fri May 4 01:36:49 2018(r333235) +++ head/share/mk/bsd.prog.mk Fri May 4 03:13:25 2018(r333236) @@ -271,6 +271,7 @@ SCRIPTSGRP_${script:T}?=${SCRIPTSGRP} SCRIPTSMODE_${script:T}?= ${SCRIPTSMODE} STAGE_AS_${script:T}= ${SCRIPTSDIR_${script:T}}/${SCRIPTSNAME_${script:T}} _scriptsinstall: _SCRIPTSINS_${script:T} + echo ">SFD>F>DF YES" _SCRIPTSINS_${script:T}: ${script} ${INSTALL} ${TAG_ARGS} -o ${SCRIPTSOWN_${.ALLSRC:T}} \ -g ${SCRIPTSGRP_${.ALLSRC:T}} -m ${SCRIPTSMODE_${.ALLSRC:T}} \ Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Fri May 4 01:36:49 2018(r333235) +++ head/share/mk/src.opts.mk Fri May 4 03:13:25 2018(r333236) @@ -187,7 +187,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ -BSD_GREP_FASTMATCH \ CLANG_EXTRAS \ DTRACE_TESTS \ GNU_GREP_COMPAT \ Modified: head/usr.bin/grep/Makefile == --- head/usr.bin/grep/Makefile Fri May 4 01:36:49 2018(r333235) +++ head/usr.bin/grep/Makefile Fri May 4 03:13:25 2018(r333236) @@ -17,15 +17,6 @@ bsdgrep.1: grep.1 .endif SRCS= file.c grep.c queue.c util.c -.if ${MK_BSD_GREP_FASTMATCH} == "yes" -# Extra files ported backported for some regex improvements -.PATH: ${.CURDIR}/regex -SRCS+= fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c -CFLAGS+=-I${.CURDIR}/regex -.else -CFLAGS+= -DWITHOUT_FASTMATCH -.endif - SCRIPTS= zgrep.sh LINKS= ${BINDIR}/zgrep ${BINDIR}/zfgrep \ ${BINDIR}/zgrep ${BINDIR}/zegrep \ Modified: head/usr.bin/grep/grep.c == --- head/usr.bin/grep/grep.cFri May 4 01:36:49 2018(r333235) +++ head/usr.bin/grep/grep.cFri May 4 03:13:25 2018(r333236) @@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef WITHOUT_FASTMATCH -#include "fastmatch.h" -#endif #include "grep.h" #ifndef WITHOUT_NLS @@ -96,9 +93,6 @@ unsigned int patterns; static unsigned int pattern_sz; struct pat *pattern; regex_t*r_pattern; -#ifndef WITHOUT_FASTMATCH -fastmatch_t*fg_pattern; -#endif /* Filename exclusion/inclusion patterns */ unsigned int fpatterns, dpatterns; @@ -712,9 +706,6 @@ main(int argc, char *argv[]) usage(); } -#ifndef WITHOUT_FASTMATCH - fg_pattern = grep_calloc(patterns, sizeof(*fg_pattern)); -#endif r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); /* Don't process any patterns if we have a blank one */ @@ -725,15 +716,6 @@ main(int argc, char *argv[]) #endif /* Check if cheating is allowed (always is for fgrep). */ for (i = 0; i < patterns; ++i) { -#ifndef WITHOUT_FASTMATCH - /* -* Attempt compilation with fastmatch regex and -* fallback to regex(3) if it fails. -*/ - if (fastncomp(_pattern[i], pattern[i].pat, - pattern[i].len, cflags) == 0) - continue; -#endif c = regcomp(_pattern[i], pattern[i].pat, cflags); if (c != 0) { regerror(c, _pattern[i], re_error, Modified: head/usr.bin/grep/grep.h == --- head/usr.bin/grep/grep.hFri May 4 01:36:49 2018(r333235) +++
svn commit: r333235 - head/usr.sbin/bhyve
Author: grehan Date: Fri May 4 01:36:49 2018 New Revision: 333235 URL: https://svnweb.freebsd.org/changeset/base/333235 Log: Allow arbitrary numbers of columns for VNC server screen resolution. The prior code only allowed multiples of 32 for the numbers of columns. Remove this restriction to allow a forthcoming UEFI firmware update to allow arbitrary x,y resolutions. (the code for handling rows already supported non mult-32 values) Reviewed by: Leon Dang (original author) MFC after:3 weeks Differential Revision:https://reviews.freebsd.org/D15274 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c == --- head/usr.sbin/bhyve/rfb.c Fri May 4 00:56:41 2018(r333234) +++ head/usr.sbin/bhyve/rfb.c Fri May 4 01:36:49 2018(r333235) @@ -541,40 +541,23 @@ rfb_send_screen(struct rfb_softc *rc, int cfd, int all } for (x = 0; x < xcells; x++) { + if (x == (xcells - 1) && rem_x > 0) + cellwidth = rem_x; + else + cellwidth = PIX_PER_CELL; + if (rc->hw_crc) crc_p[x] = fast_crc32(p, -PIX_PER_CELL * sizeof(uint32_t), +cellwidth * sizeof(uint32_t), crc_p[x]); else crc_p[x] = (uint32_t)crc32(crc_p[x], (Bytef *)p, -PIX_PER_CELL * sizeof(uint32_t)); +cellwidth * sizeof(uint32_t)); - p += PIX_PER_CELL; + p += cellwidth; /* check for crc delta if last row in cell */ - if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) { - if (orig_crc[x] != crc_p[x]) { - orig_crc[x] = crc_p[x]; - crc_p[x] = 1; - changes++; - } else { - crc_p[x] = 0; - } - } - } - - if (rem_x) { - if (rc->hw_crc) - crc_p[x] = fast_crc32(p, - rem_x * sizeof(uint32_t), - crc_p[x]); - else - crc_p[x] = (uint32_t)crc32(crc_p[x], - (Bytef *)p, - rem_x * sizeof(uint32_t)); - p += rem_x; - if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) { if (orig_crc[x] != crc_p[x]) { orig_crc[x] = crc_p[x]; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333234 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: emaste Date: Fri May 4 00:56:41 2018 New Revision: 333234 URL: https://svnweb.freebsd.org/changeset/base/333234 Log: zfs_ioctl: avoid out-of-bound read admbugs: 796 Submitted by: Domagoj StolfaReported by: Ilja Van Sprundel Reviewed by: avg MFC after:1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 4 00:34:27 2018(r333233) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 4 00:56:41 2018(r333234) @@ -6440,6 +6440,10 @@ zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t ar cflag = ZFS_CMD_COMPAT_V28; break; case sizeof(zfs_cmd_v15_t): + if (cmd >= sizeof(zfs_ioctl_v15_to_v28) / + sizeof(zfs_ioctl_v15_to_v28[0])) + return (EINVAL); + cflag = ZFS_CMD_COMPAT_V15; vecnum = zfs_ioctl_v15_to_v28[cmd]; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333233 - in head/sys: geom/part sys/disk
Author: emaste Date: Fri May 4 00:34:27 2018 New Revision: 333233 URL: https://svnweb.freebsd.org/changeset/base/333233 Log: gpart: add fat32lba MBR partition type FAT32 partition with LBA addressing. Reviewed by: marcel MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D15266 Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_ldm.c head/sys/geom/part/g_part_mbr.c head/sys/sys/disk/mbr.h Modified: head/sys/geom/part/g_part.c == --- head/sys/geom/part/g_part.c Thu May 3 23:59:39 2018(r333232) +++ head/sys/geom/part/g_part.c Fri May 4 00:34:27 2018(r333233) @@ -98,6 +98,7 @@ struct g_part_alias_list { { "efi", G_PART_ALIAS_EFI }, { "fat16", G_PART_ALIAS_MS_FAT16 }, { "fat32", G_PART_ALIAS_MS_FAT32 }, + { "fat32lba", G_PART_ALIAS_MS_FAT32LBA }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, Modified: head/sys/geom/part/g_part.h == --- head/sys/geom/part/g_part.h Thu May 3 23:59:39 2018(r333232) +++ head/sys/geom/part/g_part.h Fri May 4 00:34:27 2018(r333233) @@ -78,6 +78,7 @@ enum g_part_alias { G_PART_ALIAS_MS_BASIC_DATA, /* A Microsoft Data part. entry. */ G_PART_ALIAS_MS_FAT16, /* A Microsoft FAT16 partition entry. */ G_PART_ALIAS_MS_FAT32, /* A Microsoft FAT32 partition entry. */ + G_PART_ALIAS_MS_FAT32LBA, /* A Microsoft FAT32 LBA partition entry */ G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ G_PART_ALIAS_MS_NTFS, /* A Microsoft NTFS partition entry */ Modified: head/sys/geom/part/g_part_ebr.c == --- head/sys/geom/part/g_part_ebr.c Thu May 3 23:59:39 2018 (r333232) +++ head/sys/geom/part/g_part_ebr.c Fri May 4 00:34:27 2018 (r333233) @@ -137,6 +137,7 @@ static struct g_part_ebr_alias { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT32,G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, { DOSPTYP_LINUX,G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, Modified: head/sys/geom/part/g_part_ldm.c == --- head/sys/geom/part/g_part_ldm.c Thu May 3 23:59:39 2018 (r333232) +++ head/sys/geom/part/g_part_ldm.c Fri May 4 00:34:27 2018 (r333233) @@ -371,6 +371,7 @@ static struct g_part_ldm_alias { } ldm_alias_match[] = { { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT32,G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, Modified: head/sys/geom/part/g_part_mbr.c == --- head/sys/geom/part/g_part_mbr.c Thu May 3 23:59:39 2018 (r333232) +++ head/sys/geom/part/g_part_mbr.c Fri May 4 00:34:27 2018 (r333233) @@ -132,6 +132,7 @@ static struct g_part_mbr_alias { { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT16,G_PART_ALIAS_MS_FAT16 }, { DOSPTYP_FAT32,G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, Modified: head/sys/sys/disk/mbr.h == --- head/sys/sys/disk/mbr.h Thu May 3 23:59:39 2018(r333232) +++ head/sys/sys/disk/mbr.h Fri May 4 00:34:27 2018(r333233) @@ -46,6 +46,7 @@ #defineDOSPTYP_FAT16 0x06/* FAT16 partition */ #defineDOSPTYP_NTFS0x07/* NTFS partition */ #defineDOSPTYP_FAT32 0x0b/* FAT32 partition */ +#defineDOSPTYP_FAT32LBA0x0c/* FAT32 with LBA partition */ #defineDOSPTYP_EXTLBA 0x0f/* DOS extended partition */ #defineDOSPTYP_PPCBOOT 0x41/* PReP/CHRP boot partition */ #defineDOSPTYP_LDM 0x42
svn commit: r333232 - svnadmin/conf
Author: gjb Date: Thu May 3 23:59:39 2018 New Revision: 333232 URL: https://svnweb.freebsd.org/changeset/base/333232 Log: Require explicit re@ approval for commits to stable/11, as the code freeze for 11.2-RELEASE is now in effect. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers == --- svnadmin/conf/approvers Thu May 3 23:51:09 2018(r333231) +++ svnadmin/conf/approvers Thu May 3 23:59:39 2018(r333232) @@ -17,7 +17,7 @@ # $FreeBSD$ # #^head/re -#^stable/11/ re +^stable/11/re ^release/ re ^releng/11.[0-1]/ (security-officer|so) ^releng/10.[0-4]/ (security-officer|so) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r333227 - svnadmin/conf
Welcome back Matt! --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubertor The need of the many outweighs the greed of the few. --- -Original Message- From: Sean Bruno Sent: 03/05/2018 13:43 To: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-svnad...@freebsd.org Subject: svn commit: r333227 - svnadmin/conf Author: sbruno Date: Thu May 3 20:43:39 2018 New Revision: 333227 URL: https://svnweb.freebsd.org/changeset/base/333227 Log: Welcome back Matt Macy to the ranks of FreeBSD committers. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access == --- svnadmin/conf/accessThu May 3 20:05:57 2018(r333226) +++ svnadmin/conf/accessThu May 3 20:43:39 2018(r333227) @@ -150,6 +150,7 @@ mizhka mjg mjoras mm +mmacy mmel mp mr Modified: svnadmin/conf/mentors == --- svnadmin/conf/mentors Thu May 3 20:05:57 2018(r333226) +++ svnadmin/conf/mentors Thu May 3 20:43:39 2018(r333227) @@ -26,6 +26,7 @@ jwd rmacklem kadesaiken Co-mentor: scottl, ambrisko mahrensmckusick mjoras rstone +mmacy sbruno peterj jhb Co-mentor: grog ramken Co-mentor: mav rgrimesphk Co-mentor: bde ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333230 - head/sys/dev/pci
Author: grehan Date: Thu May 3 22:51:44 2018 New Revision: 333230 URL: https://svnweb.freebsd.org/changeset/base/333230 Log: Allow PCI VGA devices to be detached. GPUs often have a VGA PCI class code and are probed/attached by the VGA driver. Allow them to be detached so they can be presented as passthru devices to VM guests. Submitted by: mmacy Reviewed by: jhb, imp, rgrimes MFC after:3 weeks Differential Revision:https://reviews.freebsd.org/D15269 Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c == --- head/sys/dev/pci/vga_pci.c Thu May 3 21:45:59 2018(r333229) +++ head/sys/dev/pci/vga_pci.c Thu May 3 22:51:44 2018(r333230) @@ -283,6 +283,17 @@ vga_pci_suspend(device_t dev) } static int +vga_pci_detach(device_t dev) +{ + int error; + + error = bus_generic_detach(dev); + if (error == 0) + error = device_delete_children(dev); + return (error); +} + +static int vga_pci_resume(device_t dev) { @@ -620,6 +631,7 @@ static device_method_t vga_pci_methods[] = { DEVMETHOD(device_attach,vga_pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, vga_pci_suspend), + DEVMETHOD(device_detach,vga_pci_detach), DEVMETHOD(device_resume,vga_pci_resume), /* Bus interface */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333229 - head/sys/x86/include
Author: kib Date: Thu May 3 21:45:59 2018 New Revision: 333229 URL: https://svnweb.freebsd.org/changeset/base/333229 Log: Add helper macros to hide some boring repeatable ceremonies to define ifuncs on x86. Also keep helpers to define 'pseudo-ifuncs' which are emulated by the indirect jmp. Reviewed by: jhb (previous version, as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after:2 weeks Differential revision:https://reviews.freebsd.org/D13838 Added: head/sys/x86/include/ifunc.h (contents, props changed) Added: head/sys/x86/include/ifunc.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/ifunc.hThu May 3 21:45:59 2018 (r333229) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2015, 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov+ * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __X86_IFUNC_H +#define__X86_IFUNC_H + +#defineDECLARE_LIFUNC(ret_type, name, args) \ +ret_type name args + +#defineDEFINE_LIFUNC(scope, selector_qual, ret_type, name, args) \ +__asm__ (scope "\t" #name "\n" \ +"\t.type\t" #name ",@function\n" \ +#name ":\n"\ +"\tjmp *" #name "_selector\n" \ +"\t.size\t" #name ",\t. - "#name); \ +selector_qual ret_type (*name##_selector)args __used; \ +DECLARE_LIFUNC(ret_type, name, args) + +#defineDEFINE_STATIC_LIFUNC(ret_type, name, args) \ + DEFINE_LIFUNC(".local", static, ret_type, name, args) + +#defineDEFINE_GLOBAL_LIFUNC(ret_type, name, args) \ + DEFINE_LIFUNC(".globl", , ret_type, name, args) + +#defineDEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ +resolver_qual ret_type (*name##_resolver(void))args __used; \ +qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ +resolver_qual ret_type (*name##_resolver(void))args + +#endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333228 - in head/sys: amd64/amd64 i386/i386 kern sys
Author: kib Date: Thu May 3 21:37:46 2018 New Revision: 333228 URL: https://svnweb.freebsd.org/changeset/base/333228 Log: Implement support for ifuncs in the kernel linker. Required MD bits are only provided for x86. Reviewed by: jhb (previous version, as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after:2 weeks Differential revision:https://reviews.freebsd.org/D13838 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/machdep.c head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/machdep.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/sys/linker.h Modified: head/sys/amd64/amd64/elf_machdep.c == --- head/sys/amd64/amd64/elf_machdep.c Thu May 3 20:43:39 2018 (r333227) +++ head/sys/amd64/amd64/elf_machdep.c Thu May 3 21:37:46 2018 (r333228) @@ -175,10 +175,13 @@ elf64_dump_thread(struct thread *td, void *dst, size_t *off = len; } +#defineERI_LOCAL 0x0001 +#defineERI_ONLYIFUNC 0x0002 + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, -int type, int local, elf_lookup_fn lookup) +int type, elf_lookup_fn lookup, int flags) { Elf64_Addr *where, val; Elf32_Addr *where32, val32; @@ -218,6 +221,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } + if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_X86_64_IRELATIVE)) + return (0); + switch (rtype) { case R_X86_64_NONE: /* none */ break; @@ -278,6 +284,13 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *where = val; break; + case R_X86_64_IRELATIVE: + addr = relocbase + addend; + val = ((Elf64_Addr (*)(void))addr)(); + if (*where != val) + *where = val; + break; + default: printf("kldload: unexpected relocation type %ld\n", rtype); @@ -287,11 +300,20 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas } int +elf_reloc_ifunc(linker_file_t lf, Elf_Addr relocbase, const void *data, +int type, elf_lookup_fn lookup) +{ + + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_ONLYIFUNC)); +} + +int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 0, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, 0)); } int @@ -299,7 +321,8 @@ elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 1, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_LOCAL)); } int Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Thu May 3 20:43:39 2018 (r333227) +++ head/sys/amd64/amd64/machdep.c Thu May 3 21:37:46 2018 (r333228) @@ -1566,6 +1566,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) identify_cpu1(); identify_hypervisor(); + /* link_elf_ireloc(kmdp); */ + /* Init basic tunables, hz etc */ init_param1(); @@ -1744,6 +1746,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) cninit(); amd64_kdb_init(); } + link_elf_ireloc(kmdp); getmemsize(kmdp, physfree); init_param2(physmem); Modified: head/sys/i386/i386/elf_machdep.c == --- head/sys/i386/i386/elf_machdep.cThu May 3 20:43:39 2018 (r333227) +++ head/sys/i386/i386/elf_machdep.cThu May 3 21:37:46 2018 (r333228) @@ -159,10 +159,13 @@ elf32_dump_thread(struct thread *td, void *dst, size_t *off = len; } +#defineERI_LOCAL 0x0001 +#defineERI_ONLYIFUNC 0x0002 + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, -int type, int local, elf_lookup_fn lookup) +int type, elf_lookup_fn lookup, int flags) { Elf_Addr *where; Elf_Addr addr; @@ -191,7 +194,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } - if (local) { + if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_386_IRELATIVE)) +
svn commit: r333227 - svnadmin/conf
Author: sbruno Date: Thu May 3 20:43:39 2018 New Revision: 333227 URL: https://svnweb.freebsd.org/changeset/base/333227 Log: Welcome back Matt Macy to the ranks of FreeBSD committers. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access == --- svnadmin/conf/accessThu May 3 20:05:57 2018(r333226) +++ svnadmin/conf/accessThu May 3 20:43:39 2018(r333227) @@ -150,6 +150,7 @@ mizhka mjg mjoras mm +mmacy mmel mp mr Modified: svnadmin/conf/mentors == --- svnadmin/conf/mentors Thu May 3 20:05:57 2018(r333226) +++ svnadmin/conf/mentors Thu May 3 20:43:39 2018(r333227) @@ -26,6 +26,7 @@ jwd rmacklem kadesaiken Co-mentor: scottl, ambrisko mahrensmckusick mjoras rstone +mmacy sbruno peterj jhb Co-mentor: grog ramken Co-mentor: mav rgrimesphk Co-mentor: bde ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r333175 - in head/sys: kern net netinet netinet6 sys
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Am Thu, 3 May 2018 12:53:05 -0700 "K. Macy"schrieb: > Can you give any context on what they're doing? In addition - even on > a production kernel it's possible to compile in DDB to at least get a > backtrace. Your report only gives us enough information to know that Not at the moment. The immediate crash corrupted the /usr/src filesystem so I can not recompile a kernel. Every attempt to /etc/netstart the network on the buggy kernel ends up in a further destruction, so I stopped at this very moment and hopefully I can copy /usr/src from a r33153 box (r333153 is for me the last working revision) via USB flash drive and recompile the kernel. But I'll go for r333153 first since I need the server up tomorrow and I'll try on the other box which is also affected, but also equipted with the i350 NIC on which the problem occurs very quickly. > there is _an_ issue. It's difficult to proceed on this alone. I do > have a report from the FreeBSD CI infrastructure that we're looking in > to now. With luck that is the same issue. > > -M > > On Thu, May 3, 2018 at 12:31 PM, O. Hartmann wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA512 > > > > Am Wed, 2 May 2018 19:36:29 + (UTC) > > Stephen Hurd schrieb: > > > >> Author: shurd > >> Date: Wed May 2 19:36:29 2018 > >> New Revision: 333175 > >> URL: https://svnweb.freebsd.org/changeset/base/333175 > >> > >> Log: > >> Separate list manipulation locking from state change in multicast > >> > >> Multicast incorrectly calls in to drivers with a mutex held causing > >> drivers > >> to have to go through all manner of contortions to use a non sleepable > >> lock. > >> Serialize multicast updates instead. > >> > >> Submitted by: mmacy > >> Reviewed by:shurd, sbruno > >> Sponsored by: Limelight Networks > >> Differential Revision: https://reviews.freebsd.org/D14969 > >> > >> Modified: > >> head/sys/kern/subr_gtaskqueue.c > >> head/sys/kern/subr_witness.c > >> head/sys/net/if.c > >> head/sys/netinet/igmp.c > >> head/sys/netinet/igmp_var.h > >> head/sys/netinet/in.c > >> head/sys/netinet/in_mcast.c > >> head/sys/netinet/in_pcb.c > >> head/sys/netinet/in_var.h > >> head/sys/netinet/ip_carp.c > >> head/sys/netinet6/in6.c > >> head/sys/netinet6/in6_ifattach.c > >> head/sys/netinet6/in6_mcast.c > >> head/sys/netinet6/in6_pcb.c > >> head/sys/netinet6/in6_var.h > >> head/sys/netinet6/mld6.c > >> head/sys/netinet6/mld6_var.h > >> head/sys/sys/gtaskqueue.h > >> > >> Modified: head/sys/kern/subr_gtaskqueue.c > >> == > >> --- head/sys/kern/subr_gtaskqueue.c Wed May 2 17:41:00 2018 > >> (r333174) > >> +++ head/sys/kern/subr_gtaskqueue.c Wed May 2 19:36:29 2018 > >> (r333175) > >> @@ -53,6 +53,7 @@ static void gtaskqueue_thread_enqueue(void *); > >> static void gtaskqueue_thread_loop(void *arg); > >> > >> TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); > >> +TASKQGROUP_DEFINE(config, 1, 1); > >> > >> struct gtaskqueue_busy { > >> struct gtask*tb_running; > >> @@ -662,7 +663,7 @@ SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_F > >> > >> void > >> taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, > >> -void *uniq, int irq, char *name) > >> +void *uniq, int irq, const char *name) > >> { > >> cpuset_t mask; > >> int qid, error; > >> @@ -976,4 +977,13 @@ void > >> taskqgroup_destroy(struct taskqgroup *qgroup) > >> { > >> > >> +} > >> + > >> +void > >> +taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, > >> gtask_fn_t *fn, > >> + const char *name) > >> +{ > >> + > >> + GROUPTASK_INIT(gtask, 0, fn, ctx); > >> + taskqgroup_attach(qgroup_config, gtask, gtask, -1, name); > >> } > >> > >> Modified: head/sys/kern/subr_witness.c > >> == > >> --- head/sys/kern/subr_witness.c Wed May 2 17:41:00 2018 > >> (r333174) > >> +++ head/sys/kern/subr_witness.c Wed May 2 19:36:29 2018 > >> (r333175) > >> @@ -532,18 +532,22 @@ static struct witness_order_list_entry order_lists[] > >> = > >>* IPv4 multicast: > >>* protocol locks before interface locks, after UDP locks. > >>*/ > >> + { "in_multi_sx", _class_sx }, > >> { "udpinp", _class_rw }, > >> - { "in_multi_mtx", _class_mtx_sleep }, > >> + { "in_multi_list_mtx", _class_mtx_sleep }, > >> { "igmp_mtx", _class_mtx_sleep }, > >> + { "ifnet_rw", _class_rw }, > >> { "if_addr_lock", _class_rw }, > >> { NULL, NULL }, > >> /* > >>* IPv6 multicast: > >>* protocol locks before interface locks, after UDP locks. > >>*/ > >> + { "in6_multi_sx", _class_sx }, > >>
svn commit: r333226 - stable/11/sys/net
Author: brooks Date: Thu May 3 20:05:57 2018 New Revision: 333226 URL: https://svnweb.freebsd.org/changeset/base/333226 Log: MFC r332997: Translate 32-bit ifmedia requests into native ones. We use transformation rather than accessors as virtually ever driver implements SIOCGIFMEDIA and all would have to be touched. Keep the code readable by always performing copies and (possiably no-op) transforms. Reviewed by: jhb, kib Obtained from:CheriBSD Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14996 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c == --- stable/11/sys/net/if.c Thu May 3 19:49:40 2018(r333225) +++ stable/11/sys/net/if.c Thu May 3 20:05:57 2018(r333226) @@ -142,11 +142,24 @@ struct ifgroupreq32 { uint32_tifgru_groups; } ifgr_ifgru; }; + +struct ifmediareq32 { + charifm_name[IFNAMSIZ]; + int ifm_current; + int ifm_mask; + int ifm_status; + int ifm_active; + int ifm_count; + uint32_tifm_ulist; /* (int *) */ +}; +#defineSIOCGIFMEDIA32 _IOC_NEWTYPE(SIOCGIFMEDIA, struct ifmediareq32) +#defineSIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct ifmediareq32) + #define_CASE_IOC_IFGROUPREQ_32(cmd)\ case _IOC_NEWTYPE((cmd), struct ifgroupreq32): -#else +#else /* !COMPAT_FREEBSD32 */ #define _CASE_IOC_IFGROUPREQ_32(cmd) -#endif /* COMPAT_FREEBSD32 */ +#endif /* !COMPAT_FREEBSD32 */ #define CASE_IOC_IFGROUPREQ(cmd) \ _CASE_IOC_IFGROUPREQ_32(cmd) \ @@ -2886,12 +2899,48 @@ struct ifconf32 { #defineSIOCGIFCONF32 _IOWR('i', 36, struct ifconf32) #endif +#ifdef COMPAT_FREEBSD32 +static void +ifmr_init(struct ifmediareq *ifmr, caddr_t data) +{ + struct ifmediareq32 *ifmr32; + + ifmr32 = (struct ifmediareq32 *)data; + memcpy(ifmr->ifm_name, ifmr32->ifm_name, + sizeof(ifmr->ifm_name)); + ifmr->ifm_current = ifmr32->ifm_current; + ifmr->ifm_mask = ifmr32->ifm_mask; + ifmr->ifm_status = ifmr32->ifm_status; + ifmr->ifm_active = ifmr32->ifm_active; + ifmr->ifm_count = ifmr32->ifm_count; + ifmr->ifm_ulist = (int *)(uintptr_t)ifmr32->ifm_ulist; +} + +static void +ifmr_update(const struct ifmediareq *ifmr, caddr_t data) +{ + struct ifmediareq32 *ifmr32; + + ifmr32 = (struct ifmediareq32 *)data; + ifmr32->ifm_current = ifmr->ifm_current; + ifmr32->ifm_mask = ifmr->ifm_mask; + ifmr32->ifm_status = ifmr->ifm_status; + ifmr32->ifm_active = ifmr->ifm_active; + ifmr32->ifm_count = ifmr->ifm_count; +} +#endif + /* * Interface ioctls. */ int ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) { +#ifdef COMPAT_FREEBSD32 + caddr_t saved_data; + struct ifmediareq ifmr; +#endif + struct ifmediareq *ifmrp; struct ifnet *ifp; struct ifreq *ifr; int error; @@ -2937,17 +2986,29 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s } #endif } - ifr = (struct ifreq *)data; + ifmrp = NULL; +#ifdef COMPAT_FREEBSD32 switch (cmd) { + case SIOCGIFMEDIA32: + case SIOCGIFXMEDIA32: + ifmrp = + ifmr_init(ifmrp, data); + cmd = _IOC_NEWTYPE(cmd, struct ifmediareq); + saved_data = data; + data = (caddr_t)ifmrp; + } +#endif + + ifr = (struct ifreq *)data; + switch (cmd) { #ifdef VIMAGE case SIOCSIFRVNET: error = priv_check(td, PRIV_NET_SETIFVNET); if (error == 0) error = if_vmove_reclaim(td, ifr->ifr_name, ifr->ifr_jid); - CURVNET_RESTORE(); - return (error); + goto out_noref; #endif case SIOCIFCREATE: case SIOCIFCREATE2: @@ -2956,23 +3017,21 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_create(ifr->ifr_name, sizeof(ifr->ifr_name), cmd == SIOCIFCREATE2 ? ifr_data_get_ptr(ifr) : NULL); - CURVNET_RESTORE(); - return (error); + goto out_noref; case SIOCIFDESTROY: error = priv_check(td, PRIV_NET_IFDESTROY); if (error == 0) error = if_clone_destroy(ifr->ifr_name); - CURVNET_RESTORE(); - return (error); + goto out_noref; case SIOCIFGCLONERS: error = if_clone_list((struct if_clonereq *)data); -
Re: svn commit: r333175 - in head/sys: kern net netinet netinet6 sys
Can you give any context on what they're doing? In addition - even on a production kernel it's possible to compile in DDB to at least get a backtrace. Your report only gives us enough information to know that there is _an_ issue. It's difficult to proceed on this alone. I do have a report from the FreeBSD CI infrastructure that we're looking in to now. With luck that is the same issue. -M On Thu, May 3, 2018 at 12:31 PM, O. Hartmannwrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > Am Wed, 2 May 2018 19:36:29 + (UTC) > Stephen Hurd schrieb: > >> Author: shurd >> Date: Wed May 2 19:36:29 2018 >> New Revision: 333175 >> URL: https://svnweb.freebsd.org/changeset/base/333175 >> >> Log: >> Separate list manipulation locking from state change in multicast >> >> Multicast incorrectly calls in to drivers with a mutex held causing drivers >> to have to go through all manner of contortions to use a non sleepable >> lock. >> Serialize multicast updates instead. >> >> Submitted by: mmacy >> Reviewed by:shurd, sbruno >> Sponsored by: Limelight Networks >> Differential Revision: https://reviews.freebsd.org/D14969 >> >> Modified: >> head/sys/kern/subr_gtaskqueue.c >> head/sys/kern/subr_witness.c >> head/sys/net/if.c >> head/sys/netinet/igmp.c >> head/sys/netinet/igmp_var.h >> head/sys/netinet/in.c >> head/sys/netinet/in_mcast.c >> head/sys/netinet/in_pcb.c >> head/sys/netinet/in_var.h >> head/sys/netinet/ip_carp.c >> head/sys/netinet6/in6.c >> head/sys/netinet6/in6_ifattach.c >> head/sys/netinet6/in6_mcast.c >> head/sys/netinet6/in6_pcb.c >> head/sys/netinet6/in6_var.h >> head/sys/netinet6/mld6.c >> head/sys/netinet6/mld6_var.h >> head/sys/sys/gtaskqueue.h >> >> Modified: head/sys/kern/subr_gtaskqueue.c >> == >> --- head/sys/kern/subr_gtaskqueue.c Wed May 2 17:41:00 2018 >> (r333174) >> +++ head/sys/kern/subr_gtaskqueue.c Wed May 2 19:36:29 2018 >> (r333175) >> @@ -53,6 +53,7 @@ static void gtaskqueue_thread_enqueue(void *); >> static void gtaskqueue_thread_loop(void *arg); >> >> TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); >> +TASKQGROUP_DEFINE(config, 1, 1); >> >> struct gtaskqueue_busy { >> struct gtask*tb_running; >> @@ -662,7 +663,7 @@ SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_F >> >> void >> taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, >> -void *uniq, int irq, char *name) >> +void *uniq, int irq, const char *name) >> { >> cpuset_t mask; >> int qid, error; >> @@ -976,4 +977,13 @@ void >> taskqgroup_destroy(struct taskqgroup *qgroup) >> { >> >> +} >> + >> +void >> +taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t >> *fn, >> + const char *name) >> +{ >> + >> + GROUPTASK_INIT(gtask, 0, fn, ctx); >> + taskqgroup_attach(qgroup_config, gtask, gtask, -1, name); >> } >> >> Modified: head/sys/kern/subr_witness.c >> == >> --- head/sys/kern/subr_witness.c Wed May 2 17:41:00 2018 >> (r333174) >> +++ head/sys/kern/subr_witness.c Wed May 2 19:36:29 2018 >> (r333175) >> @@ -532,18 +532,22 @@ static struct witness_order_list_entry order_lists[] = >>* IPv4 multicast: >>* protocol locks before interface locks, after UDP locks. >>*/ >> + { "in_multi_sx", _class_sx }, >> { "udpinp", _class_rw }, >> - { "in_multi_mtx", _class_mtx_sleep }, >> + { "in_multi_list_mtx", _class_mtx_sleep }, >> { "igmp_mtx", _class_mtx_sleep }, >> + { "ifnet_rw", _class_rw }, >> { "if_addr_lock", _class_rw }, >> { NULL, NULL }, >> /* >>* IPv6 multicast: >>* protocol locks before interface locks, after UDP locks. >>*/ >> + { "in6_multi_sx", _class_sx }, >> { "udpinp", _class_rw }, >> - { "in6_multi_mtx", _class_mtx_sleep }, >> + { "in6_multi_list_mtx", _class_mtx_sleep }, >> { "mld_mtx", _class_mtx_sleep }, >> + { "ifnet_rw", _class_rw }, >> { "if_addr_lock", _class_rw }, >> { NULL, NULL }, >> /* >> >> Modified: head/sys/net/if.c >> == >> --- head/sys/net/if.c Wed May 2 17:41:00 2018(r333174) >> +++ head/sys/net/if.c Wed May 2 19:36:29 2018(r333175) >> @@ -985,11 +985,13 @@ static void >> if_purgemaddrs(struct ifnet *ifp) >> { >> struct ifmultiaddr *ifma; >> - struct ifmultiaddr *next; >> >> IF_ADDR_WLOCK(ifp); >> - TAILQ_FOREACH_SAFE(ifma, >if_multiaddrs, ifma_link, next) >> + while (!TAILQ_EMPTY(>if_multiaddrs)) { >> + ifma = TAILQ_FIRST(>if_multiaddrs); >> + TAILQ_REMOVE(>if_multiaddrs, ifma, ifma_link); >>
svn commit: r333225 - head/sys/dts/arm/overlays
Author: kevans Date: Thu May 3 19:49:40 2018 New Revision: 333225 URL: https://svnweb.freebsd.org/changeset/base/333225 Log: Garbage collect the a83t emac overlays The 4.16 DTS import brought in emac support for the a83t. Since these boards' DTS is pulled from /boot and I forgot to hook these up to the build, they should be fairly safe to go away. The a83t-sid and h3-sid overlays are still relevant. a83t-sid will likely come in with 4.18 DTS. Deleted: head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333224 - in stable/11/bin/sh: . tests/builtins
Author: jilles Date: Thu May 3 19:47:25 2018 New Revision: 333224 URL: https://svnweb.freebsd.org/changeset/base/333224 Log: MFC r333092: sh: Don't have [ match any [[:class:]] Added: stable/11/bin/sh/tests/builtins/case23.0 - copied unchanged from r333092, head/bin/sh/tests/builtins/case23.0 Modified: stable/11/bin/sh/expand.c stable/11/bin/sh/tests/builtins/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/sh/expand.c == --- stable/11/bin/sh/expand.c Thu May 3 19:45:48 2018(r333223) +++ stable/11/bin/sh/expand.c Thu May 3 19:47:25 2018(r333224) @@ -1342,8 +1342,10 @@ patmatch(const char *pattern, const char *string) } if (c == '[' && *p == ':') { found |= match_charclass(p, chr, ); - if (end != NULL) + if (end != NULL) { p = end; + continue; + } } if (c == CTLESC) c = *p++; Modified: stable/11/bin/sh/tests/builtins/Makefile == --- stable/11/bin/sh/tests/builtins/MakefileThu May 3 19:45:48 2018 (r333223) +++ stable/11/bin/sh/tests/builtins/MakefileThu May 3 19:47:25 2018 (r333224) @@ -40,6 +40,7 @@ ${PACKAGE}FILES+= case17.0 ${PACKAGE}FILES+= case18.0 ${PACKAGE}FILES+= case19.0 ${PACKAGE}FILES+= case20.0 +${PACKAGE}FILES+= case23.0 ${PACKAGE}FILES+= cd1.0 ${PACKAGE}FILES+= cd2.0 ${PACKAGE}FILES+= cd3.0 Copied: stable/11/bin/sh/tests/builtins/case23.0 (from r333092, head/bin/sh/tests/builtins/case23.0) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/bin/sh/tests/builtins/case23.0Thu May 3 19:47:25 2018 (r333224, copy of r333092, head/bin/sh/tests/builtins/case23.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +case [ in +[[:alpha:]]) echo bad +esac ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333223 - head/sys/modules/dtb/allwinner
Author: kevans Date: Thu May 3 19:45:48 2018 New Revision: 333223 URL: https://svnweb.freebsd.org/changeset/base/333223 Log: dtb/allwinner: Add a83t-sid overlay Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile == --- head/sys/modules/dtb/allwinner/Makefile Thu May 3 19:00:50 2018 (r333222) +++ head/sys/modules/dtb/allwinner/Makefile Thu May 3 19:45:48 2018 (r333223) @@ -19,7 +19,8 @@ DTS= \ sun8i-h3-orangepi-one.dts \ sun8i-h3-orangepi-plus2e.dts -DTSO= sun8i-h3-sid.dtso +DTSO= sun8i-a83t-sid.dtso \ + sun8i-h3-sid.dtso LINKS= \ ${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r333211 - head/sys/netinet/cc
On Thu, May 3, 2018 at 11:01 AM, Sean Brunowrote: > > @@ -242,8 +241,8 @@ tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned > { > > /* Equation 4 of I-D. */ > - return (((wmax * CUBIC_BETA) + (((THREE_X_PT2 * ticks_since_cong * > - smss) << CUBIC_SHIFT) / TWO_SUB_PT2 / rtt_ticks)) >> CUBIC_SHIFT); > + return (((wmax * CUBIC_BETA) + (((THREE_X_PT3 * ticks_since_cong * > + smss) << CUBIC_SHIFT) / TWO_SUB_PT3 / rtt_ticks)) >> CUBIC_SHIFT); > } > > #endif /* _NETINET_CC_CUBIC_H_ */ > Did you analyze this to ensure that the intermediate steps in this calculation would never overflow? Jonathan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r333175 - in head/sys: kern net netinet netinet6 sys
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Am Wed, 2 May 2018 19:36:29 + (UTC) Stephen Hurdschrieb: > Author: shurd > Date: Wed May 2 19:36:29 2018 > New Revision: 333175 > URL: https://svnweb.freebsd.org/changeset/base/333175 > > Log: > Separate list manipulation locking from state change in multicast > > Multicast incorrectly calls in to drivers with a mutex held causing drivers > to have to go through all manner of contortions to use a non sleepable lock. > Serialize multicast updates instead. > > Submitted by: mmacy > Reviewed by:shurd, sbruno > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D14969 > > Modified: > head/sys/kern/subr_gtaskqueue.c > head/sys/kern/subr_witness.c > head/sys/net/if.c > head/sys/netinet/igmp.c > head/sys/netinet/igmp_var.h > head/sys/netinet/in.c > head/sys/netinet/in_mcast.c > head/sys/netinet/in_pcb.c > head/sys/netinet/in_var.h > head/sys/netinet/ip_carp.c > head/sys/netinet6/in6.c > head/sys/netinet6/in6_ifattach.c > head/sys/netinet6/in6_mcast.c > head/sys/netinet6/in6_pcb.c > head/sys/netinet6/in6_var.h > head/sys/netinet6/mld6.c > head/sys/netinet6/mld6_var.h > head/sys/sys/gtaskqueue.h > > Modified: head/sys/kern/subr_gtaskqueue.c > == > --- head/sys/kern/subr_gtaskqueue.c Wed May 2 17:41:00 2018 > (r333174) > +++ head/sys/kern/subr_gtaskqueue.c Wed May 2 19:36:29 2018 > (r333175) > @@ -53,6 +53,7 @@ static void gtaskqueue_thread_enqueue(void *); > static void gtaskqueue_thread_loop(void *arg); > > TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); > +TASKQGROUP_DEFINE(config, 1, 1); > > struct gtaskqueue_busy { > struct gtask*tb_running; > @@ -662,7 +663,7 @@ SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_F > > void > taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, > -void *uniq, int irq, char *name) > +void *uniq, int irq, const char *name) > { > cpuset_t mask; > int qid, error; > @@ -976,4 +977,13 @@ void > taskqgroup_destroy(struct taskqgroup *qgroup) > { > > +} > + > +void > +taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t > *fn, > + const char *name) > +{ > + > + GROUPTASK_INIT(gtask, 0, fn, ctx); > + taskqgroup_attach(qgroup_config, gtask, gtask, -1, name); > } > > Modified: head/sys/kern/subr_witness.c > == > --- head/sys/kern/subr_witness.c Wed May 2 17:41:00 2018 > (r333174) > +++ head/sys/kern/subr_witness.c Wed May 2 19:36:29 2018 > (r333175) > @@ -532,18 +532,22 @@ static struct witness_order_list_entry order_lists[] = >* IPv4 multicast: >* protocol locks before interface locks, after UDP locks. >*/ > + { "in_multi_sx", _class_sx }, > { "udpinp", _class_rw }, > - { "in_multi_mtx", _class_mtx_sleep }, > + { "in_multi_list_mtx", _class_mtx_sleep }, > { "igmp_mtx", _class_mtx_sleep }, > + { "ifnet_rw", _class_rw }, > { "if_addr_lock", _class_rw }, > { NULL, NULL }, > /* >* IPv6 multicast: >* protocol locks before interface locks, after UDP locks. >*/ > + { "in6_multi_sx", _class_sx }, > { "udpinp", _class_rw }, > - { "in6_multi_mtx", _class_mtx_sleep }, > + { "in6_multi_list_mtx", _class_mtx_sleep }, > { "mld_mtx", _class_mtx_sleep }, > + { "ifnet_rw", _class_rw }, > { "if_addr_lock", _class_rw }, > { NULL, NULL }, > /* > > Modified: head/sys/net/if.c > == > --- head/sys/net/if.c Wed May 2 17:41:00 2018(r333174) > +++ head/sys/net/if.c Wed May 2 19:36:29 2018(r333175) > @@ -985,11 +985,13 @@ static void > if_purgemaddrs(struct ifnet *ifp) > { > struct ifmultiaddr *ifma; > - struct ifmultiaddr *next; > > IF_ADDR_WLOCK(ifp); > - TAILQ_FOREACH_SAFE(ifma, >if_multiaddrs, ifma_link, next) > + while (!TAILQ_EMPTY(>if_multiaddrs)) { > + ifma = TAILQ_FIRST(>if_multiaddrs); > + TAILQ_REMOVE(>if_multiaddrs, ifma, ifma_link); > if_delmulti_locked(ifp, ifma, 1); > + } > IF_ADDR_WUNLOCK(ifp); > } > > @@ -3429,6 +3431,12 @@ if_addmulti(struct ifnet *ifp, struct sockaddr *sa, > struct sockaddr_dl sdl; > int error; > > +#ifdef INET > + IN_MULTI_LIST_UNLOCK_ASSERT(); > +#endif > +#ifdef INET6 > + IN6_MULTI_LIST_UNLOCK_ASSERT(); > +#endif > /* >* If the address is already present, return a new reference to it; >* otherwise, allocate storage and set up a new address. > @@ -3610,6 +3618,9 @@ if_delmulti_ifma(struct ifmultiaddr *ifma) >
svn commit: r333222 - in head/sys: dev/acpica dev/acpica/Osd x86/acpica
Author: jkim Date: Thu May 3 19:00:50 2018 New Revision: 333222 URL: https://svnweb.freebsd.org/changeset/base/333222 Log: Redo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce. AcpiOsEnterSleep() was meant to implement this feature. Reviewed by: avg Modified: head/sys/dev/acpica/Osd/OsdHardware.c head/sys/dev/acpica/acpi.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/dev/acpica/Osd/OsdHardware.c == --- head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 18:20:35 2018 (r333221) +++ head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 19:00:50 2018 (r333222) @@ -37,9 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +extern int acpi_susp_bounce; + ACPI_STATUS AcpiOsEnterSleep(UINT8 SleepState, UINT32 RegaValue, UINT32 RegbValue) { + + /* If testing device suspend only, back out of everything here. */ + if (acpi_susp_bounce) + return (AE_CTRL_TERMINATE); return (AE_OK); } Modified: head/sys/dev/acpica/acpi.c == --- head/sys/dev/acpica/acpi.c Thu May 3 18:20:35 2018(r333221) +++ head/sys/dev/acpica/acpi.c Thu May 3 19:00:50 2018(r333222) @@ -287,15 +287,10 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, default_register_wid /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", _quirks); -static int acpi_susp_bounce; +int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, _susp_bounce, 0, "Don't actually suspend, just test devices."); -int acpi_susp_deep_bounce; -SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_deep_bounce, CTLFLAG_RW, -_susp_deep_bounce, 0, "Don't actually suspend, " -"bail out just before entering the sleep state."); - /* * ACPI can only be loaded as a module by the loader; activating it after * system bootstrap time is not useful, and can be fatal to the system. @@ -2951,10 +2946,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state) goto backout; } slp_state = ACPI_SS_DEV_SUSPEND; - -/* If testing device suspend only, back out of everything here. */ -if (acpi_susp_bounce) - goto backout; status = AcpiEnterSleepStatePrep(state); if (ACPI_FAILURE(status)) { Modified: head/sys/x86/acpica/acpi_wakeup.c == --- head/sys/x86/acpica/acpi_wakeup.c Thu May 3 18:20:35 2018 (r333221) +++ head/sys/x86/acpica/acpi_wakeup.c Thu May 3 19:00:50 2018 (r333222) @@ -79,7 +79,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); extern int acpi_resume_beep; extern int acpi_reset_video; -extern int acpi_susp_deep_bounce; +extern int acpi_susp_bounce; #ifdef SMP extern struct susppcb **susppcbs; @@ -277,9 +277,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) PTD[KPTDI] = PTD[LOWPTDI]; #endif - if (acpi_susp_deep_bounce) - resumectx(pcb); - /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); @@ -291,6 +288,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) AcpiFormatException(status)); return (0); /* couldn't sleep */ } + + if (acpi_susp_bounce) + resumectx(pcb); for (;;) ia32_pause(); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333221 - head/share/man/man4
Author: kevans Date: Thu May 3 18:20:35 2018 New Revision: 333221 URL: https://svnweb.freebsd.org/changeset/base/333221 Log: rsu(4) does not require legal.realtek.license_ack=1 The rsu firmware license check has been disabled since r292756. Changes rsu(4) since the license ack is no longer required. While here, add `device rsufw` hint to the kernel configuration lines and add/update paths to the installed license file in both rsu(4) and rsufw(4). Submitted by: Mateusz Piotrowski (0mp) Reviewed by: bcr (manpages) MFC after:1 month Differential Revision:https://reviews.freebsd.org/D14966 Modified: head/share/man/man4/rsu.4 head/share/man/man4/rsufw.4 Modified: head/share/man/man4/rsu.4 == --- head/share/man/man4/rsu.4 Thu May 3 17:52:40 2018(r333220) +++ head/share/man/man4/rsu.4 Thu May 3 18:20:35 2018(r333221) @@ -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. .\" -.Dd December 10, 2016 +.Dd April 4, 2018 .Dt RSU 4 .Os .Sh NAME @@ -30,22 +30,15 @@ place the following lines in your kernel configuration .Cd "device ohci" .Cd "device usb" .Cd "device rsu" +.Cd "device rsufw" .Cd "device wlan" .Ed .Pp Alternatively, to load the driver as a module at boot time, -place the following line in +place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_rsu_load="YES" -.Ed -.Pp -After you have read the license in -.Pa /usr/share/doc/legal/realtek.LICENSE -you will want to add the following lines to -.Xr loader.conf 5 : -.Bd -literal -offset indent -legal.realtek.license_ack=1 rsu-rtl8712fw_load="YES" .Ed .Sh DESCRIPTION @@ -102,6 +95,12 @@ The driver can be configured at runtime with .Xr ifconfig 8 . .Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek.LICENSE" -compact +.It Pa /usr/share/doc/legal/realtek.LICENSE +.Nm +firmware license +.El +.Pp The driver needs at least version 1.2 of the following firmware file, which is loaded when an interface is attached: .Pp Modified: head/share/man/man4/rsufw.4 == --- head/share/man/man4/rsufw.4 Thu May 3 17:52:40 2018(r333220) +++ head/share/man/man4/rsufw.4 Thu May 3 18:20:35 2018(r333221) @@ -13,7 +13,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 21, 2013 +.Dd April 4, 2018 .Dt RSUFW 4 .Os .Sh NAME @@ -40,7 +40,7 @@ rsu-rtl8712fw_load="YES" This module provides the firmware for the Realtek RTL8188SU and RTL8192SU chip based USB WiFi adapters. Please read Realtek's license, -.Pa /usr/share/license/realtek . +.Pa /usr/share/doc/legal/realtek.LICENSE . .Sh SEE ALSO .Xr rsu 4 , .Xr firmware 9 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333220 - head/share/man/man9
Author: benno Date: Thu May 3 17:52:40 2018 New Revision: 333220 URL: https://svnweb.freebsd.org/changeset/base/333220 Log: Add a stub manual page for iflib(9). Currently 'man -k iflib' would find you the right pages for iflib documentation, namely iflibdd(9) and iflibdi(9) but 'man iflib' would leave you in the dark. This allows both approaches to find the relevant documentation. Reviewed by: kmacy, shurd Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D15219 Added: head/share/man/man9/iflib.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileThu May 3 17:49:26 2018 (r333219) +++ head/share/man/man9/MakefileThu May 3 17:52:40 2018 (r333220) @@ -163,6 +163,7 @@ MAN=accept_filter.9 \ ieee80211_regdomain.9 \ ieee80211_scan.9 \ ieee80211_vap.9 \ + iflib.9 \ iflibdd.9 \ iflibdi.9 \ iflibtxrx.9 \ Added: head/share/man/man9/iflib.9 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/iflib.9 Thu May 3 17:52:40 2018(r333220) @@ -0,0 +1,41 @@ +.\" $FreeBSD$ +.Dd May 3, 2018 +.Dt IFLIB 9 +.Os +.Sh NAME +.Nm iflib +.Nd Network Interface Driver Framework +.Sh DESCRIPTION +.Nm +is a framework for writing network interface drivers for FreeBSD. +It is designed to remove a large amount of the boilerplate that is often +needed for modern network interface devices, allowing driver authors to +focus on the specific code needed for their hardware. +.Pp +There are three logical components to +.Nm +each of which is described in its own manual page. +These are: +.Bl -tag -width ".Xr iflibtxrx 9" +.It Xr iflibdi 9 +Device-independent functions, used to integrate +.Nm +into the rest of the +.Fx +networking stack. +.It Xr iflibdd 9 +Device-dependent functions, used when writing new +.Nm +based drivers. +.It Xr iflibtxrx 9 +Device-dependent transmit and receive functions, used when writing new +.Nm +based drivers. +.Sh SEE ALSO +.Xr iflibdd 9 , +.Xr iflibdi 9 , +.Xr iflibtxrx 9 , +.Xr ifnet 9 +.Sh AUTHORS +.An Benno Rice Aq Mt be...@freebsd.org + ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333219 - head/share/man/man9
Author: benno Date: Thu May 3 17:49:26 2018 New Revision: 333219 URL: https://svnweb.freebsd.org/changeset/base/333219 Log: Document ifdi_tx_queues_alloc and ifdi_rx_queues_alloc. Prior to this change the manual page documented ifdi_queues_alloc which has been replaced by separate methods for tx and rx queues. Reviewed by: kmacy, shurd Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D15218 Modified: head/share/man/man9/iflibdd.9 Modified: head/share/man/man9/iflibdd.9 == --- head/share/man/man9/iflibdd.9 Thu May 3 17:02:31 2018 (r333218) +++ head/share/man/man9/iflibdd.9 Thu May 3 17:49:26 2018 (r333219) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd March 23, 2017 +.Dd May 3, 2018 .Dt IFLIBDD 9 .Os .Sh NAME @@ -10,13 +10,22 @@ .Ss "Soft Queue Setup and Teardown Functions" .Ss "Mandatory Functions" .Ft int -.Fo ifdi_queues_alloc +.Fo ifdi_tx_queues_alloc .Fa "if_ctx_t ctx" .Fa "caddr_t *vaddrs" .Fa "uint64_t *paddrs" -.Fa "int nqs" +.Fa "int ntxqs" +.Fa "int ntxqsets" .Fc .Ft int +.Fo ifdi_rx_queues_alloc +.Fa "if_ctx_t ctx" +.Fa "caddr_t *vaddrs" +.Fa "uint64_t *paddrs" +.Fa "int nrxqs" +.Fa "int nrxqsets" +.Fc +.Ft int .Fo ifdi_queues_free .Fa "if_ctx_t ctx" .Fc @@ -185,14 +194,20 @@ registers. .Ss Device Dependent Functions .Ss Soft Queue Setup and Teardown .Bl -ohang -offset indent -.It Fn ifdi_queues_alloc -Mandatory queues allocation function that is called during iflib_attach. +.It Fn ifdi_tx_queues_alloc +Mandatory function that is called during iflib_attach to allocate transmit +queues. vaddrs and paddrs are arrays of virtual and physical addresses respectively of -the hardware transmit and receive queues, and if relevany, any command -completion queues. -nqs is the number of queues per qset. -For example, a driver with a single receive and transmit queue would have a nqs -equal to 2. +the hardware transmit queues. +ntxqs is the number of queues per qset. +ntxqsets is the number of qsets. +.It Fn ifdi_rx_queues_alloc +Mandatory function that is called during iflib_attach to allocate receive +queues. +vaddrs and paddrs are arrays of virtual and physical addresses respectively of +the hardware receive queues. +nrxqs is the number of queues per qset. +nrxqsets is the number of qsets. .It Fn ifdi_queues_free Mandatory function that frees the allocated queues and associated transmit buffers. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333218 - head/sys/net
Author: shurd Date: Thu May 3 17:02:31 2018 New Revision: 333218 URL: https://svnweb.freebsd.org/changeset/base/333218 Log: Allow iflib NIC drivers to sleep rather than busy wait Since the move to SMP NIC driver locking has had to go through serious contortions using mtx around long running hardware operations. This moves iflib past that. Individual drivers may now sleep when appropriate. Submitted by: Matthew MacyReviewed by: shurd Sponsored by: Limelight Networks Differential Revision:https://reviews.freebsd.org/D14983 Modified: head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/net/iflib.c == --- head/sys/net/iflib.cThu May 3 16:19:47 2018(r333217) +++ head/sys/net/iflib.cThu May 3 17:02:31 2018(r333218) @@ -163,7 +163,7 @@ struct iflib_ctx { if_shared_ctx_t ifc_sctx; struct if_softc_ctx ifc_softc_ctx; - struct mtx ifc_ctx_mtx; + struct sx ifc_ctx_sx; struct mtx ifc_state_mtx; uint16_t ifc_nhwtxqs; @@ -537,10 +537,10 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib ctx lock", MTX_DEF) -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) +#define CTX_LOCK_INIT(_sc) sx_init(&(_sc)->ifc_ctx_sx, "iflib ctx lock") +#define CTX_LOCK(ctx) sx_xlock(&(ctx)->ifc_ctx_sx) +#define CTX_UNLOCK(ctx) sx_xunlock(&(ctx)->ifc_ctx_sx) +#define CTX_LOCK_DESTROY(ctx) sx_destroy(&(ctx)->ifc_ctx_sx) #define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) @@ -4277,7 +4277,9 @@ iflib_device_register(device_t dev, void *sc, if_share } } + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { + CTX_UNLOCK(ctx); device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); return (err); } @@ -4435,6 +4437,7 @@ iflib_device_register(device_t dev, void *sc, if_share if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); ctx->ifc_flags |= IFC_INIT_DONE; + CTX_UNLOCK(ctx); return (0); fail_detach: ether_ifdetach(ctx->ifc_ifp); @@ -4445,6 +4448,7 @@ fail_queues: /* XXX free queues */ fail: IFDI_DETACH(ctx); + CTX_UNLOCK(ctx); return (err); } @@ -4711,8 +4715,7 @@ iflib_register(if_ctx_t ctx) _iflib_assert(sctx); - CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); - + CTX_LOCK_INIT(ctx); STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); ifp = ctx->ifc_ifp = if_gethandle(IFT_ETHER); if (ifp == NULL) { @@ -5457,8 +5460,8 @@ iflib_io_tqg_attach(struct grouptask *gt, void *uniq, } void -iflib_config_gtask_init(if_ctx_t ctx, struct grouptask *gtask, gtask_fn_t *fn, - char *name) +iflib_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, + const char *name) { GROUPTASK_INIT(gtask, 0, fn, ctx); @@ -5538,11 +5541,11 @@ iflib_add_int_delay_sysctl(if_ctx_t ctx, const char *n info, 0, iflib_sysctl_int_delay, "I", description); } -struct mtx * +struct sx * iflib_ctx_lock_get(if_ctx_t ctx) { - return (>ifc_ctx_mtx); + return (>ifc_ctx_sx); } static int Modified: head/sys/net/iflib.h == --- head/sys/net/iflib.hThu May 3 16:19:47 2018(r333217) +++ head/sys/net/iflib.hThu May 3 17:02:31 2018(r333218) @@ -373,8 +373,8 @@ void iflib_irq_free(if_ctx_t ctx, if_irq_t irq); void iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, char *name); -void iflib_config_gtask_init(if_ctx_t ctx, struct grouptask *gtask, -gtask_fn_t *fn, char *name); +void iflib_config_gtask_init(void *ctx, struct grouptask *gtask, +gtask_fn_t *fn, const char *name); void iflib_config_gtask_deinit(struct grouptask *gtask); @@ -396,7 +396,7 @@ int iflib_dma_alloc_multi(if_ctx_t ctx, int *sizes, if void iflib_dma_free_multi(iflib_dma_info_t *dmalist, int count); -struct mtx *iflib_ctx_lock_get(if_ctx_t); +struct sx *iflib_ctx_lock_get(if_ctx_t); struct mtx *iflib_qset_lock_get(if_ctx_t, uint16_t); void iflib_led_create(if_ctx_t ctx); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333217 - stable/11/contrib/ofed/libibumad
Author: slavash Date: Thu May 3 16:19:47 2018 New Revision: 333217 URL: https://svnweb.freebsd.org/changeset/base/333217 Log: MFC r333115: libibumad/umad.c: In get_port, ignore sysctl get rate errors This can cause ibpanic in ibstat when width is not set properly as can occur when Ethernet port is connected to InfiniBand fabric. ibpanic: [8167] main: stat of IB device 'mlx5_0' failed: m With this change, Rate is displayed as 0 with ibstat for this scenario. Approved by:hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: stable/11/contrib/ofed/libibumad/umad.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ofed/libibumad/umad.c == --- stable/11/contrib/ofed/libibumad/umad.c Thu May 3 15:47:49 2018 (r333216) +++ stable/11/contrib/ofed/libibumad/umad.c Thu May 3 16:19:47 2018 (r333217) @@ -138,6 +138,7 @@ static int get_port(const char *ca_name, const char *d strncpy(port->ca_name, ca_name, sizeof port->ca_name - 1); port->portnum = portnum; port->pkeys = NULL; + port->rate = 0; len = snprintf(port_dir, sizeof(port_dir), "%s/%d", dir, portnum); if (len < 0 || len > sizeof(port_dir)) @@ -155,8 +156,12 @@ static int get_port(const char *ca_name, const char *d goto clean; if (sys_read_uint(port_dir, SYS_PORT_PHY_STATE, >phys_state) < 0) goto clean; - if (sys_read_uint(port_dir, SYS_PORT_RATE, >rate) < 0) - goto clean; + /* +* If width was not set properly this read may fail. +* Instead of failing everything, we will just skip the check +* and it will be set to 0. +*/ + sys_read_uint(port_dir, SYS_PORT_RATE, >rate); if (sys_read_uint(port_dir, SYS_PORT_CAPMASK, ) < 0) goto clean; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333216 - stable/10/sys/dev/e1000
Author: marius Date: Thu May 3 15:47:49 2018 New Revision: 333216 URL: https://svnweb.freebsd.org/changeset/base/333216 Log: MFC: r330803 Use FALLTHROUGH. Modified: stable/10/sys/dev/e1000/e1000_82575.c stable/10/sys/dev/e1000/e1000_mbx.c stable/10/sys/dev/e1000/e1000_phy.c stable/10/sys/dev/e1000/e1000_vf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/e1000_82575.c == --- stable/10/sys/dev/e1000/e1000_82575.c Thu May 3 15:47:42 2018 (r333215) +++ stable/10/sys/dev/e1000/e1000_82575.c Thu May 3 15:47:49 2018 (r333216) @@ -1678,7 +1678,7 @@ static s32 e1000_setup_serdes_link_82575(struct e1000_ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ pcs_autoneg = FALSE; - /* fall through to default case */ + /* FALLTHROUGH */ default: if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { @@ -1805,6 +1805,7 @@ static s32 e1000_get_media_type_82575(struct e1000_hw break; } /* fall through for I2C based SGMII */ + /* FALLTHROUGH */ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: /* read media type from SFP EEPROM */ ret_val = e1000_set_sfp_media_type_82575(hw); Modified: stable/10/sys/dev/e1000/e1000_mbx.c == --- stable/10/sys/dev/e1000/e1000_mbx.c Thu May 3 15:47:42 2018 (r333215) +++ stable/10/sys/dev/e1000/e1000_mbx.c Thu May 3 15:47:49 2018 (r333216) @@ -778,6 +778,7 @@ s32 e1000_init_mbx_params_pf(struct e1000_hw *hw) mbx->stats.reqs = 0; mbx->stats.acks = 0; mbx->stats.rsts = 0; + /* FALLTHROUGH */ default: return E1000_SUCCESS; } Modified: stable/10/sys/dev/e1000/e1000_phy.c == --- stable/10/sys/dev/e1000/e1000_phy.c Thu May 3 15:47:42 2018 (r333215) +++ stable/10/sys/dev/e1000/e1000_phy.c Thu May 3 15:47:49 2018 (r333216) @@ -1297,6 +1297,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw * phy_data |= M88E1000_PSCR_AUTO_X_1000T; break; } + /* FALLTHROUGH */ case 0: default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; Modified: stable/10/sys/dev/e1000/e1000_vf.c == --- stable/10/sys/dev/e1000/e1000_vf.c Thu May 3 15:47:42 2018 (r333215) +++ stable/10/sys/dev/e1000/e1000_vf.c Thu May 3 15:47:49 2018 (r333216) @@ -487,8 +487,10 @@ s32 e1000_promisc_set_vf(struct e1000_hw *hw, enum e10 break; case e1000_promisc_enabled: msgbuf |= E1000_VF_SET_PROMISC_MULTICAST; + /* FALLTHROUGH */ case e1000_promisc_unicast: msgbuf |= E1000_VF_SET_PROMISC_UNICAST; + /* FALLTHROUGH */ case e1000_promisc_disabled: break; default: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333215 - stable/11/sys/dev/e1000
Author: marius Date: Thu May 3 15:47:42 2018 New Revision: 333215 URL: https://svnweb.freebsd.org/changeset/base/333215 Log: MFC: r330803 Use FALLTHROUGH. Modified: stable/11/sys/dev/e1000/e1000_82575.c stable/11/sys/dev/e1000/e1000_mbx.c stable/11/sys/dev/e1000/e1000_phy.c stable/11/sys/dev/e1000/e1000_vf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/e1000_82575.c == --- stable/11/sys/dev/e1000/e1000_82575.c Thu May 3 15:41:04 2018 (r333214) +++ stable/11/sys/dev/e1000/e1000_82575.c Thu May 3 15:47:42 2018 (r333215) @@ -1678,7 +1678,7 @@ static s32 e1000_setup_serdes_link_82575(struct e1000_ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ pcs_autoneg = FALSE; - /* fall through to default case */ + /* FALLTHROUGH */ default: if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { @@ -1805,6 +1805,7 @@ static s32 e1000_get_media_type_82575(struct e1000_hw break; } /* fall through for I2C based SGMII */ + /* FALLTHROUGH */ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: /* read media type from SFP EEPROM */ ret_val = e1000_set_sfp_media_type_82575(hw); Modified: stable/11/sys/dev/e1000/e1000_mbx.c == --- stable/11/sys/dev/e1000/e1000_mbx.c Thu May 3 15:41:04 2018 (r333214) +++ stable/11/sys/dev/e1000/e1000_mbx.c Thu May 3 15:47:42 2018 (r333215) @@ -778,6 +778,7 @@ s32 e1000_init_mbx_params_pf(struct e1000_hw *hw) mbx->stats.reqs = 0; mbx->stats.acks = 0; mbx->stats.rsts = 0; + /* FALLTHROUGH */ default: return E1000_SUCCESS; } Modified: stable/11/sys/dev/e1000/e1000_phy.c == --- stable/11/sys/dev/e1000/e1000_phy.c Thu May 3 15:41:04 2018 (r333214) +++ stable/11/sys/dev/e1000/e1000_phy.c Thu May 3 15:47:42 2018 (r333215) @@ -1297,6 +1297,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw * phy_data |= M88E1000_PSCR_AUTO_X_1000T; break; } + /* FALLTHROUGH */ case 0: default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; Modified: stable/11/sys/dev/e1000/e1000_vf.c == --- stable/11/sys/dev/e1000/e1000_vf.c Thu May 3 15:41:04 2018 (r333214) +++ stable/11/sys/dev/e1000/e1000_vf.c Thu May 3 15:47:42 2018 (r333215) @@ -487,8 +487,10 @@ s32 e1000_promisc_set_vf(struct e1000_hw *hw, enum e10 break; case e1000_promisc_enabled: msgbuf |= E1000_VF_SET_PROMISC_MULTICAST; + /* FALLTHROUGH */ case e1000_promisc_unicast: msgbuf |= E1000_VF_SET_PROMISC_UNICAST; + /* FALLTHROUGH */ case e1000_promisc_disabled: break; default: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333213 - stable/11/sys/dev/e1000
Author: marius Date: Thu May 3 15:40:56 2018 New Revision: 333213 URL: https://svnweb.freebsd.org/changeset/base/333213 Log: MFC: r327312, r327842, r327865 - Add initial support for Intel Ice Lake and Cannon Lake Ethernet MACs. - Add workaround for Intel Sky Lake and Kabby Lake Ethernet MAC erratum 1.5.4.5. - Fix uses of 1 << 31. Modified: stable/11/sys/dev/e1000/e1000_82575.h stable/11/sys/dev/e1000/e1000_api.c stable/11/sys/dev/e1000/e1000_hw.h stable/11/sys/dev/e1000/e1000_ich8lan.c stable/11/sys/dev/e1000/e1000_ich8lan.h stable/11/sys/dev/e1000/e1000_regs.h stable/11/sys/dev/e1000/if_em.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/e1000_82575.h == --- stable/11/sys/dev/e1000/e1000_82575.h Thu May 3 15:33:18 2018 (r333212) +++ stable/11/sys/dev/e1000/e1000_82575.h Thu May 3 15:40:56 2018 (r333213) @@ -384,7 +384,7 @@ struct e1000_adv_tx_context_desc { #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) #define E1000_ETQF_1588(1 << 30) -#define E1000_ETQF_QUEUE_ENABLE(1 << 31) +#define E1000_ETQF_QUEUE_ENABLE(1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -411,7 +411,7 @@ struct e1000_adv_tx_context_desc { #define E1000_DTXSWC_LLE_MASK 0x00FF /* Per VF Local LB enables */ #define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8 #define E1000_DTXSWC_LLE_SHIFT 16 -#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */ +#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1U << 31) /* global VF LB enable */ /* Easy defines for setting default pool, would normally be left a zero */ #define E1000_VT_CTL_DEFAULT_POOL_SHIFT7 Modified: stable/11/sys/dev/e1000/e1000_api.c == --- stable/11/sys/dev/e1000/e1000_api.c Thu May 3 15:33:18 2018 (r333212) +++ stable/11/sys/dev/e1000/e1000_api.c Thu May 3 15:40:56 2018 (r333213) @@ -310,6 +310,16 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; + case E1000_DEV_ID_PCH_CNP_I219_LM6: + case E1000_DEV_ID_PCH_CNP_I219_V6: + case E1000_DEV_ID_PCH_CNP_I219_LM7: + case E1000_DEV_ID_PCH_CNP_I219_V7: + case E1000_DEV_ID_PCH_ICP_I219_LM8: + case E1000_DEV_ID_PCH_ICP_I219_V8: + case E1000_DEV_ID_PCH_ICP_I219_LM9: + case E1000_DEV_ID_PCH_ICP_I219_V9: + mac->type = e1000_pch_cnp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -461,6 +471,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool i case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: Modified: stable/11/sys/dev/e1000/e1000_hw.h == --- stable/11/sys/dev/e1000/e1000_hw.h Thu May 3 15:33:18 2018 (r333212) +++ stable/11/sys/dev/e1000/e1000_hw.h Thu May 3 15:40:56 2018 (r333213) @@ -146,6 +146,14 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 #define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 #define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 +#define E1000_DEV_ID_PCH_CNP_I219_LM6 0x15BD +#define E1000_DEV_ID_PCH_CNP_I219_V6 0x15BE +#define E1000_DEV_ID_PCH_CNP_I219_LM7 0x15BB +#define E1000_DEV_ID_PCH_CNP_I219_V7 0x15BC +#define E1000_DEV_ID_PCH_ICP_I219_LM8 0x15DF +#define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 +#define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 +#define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -232,6 +240,7 @@ enum e1000_mac_type { e1000_pch2lan, e1000_pch_lpt, e1000_pch_spt, + e1000_pch_cnp, e1000_82575, e1000_82576, e1000_82580, Modified: stable/11/sys/dev/e1000/e1000_ich8lan.c == --- stable/11/sys/dev/e1000/e1000_ich8lan.c Thu May 3 15:33:18 2018 (r333212) +++ stable/11/sys/dev/e1000/e1000_ich8lan.c Thu May 3 15:40:56 2018 (r333213) @@ -344,6 +344,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1 switch (hw->mac.type)
svn commit: r333214 - stable/10/sys/dev/e1000
Author: marius Date: Thu May 3 15:41:04 2018 New Revision: 333214 URL: https://svnweb.freebsd.org/changeset/base/333214 Log: MFC: r327312, r327842, r327865 - Add initial support for Intel Ice Lake and Cannon Lake Ethernet MACs. - Add workaround for Intel Sky Lake and Kabby Lake Ethernet MAC erratum 1.5.4.5. - Fix uses of 1 << 31. Modified: stable/10/sys/dev/e1000/e1000_82575.h stable/10/sys/dev/e1000/e1000_api.c stable/10/sys/dev/e1000/e1000_hw.h stable/10/sys/dev/e1000/e1000_ich8lan.c stable/10/sys/dev/e1000/e1000_ich8lan.h stable/10/sys/dev/e1000/e1000_regs.h stable/10/sys/dev/e1000/if_em.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/e1000_82575.h == --- stable/10/sys/dev/e1000/e1000_82575.h Thu May 3 15:40:56 2018 (r333213) +++ stable/10/sys/dev/e1000/e1000_82575.h Thu May 3 15:41:04 2018 (r333214) @@ -384,7 +384,7 @@ struct e1000_adv_tx_context_desc { #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) #define E1000_ETQF_1588(1 << 30) -#define E1000_ETQF_QUEUE_ENABLE(1 << 31) +#define E1000_ETQF_QUEUE_ENABLE(1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -411,7 +411,7 @@ struct e1000_adv_tx_context_desc { #define E1000_DTXSWC_LLE_MASK 0x00FF /* Per VF Local LB enables */ #define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8 #define E1000_DTXSWC_LLE_SHIFT 16 -#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */ +#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1U << 31) /* global VF LB enable */ /* Easy defines for setting default pool, would normally be left a zero */ #define E1000_VT_CTL_DEFAULT_POOL_SHIFT7 Modified: stable/10/sys/dev/e1000/e1000_api.c == --- stable/10/sys/dev/e1000/e1000_api.c Thu May 3 15:40:56 2018 (r333213) +++ stable/10/sys/dev/e1000/e1000_api.c Thu May 3 15:41:04 2018 (r333214) @@ -310,6 +310,16 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; + case E1000_DEV_ID_PCH_CNP_I219_LM6: + case E1000_DEV_ID_PCH_CNP_I219_V6: + case E1000_DEV_ID_PCH_CNP_I219_LM7: + case E1000_DEV_ID_PCH_CNP_I219_V7: + case E1000_DEV_ID_PCH_ICP_I219_LM8: + case E1000_DEV_ID_PCH_ICP_I219_V8: + case E1000_DEV_ID_PCH_ICP_I219_LM9: + case E1000_DEV_ID_PCH_ICP_I219_V9: + mac->type = e1000_pch_cnp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -461,6 +471,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool i case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: Modified: stable/10/sys/dev/e1000/e1000_hw.h == --- stable/10/sys/dev/e1000/e1000_hw.h Thu May 3 15:40:56 2018 (r333213) +++ stable/10/sys/dev/e1000/e1000_hw.h Thu May 3 15:41:04 2018 (r333214) @@ -146,6 +146,14 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 #define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 #define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 +#define E1000_DEV_ID_PCH_CNP_I219_LM6 0x15BD +#define E1000_DEV_ID_PCH_CNP_I219_V6 0x15BE +#define E1000_DEV_ID_PCH_CNP_I219_LM7 0x15BB +#define E1000_DEV_ID_PCH_CNP_I219_V7 0x15BC +#define E1000_DEV_ID_PCH_ICP_I219_LM8 0x15DF +#define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 +#define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 +#define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -232,6 +240,7 @@ enum e1000_mac_type { e1000_pch2lan, e1000_pch_lpt, e1000_pch_spt, + e1000_pch_cnp, e1000_82575, e1000_82576, e1000_82580, Modified: stable/10/sys/dev/e1000/e1000_ich8lan.c == --- stable/10/sys/dev/e1000/e1000_ich8lan.c Thu May 3 15:40:56 2018 (r333213) +++ stable/10/sys/dev/e1000/e1000_ich8lan.c Thu May 3 15:41:04 2018 (r333214) @@ -344,6 +344,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1 switch (hw->mac.type)
svn commit: r333212 - head/sys/dev/amdsbwd
Author: avg Date: Thu May 3 15:33:18 2018 New Revision: 333212 URL: https://svnweb.freebsd.org/changeset/base/333212 Log: amdsbwd: add suspend and resume methods Without the suspend method the watchdog may fire in S1 state. Without the resume method the watchdog is not re-enabled after returning from S3 state. I observe this on one of my systems. Not sure if watchdog(4) should participate in the suspend actions. Right now everything is up to individual drivers. MFC after:2 weeks Modified: head/sys/dev/amdsbwd/amdsbwd.c Modified: head/sys/dev/amdsbwd/amdsbwd.c == --- head/sys/dev/amdsbwd/amdsbwd.c Thu May 3 15:01:27 2018 (r333211) +++ head/sys/dev/amdsbwd/amdsbwd.c Thu May 3 15:33:18 2018 (r333212) @@ -104,12 +104,16 @@ static void amdsbwd_identify(driver_t *driver, device_ static int amdsbwd_probe(device_t dev); static int amdsbwd_attach(device_t dev); static int amdsbwd_detach(device_t dev); +static int amdsbwd_suspend(device_t dev); +static int amdsbwd_resume(device_t dev); static device_method_t amdsbwd_methods[] = { DEVMETHOD(device_identify, amdsbwd_identify), DEVMETHOD(device_probe, amdsbwd_probe), DEVMETHOD(device_attach,amdsbwd_attach), DEVMETHOD(device_detach,amdsbwd_detach), + DEVMETHOD(device_suspend, amdsbwd_suspend), + DEVMETHOD(device_resume,amdsbwd_resume), #if 0 DEVMETHOD(device_shutdown, amdsbwd_detach), #endif @@ -553,3 +557,30 @@ amdsbwd_detach(device_t dev) return (0); } +static int +amdsbwd_suspend(device_t dev) +{ + struct amdsbwd_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = wdctrl_read(sc); + val &= ~AMDSB_WD_RUN; + wdctrl_write(sc, val); + return (0); +} + +static int +amdsbwd_resume(device_t dev) +{ + struct amdsbwd_softc *sc; + + sc = device_get_softc(dev); + wdctrl_write(sc, AMDSB_WD_FIRED); + if (sc->active) { + amdsbwd_tmr_set(sc, sc->timeout); + amdsbwd_tmr_enable(sc); + amdsbwd_tmr_reload(sc); + } + return (0); +} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333211 - head/sys/netinet/cc
Author: sbruno Date: Thu May 3 15:01:27 2018 New Revision: 333211 URL: https://svnweb.freebsd.org/changeset/base/333211 Log: cc_cubic: - Update cubic parameters to draft-ietf-tcpm-cubic-04 Submitted by: Matt MacyReviewed by: lstewart Differential Revision:https://reviews.freebsd.org/D10556 Modified: head/sys/netinet/cc/cc_cubic.h Modified: head/sys/netinet/cc/cc_cubic.h == --- head/sys/netinet/cc/cc_cubic.h Thu May 3 14:48:42 2018 (r333210) +++ head/sys/netinet/cc/cc_cubic.h Thu May 3 15:01:27 2018 (r333211) @@ -51,23 +51,23 @@ /* 0.5 << CUBIC_SHIFT. */ #defineRENO_BETA 128 -/* ~0.8 << CUBIC_SHIFT. */ -#defineCUBIC_BETA 204 +/* ~0.7 << CUBIC_SHIFT. */ +#defineCUBIC_BETA 179 -/* ~0.2 << CUBIC_SHIFT. */ -#defineONE_SUB_CUBIC_BETA 51 +/* ~0.3 << CUBIC_SHIFT. */ +#defineONE_SUB_CUBIC_BETA 77 /* 3 * ONE_SUB_CUBIC_BETA. */ -#defineTHREE_X_PT2 153 +#defineTHREE_X_PT3 231 /* (2 << CUBIC_SHIFT) - ONE_SUB_CUBIC_BETA. */ -#defineTWO_SUB_PT2 461 +#defineTWO_SUB_PT3 435 /* ~0.4 << CUBIC_SHIFT. */ #defineCUBIC_C_FACTOR 102 -/* CUBIC fast convergence factor: ~0.9 << CUBIC_SHIFT. */ -#defineCUBIC_FC_FACTOR 230 +/* CUBIC fast convergence factor: (1+beta_cubic)/2. */ +#defineCUBIC_FC_FACTOR 217 /* Don't trust s_rtt until this many rtt samples have been taken. */ #defineCUBIC_MIN_RTT_SAMPLES 8 @@ -79,9 +79,8 @@ extern int hz; /* * Implementation based on the formulae found in the CUBIC Internet Draft - * "draft-rhee-tcpm-cubic-02". + * "draft-ietf-tcpm-cubic-04". * - * Note BETA used in cc_cubic is equal to (1-beta) in the I-D */ static __inline float @@ -91,7 +90,7 @@ theoretical_cubic_k(double wmax_pkts) C = 0.4; - return (pow((wmax_pkts * 0.2) / C, (1.0 / 3.0)) * pow(2, CUBIC_SHIFT)); + return (pow((wmax_pkts * 0.3) / C, (1.0 / 3.0)) * pow(2, CUBIC_SHIFT)); } static __inline unsigned long @@ -120,7 +119,7 @@ theoretical_tf_cwnd(int ticks_since_cong, int rtt_tick uint32_t smss) { - return ((wmax * 0.8) + ((3 * 0.2) / (2 - 0.2) * + return ((wmax * 0.7) + ((3 * 0.3) / (2 - 0.3) * (ticks_since_cong / (float)rtt_ticks) * smss)); } @@ -232,7 +231,7 @@ reno_cwnd(int ticks_since_cong, int rtt_ticks, unsigne /* * Compute an approximation of the "TCP friendly" cwnd some number of ticks * after a congestion event that is designed to yield the same average cwnd as - * NewReno while using CUBIC's beta of 0.8. RTT should be the average RTT + * NewReno while using CUBIC's beta of 0.7. RTT should be the average RTT * estimate for the path measured over the previous congestion epoch and wmax is * the value of cwnd at the last congestion event. */ @@ -242,8 +241,8 @@ tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned { /* Equation 4 of I-D. */ - return (((wmax * CUBIC_BETA) + (((THREE_X_PT2 * ticks_since_cong * - smss) << CUBIC_SHIFT) / TWO_SUB_PT2 / rtt_ticks)) >> CUBIC_SHIFT); + return (((wmax * CUBIC_BETA) + (((THREE_X_PT3 * ticks_since_cong * + smss) << CUBIC_SHIFT) / TWO_SUB_PT3 / rtt_ticks)) >> CUBIC_SHIFT); } #endif /* _NETINET_CC_CUBIC_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333210 - in head: share/man/man4 sys/dev/nxge
Author: sbruno Date: Thu May 3 14:48:42 2018 New Revision: 333210 URL: https://svnweb.freebsd.org/changeset/base/333210 Log: nxge(4) deprecation notice Submitted by: kbowling Reviewed by: brooks Sponsored by: Limelight Networks Differential Revision:https://reviews.freebsd.org/D15277 Modified: head/share/man/man4/nxge.4 head/sys/dev/nxge/if_nxge.c Modified: head/share/man/man4/nxge.4 == --- head/share/man/man4/nxge.4 Thu May 3 13:14:31 2018(r333209) +++ head/share/man/man4/nxge.4 Thu May 3 14:48:42 2018(r333210) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2007 +.Dd May 3, 2018 .Dt NXGE 4 .Os .Sh NAME @@ -44,6 +44,12 @@ module at boot time, place the following line in .Bd -literal -offset indent if_nxge_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 12.0 +and later. .Sh DESCRIPTION The .Nm Modified: head/sys/dev/nxge/if_nxge.c == --- head/sys/dev/nxge/if_nxge.c Thu May 3 13:14:31 2018(r333209) +++ head/sys/dev/nxge/if_nxge.c Thu May 3 14:48:42 2018(r333210) @@ -1006,6 +1006,7 @@ xge_attach(device_t dev) attach_out: xge_os_free(NULL, device_config, sizeof(xge_hal_device_config_t)); attach_out_config: + gone_in_dev(dev, 12, "nxge(4) driver"); return status; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333209 - head/sys/dev/acpica
Author: avg Date: Thu May 3 13:14:31 2018 New Revision: 333209 URL: https://svnweb.freebsd.org/changeset/base/333209 Log: hpet: use macros instead of magic values for the timer mode MFC after:1 week Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c == --- head/sys/dev/acpica/acpi_hpet.c Thu May 3 10:17:37 2018 (r333208) +++ head/sys/dev/acpica/acpi_hpet.c Thu May 3 13:14:31 2018 (r333209) @@ -96,6 +96,9 @@ struct hpet_softc { struct hpet_softc *sc; int num; int mode; +#defineTIMER_STOPPED 0 +#defineTIMER_PERIODIC 1 +#defineTIMER_ONESHOT 2 int intr_rid; int irq; int pcpu_cpu; @@ -206,10 +209,10 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb t = (mt->pcpu_master < 0) ? mt : >t[mt->pcpu_slaves[curcpu]]; if (period != 0) { - t->mode = 1; + t->mode = TIMER_PERIODIC; t->div = (sc->freq * period) >> 32; } else { - t->mode = 2; + t->mode = TIMER_ONESHOT; t->div = 0; } if (first != 0) @@ -222,7 +225,7 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); restart: t->next = now + fdiv; - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps | HPET_TCNF_VAL_SET); @@ -253,7 +256,7 @@ hpet_stop(struct eventtimer *et) struct hpet_softc *sc = mt->sc; t = (mt->pcpu_master < 0) ? mt : >t[mt->pcpu_slaves[curcpu]]; - t->mode = 0; + t->mode = TIMER_STOPPED; t->caps &= ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE); bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); return (0); @@ -267,7 +270,7 @@ hpet_intr_single(void *arg) struct hpet_softc *sc = t->sc; uint32_t now; - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) return (FILTER_STRAY); /* Check that per-CPU timer interrupt reached right CPU. */ if (t->pcpu_cpu >= 0 && t->pcpu_cpu != curcpu) { @@ -281,8 +284,9 @@ hpet_intr_single(void *arg) * Reload timer, hoping that next time may be more lucky * (system will manage proper interrupt binding). */ - if ((t->mode == 1 && (t->caps & HPET_TCAP_PER_INT) == 0) || - t->mode == 2) { + if ((t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) == 0) || + t->mode == TIMER_ONESHOT) { t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER) + sc->freq / 8; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), @@ -290,7 +294,7 @@ hpet_intr_single(void *arg) } return (FILTER_HANDLED); } - if (t->mode == 1 && + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT) == 0) { t->next += t->div; now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); @@ -298,8 +302,8 @@ hpet_intr_single(void *arg) t->next = now + t->div / 2; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), t->next); - } else if (t->mode == 2) - t->mode = 0; + } else if (t->mode == TIMER_ONESHOT) + t->mode = TIMER_STOPPED; mt = (t->pcpu_master < 0) ? t : >t[t->pcpu_master]; if (mt->et.et_active) mt->et.et_event_cb(>et, mt->et.et_arg); @@ -528,7 +532,7 @@ hpet_attach(device_t dev) t = >t[i]; t->sc = sc; t->num = i; - t->mode = 0; + t->mode = TIMER_STOPPED; t->intr_rid = -1; t->irq = -1; t->pcpu_cpu = -1; @@ -878,10 +882,11 @@ hpet_resume(device_t dev) } } #endif - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) continue; t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) != 0) { t->caps |= HPET_TCNF_TYPE; t->next += t->div;
svn commit: r333208 - head/sys/amd64/amd64
Author: kib Date: Thu May 3 10:17:37 2018 New Revision: 333208 URL: https://svnweb.freebsd.org/changeset/base/333208 Log: Style. Sponsored by: The FreeBSD Foundation MFC after:3 days Differential revision:https://reviews.freebsd.org/D13838 Modified: head/sys/amd64/amd64/elf_machdep.c Modified: head/sys/amd64/amd64/elf_machdep.c == --- head/sys/amd64/amd64/elf_machdep.c Thu May 3 08:17:12 2018 (r333207) +++ head/sys/amd64/amd64/elf_machdep.c Thu May 3 10:17:37 2018 (r333208) @@ -219,7 +219,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas } switch (rtype) { - case R_X86_64_NONE: /* none */ break; @@ -260,7 +259,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * objects. */ printf("kldload: unexpected R_COPY relocation\n"); - return -1; + return (-1); break; case R_X86_64_GLOB_DAT: /* S */ @@ -282,9 +281,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas default: printf("kldload: unexpected relocation type %ld\n", rtype); - return -1; + return (-1); } - return(0); + return (0); } int ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333206 - stable/11/sys/netinet6
Author: ae Date: Thu May 3 08:15:32 2018 New Revision: 333206 URL: https://svnweb.freebsd.org/changeset/base/333206 Log: MFC r332886: icmp6_reflect() sends ICMPv6 message with new IPv6 header. So, it is considered as originated by our host packet. And thus rcvif should be NULL, since it is used by ipfw(4) to determine that packet was originated from this host. Some of icmp6_reflect() consumers reuse mbuf and m_pkthdr without resetting rcvif pointer. To avoid this always reset m_pkthdr.rcvif pointer to NULL in icmp6_reflect(). Also remove such line and comment describing this from icmp6_error(), since it does not longer matters. PR: 227674 Modified: stable/11/sys/netinet6/icmp6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/icmp6.c == --- stable/11/sys/netinet6/icmp6.c Thu May 3 07:57:08 2018 (r333205) +++ stable/11/sys/netinet6/icmp6.c Thu May 3 08:15:32 2018 (r333206) @@ -381,15 +381,6 @@ icmp6_error(struct mbuf *m, int type, int code, int pa icmp6->icmp6_code = code; icmp6->icmp6_pptr = htonl((u_int32_t)param); - /* -* icmp6_reflect() is designed to be in the input path. -* icmp6_error() can be called from both input and output path, -* and if we are in output path rcvif could contain bogus value. -* clear m->m_pkthdr.rcvif for safety, we should have enough scope -* information in ip header (nip6). -*/ - m->m_pkthdr.rcvif = NULL; - ICMP6STAT_INC(icp6s_outhist[type]); icmp6_reflect(m, sizeof(struct ip6_hdr)); /* header order: IPv6 - ICMPv6 */ @@ -2181,7 +2172,7 @@ icmp6_reflect(struct mbuf *m, size_t off) */ m->m_flags &= ~(M_BCAST|M_MCAST); - + m->m_pkthdr.rcvif = NULL; ip6_output(m, NULL, NULL, 0, NULL, , NULL); if (outif) icmp6_ifoutstat_inc(outif, type, code); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333207 - stable/11/sys/netipsec
Author: ae Date: Thu May 3 08:17:12 2018 New Revision: 333207 URL: https://svnweb.freebsd.org/changeset/base/333207 Log: MFC r333016: Merge r1.22-1.23 from NetBSD: Don't assume M_PKTHDR is set only on the first mbuf of the chain. The check is replaced by (m1 != m), which is equivalent to the previous code: we want to modify m->m_pkthdr.len only when 'm' was not passed in m_adj(). Fix a pretty bad mistake, that has always been there: m_adj(m1, -(m1->m_len - roff)); if (m1 != m) m->m_pkthdr.len -= (m1->m_len - roff); This is wrong: m_adj() will modify m1->m_len, so we're using a wrong value when manually adjusting m->m_pkthdr.len. Reported by:Maxime Villard Obtained from: NetBSD Modified: stable/11/sys/netipsec/ipsec_mbuf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec_mbuf.c == --- stable/11/sys/netipsec/ipsec_mbuf.c Thu May 3 08:15:32 2018 (r333206) +++ stable/11/sys/netipsec/ipsec_mbuf.c Thu May 3 08:17:12 2018 (r333207) @@ -253,10 +253,11 @@ m_striphdr(struct mbuf *m, int skip, int hlen) /* The header was at the beginning of the mbuf */ IPSECSTAT_INC(ips_input_front); m_adj(m1, hlen); - if ((m1->m_flags & M_PKTHDR) == 0) + if (m1 != m) m->m_pkthdr.len -= hlen; } else if (roff + hlen >= m1->m_len) { struct mbuf *mo; + int adjlen; /* * Part or all of the header is at the end of this mbuf, @@ -265,11 +266,13 @@ m_striphdr(struct mbuf *m, int skip, int hlen) */ IPSECSTAT_INC(ips_input_end); if (roff + hlen > m1->m_len) { + adjlen = roff + hlen - m1->m_len; + /* Adjust the next mbuf by the remainder */ - m_adj(m1->m_next, roff + hlen - m1->m_len); + m_adj(m1->m_next, adjlen); /* The second mbuf is guaranteed not to have a pkthdr... */ - m->m_pkthdr.len -= (roff + hlen - m1->m_len); + m->m_pkthdr.len -= adjlen; } /* Now, let's unlink the mbuf chain for a second...*/ @@ -277,9 +280,10 @@ m_striphdr(struct mbuf *m, int skip, int hlen) m1->m_next = NULL; /* ...and trim the end of the first part of the chain...sick */ - m_adj(m1, -(m1->m_len - roff)); - if ((m1->m_flags & M_PKTHDR) == 0) - m->m_pkthdr.len -= (m1->m_len - roff); + adjlen = m1->m_len - roff; + m_adj(m1, -adjlen); + if (m1 != m) + m->m_pkthdr.len -= adjlen; /* Finally, let's relink */ m1->m_next = mo; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333205 - in stable/10/sys: amd64/amd64 i386/i386 powerpc/aim powerpc/booke sys
Author: avg Date: Thu May 3 07:57:08 2018 New Revision: 333205 URL: https://svnweb.freebsd.org/changeset/base/333205 Log: MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal This will allow to hook a ddb script to "kdb.enter.trap" event. Previously there was no specific name for this event, so it could only be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks. Both are very unspecific. Having a specific event is useful because the fatal trap condition is very similar to panic but it has an additional property that the current stack frame is the frame where the trap occurred. So, both a register dump and a stack bottom dump have additional information that can help analyze the problem. I have added the event only on architectures that have trap_fatal() function defined. I haven't looked at other architectures. Their maintainers can add support for the event later. Sample script: kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20 Note: changes to powerpc/aim/trap.c and powerpc/booke/trap.c are direct changes. Sponsored by: Panzura Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c stable/10/sys/sys/kdb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c == --- stable/10/sys/amd64/amd64/trap.cThu May 3 07:47:03 2018 (r333204) +++ stable/10/sys/amd64/amd64/trap.cThu May 3 07:57:08 2018 (r333205) @@ -793,6 +793,9 @@ trap_fatal(frame, eva) long esp; struct soft_segment_descriptor softseg; char *msg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -849,9 +852,13 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic) - if (kdb_trap(type, 0, frame)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(type, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) return; + } #endif printf("trap number = %d\n", type); if (type <= MAX_TRAP_MSG) Modified: stable/10/sys/i386/i386/trap.c == --- stable/10/sys/i386/i386/trap.c Thu May 3 07:47:03 2018 (r333204) +++ stable/10/sys/i386/i386/trap.c Thu May 3 07:57:08 2018 (r333205) @@ -956,6 +956,9 @@ trap_fatal(frame, eva) u_int type; struct soft_segment_descriptor softseg; char *msg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -1019,12 +1022,13 @@ trap_fatal(frame, eva) #ifdef KDB if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; frame->tf_err = eva;/* smuggle fault address to ddb */ - if (kdb_trap(type, 0, frame)) { - frame->tf_err = code; /* restore error code */ + handled = kdb_trap(type, 0, frame); + frame->tf_err = code; /* restore error code */ + kdb_why = KDB_WHY_UNSET; + if (handled) return; - } - frame->tf_err = code; /* restore error code */ } #endif printf("trap number = %d\n", type); Modified: stable/10/sys/powerpc/aim/trap.c == --- stable/10/sys/powerpc/aim/trap.cThu May 3 07:47:03 2018 (r333204) +++ stable/10/sys/powerpc/aim/trap.cThu May 3 07:57:08 2018 (r333205) @@ -357,11 +357,19 @@ trap(struct trapframe *frame) static void trap_fatal(struct trapframe *frame) { +#ifdef KDB + bool handled; +#endif printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) - return; + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(frame->exc, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) + return; + } #endif panic("%s trap", trapname(frame->exc)); } Modified: stable/10/sys/powerpc/booke/trap.c == --- stable/10/sys/powerpc/booke/trap.c Thu May 3 07:47:03 2018 (r333204) +++ stable/10/sys/powerpc/booke/trap.c Thu May 3 07:57:08 2018 (r333205) @@ -239,11 +239,19 @@ trap(struct trapframe *frame) static void trap_fatal(struct trapframe *frame) { +#ifdef KDB + bool handled;
svn commit: r333204 - in stable/11/sys: amd64/amd64 i386/i386 powerpc/powerpc sys
Author: avg Date: Thu May 3 07:47:03 2018 New Revision: 333204 URL: https://svnweb.freebsd.org/changeset/base/333204 Log: MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal This will allow to hook a ddb script to "kdb.enter.trap" event. Previously there was no specific name for this event, so it could only be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks. Both are very unspecific. Having a specific event is useful because the fatal trap condition is very similar to panic but it has an additional property that the current stack frame is the frame where the trap occurred. So, both a register dump and a stack bottom dump have additional information that can help analyze the problem. I have added the event only on architectures that have trap_fatal() function defined. I haven't looked at other architectures. Their maintainers can add support for the event later. Sample script: kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20 Sponsored by: Panzura Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c stable/11/sys/powerpc/powerpc/trap.c stable/11/sys/sys/kdb.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c == --- stable/11/sys/amd64/amd64/trap.cThu May 3 07:38:45 2018 (r333203) +++ stable/11/sys/amd64/amd64/trap.cThu May 3 07:47:03 2018 (r333204) @@ -758,6 +758,9 @@ trap_fatal(frame, eva) u_int type; struct soft_segment_descriptor softseg; char *msg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -808,9 +811,13 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic) - if (kdb_trap(type, 0, frame)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(type, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) return; + } #endif printf("trap number = %d\n", type); if (type <= MAX_TRAP_MSG) Modified: stable/11/sys/i386/i386/trap.c == --- stable/11/sys/i386/i386/trap.c Thu May 3 07:38:45 2018 (r333203) +++ stable/11/sys/i386/i386/trap.c Thu May 3 07:47:03 2018 (r333204) @@ -880,6 +880,9 @@ trap_fatal(frame, eva) u_int type; struct soft_segment_descriptor softseg; char *msg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -945,12 +948,13 @@ trap_fatal(frame, eva) #ifdef KDB if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; frame->tf_err = eva;/* smuggle fault address to ddb */ - if (kdb_trap(type, 0, frame)) { - frame->tf_err = code; /* restore error code */ + handled = kdb_trap(type, 0, frame); + frame->tf_err = code; /* restore error code */ + kdb_why = KDB_WHY_UNSET; + if (handled) return; - } - frame->tf_err = code; /* restore error code */ } #endif printf("trap number = %d\n", type); Modified: stable/11/sys/powerpc/powerpc/trap.c == --- stable/11/sys/powerpc/powerpc/trap.cThu May 3 07:38:45 2018 (r333203) +++ stable/11/sys/powerpc/powerpc/trap.cThu May 3 07:47:03 2018 (r333204) @@ -389,11 +389,19 @@ trap(struct trapframe *frame) static void trap_fatal(struct trapframe *frame) { +#ifdef KDB + bool handled; +#endif printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) - return; + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(frame->exc, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) + return; + } #endif panic("%s trap", trapname(frame->exc)); } Modified: stable/11/sys/sys/kdb.h == --- stable/11/sys/sys/kdb.h Thu May 3 07:38:45 2018(r333203) +++ stable/11/sys/sys/kdb.h Thu May 3 07:47:03 2018(r333204) @@ -98,6 +98,7 @@ extern const char * volatile kdb_why; #defineKDB_WHY_UNSET NULL/* No reason set. */ #defineKDB_WHY_PANIC "panic" /* panic() was called. */ #defineKDB_WHY_KASSERT "kassert"
svn commit: r333203 - stable/10/sys/dev/usb/controller
Author: hselasky Date: Thu May 3 07:38:45 2018 New Revision: 333203 URL: https://svnweb.freebsd.org/changeset/base/333203 Log: MFC r333100: Improve fix in r304629 by allowing configuration of the behaviour through a SYSCTL instead of a compile time define. Add quirk by default for all LynxPoint XHCI controllers. PR: 227602 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/controller/xhci.h stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c == --- stable/10/sys/dev/usb/controller/xhci.c Thu May 3 07:37:49 2018 (r333202) +++ stable/10/sys/dev/usb/controller/xhci.c Thu May 3 07:38:45 2018 (r333203) @@ -99,6 +99,7 @@ static int xhcidebug; static int xhciroute; static int xhcipolling; static int xhcidma32; +static int xhcictlstep; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, , 0, "Debug level"); @@ -112,9 +113,13 @@ TUNABLE_INT("hw.usb.xhci.use_polling", ); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, , 0, "Set to only use 32-bit DMA for the XHCI controller"); TUNABLE_INT("hw.usb.xhci.dma32", ); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, ctlstep, CTLFLAG_RWTUN, +, 0, "Set to enable control endpoint status stage stepping"); +TUNABLE_INT("hw.usb.xhci.ctlstep", ); #else #definexhciroute 0 #definexhcidma32 0 +#definexhcictlstep 0 #endif #defineXHCI_INTR_ENDPT 1 @@ -2244,11 +2249,17 @@ xhci_setup_generic_chain(struct usb_xfer *xfer) * Send a DATA1 message and invert the current * endpoint direction. */ -#ifdef XHCI_STEP_STATUS_STAGE - temp.step_td = (xfer->nframes != 0); -#else - temp.step_td = 0; -#endif + if (xhcictlstep || temp.sc->sc_ctlstep) { + /* +* Some XHCI controllers will not delay the +* status stage until the next SOF. Force this +* behaviour to avoid failed control +* transfers. +*/ + temp.step_td = (xfer->nframes != 0); + } else { + temp.step_td = 0; + } temp.direction = UE_GET_DIR(xfer->endpointno) ^ UE_DIR_IN; temp.len = 0; temp.pc = NULL; Modified: stable/10/sys/dev/usb/controller/xhci.h == --- stable/10/sys/dev/usb/controller/xhci.h Thu May 3 07:37:49 2018 (r333202) +++ stable/10/sys/dev/usb/controller/xhci.h Thu May 3 07:38:45 2018 (r333203) @@ -506,6 +506,8 @@ struct xhci_softc { uint8_t sc_noport; /* root HUB device configuration */ uint8_t sc_conf; + /* step status stage of all control transfers */ + uint8_t sc_ctlstep; /* root HUB port event bitmap, max 256 ports */ uint8_t sc_hub_idata[32]; Modified: stable/10/sys/dev/usb/controller/xhci_pci.c == --- stable/10/sys/dev/usb/controller/xhci_pci.c Thu May 3 07:37:49 2018 (r333202) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Thu May 3 07:38:45 2018 (r333203) @@ -240,6 +240,7 @@ xhci_pci_attach(device_t self) */ sc->sc_port_route = _pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; + sc->sc_ctlstep = 1; break; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333202 - in stable/10/sys/powerpc: aim booke
Author: avg Date: Thu May 3 07:37:49 2018 New Revision: 333202 URL: https://svnweb.freebsd.org/changeset/base/333202 Log: follow-up to r333201 for powerpc, no kdb_active check in trap_fatal This is a direct commit as there are two copies of trap_fatal for powerpc in this branch. Sponsored by: Panzura Modified: stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c Modified: stable/10/sys/powerpc/aim/trap.c == --- stable/10/sys/powerpc/aim/trap.cThu May 3 07:34:10 2018 (r333201) +++ stable/10/sys/powerpc/aim/trap.cThu May 3 07:37:49 2018 (r333202) @@ -360,8 +360,7 @@ trap_fatal(struct trapframe *frame) printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if ((debugger_on_panic || kdb_active) && - kdb_trap(frame->exc, 0, frame)) + if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) return; #endif panic("%s trap", trapname(frame->exc)); Modified: stable/10/sys/powerpc/booke/trap.c == --- stable/10/sys/powerpc/booke/trap.c Thu May 3 07:34:10 2018 (r333201) +++ stable/10/sys/powerpc/booke/trap.c Thu May 3 07:37:49 2018 (r333202) @@ -242,8 +242,7 @@ trap_fatal(struct trapframe *frame) printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if ((debugger_on_panic || kdb_active) && - kdb_trap(frame->exc, 0, frame)) + if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) return; #endif panic("%s trap", trapname(frame->exc)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333201 - in stable/10/sys: amd64/amd64 i386/i386
Author: avg Date: Thu May 3 07:34:10 2018 New Revision: 333201 URL: https://svnweb.freebsd.org/changeset/base/333201 Log: MFC r332730: don't check for kdb reentry in trap_fatal(), it's impossible Sponsored by: Panzura Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c == --- stable/10/sys/amd64/amd64/trap.cThu May 3 07:31:09 2018 (r333200) +++ stable/10/sys/amd64/amd64/trap.cThu May 3 07:34:10 2018 (r333201) @@ -849,7 +849,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) if (kdb_trap(type, 0, frame)) return; #endif Modified: stable/10/sys/i386/i386/trap.c == --- stable/10/sys/i386/i386/trap.c Thu May 3 07:31:09 2018 (r333200) +++ stable/10/sys/i386/i386/trap.c Thu May 3 07:34:10 2018 (r333201) @@ -1018,7 +1018,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { frame->tf_err = eva;/* smuggle fault address to ddb */ if (kdb_trap(type, 0, frame)) { frame->tf_err = code; /* restore error code */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333200 - in stable/11/sys: amd64/amd64 i386/i386 powerpc/powerpc
Author: avg Date: Thu May 3 07:31:09 2018 New Revision: 333200 URL: https://svnweb.freebsd.org/changeset/base/333200 Log: MFC r332730: don't check for kdb reentry in trap_fatal(), it's impossible Sponsored by: Panzura Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c stable/11/sys/powerpc/powerpc/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c == --- stable/11/sys/amd64/amd64/trap.cThu May 3 07:29:08 2018 (r333199) +++ stable/11/sys/amd64/amd64/trap.cThu May 3 07:31:09 2018 (r333200) @@ -808,7 +808,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) if (kdb_trap(type, 0, frame)) return; #endif Modified: stable/11/sys/i386/i386/trap.c == --- stable/11/sys/i386/i386/trap.c Thu May 3 07:29:08 2018 (r333199) +++ stable/11/sys/i386/i386/trap.c Thu May 3 07:31:09 2018 (r333200) @@ -944,7 +944,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { frame->tf_err = eva;/* smuggle fault address to ddb */ if (kdb_trap(type, 0, frame)) { frame->tf_err = code; /* restore error code */ Modified: stable/11/sys/powerpc/powerpc/trap.c == --- stable/11/sys/powerpc/powerpc/trap.cThu May 3 07:29:08 2018 (r333199) +++ stable/11/sys/powerpc/powerpc/trap.cThu May 3 07:31:09 2018 (r333200) @@ -392,8 +392,7 @@ trap_fatal(struct trapframe *frame) printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if ((debugger_on_panic || kdb_active) && - kdb_trap(frame->exc, 0, frame)) + if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) return; #endif panic("%s trap", trapname(frame->exc)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333198 - stable/10/usr.sbin/mountd
Author: avg Date: Thu May 3 07:28:49 2018 New Revision: 333198 URL: https://svnweb.freebsd.org/changeset/base/333198 Log: MFC r332559: mountd: fix a crash when getgrouplist reports too many groups Sponsored by: Panzura Modified: stable/10/usr.sbin/mountd/mountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mountd/mountd.c == --- stable/10/usr.sbin/mountd/mountd.c Thu May 3 07:28:04 2018 (r333197) +++ stable/10/usr.sbin/mountd/mountd.c Thu May 3 07:28:49 2018 (r333198) @@ -2955,8 +2955,11 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_uid = pw->pw_uid; ngroups = XU_NGROUPS + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) { syslog(LOG_ERR, "too many groups"); + ngroups = XU_NGROUPS + 1; + } + /* * Compress out duplicate. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333199 - stable/11/sys/dev/usb/controller
Author: hselasky Date: Thu May 3 07:29:08 2018 New Revision: 333199 URL: https://svnweb.freebsd.org/changeset/base/333199 Log: MFC r333100: Improve fix in r304629 by allowing configuration of the behaviour through a SYSCTL instead of a compile time define. Add quirk by default for all LynxPoint XHCI controllers. PR: 227602 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/controller/xhci.c stable/11/sys/dev/usb/controller/xhci.h stable/11/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/xhci.c == --- stable/11/sys/dev/usb/controller/xhci.c Thu May 3 07:28:49 2018 (r333198) +++ stable/11/sys/dev/usb/controller/xhci.c Thu May 3 07:29:08 2018 (r333199) @@ -98,6 +98,7 @@ static int xhcidebug; static int xhciroute; static int xhcipolling; static int xhcidma32; +static int xhcictlstep; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RWTUN, , 0, "Debug level"); @@ -107,9 +108,12 @@ SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLA , 0, "Set to enable software interrupt polling for the XHCI controller"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, , 0, "Set to only use 32-bit DMA for the XHCI controller"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, ctlstep, CTLFLAG_RWTUN, +, 0, "Set to enable control endpoint status stage stepping"); #else #definexhciroute 0 #definexhcidma32 0 +#definexhcictlstep 0 #endif #defineXHCI_INTR_ENDPT 1 @@ -2238,11 +2242,17 @@ xhci_setup_generic_chain(struct usb_xfer *xfer) * Send a DATA1 message and invert the current * endpoint direction. */ -#ifdef XHCI_STEP_STATUS_STAGE - temp.step_td = (xfer->nframes != 0); -#else - temp.step_td = 0; -#endif + if (xhcictlstep || temp.sc->sc_ctlstep) { + /* +* Some XHCI controllers will not delay the +* status stage until the next SOF. Force this +* behaviour to avoid failed control +* transfers. +*/ + temp.step_td = (xfer->nframes != 0); + } else { + temp.step_td = 0; + } temp.direction = UE_GET_DIR(xfer->endpointno) ^ UE_DIR_IN; temp.len = 0; temp.pc = NULL; Modified: stable/11/sys/dev/usb/controller/xhci.h == --- stable/11/sys/dev/usb/controller/xhci.h Thu May 3 07:28:49 2018 (r333198) +++ stable/11/sys/dev/usb/controller/xhci.h Thu May 3 07:29:08 2018 (r333199) @@ -507,6 +507,8 @@ struct xhci_softc { uint8_t sc_noport; /* root HUB device configuration */ uint8_t sc_conf; + /* step status stage of all control transfers */ + uint8_t sc_ctlstep; /* root HUB port event bitmap, max 256 ports */ uint8_t sc_hub_idata[32]; Modified: stable/11/sys/dev/usb/controller/xhci_pci.c == --- stable/11/sys/dev/usb/controller/xhci_pci.c Thu May 3 07:28:49 2018 (r333198) +++ stable/11/sys/dev/usb/controller/xhci_pci.c Thu May 3 07:29:08 2018 (r333199) @@ -252,6 +252,7 @@ xhci_pci_attach(device_t self) */ sc->sc_port_route = _pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; + sc->sc_ctlstep = 1; break; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333197 - stable/11/usr.sbin/mountd
Author: avg Date: Thu May 3 07:28:04 2018 New Revision: 333197 URL: https://svnweb.freebsd.org/changeset/base/333197 Log: MFC r332559: mountd: fix a crash when getgrouplist reports too many groups Sponsored by: Panzura Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c == --- stable/11/usr.sbin/mountd/mountd.c Thu May 3 07:22:24 2018 (r333196) +++ stable/11/usr.sbin/mountd/mountd.c Thu May 3 07:28:04 2018 (r333197) @@ -2913,8 +2913,11 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_uid = pw->pw_uid; ngroups = XU_NGROUPS + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) { syslog(LOG_ERR, "too many groups"); + ngroups = XU_NGROUPS + 1; + } + /* * Compress out duplicate. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r333196 - in stable/10: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/...
Author: avg Date: Thu May 3 07:22:24 2018 New Revision: 333196 URL: https://svnweb.freebsd.org/changeset/base/333196 Log: MFC r332426: allow ZFS pool to have temporary name for duration of current import The change adds -t option to zpool create and -t option to zpool import in its form with an old name and a new name. This allows to import (or create) a pool under a name that's different from its real, permanent name without affecting that name. This is useful when working with VM images or images of other physical systems if they happen to have a ZFS pool with the same name as the host system. Sponsored by: Panzura (porting) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 == --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8Thu May 3 06:52:47 2018(r333195) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8Thu May 3 07:22:24 2018(r333196) @@ -57,6 +57,7 @@ .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Nm .Cm destroy @@ -108,6 +109,7 @@ .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -868,6 +870,7 @@ do not actually discard any transactions. .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Xc .Pp @@ -969,6 +972,18 @@ or .Qq Cm none . For more information on dataset mount points, see .Xr zfs 8 . +.It Fl t Ar tempname +Sets the in-core pool name to +.Pa tempname +while the on-disk name will be the name specified as the pool name +.Pa pool . +This will set the default +.Sy cachefile +property to +.Sy none . +This is intended to handle name space collisions when creating pools +for other systems, such as virtual machines or physical machines +whose pools live on network block devices. .El .It Xo .Nm @@ -1223,6 +1238,7 @@ Searches for and imports all pools found. .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -1282,6 +1298,20 @@ Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root +.It Fl t +Used with +.Ar newpool . +Specifies that +.Ar newpool +is temporary. +Temporary pool names last until export. +Ensures that the original pool name will be used in all label updates and +therefore is retained upon export. +Will also set +.Sy cachefile +property to +.Sy none +when not explicitly specified. .It Fl F Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c == --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu May 3 06:52:47 2018(r333195) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu May 3 07:22:24 2018(r333196) @@ -212,8 +212,9 @@ get_usage(zpool_help_t idx) return (gettext("\tclear [-nF] [device]\n")); case HELP_CREATE: return (gettext("\tcreate [-fnd] [-o property=value] ... \n" - "\t[-O file-system-property=value] ... \n" - "\t[-m mountpoint] [-R root] ...\n")); + "\t[-O file-system-property=value] ...\n" + "\t[-m mountpoint] [-R root] [-t tempname] " + " ...\n")); case HELP_DESTROY: return (gettext("\tdestroy [-f] \n")); case HELP_DETACH: @@ -230,7 +231,7 @@ get_usage(zpool_help_t idx) "[-R root] [-F [-n]] -a\n" "\timport [-o mntopts] [-o property=value] ... \n" "\t[-d dir | -c cachefile] [-D] [-f] [-m] [-N] " - "[-R root] [-F [-n]]\n" + "[-R root] [-F [-n]] [-t]\n" "\t [newpool]\n")); case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " @@ -480,6 +481,21 @@ add_prop_list(const char *propname, char *propval, nvl } /* + * Set a default property pair (name, string-value) in a property nvlist + */ +static int +add_prop_list_default(const char *propname, char *propval, nvlist_t **props, +boolean_t
svn commit: r333195 - head/share/syscons/keymaps
Author: rcyu (doc committer) Date: Thu May 3 06:52:47 2018 New Revision: 333195 URL: https://svnweb.freebsd.org/changeset/base/333195 Log: - Add us.iso Macbook/Macbook Pro keyboard support Approved by: delphij Differential Revision:https://reviews.freebsd.org/D14504 Added: head/share/syscons/keymaps/us.iso.macbook.kbd (contents, props changed) Modified: head/share/syscons/keymaps/INDEX.keymaps head/share/syscons/keymaps/Makefile Modified: head/share/syscons/keymaps/INDEX.keymaps == --- head/share/syscons/keymaps/INDEX.keymapsThu May 3 06:34:07 2018 (r333194) +++ head/share/syscons/keymaps/INDEX.keymapsThu May 3 06:52:47 2018 (r333195) @@ -527,6 +527,12 @@ us.iso.acc.kbd:fr:�tats Unis d'Am�rique ISO-8859-1 (av us.iso.acc.kbd:pt:Estados Unidos da Am�rica ISO-8859-1 (com acentos) us.iso.acc.kbd:es:Estadounidense ISO-8859-1 (con acentos) +us.iso.macbook.kbd:en:United States of America Macbook/Macbook Pro ISO-8859-1 +us.iso.macbook.kbd:de:US-amerikanisch Macbook/Macbook Pro ISO-8859-1 +us.iso.macbook.kbd:fr:ノtats Unis d'Am駻ique Macbook/Macbook Pro ISO-8859-1 +us.iso.macbook.kbd:pt:Estados Unidos da Am駻ica Macbook/Macbook Pro ISO-8859-1 +us.iso.macbook.kbd:es:Estadounidense Macbook/Macbook Pro ISO-8859-1 + us.dvorak.kbd:en:United States of America dvorak us.dvorak.kbd:de:US-amerikanisch dvorak us.dvorak.kbd:fr:�tats Unis d'Am�rique dvorak Modified: head/share/syscons/keymaps/Makefile == --- head/share/syscons/keymaps/Makefile Thu May 3 06:34:07 2018 (r333194) +++ head/share/syscons/keymaps/Makefile Thu May 3 06:52:47 2018 (r333195) @@ -48,7 +48,8 @@ FILES=INDEX.keymaps \ uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \ uk.dvorak.kbd \ us.iso.kbd us.dvorak.kbd us.dvorakl.kbd us.dvorakr.kbd us.dvorakp.kbd \ - us.dvorakx.kbd us.emacs.kbd us.pc-ctrl.kbd us.unix.kbd us.iso.acc.kbd + us.dvorakx.kbd us.emacs.kbd us.pc-ctrl.kbd us.unix.kbd us.iso.acc.kbd \ + us.iso.macbook.kbd FILESDIR= ${SHAREDIR}/syscons/keymaps Added: head/share/syscons/keymaps/us.iso.macbook.kbd == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/keymaps/us.iso.macbook.kbd Thu May 3 06:52:47 2018(r333195) @@ -0,0 +1,116 @@ +# $FreeBSD$ +# by Willian Theesfeld Jr+# alt +# scan cntrl altalt cntrl lock +# code base shift cntrl shift altshift cntrl shift state +# -- + 000 nopnopnopnopnopnopnopnop O + 001 escescescescescescdebug esc O + 002 '1''!'nopnop'1''!'nopnop O + 003 '2''@'nulnul'2''@'nulnul O + 004 '3''#'nopnop'3''#'nopnop O + 005 '4''$'nopnop'4''$'nopnop O + 006 '5''%'nopnop'5''%'nopnop O + 007 '6''^'rs rs '6''^'rs rs O + 008 '7''&'nopnop'7''&'nopnop O + 009 '8''*'nopnop'8''*'nopnop O + 010 '9''('nopnop'9''('nopnop O + 011 '0'')'nopnop'0'')'nopnop O + 012 '-''_'us us '-''_'us us O + 013 '=''+'nopnop'=''+'nopnop O + 014 bs bs deldelbs bs deldel O + 015 ht btab nopnopht btab nopnop O + 016 'q''Q'dc1dc1'q''Q'dc1dc1 C + 017 'w''W'etbetb'w''W'etbetb C + 018 'e''E'enqenq'e''E'enqenq C + 019 'r''R'dc2dc2'r''R'dc2dc2 C + 020 't''T'dc4dc4't''T'dc4dc4 C + 021 'y''Y'em em 'y''Y'em em C + 022 'u''U'naknak'u''U'naknak C + 023 'i''I'ht ht 'i''I'ht ht C + 024 'o''O'si si 'o''O'si si C + 025 'p''P'dledle'p''P'dledle C + 026 '[''{'escesc'[''{'escesc O + 027 ']''}'gs gs ']''}'gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a''A'sohsoh'a''A'sohsoh C
svn commit: r333194 - in stable/11: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/...
Author: avg Date: Thu May 3 06:34:07 2018 New Revision: 333194 URL: https://svnweb.freebsd.org/changeset/base/333194 Log: MFC r332426: allow ZFS pool to have temporary name for duration of current import The change adds -t option to zpool create and -t option to zpool import in its form with an old name and a new name. This allows to import (or create) a pool under a name that's different from its real, permanent name without affecting that name. This is useful when working with VM images or images of other physical systems if they happen to have a ZFS pool with the same name as the host system. Sponsored by: Panzura (porting) Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/11/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 == --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Thu May 3 02:56:13 2018(r333193) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Thu May 3 06:34:07 2018(r333194) @@ -62,6 +62,7 @@ .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Nm .Cm destroy @@ -115,6 +116,7 @@ .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -966,6 +968,7 @@ do not actually discard any transactions. .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Xc .Pp @@ -1067,6 +1070,18 @@ or .Qq Cm none . For more information on dataset mount points, see .Xr zfs 8 . +.It Fl t Ar tempname +Sets the in-core pool name to +.Pa tempname +while the on-disk name will be the name specified as the pool name +.Pa pool . +This will set the default +.Sy cachefile +property to +.Sy none . +This is intended to handle name space collisions when creating pools +for other systems, such as virtual machines or physical machines +whose pools live on network block devices. .El .It Xo .Nm @@ -1321,6 +1336,7 @@ Searches for and imports all pools found. .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -1380,6 +1396,20 @@ Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root +.It Fl t +Used with +.Ar newpool . +Specifies that +.Ar newpool +is temporary. +Temporary pool names last until export. +Ensures that the original pool name will be used in all label updates and +therefore is retained upon export. +Will also set +.Sy cachefile +property to +.Sy none +when not explicitly specified. .It Fl F Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c == --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu May 3 02:56:13 2018(r333193) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu May 3 06:34:07 2018(r333194) @@ -220,8 +220,9 @@ get_usage(zpool_help_t idx) case HELP_CREATE: return (gettext("\tcreate [-fnd] [-B] " "[-o property=value] ... \n" - "\t[-O file-system-property=value] ... \n" - "\t[-m mountpoint] [-R root] ...\n")); + "\t[-O file-system-property=value] ...\n" + "\t[-m mountpoint] [-R root] [-t tempname] " + " ...\n")); case HELP_CHECKPOINT: return (gettext("\tcheckpoint [--discard] ...\n")); case HELP_DESTROY: @@ -239,7 +240,7 @@ get_usage(zpool_help_t idx) "[-R root] [-F [-n]] -a\n" "\timport [-o mntopts] [-o property=value] ... \n" "\t[-d dir | -c cachefile] [-D] [-f] [-m] [-N] " - "[-R root] [-F [-n]]\n" + "[-R root] [-F [-n]] [-t]\n" "\t[--rewind-to-checkpoint] [newpool]\n")); case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " @@ -489,6 +490,21 @@ add_prop_list(const char *propname, char *propval, nvl } /* + * Set a default property pair (name, string-value) in a property nvlist + */ +static int +add_prop_list_default(const char *propname, char *propval, nvlist_t **props, +