From owner-svn-src-user@freebsd.org Mon Jan 29 18:49:33 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA439ED792F for ; Mon, 29 Jan 2018 18:49:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D67F8077E; Mon, 29 Jan 2018 18:49:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E82E4318; Mon, 29 Jan 2018 18:49:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0TInW66012824; Mon, 29 Jan 2018 18:49:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0TInTmH012797; Mon, 29 Jan 2018 18:49:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801291849.w0TInTmH012797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Jan 2018 18:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328558 - in user/markj/netdump: . bin/date bin/dd bin/pax bin/ps cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/lib... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . bin/date bin/dd bin/pax bin/ps cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/lib/libdtrace contrib/compil... X-SVN-Commit-Revision: 328558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 18:49:33 -0000 Author: markj Date: Mon Jan 29 18:49:28 2018 New Revision: 328558 URL: https://svnweb.freebsd.org/changeset/base/328558 Log: MFH at r328557. Added: user/markj/netdump/contrib/libarchive/cat/test/test_stdin.c - copied unchanged from r328557, head/contrib/libarchive/cat/test/test_stdin.c user/markj/netdump/contrib/libarchive/libarchive/test/test_compat_zip_8.zip.uu - copied unchanged from r328557, head/contrib/libarchive/libarchive/test/test_compat_zip_8.zip.uu user/markj/netdump/contrib/lua/src/luaconf.h.dist - copied unchanged from r328557, head/contrib/lua/src/luaconf.h.dist user/markj/netdump/contrib/tzdata/pacificnew - copied unchanged from r328557, head/contrib/tzdata/pacificnew user/markj/netdump/lib/libc/tests/regex/Makefile.inc - copied unchanged from r328557, head/lib/libc/tests/regex/Makefile.inc user/markj/netdump/lib/libcasper/services/cap_grp/cap_grp.3 - copied unchanged from r328557, head/lib/libcasper/services/cap_grp/cap_grp.3 user/markj/netdump/lib/libcasper/services/cap_random/cap_random.3 - copied unchanged from r328557, head/lib/libcasper/services/cap_random/cap_random.3 user/markj/netdump/lib/libcasper/services/cap_syslog/cap_syslog.3 - copied unchanged from r328557, head/lib/libcasper/services/cap_syslog/cap_syslog.3 user/markj/netdump/lib/libregex/ - copied from r328557, head/lib/libregex/ user/markj/netdump/share/man/man4/bcm283x_pwm.4 - copied unchanged from r328557, head/share/man/man4/bcm283x_pwm.4 user/markj/netdump/stand/libsa/abort.c - copied unchanged from r328557, head/stand/libsa/abort.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_clkman.c - copied unchanged from r328557, head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_clkman.h - copied unchanged from r328557, head/sys/arm/broadcom/bcm2835/bcm2835_clkman.h user/markj/netdump/sys/dev/usb/controller/ehci_msm.c - copied unchanged from r328557, head/sys/dev/usb/controller/ehci_msm.c user/markj/netdump/sys/modules/bcm283x_clkman/ - copied from r328557, head/sys/modules/bcm283x_clkman/ Deleted: user/markj/netdump/contrib/lua/src/luaconf.h user/markj/netdump/sys/arm/conf/EA3250 user/markj/netdump/sys/arm/lpc/files.lpc user/markj/netdump/sys/arm/lpc/if_lpe.c user/markj/netdump/sys/arm/lpc/if_lpereg.h user/markj/netdump/sys/arm/lpc/lpc_dmac.c user/markj/netdump/sys/arm/lpc/lpc_fb.c user/markj/netdump/sys/arm/lpc/lpc_gpio.c user/markj/netdump/sys/arm/lpc/lpc_intc.c user/markj/netdump/sys/arm/lpc/lpc_machdep.c user/markj/netdump/sys/arm/lpc/lpc_mmc.c user/markj/netdump/sys/arm/lpc/lpc_ohci.c user/markj/netdump/sys/arm/lpc/lpc_pll.c user/markj/netdump/sys/arm/lpc/lpc_pwr.c user/markj/netdump/sys/arm/lpc/lpc_rtc.c user/markj/netdump/sys/arm/lpc/lpc_spi.c user/markj/netdump/sys/arm/lpc/lpc_timer.c user/markj/netdump/sys/arm/lpc/lpcreg.h user/markj/netdump/sys/arm/lpc/lpcvar.h user/markj/netdump/sys/arm/lpc/ssd1289.c user/markj/netdump/sys/arm/lpc/std.lpc user/markj/netdump/sys/dev/uart/uart_dev_lpc.c Modified: user/markj/netdump/Makefile.inc1 user/markj/netdump/Makefile.libcompat user/markj/netdump/bin/date/date.c user/markj/netdump/bin/dd/dd.c user/markj/netdump/bin/pax/pax.c user/markj/netdump/bin/ps/keyword.c user/markj/netdump/bin/ps/ps.1 user/markj/netdump/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c user/markj/netdump/cddl/lib/libdtrace/tcp.d user/markj/netdump/contrib/compiler-rt/lib/builtins/clear_cache.c user/markj/netdump/contrib/libarchive/cat/bsdcat.c user/markj/netdump/contrib/libarchive/libarchive/archive_acl.c user/markj/netdump/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c user/markj/netdump/contrib/libarchive/libarchive/archive_match.c user/markj/netdump/contrib/libarchive/libarchive/archive_platform.h user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7.c user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7_private.h user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd_private.h user/markj/netdump/contrib/libarchive/libarchive/archive_read.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_disk_posix.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_7zip.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_mtree.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_rar.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_tar.c user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_zip.c user/markj/netdump/contrib/libarchive/libarchive/archive_util.c user/markj/netdump/contrib/libarchive/libarchive/archive_virtual.c user/markj/netdump/contrib/libarchive/libarchive/archive_write.c user/markj/netdump/contrib/libarchive/libarchive/archive_write_disk_posix.c user/markj/netdump/contrib/libarchive/libarchive/archive_write_set_format_7zip.c user/markj/netdump/contrib/libarchive/libarchive/test/read_open_memory.c user/markj/netdump/contrib/libarchive/libarchive/test/test.h user/markj/netdump/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c user/markj/netdump/contrib/libarchive/libarchive/test/test_compat_zip.c user/markj/netdump/contrib/libarchive/libarchive/test/test_read_format_zip.c user/markj/netdump/contrib/libarchive/libarchive/test/test_write_disk_perms.c user/markj/netdump/contrib/libarchive/tar/test/test_option_acls.c user/markj/netdump/contrib/llvm/include/llvm/Analysis/RegionInfoImpl.h user/markj/netdump/contrib/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCCodeView.h user/markj/netdump/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalMerge.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp user/markj/netdump/contrib/llvm/lib/Linker/IRMover.cpp user/markj/netdump/contrib/llvm/lib/MC/MCCodeView.cpp user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp user/markj/netdump/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp user/markj/netdump/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp user/markj/netdump/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h user/markj/netdump/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/Attr.td user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def user/markj/netdump/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h user/markj/netdump/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/AST/ODRHash.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Lex/PPCaching.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Sema/Scope.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp user/markj/netdump/contrib/llvm/tools/lld/COFF/Driver.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/LinkerScript.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/LinkerScript.h user/markj/netdump/contrib/llvm/tools/lld/ELF/OutputSections.h user/markj/netdump/contrib/llvm/tools/lld/ELF/ScriptParser.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/SymbolTable.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.h user/markj/netdump/contrib/llvm/tools/llvm-readobj/MachODumper.cpp user/markj/netdump/contrib/lua/src/lstrlib.c user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_mlock.c user/markj/netdump/contrib/tnftp/src/cmds.c user/markj/netdump/contrib/traceroute/traceroute.c user/markj/netdump/contrib/tzdata/Makefile user/markj/netdump/contrib/tzdata/NEWS user/markj/netdump/contrib/tzdata/README user/markj/netdump/contrib/tzdata/asia user/markj/netdump/contrib/tzdata/europe user/markj/netdump/contrib/tzdata/leap-seconds.list user/markj/netdump/contrib/tzdata/leapseconds user/markj/netdump/contrib/tzdata/theory.html user/markj/netdump/contrib/tzdata/version user/markj/netdump/contrib/tzdata/zishrink.awk user/markj/netdump/crypto/openssl/ssl/srtp.h user/markj/netdump/etc/Makefile user/markj/netdump/etc/mtree/BSD.root.dist user/markj/netdump/etc/mtree/BSD.tests.dist user/markj/netdump/etc/rc.subr user/markj/netdump/include/err.h user/markj/netdump/include/stdlib.h user/markj/netdump/lib/Makefile user/markj/netdump/lib/clang/include/clang/Basic/Version.inc user/markj/netdump/lib/clang/include/lld/Common/Version.inc user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h user/markj/netdump/lib/libarchive/tests/Makefile user/markj/netdump/lib/libc/gen/getgrent.c user/markj/netdump/lib/libc/mips/gen/makecontext.c user/markj/netdump/lib/libc/regex/Makefile.inc user/markj/netdump/lib/libc/regex/regcomp.c user/markj/netdump/lib/libc/sys/mlock.2 user/markj/netdump/lib/libc/sys/setgroups.2 user/markj/netdump/lib/libc/sys/shmat.2 user/markj/netdump/lib/libc/tests/regex/Makefile user/markj/netdump/lib/libcasper/libcasper/libcasper.c user/markj/netdump/lib/libcasper/libcasper/libcasper.h user/markj/netdump/lib/libcasper/libcasper/libcasper_impl.c user/markj/netdump/lib/libcasper/libcasper/libcasper_impl.h user/markj/netdump/lib/libcasper/libcasper/libcasper_service.c user/markj/netdump/lib/libcasper/libcasper/libcasper_service.h user/markj/netdump/lib/libcasper/libcasper/service.c user/markj/netdump/lib/libcasper/libcasper/zygote.c user/markj/netdump/lib/libcasper/libcasper/zygote.h user/markj/netdump/lib/libcasper/services/cap_dns/cap_dns.c user/markj/netdump/lib/libcasper/services/cap_dns/tests/dns_test.c user/markj/netdump/lib/libcasper/services/cap_grp/Makefile user/markj/netdump/lib/libcasper/services/cap_grp/cap_grp.c user/markj/netdump/lib/libcasper/services/cap_grp/tests/grp_test.c user/markj/netdump/lib/libcasper/services/cap_pwd/cap_pwd.c user/markj/netdump/lib/libcasper/services/cap_pwd/tests/pwd_test.c user/markj/netdump/lib/libcasper/services/cap_random/Makefile user/markj/netdump/lib/libcasper/services/cap_random/cap_random.c user/markj/netdump/lib/libcasper/services/cap_sysctl/cap_sysctl.c user/markj/netdump/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c user/markj/netdump/lib/libcasper/services/cap_syslog/Makefile user/markj/netdump/lib/libcasper/services/cap_syslog/cap_syslog.c user/markj/netdump/lib/libcxxrt/Version.map user/markj/netdump/lib/libthr/thread/thr_printf.c user/markj/netdump/lib/libufs/Makefile user/markj/netdump/lib/libufs/libufs.h user/markj/netdump/lib/libufs/sblock.c user/markj/netdump/lib/libufs/sbread.3 user/markj/netdump/release/release.sh user/markj/netdump/sbin/clri/Makefile user/markj/netdump/sbin/clri/clri.c user/markj/netdump/sbin/decryptcore/decryptcore.8 user/markj/netdump/sbin/devd/devd.cc user/markj/netdump/sbin/dump/Makefile user/markj/netdump/sbin/dump/dump.h user/markj/netdump/sbin/dump/main.c user/markj/netdump/sbin/fsck_ffs/fsck.h user/markj/netdump/sbin/fsck_ffs/fsutil.c user/markj/netdump/sbin/fsck_ffs/gjournal.c user/markj/netdump/sbin/fsck_ffs/globs.c user/markj/netdump/sbin/fsck_ffs/setup.c user/markj/netdump/sbin/fsck_ffs/suj.c user/markj/netdump/sbin/fsirand/Makefile user/markj/netdump/sbin/fsirand/fsirand.c user/markj/netdump/sbin/growfs/growfs.c user/markj/netdump/sbin/newfs/mkfs.c user/markj/netdump/sbin/pfctl/pfctl_optimize.c user/markj/netdump/sbin/quotacheck/Makefile user/markj/netdump/sbin/quotacheck/quotacheck.c user/markj/netdump/share/examples/kld/cdev/module/cdev.c user/markj/netdump/share/examples/kld/cdev/module/cdevmod.c user/markj/netdump/share/man/man4/Makefile user/markj/netdump/share/man/man4/nmdm.4 user/markj/netdump/share/man/man7/hier.7 user/markj/netdump/share/man/man8/Makefile user/markj/netdump/share/man/man8/uefi.8 user/markj/netdump/share/man/man9/malloc.9 user/markj/netdump/share/man/man9/style.9 user/markj/netdump/share/mk/bsd.libnames.mk user/markj/netdump/share/mk/src.libnames.mk user/markj/netdump/share/vt/keymaps/us.kbd user/markj/netdump/stand/common/boot.c user/markj/netdump/stand/common/bootstrap.h user/markj/netdump/stand/common/commands.c user/markj/netdump/stand/common/interp.c user/markj/netdump/stand/common/load_elf.c user/markj/netdump/stand/common/misc.c user/markj/netdump/stand/efi/fdt/efi_fdt.c user/markj/netdump/stand/efi/include/efiapi.h user/markj/netdump/stand/efi/loader/main.c user/markj/netdump/stand/fdt/fdt_loader_cmd.c user/markj/netdump/stand/fdt/fdt_platform.h user/markj/netdump/stand/i386/gptboot/gptboot.c user/markj/netdump/stand/libsa/Makefile user/markj/netdump/stand/libsa/environment.c user/markj/netdump/stand/libsa/panic.c user/markj/netdump/stand/libsa/stand.h user/markj/netdump/stand/libsa/ufs.c user/markj/netdump/stand/mips/beri/boot2/boot2.c user/markj/netdump/stand/mips/beri/loader/main.c user/markj/netdump/stand/mips/uboot/conf.c user/markj/netdump/stand/powerpc/kboot/conf.c user/markj/netdump/stand/powerpc/kboot/host_syscall.S user/markj/netdump/stand/powerpc/kboot/host_syscall.h user/markj/netdump/stand/powerpc/kboot/hostdisk.c user/markj/netdump/stand/powerpc/kboot/kerneltramp.S user/markj/netdump/stand/powerpc/kboot/main.c user/markj/netdump/stand/powerpc/kboot/metadata.c user/markj/netdump/stand/powerpc/kboot/ppc64_elf_freebsd.c user/markj/netdump/stand/uboot/common/main.c user/markj/netdump/stand/uboot/fdt/uboot_fdt.c user/markj/netdump/stand/uboot/lib/glue.c user/markj/netdump/stand/uboot/lib/glue.h user/markj/netdump/sys/amd64/amd64/apic_vector.S user/markj/netdump/sys/amd64/amd64/fpu.c user/markj/netdump/sys/amd64/amd64/mp_machdep.c user/markj/netdump/sys/amd64/amd64/pmap.c user/markj/netdump/sys/amd64/amd64/support.S user/markj/netdump/sys/amd64/include/pmap.h user/markj/netdump/sys/amd64/include/smp.h user/markj/netdump/sys/amd64/linux/linux_ptrace.c user/markj/netdump/sys/amd64/linux/linux_support.s user/markj/netdump/sys/amd64/linux32/linux32_support.s user/markj/netdump/sys/arm/arm/cpuinfo.c user/markj/netdump/sys/arm/arm/genassym.c user/markj/netdump/sys/arm/arm/machdep.c user/markj/netdump/sys/arm/arm/mp_machdep.c user/markj/netdump/sys/arm/arm/swtch-v6.S user/markj/netdump/sys/arm/arm/trap-v6.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/markj/netdump/sys/arm/freescale/imx/imx_machdep.c user/markj/netdump/sys/arm/freescale/imx/imx_machdep.h user/markj/netdump/sys/arm/freescale/imx/imx_wdog.c user/markj/netdump/sys/arm/freescale/imx/imx_wdogreg.h user/markj/netdump/sys/arm/include/cpuinfo.h user/markj/netdump/sys/arm/include/pcpu.h user/markj/netdump/sys/arm/mv/armada38x/files.armada38x user/markj/netdump/sys/arm/xilinx/files.zynq7 user/markj/netdump/sys/arm64/arm64/cpufunc_asm.S user/markj/netdump/sys/arm64/arm64/pmap.c user/markj/netdump/sys/cam/cam_periph.h user/markj/netdump/sys/cam/cam_xpt.c user/markj/netdump/sys/cam/ctl/ctl_frontend_cam_sim.c user/markj/netdump/sys/cam/ctl/scsi_ctl.c user/markj/netdump/sys/cam/nvme/nvme_da.c user/markj/netdump/sys/cam/scsi/scsi_ch.c user/markj/netdump/sys/cam/scsi/scsi_da.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h user/markj/netdump/sys/compat/linuxkpi/common/src/linux_compat.c user/markj/netdump/sys/compat/linuxkpi/common/src/linux_idr.c user/markj/netdump/sys/compat/linuxkpi/common/src/linux_page.c user/markj/netdump/sys/conf/files user/markj/netdump/sys/conf/files.amd64 user/markj/netdump/sys/conf/files.i386 user/markj/netdump/sys/conf/kern.post.mk user/markj/netdump/sys/conf/options user/markj/netdump/sys/contrib/ipfilter/netinet/ip_compat.h user/markj/netdump/sys/contrib/libfdt/fdt.c user/markj/netdump/sys/contrib/libfdt/fdt_overlay.c user/markj/netdump/sys/contrib/libfdt/fdt_ro.c user/markj/netdump/sys/contrib/libfdt/libfdt.h user/markj/netdump/sys/contrib/libnv/cnvlist.c user/markj/netdump/sys/contrib/libnv/dnvlist.c user/markj/netdump/sys/contrib/libnv/nv_impl.h user/markj/netdump/sys/contrib/libnv/nvlist.c user/markj/netdump/sys/contrib/libnv/nvlist_impl.h user/markj/netdump/sys/contrib/libnv/nvpair.c user/markj/netdump/sys/contrib/libnv/nvpair_impl.h user/markj/netdump/sys/crypto/ccp/ccp.c user/markj/netdump/sys/dev/advansys/advansys.c user/markj/netdump/sys/dev/advansys/adwcam.c user/markj/netdump/sys/dev/aha/aha.c user/markj/netdump/sys/dev/aic/aic.c user/markj/netdump/sys/dev/ata/ata-isa.c user/markj/netdump/sys/dev/atkbdc/psm.c user/markj/netdump/sys/dev/buslogic/bt.c user/markj/netdump/sys/dev/cxgb/cxgb_main.c user/markj/netdump/sys/dev/cxgbe/common/t4_hw.c user/markj/netdump/sys/dev/cxgbe/crypto/t4_crypto.c user/markj/netdump/sys/dev/cxgbe/t4_main.c user/markj/netdump/sys/dev/dpt/dpt_pci.c user/markj/netdump/sys/dev/drm2/drm_mem_util.h user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch.c user/markj/netdump/sys/dev/etherswitch/e6000sw/e6060sw.c user/markj/netdump/sys/dev/etherswitch/infineon/adm6996fc.c user/markj/netdump/sys/dev/etherswitch/ip17x/ip17x.c user/markj/netdump/sys/dev/etherswitch/micrel/ksz8995ma.c user/markj/netdump/sys/dev/etherswitch/mtkswitch/mtkswitch.c user/markj/netdump/sys/dev/etherswitch/rtl8366/rtl8366rb.c user/markj/netdump/sys/dev/etherswitch/ukswitch/ukswitch.c user/markj/netdump/sys/dev/extres/clk/clk.c user/markj/netdump/sys/dev/iicbus/ds1307.c user/markj/netdump/sys/dev/iicbus/ds13rtc.c user/markj/netdump/sys/dev/iicbus/iiconf.c user/markj/netdump/sys/dev/iicbus/iiconf.h user/markj/netdump/sys/dev/iicbus/isl12xx.c user/markj/netdump/sys/dev/iicbus/nxprtc.c user/markj/netdump/sys/dev/iscsi/icl_conn_if.m user/markj/netdump/sys/dev/iscsi/icl_soft.c user/markj/netdump/sys/dev/iscsi/icl_wrappers.h user/markj/netdump/sys/dev/ixgbe/if_ixv.c user/markj/netdump/sys/dev/joy/joy.c user/markj/netdump/sys/dev/mps/mps.c user/markj/netdump/sys/dev/mse/mse.c user/markj/netdump/sys/dev/ncv/ncr53c500_pccard.c user/markj/netdump/sys/dev/nsp/nsp_pccard.c user/markj/netdump/sys/dev/ntb/ntb_transport.c user/markj/netdump/sys/dev/nvme/nvme.c user/markj/netdump/sys/dev/nvme/nvme_ctrlr.c user/markj/netdump/sys/dev/nvme/nvme_private.h user/markj/netdump/sys/dev/ofw/ofw_bus_subr.c user/markj/netdump/sys/dev/sbni/if_sbni_isa.c user/markj/netdump/sys/dev/sdhci/sdhci_fdt.c user/markj/netdump/sys/dev/sound/isa/ess.c user/markj/netdump/sys/dev/sound/isa/gusc.c user/markj/netdump/sys/dev/sound/isa/mss.c user/markj/netdump/sys/dev/sound/isa/sbc.c user/markj/netdump/sys/dev/stg/tmc18c30.c user/markj/netdump/sys/dev/usb/quirk/usb_quirk.c user/markj/netdump/sys/dev/usb/storage/cfumass.c user/markj/netdump/sys/dev/usb/usbdevs user/markj/netdump/sys/dts/arm/bcm2836.dtsi user/markj/netdump/sys/fs/autofs/autofs.h user/markj/netdump/sys/fs/autofs/autofs_ioctl.h user/markj/netdump/sys/fs/autofs/autofs_vfsops.c user/markj/netdump/sys/fs/autofs/autofs_vnops.c user/markj/netdump/sys/fs/cd9660/cd9660_vnops.c user/markj/netdump/sys/fs/ext2fs/ext2_csum.c user/markj/netdump/sys/fs/ext2fs/ext2_extents.c user/markj/netdump/sys/fs/ext2fs/ext2_lookup.c user/markj/netdump/sys/fs/ext2fs/ext2_vfsops.c user/markj/netdump/sys/fs/nandfs/nandfs_vfsops.c user/markj/netdump/sys/fs/nfs/nfs_commonkrpc.c user/markj/netdump/sys/fs/nfs/nfs_commonsubs.c user/markj/netdump/sys/fs/nfs/nfsport.h user/markj/netdump/sys/fs/nfsclient/nfs_clcomsubs.c user/markj/netdump/sys/fs/nfsclient/nfs_clnode.c user/markj/netdump/sys/fs/nfsclient/nfs_clport.c user/markj/netdump/sys/fs/nfsclient/nfs_clrpcops.c user/markj/netdump/sys/fs/nfsclient/nfs_clstate.c user/markj/netdump/sys/fs/nfsclient/nfs_clsubs.c user/markj/netdump/sys/fs/nfsclient/nfs_clvfsops.c user/markj/netdump/sys/fs/nfsclient/nfs_clvnops.c user/markj/netdump/sys/fs/nfsclient/nfsnode.h user/markj/netdump/sys/fs/nfsserver/nfs_nfsdcache.c user/markj/netdump/sys/fs/nfsserver/nfs_nfsdport.c user/markj/netdump/sys/fs/nfsserver/nfs_nfsdserv.c user/markj/netdump/sys/fs/nfsserver/nfs_nfsdstate.c user/markj/netdump/sys/geom/geom.h user/markj/netdump/sys/geom/geom_io.c user/markj/netdump/sys/geom/journal/g_journal_ufs.c user/markj/netdump/sys/geom/label/g_label.c user/markj/netdump/sys/geom/label/g_label_ufs.c user/markj/netdump/sys/i386/i386/npx.c user/markj/netdump/sys/i386/i386/pmap.c user/markj/netdump/sys/i386/i386/vm_machdep.c user/markj/netdump/sys/i386/linux/linux_support.s user/markj/netdump/sys/isa/vga_isa.c user/markj/netdump/sys/kern/kern_exec.c user/markj/netdump/sys/kern/kern_malloc.c user/markj/netdump/sys/kern/link_elf_obj.c user/markj/netdump/sys/kern/subr_bus.c user/markj/netdump/sys/kern/subr_hash.c user/markj/netdump/sys/kern/uipc_usrreq.c user/markj/netdump/sys/kern/vfs_default.c user/markj/netdump/sys/modules/Makefile user/markj/netdump/sys/modules/cam/Makefile user/markj/netdump/sys/modules/geom/geom_label/Makefile user/markj/netdump/sys/modules/linux64/Makefile user/markj/netdump/sys/modules/uart/Makefile user/markj/netdump/sys/net/bpf.c user/markj/netdump/sys/net/ieee8023ad_lacp.c user/markj/netdump/sys/net/route.c user/markj/netdump/sys/net/route.h user/markj/netdump/sys/net/rtsock.c user/markj/netdump/sys/netinet/in_kdtrace.c user/markj/netdump/sys/netinet/in_pcb.c user/markj/netdump/sys/netinet/ip_mroute.c user/markj/netdump/sys/netinet/ip_output.c user/markj/netdump/sys/netinet/ip_reass.c user/markj/netdump/sys/netinet/sctp_constants.h user/markj/netdump/sys/netinet6/frag6.c user/markj/netdump/sys/netinet6/in6.c user/markj/netdump/sys/netinet6/in6_ifattach.c user/markj/netdump/sys/netinet6/ip6_input.c user/markj/netdump/sys/netinet6/nd6.c user/markj/netdump/sys/netinet6/scope6.c user/markj/netdump/sys/netipsec/xform_ah.c user/markj/netdump/sys/netpfil/ipfw/ip_fw2.c user/markj/netdump/sys/netpfil/ipfw/ip_fw_sockopt.c user/markj/netdump/sys/netpfil/ipfw/ip_fw_table_algo.c user/markj/netdump/sys/netpfil/pf/pf.c user/markj/netdump/sys/netsmb/smb_crypt.c user/markj/netdump/sys/nfsclient/nfsnode.h user/markj/netdump/sys/opencrypto/cryptodev.c user/markj/netdump/sys/powerpc/aim/mmu_oea.c user/markj/netdump/sys/powerpc/aim/mmu_oea64.c user/markj/netdump/sys/powerpc/aim/mp_cpudep.c user/markj/netdump/sys/powerpc/booke/pmap.c user/markj/netdump/sys/powerpc/conf/QORIQ64 user/markj/netdump/sys/powerpc/include/pmap.h user/markj/netdump/sys/powerpc/include/spr.h user/markj/netdump/sys/powerpc/include/vmparam.h user/markj/netdump/sys/powerpc/mpc85xx/atpic.c user/markj/netdump/sys/powerpc/powernv/opal_pci.c user/markj/netdump/sys/powerpc/powernv/platform_powernv.c user/markj/netdump/sys/powerpc/powerpc/exec_machdep.c user/markj/netdump/sys/powerpc/powerpc/intr_machdep.c user/markj/netdump/sys/powerpc/powerpc/mmu_if.m user/markj/netdump/sys/powerpc/powerpc/mp_machdep.c user/markj/netdump/sys/powerpc/powerpc/pmap_dispatch.c user/markj/netdump/sys/powerpc/powerpc/trap.c user/markj/netdump/sys/powerpc/pseries/platform_chrp.c user/markj/netdump/sys/powerpc/pseries/xics.c user/markj/netdump/sys/sparc64/sparc64/rtc.c user/markj/netdump/sys/sys/copyright.h user/markj/netdump/sys/sys/malloc.h user/markj/netdump/sys/sys/systm.h user/markj/netdump/sys/tools/usbdevs2h.awk user/markj/netdump/sys/ufs/ffs/ffs_extern.h user/markj/netdump/sys/ufs/ffs/ffs_snapshot.c user/markj/netdump/sys/ufs/ffs/ffs_softdep.c user/markj/netdump/sys/ufs/ffs/ffs_subr.c user/markj/netdump/sys/ufs/ffs/ffs_vfsops.c user/markj/netdump/sys/ufs/ffs/fs.h user/markj/netdump/sys/ufs/ufs/ufs_dirhash.c user/markj/netdump/sys/ufs/ufs/ufs_vnops.c user/markj/netdump/sys/x86/include/x86_smp.h user/markj/netdump/sys/x86/isa/atpic.c user/markj/netdump/sys/x86/isa/atrtc.c user/markj/netdump/sys/x86/isa/clock.c user/markj/netdump/sys/x86/isa/isa_dma.c user/markj/netdump/sys/x86/isa/orm.c user/markj/netdump/sys/x86/pci/pci_bus.c user/markj/netdump/sys/x86/x86/local_apic.c user/markj/netdump/sys/x86/x86/mca.c user/markj/netdump/sys/x86/x86/mp_x86.c user/markj/netdump/sys/x86/x86/nexus.c user/markj/netdump/tests/sys/kern/ptrace_test.c user/markj/netdump/tools/tools/README user/markj/netdump/usr.bin/awk/Makefile user/markj/netdump/usr.bin/bsdcat/tests/Makefile user/markj/netdump/usr.bin/fortune/fortune/fortune.c user/markj/netdump/usr.bin/m4/extern.h user/markj/netdump/usr.bin/procstat/procstat.1 user/markj/netdump/usr.bin/sockstat/sockstat.1 user/markj/netdump/usr.bin/sockstat/sockstat.c user/markj/netdump/usr.bin/time/time.c user/markj/netdump/usr.sbin/autofs/automount.c user/markj/netdump/usr.sbin/autofs/automountd.c user/markj/netdump/usr.sbin/autofs/autounmountd.c user/markj/netdump/usr.sbin/autofs/common.c user/markj/netdump/usr.sbin/autofs/common.h user/markj/netdump/usr.sbin/autofs/defined.c user/markj/netdump/usr.sbin/autofs/log.c user/markj/netdump/usr.sbin/autofs/popen.c user/markj/netdump/usr.sbin/autofs/token.l user/markj/netdump/usr.sbin/bsdinstall/partedit/gpart_ops.c user/markj/netdump/usr.sbin/ctld/chap.c user/markj/netdump/usr.sbin/ctld/isns.c user/markj/netdump/usr.sbin/ctld/uclparse.c user/markj/netdump/usr.sbin/daemon/daemon.8 user/markj/netdump/usr.sbin/fstyp/Makefile user/markj/netdump/usr.sbin/fstyp/ufs.c user/markj/netdump/usr.sbin/iscsid/chap.c user/markj/netdump/usr.sbin/pppctl/pppctl.c user/markj/netdump/usr.sbin/quot/Makefile user/markj/netdump/usr.sbin/quot/quot.c user/markj/netdump/usr.sbin/service/service.sh user/markj/netdump/usr.sbin/traceroute6/traceroute6.8 user/markj/netdump/usr.sbin/traceroute6/traceroute6.c user/markj/netdump/usr.sbin/uefisign/child.c user/markj/netdump/usr.sbin/uefisign/magic.h user/markj/netdump/usr.sbin/uefisign/pe.c user/markj/netdump/usr.sbin/uefisign/uefisign.c user/markj/netdump/usr.sbin/uefisign/uefisign.h Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/cddl/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/cmd/zfs/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/markj/netdump/contrib/compiler-rt/ (props changed) user/markj/netdump/contrib/libarchive/ (props changed) user/markj/netdump/contrib/libc++/ (props changed) user/markj/netdump/contrib/llvm/ (props changed) user/markj/netdump/contrib/llvm/tools/clang/ (props changed) user/markj/netdump/contrib/llvm/tools/lld/ (props changed) user/markj/netdump/contrib/llvm/tools/lldb/ (props changed) user/markj/netdump/contrib/netbsd-tests/ (props changed) user/markj/netdump/contrib/tnftp/ (props changed) user/markj/netdump/contrib/tzdata/ (props changed) user/markj/netdump/crypto/openssl/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) user/markj/netdump/sys/contrib/ipfilter/ (props changed) user/markj/netdump/sys/contrib/libfdt/ (props changed) Modified: user/markj/netdump/Makefile.inc1 ============================================================================== --- user/markj/netdump/Makefile.inc1 Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/Makefile.inc1 Mon Jan 29 18:49:28 2018 (r328558) @@ -144,7 +144,10 @@ TEST_SYSTEM_COMPILER_VARS= \ WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ COMPILER_FREEBSD_VERSION \ - LINKER_TYPE LINKER_FEATURES LINKER_VERSION + X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ + X_COMPILER_FREEBSD_VERSION \ + LINKER_TYPE LINKER_FEATURES LINKER_VERSION \ + X_LINKER_TYPE X_LINKER_FEATURES X_LINKER_VERSION test-system-compiler: .PHONY .for v in ${TEST_SYSTEM_COMPILER_VARS} ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" @@ -637,7 +640,8 @@ XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTM # combined with --sysroot. XCFLAGS+= -B${WORLDTMP}/usr/lib # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif @@ -1443,20 +1447,26 @@ reinstallkernel reinstallkernel.debug: _installcheck_k false .endif @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel ${INSTALLKERNEL}" + @echo ">>> Installing kernel ${INSTALLKERNEL} on $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)" + @echo "--------------------------------------------------------------" .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel ${_kernel}" + @echo ">>> Installing kernel ${_kernel} $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)" + @echo "--------------------------------------------------------------" .endfor .endif @@ -2880,7 +2890,8 @@ CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDE # combined with --sysroot. CD2CFLAGS+= -B${XDDESTDIR}/usr/lib # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif Modified: user/markj/netdump/Makefile.libcompat ============================================================================== --- user/markj/netdump/Makefile.libcompat Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/Makefile.libcompat Mon Jan 29 18:49:28 2018 (r328558) @@ -108,7 +108,8 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat # sysroot path which --sysroot does not actually do for headers. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \ +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \ (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ Modified: user/markj/netdump/bin/date/date.c ============================================================================== --- user/markj/netdump/bin/date/date.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/bin/date/date.c Mon Jan 29 18:49:28 2018 (r328558) @@ -301,6 +301,7 @@ setthetime(const char *fmt, const char *p, int jflag, /* set the time */ if (nflag || netsettime(tval)) { utx.ut_type = OLD_TIME; + memset(utx.ut_id, 0, sizeof(utx.ut_id)); (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); tv.tv_sec = tval; Modified: user/markj/netdump/bin/dd/dd.c ============================================================================== --- user/markj/netdump/bin/dd/dd.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/bin/dd/dd.c Mon Jan 29 18:49:28 2018 (r328558) @@ -339,6 +339,21 @@ speed_limit(void) } static void +swapbytes(void *v, size_t len) +{ + unsigned char *p = v; + unsigned char t; + + while (len > 1) { + t = p[0]; + p[0] = p[1]; + p[1] = t; + p += 2; + len -= 2; + } +} + +static void dd_in(void) { ssize_t n; @@ -438,7 +453,7 @@ dd_in(void) ++st.swab; --n; } - swab(in.dbp, in.dbp, (size_t)n); + swapbytes(in.dbp, (size_t)n); } in.dbp += in.dbrcnt; Modified: user/markj/netdump/bin/pax/pax.c ============================================================================== --- user/markj/netdump/bin/pax/pax.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/bin/pax/pax.c Mon Jan 29 18:49:28 2018 (r328558) @@ -109,7 +109,7 @@ char *tempbase; /* basename of tempfile to use for mk /* * PAX - Portable Archive Interchange * - * A utility to read, write, and write lists of the members of archive + * A utility to read, write, and write lists of the members of archive * files and copy directory hierarchies. A variety of archive formats * are supported (some are described in POSIX 1003.1 10.1): * @@ -237,7 +237,7 @@ main(int argc, char *argv[]) /* * Keep a reference to cwd, so we can always come back home. */ - cwdfd = open(".", O_RDONLY); + cwdfd = open(".", O_RDONLY | O_CLOEXEC); if (cwdfd < 0) { syswarn(0, errno, "Can't open current working directory."); return(exit_val); @@ -249,7 +249,7 @@ main(int argc, char *argv[]) if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') tmpdir = _PATH_TMP; tdlen = strlen(tmpdir); - while(tdlen > 0 && tmpdir[tdlen - 1] == '/') + while (tdlen > 0 && tmpdir[tdlen - 1] == '/') tdlen--; tempfile = malloc(tdlen + 1 + sizeof(_TFILE_BASE)); if (tempfile == NULL) { @@ -271,7 +271,7 @@ main(int argc, char *argv[]) /* * select a primary operation mode */ - switch(act) { + switch (act) { case EXTRACT: extract(); break; @@ -325,6 +325,25 @@ sig_cleanup(int which_sig) } /* + * setup_sig() + * set a signal to be caught, but only if it isn't being ignored already + */ + +static int +setup_sig(int sig, const struct sigaction *n_hand) +{ + struct sigaction o_hand; + + if (sigaction(sig, NULL, &o_hand) < 0) + return (-1); + + if (o_hand.sa_handler == SIG_IGN) + return (0); + + return (sigaction(sig, n_hand, NULL)); +} + +/* * gen_init() * general setup routines. Not all are required, but they really help * when dealing with a medium to large sized archives. @@ -335,7 +354,6 @@ gen_init(void) { struct rlimit reslimit; struct sigaction n_hand; - struct sigaction o_hand; /* * Really needed to handle large archives. We can run out of memory for @@ -389,34 +407,16 @@ gen_init(void) n_hand.sa_flags = 0; n_hand.sa_handler = sig_cleanup; - if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGHUP, &o_hand, &o_hand) < 0)) + if (setup_sig(SIGHUP, &n_hand) || + setup_sig(SIGTERM, &n_hand) || + setup_sig(SIGINT, &n_hand) || + setup_sig(SIGQUIT, &n_hand) || + setup_sig(SIGXCPU, &n_hand)) goto out; - if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGTERM, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGINT, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) - goto out; - n_hand.sa_handler = SIG_IGN; - if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) || - (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)) + if ((sigaction(SIGPIPE, &n_hand, NULL) < 0) || + (sigaction(SIGXFSZ, &n_hand, NULL) < 0)) goto out; return(0); Modified: user/markj/netdump/bin/ps/keyword.c ============================================================================== --- user/markj/netdump/bin/ps/keyword.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/bin/ps/keyword.c Mon Jan 29 18:49:28 2018 (r328558) @@ -122,7 +122,7 @@ static VAR var[] = { {"logname", "", "login", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"lstart", "STARTED", NULL, "start-time", LJUST|USER, lstarted, 0, CHAR, NULL, 0}, - {"lwp", "LWP", NULL, "process-thread-id", 0, kvar, KOFF(ki_tid), UINT, + {"lwp", "LWP", NULL, "thread-id", 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, {"majflt", "MAJFLT", NULL, "major-faults", USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, @@ -204,6 +204,7 @@ static VAR var[] = { {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tid", "", "lwp", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: user/markj/netdump/bin/ps/ps.1 ============================================================================== --- user/markj/netdump/bin/ps/ps.1 Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/bin/ps/ps.1 Mon Jan 29 18:49:28 2018 (r328558) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd January 23, 2018 .Dt PS 1 .Os .Sh NAME @@ -148,12 +148,7 @@ This option is honored only if the UID of the user is Display information about processes which are running with the specified real group IDs. .It Fl H -Show all of the -.Em kernel visible -threads associated with each process. -Depending on the threading package that -is in use, this may show only the process, only the kernel scheduled entities, -or all of the process threads. +Show all of the threads associated with each process. .It Fl h Repeat the information header as often as necessary to guarantee one header per page of information. @@ -588,7 +583,8 @@ login name of user who started the session .It Cm lstart time started .It Cm lwp -process thread-id +thread (light-weight process) ID (alias +.Cm tid ) .It Cm majflt total page faults .It Cm minflt @@ -605,7 +601,7 @@ nice value (alias .It Cm nivcsw total involuntary context switches .It Cm nlwp -number of threads tied to a process +number of threads (light-weight processes) tied to a process .It Cm nsigs total signals taken (alias .Cm nsignals ) Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 29 18:49:28 2018 (r328558) @@ -5636,8 +5636,6 @@ print_holds(boolean_t scripted, boolean_t literal, siz uint64_t val = 0; time_t time; struct tm t; - char sep = scripted ? '\t' : ' '; - size_t sepnum = scripted ? 1 : 2; (void) nvpair_value_uint64(nvp2, &val); if (literal) @@ -5649,8 +5647,13 @@ print_holds(boolean_t scripted, boolean_t literal, siz gettext(STRFTIME_FMT_STR), &t); } - (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname, - sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf); + if (scripted) { + (void) printf("%s\t%s\t%s\n", zname, + tagname, tsbuf); + } else { + (void) printf("%-*s %-*s %s\n", nwidth, + zname, tagwidth, tagname, tsbuf); + } } } } Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jan 29 18:49:28 2018 (r328558) @@ -441,7 +441,7 @@ add_prop_list(const char *propname, char *propval, nvl * feature@ properties and version should not be specified * at the same time. */ - if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) && + if ((prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname) && nvlist_exists(proplist, vname)) || (prop == ZPOOL_PROP_VERSION && prop_list_contains_feature(proplist))) { Modified: user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jan 29 18:49:28 2018 (r328558) @@ -50,6 +50,7 @@ #include "zfeature_common.h" static int read_efi_label(nvlist_t *config, diskaddr_t *sb); +static boolean_t zpool_vdev_is_interior(const char *name); #define BACKUP_SLICE "s2" @@ -444,7 +445,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char const char *propname = nvpair_name(elem); prop = zpool_name_to_prop(propname); - if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { + if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) { int err; char *fname = strchr(propname, '@') + 1; @@ -483,7 +484,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char /* * Make sure this property is valid and applies to this type. */ - if (prop == ZPROP_INVAL) { + if (prop == ZPOOL_PROP_INVAL) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid property '%s'"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); @@ -2065,10 +2066,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, bo break; } - verify(strncmp(type, VDEV_TYPE_RAIDZ, - strlen(VDEV_TYPE_RAIDZ)) == 0 || - strncmp(type, VDEV_TYPE_MIRROR, - strlen(VDEV_TYPE_MIRROR)) == 0); + verify(zpool_vdev_is_interior(type)); verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_ID, &id) == 0); @@ -2175,10 +2173,13 @@ zpool_find_vdev_by_physpath(zpool_handle_t *zhp, const /* * Determine if we have an "interior" top-level vdev (i.e mirror/raidz). */ -boolean_t +static boolean_t zpool_vdev_is_interior(const char *name) { if (strncmp(name, VDEV_TYPE_RAIDZ, strlen(VDEV_TYPE_RAIDZ)) == 0 || + strncmp(name, VDEV_TYPE_SPARE, strlen(VDEV_TYPE_SPARE)) == 0 || + strncmp(name, + VDEV_TYPE_REPLACING, strlen(VDEV_TYPE_REPLACING)) == 0 || strncmp(name, VDEV_TYPE_MIRROR, strlen(VDEV_TYPE_MIRROR)) == 0) return (B_TRUE); return (B_FALSE); Modified: user/markj/netdump/cddl/lib/libdtrace/tcp.d ============================================================================== --- user/markj/netdump/cddl/lib/libdtrace/tcp.d Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/cddl/lib/libdtrace/tcp.d Mon Jan 29 18:49:28 2018 (r328558) @@ -260,7 +260,7 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_ack = p == NULL ? -1 : p->th_ack; tcp_offset = p == NULL ? -1 : (p->th_off >> 2); tcp_flags = p == NULL ? 0 : p->th_flags; - tcp_window = p == NULL ? 0 : (p->th_win); + tcp_window = p == NULL ? 0 : p->th_win; tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); tcp_urgent = p == NULL ? 0 : p->th_urp; tcp_hdr = (struct tcphdr *)p; Modified: user/markj/netdump/contrib/compiler-rt/lib/builtins/clear_cache.c ============================================================================== --- user/markj/netdump/contrib/compiler-rt/lib/builtins/clear_cache.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/compiler-rt/lib/builtins/clear_cache.c Mon Jan 29 18:49:28 2018 (r328558) @@ -33,6 +33,11 @@ uintptr_t GetCurrentProcess(void); #include #endif +#if defined(__OpenBSD__) && defined(__mips__) + #include + #include +#endif + #if defined(__linux__) && defined(__mips__) #include #include @@ -142,6 +147,8 @@ void __clear_cache(void *start, void *end) { #else syscall(__NR_cacheflush, start, (end_int - start_int), BCACHE); #endif +#elif defined(__mips__) && defined(__OpenBSD__) + cacheflush(start, (uintptr_t)end - (uintptr_t)start, BCACHE); #elif defined(__aarch64__) && !defined(__APPLE__) uint64_t xstart = (uint64_t)(uintptr_t) start; uint64_t xend = (uint64_t)(uintptr_t) end; @@ -156,12 +163,14 @@ void __clear_cache(void *start, void *end) { * uintptr_t in case this runs in an IPL32 environment. */ const size_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15); - for (addr = xstart; addr < xend; addr += dcache_line_size) + for (addr = xstart & ~(dcache_line_size - 1); addr < xend; + addr += dcache_line_size) __asm __volatile("dc cvau, %0" :: "r"(addr)); __asm __volatile("dsb ish"); const size_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15); - for (addr = xstart; addr < xend; addr += icache_line_size) + for (addr = xstart & ~(icache_line_size - 1); addr < xend; + addr += icache_line_size) __asm __volatile("ic ivau, %0" :: "r"(addr)); __asm __volatile("isb sy"); #elif defined (__powerpc64__) Modified: user/markj/netdump/contrib/libarchive/cat/bsdcat.c ============================================================================== --- user/markj/netdump/contrib/libarchive/cat/bsdcat.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/cat/bsdcat.c Mon Jan 29 18:49:28 2018 (r328558) @@ -70,6 +70,12 @@ version(void) void bsdcat_next(void) { + if (a != NULL) { + if (archive_read_close(a) != ARCHIVE_OK) + bsdcat_print_error(); + archive_read_free(a); + } + a = archive_read_new(); archive_read_support_filter_all(a); archive_read_support_format_empty(a); @@ -100,8 +106,10 @@ bsdcat_read_to_stdout(const char* filename) ; else if (archive_read_data_into_fd(a, 1) != ARCHIVE_OK) bsdcat_print_error(); - if (archive_read_free(a) != ARCHIVE_OK) + if (archive_read_close(a) != ARCHIVE_OK) bsdcat_print_error(); + archive_read_free(a); + a = NULL; } int @@ -135,15 +143,14 @@ main(int argc, char **argv) if (*bsdcat->argv == NULL) { bsdcat_current_path = ""; bsdcat_read_to_stdout(NULL); - } else + } else { while (*bsdcat->argv) { bsdcat_current_path = *bsdcat->argv++; bsdcat_read_to_stdout(bsdcat_current_path); bsdcat_next(); } - - if (a != NULL) - archive_read_free(a); + archive_read_free(a); /* Help valgrind & friends */ + } exit(exit_status); } Copied: user/markj/netdump/contrib/libarchive/cat/test/test_stdin.c (from r328557, head/contrib/libarchive/cat/test/test_stdin.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/contrib/libarchive/cat/test/test_stdin.c Mon Jan 29 18:49:28 2018 (r328558, copy of r328557, head/contrib/libarchive/cat/test/test_stdin.c) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +#if !defined(_WIN32) || defined(__CYGWIN__) +#define DEV_NULL "/dev/null" +#else +#define DEV_NULL "NUL" +#endif + +DEFINE_TEST(test_stdin) +{ + int f; + + f = systemf("%s <%s >test.out 2>test.err", testprog, DEV_NULL); + assertEqualInt(0, f); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); +} + Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_acl.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_acl.c Mon Jan 29 18:49:28 2018 (r328558) @@ -1159,6 +1159,7 @@ archive_acl_from_text_w(struct archive_acl *acl, const switch (want_type) { case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E: want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + __LA_FALLTHROUGH; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: numfields = 5; @@ -1626,6 +1627,7 @@ archive_acl_from_text_l(struct archive_acl *acl, const switch (want_type) { case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E: want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + __LA_FALLTHROUGH; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: numfields = 5; Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c Mon Jan 29 18:49:28 2018 (r328558) @@ -93,7 +93,9 @@ static const acl_perm_map_t acl_nfs4_flag_map[] = { {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, +#ifdef ACL_ENTRY_INHERITED {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} +#endif }; static const int acl_nfs4_flag_map_size = Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_match.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_match.c Mon Jan 29 18:49:28 2018 (r328558) @@ -1582,7 +1582,7 @@ time_excluded(struct archive_match *a, struct archive_ */ int -archive_match_include_uid(struct archive *_a, int64_t uid) +archive_match_include_uid(struct archive *_a, la_int64_t uid) { struct archive_match *a; @@ -1593,7 +1593,7 @@ archive_match_include_uid(struct archive *_a, int64_t } int -archive_match_include_gid(struct archive *_a, int64_t gid) +archive_match_include_gid(struct archive *_a, la_int64_t gid) { struct archive_match *a; Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_platform.h Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_platform.h Mon Jan 29 18:49:28 2018 (r328558) @@ -191,4 +191,10 @@ #define ARCHIVE_ERRNO_MISC (-1) #endif +#if defined(__GNUC__) && (__GNUC__ >= 7) +#define __LA_FALLTHROUGH __attribute__((fallthrough)) +#else +#define __LA_FALLTHROUGH +#endif + #endif /* !ARCHIVE_PLATFORM_H_INCLUDED */ Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7.c Mon Jan 29 18:49:28 2018 (r328558) @@ -115,14 +115,14 @@ static void Ppmd7_Construct(CPpmd7 *p) memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40); } -static void Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc) +static void Ppmd7_Free(CPpmd7 *p) { - alloc->Free(alloc, p->Base); + free(p->Base); p->Size = 0; p->Base = 0; } -static Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc) +static Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size) { if (p->Base == 0 || p->Size != size) { @@ -131,14 +131,14 @@ static Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAll if (size < UNIT_SIZE) { return False; } - Ppmd7_Free(p, alloc); + Ppmd7_Free(p); p->AlignOffset = #ifdef PPMD_32BIT (4 - size) & 3; #else 4 - (size & 3); #endif - if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size + if ((p->Base = (Byte *)malloc(p->AlignOffset + size #ifndef PPMD_32BIT + UNIT_SIZE #endif Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7_private.h ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7_private.h Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd7_private.h Mon Jan 29 18:49:28 2018 (r328558) @@ -95,8 +95,8 @@ typedef struct { /* Base Functions */ void (*Ppmd7_Construct)(CPpmd7 *p); - Bool (*Ppmd7_Alloc)(CPpmd7 *p, UInt32 size, ISzAlloc *alloc); - void (*Ppmd7_Free)(CPpmd7 *p, ISzAlloc *alloc); + Bool (*Ppmd7_Alloc)(CPpmd7 *p, UInt32 size); + void (*Ppmd7_Free)(CPpmd7 *p); void (*Ppmd7_Init)(CPpmd7 *p, unsigned maxOrder); #define Ppmd7_WasAllocated(p) ((p)->Base != NULL) Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd_private.h ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd_private.h Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_ppmd_private.h Mon Jan 29 18:49:28 2018 (r328558) @@ -69,13 +69,6 @@ typedef struct void (*Write)(void *p, Byte b); } IByteOut; - -typedef struct -{ - void *(*Alloc)(void *p, size_t size); - void (*Free)(void *p, void *address); /* address can be 0 */ -} ISzAlloc; - /*** End defined in Types.h ***/ /*** Begin defined in CpuArch.h ***/ Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_read.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_read.c Mon Jan 29 18:49:28 2018 (r328558) @@ -120,7 +120,8 @@ archive_read_new(void) * Record the do-not-extract-to file. This belongs in archive_read_extract.c. */ void -archive_read_extract_set_skip_file(struct archive *_a, int64_t d, int64_t i) +archive_read_extract_set_skip_file(struct archive *_a, la_int64_t d, + la_int64_t i) { struct archive_read *a = (struct archive_read *)_a; @@ -747,7 +748,7 @@ choose_format(struct archive_read *a) * Return the file offset (within the uncompressed data stream) where * the last header started. */ -int64_t +la_int64_t archive_read_header_position(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; @@ -943,7 +944,7 @@ archive_read_data_skip(struct archive *_a) return (r); } -int64_t +la_int64_t archive_seek_data(struct archive *_a, int64_t offset, int whence) { struct archive_read *a = (struct archive_read *)_a; @@ -1626,7 +1627,8 @@ __archive_read_filter_seek(struct archive_read_filter switch (whence) { case SEEK_CUR: /* Adjust the offset and use SEEK_SET instead */ - offset += filter->position; + offset += filter->position; + __LA_FALLTHROUGH; case SEEK_SET: cursor = 0; while (1) Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Jan 29 18:49:28 2018 (r328558) @@ -387,7 +387,7 @@ archive_read_disk_vtable(void) } const char * -archive_read_disk_gname(struct archive *_a, int64_t gid) +archive_read_disk_gname(struct archive *_a, la_int64_t gid) { struct archive_read_disk *a = (struct archive_read_disk *)_a; if (ARCHIVE_OK != __archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, @@ -399,7 +399,7 @@ archive_read_disk_gname(struct archive *_a, int64_t gi } const char * -archive_read_disk_uname(struct archive *_a, int64_t uid) +archive_read_disk_uname(struct archive *_a, la_int64_t uid) { struct archive_read_disk *a = (struct archive_read_disk *)_a; if (ARCHIVE_OK != __archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, @@ -413,7 +413,7 @@ archive_read_disk_uname(struct archive *_a, int64_t ui int archive_read_disk_set_gname_lookup(struct archive *_a, void *private_data, - const char * (*lookup_gname)(void *private, int64_t gid), + const char * (*lookup_gname)(void *private, la_int64_t gid), void (*cleanup_gname)(void *private)) { struct archive_read_disk *a = (struct archive_read_disk *)_a; @@ -432,7 +432,7 @@ archive_read_disk_set_gname_lookup(struct archive *_a, int archive_read_disk_set_uname_lookup(struct archive *_a, void *private_data, - const char * (*lookup_uname)(void *private, int64_t uid), + const char * (*lookup_uname)(void *private, la_int64_t uid), void (*cleanup_uname)(void *private)) { struct archive_read_disk *a = (struct archive_read_disk *)_a; Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_7zip.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Mon Jan 29 18:49:28 2018 (r328558) @@ -975,18 +975,6 @@ decode_codec_id(const unsigned char *codecId, size_t i return (id); } -static void * -ppmd_alloc(void *p, size_t size) -{ - (void)p; - return malloc(size); -} -static void -ppmd_free(void *p, void *address) -{ - (void)p; - free(address); -} static Byte ppmd_read(void *p) { @@ -1006,8 +994,6 @@ ppmd_read(void *p) return (b); } -static ISzAlloc g_szalloc = { ppmd_alloc, ppmd_free }; - static int init_decompression(struct archive_read *a, struct _7zip *zip, const struct _7z_coder *coder1, const struct _7z_coder *coder2) @@ -1237,7 +1223,7 @@ init_decompression(struct archive_read *a, struct _7zi if (zip->ppmd7_valid) { __archive_ppmd7_functions.Ppmd7_Free( - &zip->ppmd7_context, &g_szalloc); + &zip->ppmd7_context); zip->ppmd7_valid = 0; } @@ -1256,7 +1242,7 @@ init_decompression(struct archive_read *a, struct _7zi } __archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context); r = __archive_ppmd7_functions.Ppmd7_Alloc( - &zip->ppmd7_context, msize, &g_szalloc); + &zip->ppmd7_context, msize); if (r == 0) { archive_set_error(&a->archive, ENOMEM, "Coludn't allocate memory for PPMd"); @@ -1636,7 +1622,7 @@ free_decompression(struct archive_read *a, struct _7zi #endif if (zip->ppmd7_valid) { __archive_ppmd7_functions.Ppmd7_Free( - &zip->ppmd7_context, &g_szalloc); + &zip->ppmd7_context); zip->ppmd7_valid = 0; } return (r); @@ -2569,6 +2555,7 @@ read_Header(struct archive_read *a, struct _7z_header_ case kDummy: if (ll == 0) break; + __LA_FALLTHROUGH; default: if (header_bytes(a, ll) == NULL) return (-1); Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Mon Jan 29 18:49:28 2018 (r328558) @@ -1499,6 +1499,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt } if (strcmp(key, "cksum") == 0) break; + __LA_FALLTHROUGH; case 'd': if (strcmp(key, "device") == 0) { /* stat(2) st_rdev field, e.g. the major/minor IDs @@ -1512,12 +1513,14 @@ parse_keyword(struct archive_read *a, struct mtree *mt archive_entry_set_rdev(entry, dev); return r; } + __LA_FALLTHROUGH; case 'f': if (strcmp(key, "flags") == 0) { *parsed_kws |= MTREE_HAS_FFLAGS; archive_entry_copy_fflags_text(entry, val); break; } + __LA_FALLTHROUGH; case 'g': if (strcmp(key, "gid") == 0) { *parsed_kws |= MTREE_HAS_GID; @@ -1529,16 +1532,19 @@ parse_keyword(struct archive_read *a, struct mtree *mt archive_entry_copy_gname(entry, val); break; } + __LA_FALLTHROUGH; case 'i': if (strcmp(key, "inode") == 0) { archive_entry_set_ino(entry, mtree_atol(&val, 10)); break; } + __LA_FALLTHROUGH; case 'l': if (strcmp(key, "link") == 0) { archive_entry_copy_symlink(entry, val); break; } + __LA_FALLTHROUGH; case 'm': if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) break; @@ -1555,6 +1561,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt } break; } + __LA_FALLTHROUGH; case 'n': if (strcmp(key, "nlink") == 0) { *parsed_kws |= MTREE_HAS_NLINK; @@ -1562,6 +1569,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt (unsigned int)mtree_atol(&val, 10)); break; } + __LA_FALLTHROUGH; case 'r': if (strcmp(key, "resdevice") == 0) { /* stat(2) st_dev field, e.g. the device ID where the @@ -1577,6 +1585,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt if (strcmp(key, "rmd160") == 0 || strcmp(key, "rmd160digest") == 0) break; + __LA_FALLTHROUGH; case 's': if (strcmp(key, "sha1") == 0 || strcmp(key, "sha1digest") == 0) break; @@ -1593,6 +1602,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt archive_entry_set_size(entry, mtree_atol(&val, 10)); break; } + __LA_FALLTHROUGH; case 't': if (strcmp(key, "tags") == 0) { /* @@ -1635,18 +1645,21 @@ parse_keyword(struct archive_read *a, struct mtree *mt archive_entry_set_filetype(entry, AE_IFBLK); break; } + __LA_FALLTHROUGH; case 'c': if (strcmp(val, "char") == 0) { archive_entry_set_filetype(entry, AE_IFCHR); break; } + __LA_FALLTHROUGH; case 'd': if (strcmp(val, "dir") == 0) { archive_entry_set_filetype(entry, AE_IFDIR); break; } + __LA_FALLTHROUGH; case 'f': if (strcmp(val, "fifo") == 0) { archive_entry_set_filetype(entry, @@ -1658,12 +1671,14 @@ parse_keyword(struct archive_read *a, struct mtree *mt AE_IFREG); break; } + __LA_FALLTHROUGH; case 'l': if (strcmp(val, "link") == 0) { archive_entry_set_filetype(entry, AE_IFLNK); break; } + __LA_FALLTHROUGH; default: archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, @@ -1675,6 +1690,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt *parsed_kws |= MTREE_HAS_TYPE; break; } + __LA_FALLTHROUGH; case 'u': if (strcmp(key, "uid") == 0) { *parsed_kws |= MTREE_HAS_UID; @@ -1686,6 +1702,7 @@ parse_keyword(struct archive_read *a, struct mtree *mt archive_entry_copy_uname(entry, val); break; } + __LA_FALLTHROUGH; default: archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Unrecognized key %s=%s", key, val); Modified: user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon Jan 29 18:21:50 2018 (r328557) +++ user/markj/netdump/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon Jan 29 18:49:28 2018 (r328558) @@ -604,20 +604,6 @@ lzss_emit_match(struct rar *rar, int offset, int lengt rar->lzss.position += length; } -static void * -ppmd_alloc(void *p, size_t size) -{ - (void)p; - return malloc(size); -} -static void -ppmd_free(void *p, void *address) -{ - (void)p; - free(address); -} -static ISzAlloc g_szalloc = { ppmd_alloc, ppmd_free }; - static Byte ppmd_read(void *p) { @@ -1038,7 +1024,7 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) - __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_szalloc); + __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); break; default: @@ -1253,7 +1239,7 @@ archive_read_format_rar_cleanup(struct archive_read *a free(rar->dbo); free(rar->unp_buffer); free(rar->lzss.window); - __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_szalloc); + __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); free(rar); (a->format->data) = NULL; return (ARCHIVE_OK); @@ -1658,7 +1644,7 @@ read_header(struct archive_read *a, struct archive_ent rar->unp_offset = 0; rar->unp_buffer_size = UNP_BUFFER_SIZE; memset(rar->lengthtable, 0, sizeof(rar->lengthtable)); - __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_szalloc); + __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->ppmd_valid = rar->ppmd_eod = 0; /* Don't set any archive entries for non-file header types */ @@ -2122,7 +2108,7 @@ parse_codes(struct archive_read *a) /* Make sure ppmd7_contest is freed before Ppmd7_Construct * because reading a broken file cause this abnormal sequence. */ - __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_szalloc); + __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->bytein.a = a; rar->bytein.Read = &ppmd_read; @@ -2137,7 +2123,7 @@ parse_codes(struct archive_read *a) } if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context, - rar->dictionary_size, &g_szalloc)) + rar->dictionary_size)) { archive_set_error(&a->archive, ENOMEM, "Out of memory"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Mon Jan 29 22:03:02 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C67CEE16BA for ; Mon, 29 Jan 2018 22:03:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC47692CE; Mon, 29 Jan 2018 22:03:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E57D663AF; Mon, 29 Jan 2018 22:03:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0TM31SJ014493; Mon, 29 Jan 2018 22:03:01 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0TM31sk014492; Mon, 29 Jan 2018 22:03:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801292203.w0TM31sk014492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 29 Jan 2018 22:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328565 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 328565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 22:03:02 -0000 Author: jeff Date: Mon Jan 29 22:03:01 2018 New Revision: 328565 URL: https://svnweb.freebsd.org/changeset/base/328565 Log: Diff reduction with head. Deleted: user/jeff/numa/sys/kern/kern_numa.c From owner-svn-src-user@freebsd.org Mon Jan 29 22:50:46 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4937EE325B for ; Mon, 29 Jan 2018 22:50:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 988566AE21; Mon, 29 Jan 2018 22:50:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937536A42; Mon, 29 Jan 2018 22:50:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0TMojDB035337; Mon, 29 Jan 2018 22:50:45 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0TMoieT035326; Mon, 29 Jan 2018 22:50:44 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801292250.w0TMoieT035326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 29 Jan 2018 22:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328568 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 22:50:46 -0000 Author: jeff Date: Mon Jan 29 22:50:44 2018 New Revision: 328568 URL: https://svnweb.freebsd.org/changeset/base/328568 Log: Fix review feedback from markj. Modified: user/jeff/numa/sys/vm/vm_extern.h user/jeff/numa/sys/vm/vm_meter.c user/jeff/numa/sys/vm/vm_object.h user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_pageout.c user/jeff/numa/sys/vm/vm_pagequeue.h Modified: user/jeff/numa/sys/vm/vm_extern.h ============================================================================== --- user/jeff/numa/sys/vm/vm_extern.h Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_extern.h Mon Jan 29 22:50:44 2018 (r328568) @@ -125,5 +125,6 @@ int vm_thread_new(struct thread *td, int pages); u_int vm_active_count(void); u_int vm_inactive_count(void); u_int vm_laundry_count(void); +u_int vm_wait_count(void); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: user/jeff/numa/sys/vm/vm_meter.c ============================================================================== --- user/jeff/numa/sys/vm/vm_meter.c Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_meter.c Mon Jan 29 22:50:44 2018 (r328568) @@ -215,11 +215,6 @@ vmtotal(SYSCTL_HANDLER_ARGS) total.t_dw++; else total.t_sl++; -#if 0 /* XXX */ - if (td->td_wchan == - &vm_cnt.v_free_count) - total.t_pw++; -#endif } break; case TDS_CAN_RUN: @@ -287,6 +282,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } mtx_unlock(&vm_object_list_mtx); + total.t_pw = vm_wait_count(); total.t_free = vm_free_count(); #if defined(COMPAT_FREEBSD11) /* sysctl(8) allocates twice as much memory as reported by sysctl(3) */ @@ -441,42 +437,38 @@ vm_free_count(void) return (v); } +static u_int -vm_active_count(void) +vm_pagequeue_count(int pq) { u_int v; int i; v = 0; for (i = 0; i < vm_ndomains; i++) - v += vm_dom[i].vmd_pagequeues[PQ_ACTIVE].pq_cnt; + v += vm_dom[i].vmd_pagequeues[pq].pq_cnt; return (v); } u_int -vm_inactive_count(void) +vm_active_count(void) { - u_int v; - int i; - v = 0; - for (i = 0; i < vm_ndomains; i++) - v += vm_dom[i].vmd_pagequeues[PQ_INACTIVE].pq_cnt; + return vm_pagequeue_count(PQ_ACTIVE); +} - return (v); +u_int +vm_inactive_count(void) +{ + + return vm_pagequeue_count(PQ_INACTIVE); } u_int vm_laundry_count(void) { - u_int v; - int i; - v = 0; - for (i = 0; i < vm_ndomains; i++) - v += vm_dom[i].vmd_pagequeues[PQ_LAUNDRY].pq_cnt; - - return (v); + return vm_pagequeue_count(PQ_LAUNDRY); } Modified: user/jeff/numa/sys/vm/vm_object.h ============================================================================== --- user/jeff/numa/sys/vm/vm_object.h Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_object.h Mon Jan 29 22:50:44 2018 (r328568) @@ -297,6 +297,17 @@ vm_object_color(vm_object_t object, u_short color) } } +static __inline bool +vm_object_reserv(vm_object_t object) +{ + + if (object != NULL && + (object->flags & (OBJ_COLORED | OBJ_FICTITIOUS)) == OBJ_COLORED) { + return (true); + } + return (false); +} + void vm_object_clear_flag(vm_object_t object, u_short bits); void vm_object_pip_add(vm_object_t object, short i); void vm_object_pip_subtract(vm_object_t object, short i); Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_page.c Mon Jan 29 22:50:44 2018 (r328568) @@ -1683,13 +1683,7 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind vm_page_t m; int flags; u_int free_count; -#if VM_NRESERVLEVEL > 0 - int reserv; - reserv = object != NULL && - (object->flags & (OBJ_COLORED | OBJ_FICTITIOUS)) == OBJ_COLORED; -#endif - KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != @@ -1706,7 +1700,7 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind again: m = NULL; #if VM_NRESERVLEVEL > 0 - if (reserv && + if (vm_object_reserv(object) && (m = vm_reserv_extend(req, object, pindex, domain, mpred)) != NULL) { domain = vm_phys_domain(m); @@ -1721,7 +1715,8 @@ again: * Can we allocate the page from a reservation? */ #if VM_NRESERVLEVEL > 0 - if (!reserv || (m = vm_reserv_alloc_page(object, pindex, + if (!vm_object_reserv(object) || + (m = vm_reserv_alloc_page(object, pindex, domain, mpred)) == NULL) #endif { @@ -1892,12 +1887,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin struct vm_domain *vmd; vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; -#if VM_NRESERVLEVEL > 0 - int reserv; - reserv = object != NULL && - (object->flags & (OBJ_COLORED | OBJ_FICTITIOUS)) == OBJ_COLORED; -#endif mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1927,7 +1917,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin */ again: #if VM_NRESERVLEVEL > 0 - if (reserv && + if (vm_object_reserv(object) && (m_ret = vm_reserv_extend_contig(req, object, pindex, domain, npages, low, high, alignment, boundary, mpred)) != NULL) { domain = vm_phys_domain(m_ret); @@ -1944,7 +1934,7 @@ again: */ #if VM_NRESERVLEVEL > 0 retry: - if (!reserv || + if (!vm_object_reserv(object) || (m_ret = vm_reserv_alloc_contig(object, pindex, domain, npages, low, high, alignment, boundary, mpred)) == NULL) #endif @@ -2541,10 +2531,10 @@ unlock: if (m_mtx != NULL) mtx_unlock(m_mtx); if ((m = SLIST_FIRST(&free)) != NULL) { - MPASS(vm_phys_domain(m) == domain); vmd = VM_DOMAIN(domain); vm_domain_free_lock(vmd); do { + MPASS(vm_phys_domain(m) == domain); SLIST_REMOVE_HEAD(&free, plinks.s.ss); vm_page_free_phys(m); } while ((m = SLIST_FIRST(&free)) != NULL); @@ -2720,7 +2710,7 @@ vm_domain_clear(struct vm_domain *vmd) if (vmd->vmd_minset && !vm_paging_min(vmd)) { vmd->vmd_minset = 0; DOMAINSET_CLR(vmd->vmd_domain, &vm_min_domains); - if (!vm_page_count_min() && vm_min_waiters) { + if (vm_min_waiters != 0) { vm_min_waiters = 0; wakeup(&vm_min_domains); } @@ -2728,7 +2718,7 @@ vm_domain_clear(struct vm_domain *vmd) if (vmd->vmd_severeset && !vm_paging_severe(vmd)) { vmd->vmd_severeset = 0; DOMAINSET_CLR(vmd->vmd_domain, &vm_severe_domains); - if (!vm_page_count_severe() && vm_severe_waiters) { + if (vm_severe_waiters != 0) { vm_severe_waiters = 0; wakeup(&vm_severe_domains); } @@ -2759,13 +2749,27 @@ vm_wait_severe(void) { mtx_lock(&vm_domainset_lock); - while (vm_page_count_min()) { + while (vm_page_count_severe()) { vm_severe_waiters++; msleep(&vm_min_domains, &vm_domainset_lock, PVM, "vmwait", 0); } mtx_unlock(&vm_domainset_lock); } +u_int +vm_wait_count(void) +{ + u_int cnt; + int i; + + cnt = 0; + for (i = 0; i < vm_ndomains; i++) + cnt += VM_DOMAIN(i)->vmd_waiters; + cnt += vm_severe_waiters + vm_min_waiters; + + return (cnt); +} + /* * vm_wait_domain: * @@ -2815,13 +2819,20 @@ vm_wait(void) msleep(&vm_pageproc_waiters, &vm_domainset_lock, PVM, "pageprocwait", 1); mtx_unlock(&vm_domainset_lock); - } else + } else { /* * XXX Ideally we would wait only until the allocation could * be satisfied. This condition can cause new allocators to * consume all freed pages while old allocators wait. */ - vm_wait_min(); + mtx_lock(&vm_domainset_lock); + if (vm_page_count_min()) { + vm_min_waiters++; + msleep(&vm_min_domains, &vm_domainset_lock, PVM, + "vmwait", 0); + } + mtx_unlock(&vm_domainset_lock); + } } /* @@ -2872,7 +2883,7 @@ vm_waitpfault(void) { mtx_lock(&vm_domainset_lock); - while (vm_page_count_min()) { + if (vm_page_count_min()) { vm_min_waiters++; msleep(&vm_min_domains, &vm_domainset_lock, PUSER, "pfault", 0); } Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_pageout.c Mon Jan 29 22:50:44 2018 (r328568) @@ -185,11 +185,6 @@ SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTL &act_scan_laundry_weight, 0, "weight given to clean vs. dirty pages in active queue scans"); -static u_int vm_background_launder_target; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RWTUN, - &vm_background_launder_target, 0, - "background laundering target, in pages"); - static u_int vm_background_launder_rate = 4096; SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RWTUN, &vm_background_launder_rate, 0, @@ -1030,7 +1025,7 @@ trybackground: ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt; if (target == 0 && inactq_scans != last_launder && ndirty * isqrt(inactq_scans - last_launder) >= nclean) { - target = vm_background_launder_target; + target = vmd->vmd_background_launder_target; } /* @@ -1880,6 +1875,14 @@ vm_pageout_init_domain(int domain) * page limit. This keeps the steady state out of shortfall. */ vmd->vmd_pageout_wakeup_thresh = (vmd->vmd_free_min / 10) * 11; + + /* + * Target amount of memory to move out of the laundry queue during a + * background laundering. This is proportional to the amount of system + * memory. + */ + vmd->vmd_background_launder_target = (vmd->vmd_free_target - + vmd->vmd_free_min) / 10; } static void @@ -1920,14 +1923,6 @@ vm_pageout_init(void) if (vm_page_max_wired == 0) vm_page_max_wired = freecount / 3; - - /* - * Target amount of memory to move out of the laundry queue during a - * background laundering. This is proportional to the amount of system - * memory. - */ - vm_background_launder_target = (vm_cnt.v_free_target - - vm_cnt.v_free_min) / 10; } /* @@ -2006,6 +2001,8 @@ pagedaemon_wait(int domain, int pri, const char *wmesg wakeup(&vmd->vmd_pageout_wanted); } vmd->vmd_pages_needed = true; + vmd->vmd_waiters++; msleep(&vmd->vmd_free_count, vm_domain_free_lockptr(vmd), PDROP | pri, wmesg, 0); + vmd->vmd_waiters--; } Modified: user/jeff/numa/sys/vm/vm_pagequeue.h ============================================================================== --- user/jeff/numa/sys/vm/vm_pagequeue.h Mon Jan 29 22:38:23 2018 (r328567) +++ user/jeff/numa/sys/vm/vm_pagequeue.h Mon Jan 29 22:50:44 2018 (r328568) @@ -93,6 +93,7 @@ struct vm_domain { int vmd_pageout_pages_needed; /* page daemon waiting for pages? */ int vmd_pageout_deficit; /* Estimated number of pages deficit */ + int vmd_waiters; /* Pageout waiters. */ bool vmd_pages_needed; /* Are threads waiting for free pages? */ bool vmd_pageout_wanted; /* pageout daemon wait channel */ bool vmd_minset; /* Are we in vm_min_domains? */ @@ -105,6 +106,7 @@ struct vm_domain { } vmd_laundry_request; /* Paging thresholds. */ + u_int vmd_background_launder_target; u_int vmd_free_reserved; /* (c) pages reserved for deadlock */ u_int vmd_free_target; /* (c) pages desired free */ u_int vmd_free_min; /* (c) pages desired free */ From owner-svn-src-user@freebsd.org Tue Jan 30 17:20:29 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FE6DED6EC3 for ; Tue, 30 Jan 2018 17:20:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6A3E77087; Tue, 30 Jan 2018 17:20:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D17CA1A1E1; Tue, 30 Jan 2018 17:20:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0UHKSW3091606; Tue, 30 Jan 2018 17:20:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0UHKS8u091605; Tue, 30 Jan 2018 17:20:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801301720.w0UHKS8u091605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Jan 2018 17:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328597 - user/markj/netdump/sys/netinet/netdump X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: user/markj/netdump/sys/netinet/netdump X-SVN-Commit-Revision: 328597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2018 17:20:29 -0000 Author: markj Date: Tue Jan 30 17:20:28 2018 New Revision: 328597 URL: https://svnweb.freebsd.org/changeset/base/328597 Log: Pass the input thread pointer to set_dumper(). Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump_client.c Tue Jan 30 16:43:20 2018 (r328596) +++ user/markj/netdump/sys/netinet/netdump/netdump_client.c Tue Jan 30 17:20:28 2018 (r328597) @@ -1156,8 +1156,8 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c dumper.maxiosize = MAXDUMPPGS * PAGE_SIZE; dumper.mediaoffset = 0; dumper.mediasize = 0; - error = set_dumper(&dumper, conf->ndc_iface, curthread, 0, 0, - NULL, 0, NULL); + error = set_dumper(&dumper, conf->ndc_iface, td, 0, 0, NULL, 0, + NULL); if (error != 0) { nd_enabled = 0; netdump_mbuf_drain(); From owner-svn-src-user@freebsd.org Tue Jan 30 21:34:35 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B8DEE4A95 for ; Tue, 30 Jan 2018 21:34:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BEC582CF6; Tue, 30 Jan 2018 21:34:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FF831CCCE; Tue, 30 Jan 2018 21:34:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ULYYm0024552; Tue, 30 Jan 2018 21:34:34 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ULYYT5024550; Tue, 30 Jan 2018 21:34:34 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801302134.w0ULYYT5024550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 30 Jan 2018 21:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328607 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2018 21:34:35 -0000 Author: jeff Date: Tue Jan 30 21:34:34 2018 New Revision: 328607 URL: https://svnweb.freebsd.org/changeset/base/328607 Log: Fix some bugs and review feedback. Modified: user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_reserv.c Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Tue Jan 30 21:26:31 2018 (r328606) +++ user/jeff/numa/sys/vm/vm_page.c Tue Jan 30 21:34:34 2018 (r328607) @@ -171,7 +171,7 @@ static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_enqueue(uint8_t queue, vm_page_t m); -static void vm_page_free_phys(vm_page_t m); +static void vm_page_free_phys(struct vm_domain *vmd, vm_page_t m); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); @@ -2536,7 +2536,7 @@ unlock: do { MPASS(vm_phys_domain(m) == domain); SLIST_REMOVE_HEAD(&free, plinks.s.ss); - vm_page_free_phys(m); + vm_page_free_phys(vmd, m); } while ((m = SLIST_FIRST(&free)) != NULL); vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); @@ -2751,7 +2751,8 @@ vm_wait_severe(void) mtx_lock(&vm_domainset_lock); while (vm_page_count_severe()) { vm_severe_waiters++; - msleep(&vm_min_domains, &vm_domainset_lock, PVM, "vmwait", 0); + msleep(&vm_severe_domains, &vm_domainset_lock, PVM, + "vmwait", 0); } mtx_unlock(&vm_domainset_lock); } @@ -3165,12 +3166,12 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) * queues. This is the last step to free a page. */ static void -vm_page_free_phys(vm_page_t m) +vm_page_free_phys(struct vm_domain *vmd, vm_page_t m) { - vm_domain_free_assert_locked(vm_pagequeue_domain(m)); + vm_domain_free_assert_locked(vmd); - vm_domain_freecnt_adj(vm_pagequeue_domain(m), 1); + vm_domain_freecnt_adj(vmd, 1); #if VM_NRESERVLEVEL > 0 if (!vm_reserv_free_page(m)) #endif @@ -3195,7 +3196,7 @@ vm_page_free_phys_pglist(struct pglist *tq) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); } - vm_page_free_phys(m); + vm_page_free_phys(vmd, m); } if (vmd != NULL) { vm_domain_free_wakeup(vmd); @@ -3221,7 +3222,7 @@ vm_page_free_toq(vm_page_t m) return; vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); - vm_page_free_phys(m); + vm_page_free_phys(vmd, m); vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); } Modified: user/jeff/numa/sys/vm/vm_reserv.c ============================================================================== --- user/jeff/numa/sys/vm/vm_reserv.c Tue Jan 30 21:26:31 2018 (r328606) +++ user/jeff/numa/sys/vm/vm_reserv.c Tue Jan 30 21:34:34 2018 (r328607) @@ -822,9 +822,11 @@ vm_reserv_extend(int req, vm_object_t object, vm_pinde /* Handle vm_page_rename(m, new_object, ...). */ popmap_is_set(rv->popmap, index)) m = NULL; - if (m != NULL) + if (m != NULL) { vm_reserv_populate(rv, index); - free_count = vm_domain_freecnt_adj(vmd, -1); + free_count = vm_domain_freecnt_adj(vmd, -1); + } else + free_count = vmd->vmd_free_count; vm_domain_free_unlock(vmd); if (vm_paging_needed(vmd, free_count)) @@ -1362,12 +1364,20 @@ vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end, vm_page_t vm_reserv_to_superpage(vm_page_t m) { + struct vm_domain *vmd; vm_reserv_t rv; VM_OBJECT_ASSERT_LOCKED(m->object); rv = vm_reserv_from_page(m); - return (rv->object == m->object && rv->popcnt == VM_LEVEL_0_NPAGES ? - rv->pages : NULL); + vmd = VM_DOMAIN(rv->domain); + vm_domain_free_lock(vmd); + if (rv->object == m->object && rv->popcnt == VM_LEVEL_0_NPAGES) + m = rv->pages; + else + m = NULL; + vm_domain_free_unlock(vmd); + + return (m); } #endif /* VM_NRESERVLEVEL > 0 */ From owner-svn-src-user@freebsd.org Thu Feb 1 16:43:52 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2888EEDCFC6 for ; Thu, 1 Feb 2018 16:43:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFD997667A; Thu, 1 Feb 2018 16:43:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6EC796F; Thu, 1 Feb 2018 16:43:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11Ghp90025933; Thu, 1 Feb 2018 16:43:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11GhmHf025902; Thu, 1 Feb 2018 16:43:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802011643.w11GhmHf025902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Feb 2018 16:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328682 - in user/markj/netdump: cddl/usr.sbin/zfsd contrib/jemalloc contrib/jemalloc/include/jemalloc contrib/llvm/include/llvm/MC contrib/llvm/lib/MC contrib/netbsd-tests/lib/libc/sys... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: cddl/usr.sbin/zfsd contrib/jemalloc contrib/jemalloc/include/jemalloc contrib/llvm/include/llvm/MC contrib/llvm/lib/MC contrib/netbsd-tests/lib/libc/sys contrib/netbsd-tests/usr... X-SVN-Commit-Revision: 328682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 16:43:52 -0000 Author: markj Date: Thu Feb 1 16:43:48 2018 New Revision: 328682 URL: https://svnweb.freebsd.org/changeset/base/328682 Log: MFH at r328681. Added: user/markj/netdump/lib/libc/stdlib/strtold.c - copied unchanged from r328681, head/lib/libc/stdlib/strtold.c user/markj/netdump/lib/libc/tests/gen/makecontext_test.c - copied unchanged from r328681, head/lib/libc/tests/gen/makecontext_test.c user/markj/netdump/stand/common/interp_simple.c - copied unchanged from r328681, head/stand/common/interp_simple.c user/markj/netdump/stand/libsa/libsa.3 - copied unchanged from r328681, head/stand/libsa/libsa.3 user/markj/netdump/stand/libsa/xlocale_private.h - copied unchanged from r328681, head/stand/libsa/xlocale_private.h user/markj/netdump/sys/mips/include/abi.h - copied unchanged from r328681, head/sys/mips/include/abi.h Deleted: user/markj/netdump/stand/libsa/libstand.3 user/markj/netdump/stand/libsa/strtol.c user/markj/netdump/stand/libsa/strtoul.c Modified: user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc user/markj/netdump/contrib/jemalloc/FREEBSD-diffs user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh user/markj/netdump/lib/libc/gen/makecontext.3 user/markj/netdump/lib/libc/i386/gen/makecontext.c user/markj/netdump/lib/libc/mips/gen/makecontext.c user/markj/netdump/lib/libc/powerpc/gen/makecontext.c user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c user/markj/netdump/lib/libc/stdlib/Makefile.inc user/markj/netdump/lib/libc/stdlib/strtol.c user/markj/netdump/lib/libc/tests/gen/Makefile user/markj/netdump/lib/libedit/Makefile user/markj/netdump/lib/libgcc_s/Makefile user/markj/netdump/release/scripts/make-manifest.sh user/markj/netdump/share/man/man4/usb_template.4 user/markj/netdump/share/man/man7/arch.7 user/markj/netdump/stand/common/bootstrap.h user/markj/netdump/stand/common/install.c user/markj/netdump/stand/common/interp.c user/markj/netdump/stand/common/interp_forth.c user/markj/netdump/stand/common/load_elf.c user/markj/netdump/stand/fdt/fdt_loader_cmd.c user/markj/netdump/stand/libsa/Makefile user/markj/netdump/stand/libsa/stand.h user/markj/netdump/stand/loader.mk user/markj/netdump/sys/amd64/amd64/db_trace.c user/markj/netdump/sys/amd64/amd64/exception.S user/markj/netdump/sys/amd64/amd64/genassym.c user/markj/netdump/sys/amd64/amd64/initcpu.c user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/amd64/support.S user/markj/netdump/sys/amd64/ia32/ia32_exception.S user/markj/netdump/sys/amd64/include/md_var.h user/markj/netdump/sys/amd64/include/pcpu.h user/markj/netdump/sys/amd64/linux/Makefile user/markj/netdump/sys/amd64/linux32/Makefile user/markj/netdump/sys/amd64/vmm/amd/svm.c user/markj/netdump/sys/arm64/arm64/pmap.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c user/markj/netdump/sys/compat/cloudabi32/Makefile user/markj/netdump/sys/compat/cloudabi64/Makefile user/markj/netdump/sys/compat/freebsd32/Makefile user/markj/netdump/sys/compat/linuxkpi/common/include/linux/sched.h user/markj/netdump/sys/dev/atkbdc/psm.c user/markj/netdump/sys/dev/cpuctl/cpuctl.c user/markj/netdump/sys/dev/cxgbe/tom/t4_tom.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_8327.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchvar.h user/markj/netdump/sys/dev/mlx5/mlx5_en/en.h user/markj/netdump/sys/dev/ntb/ntb_transport.c user/markj/netdump/sys/dev/uart/uart_dev_mvebu.c user/markj/netdump/sys/dev/usb/usb_device.c user/markj/netdump/sys/fs/ext2fs/ext2_alloc.c user/markj/netdump/sys/fs/ext2fs/ext2_inode_cnv.c user/markj/netdump/sys/fs/ext2fs/ext2_vfsops.c user/markj/netdump/sys/fs/ext2fs/ext2fs.h user/markj/netdump/sys/geom/journal/g_journal.c user/markj/netdump/sys/i386/i386/support.s user/markj/netdump/sys/i386/ibcs2/Makefile user/markj/netdump/sys/i386/linux/Makefile user/markj/netdump/sys/kern/Makefile user/markj/netdump/sys/kern/makesyscalls.sh user/markj/netdump/sys/kern/vfs_subr.c user/markj/netdump/sys/mips/include/asm.h user/markj/netdump/sys/mips/mips/pm_machdep.c user/markj/netdump/sys/mips/mips/vm_machdep.c user/markj/netdump/sys/netinet/tcp_timer.c user/markj/netdump/sys/netinet/tcp_timer.h user/markj/netdump/sys/netpfil/pf/pf.c user/markj/netdump/sys/powerpc/aim/aim_machdep.c user/markj/netdump/sys/powerpc/aim/mp_cpudep.c user/markj/netdump/sys/powerpc/booke/booke_machdep.c user/markj/netdump/sys/powerpc/include/psl.h user/markj/netdump/sys/powerpc/powerpc/exec_machdep.c user/markj/netdump/sys/powerpc/powerpc/genassym.c user/markj/netdump/sys/powerpc/powerpc/machdep.c user/markj/netdump/sys/powerpc/powerpc/vm_machdep.c user/markj/netdump/sys/sys/mouse.h user/markj/netdump/sys/ufs/ffs/ffs_alloc.c user/markj/netdump/sys/x86/include/specialreg.h user/markj/netdump/sys/x86/include/x86_var.h user/markj/netdump/sys/x86/x86/cpu_machdep.c user/markj/netdump/sys/x86/x86/identcpu.c user/markj/netdump/usr.bin/dtc/Makefile user/markj/netdump/usr.bin/nfsstat/Makefile user/markj/netdump/usr.bin/nfsstat/nfsstat.1 user/markj/netdump/usr.bin/nfsstat/nfsstat.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/cddl/ (props changed) user/markj/netdump/contrib/llvm/ (props changed) user/markj/netdump/contrib/netbsd-tests/ (props changed) user/markj/netdump/lib/libedit/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 1 16:43:48 2018 (r328682) @@ -442,10 +442,38 @@ CaseFile::ReEvaluate(const ZfsEvent &event) return (consumed || closed); } +/* Find a Vdev containing the vdev with the given GUID */ +static nvlist_t* +find_parent(nvlist_t *pool_config, nvlist_t *config, DevdCtl::Guid child_guid) +{ + nvlist_t **vdevChildren; + int error; + unsigned ch, numChildren; + error = nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, + &vdevChildren, &numChildren); + + if (error != 0 || numChildren == 0) + return (NULL); + + for (ch = 0; ch < numChildren; ch++) { + nvlist *result; + Vdev vdev(pool_config, vdevChildren[ch]); + + if (vdev.GUID() == child_guid) + return (config); + + result = find_parent(pool_config, vdevChildren[ch], child_guid); + if (result != NULL) + return (result); + } + + return (NULL); +} + bool CaseFile::ActivateSpare() { - nvlist_t *config, *nvroot; + nvlist_t *config, *nvroot, *parent_config; nvlist_t **spares; char *devPath, *vdev_type; const char *poolname; @@ -472,6 +500,22 @@ CaseFile::ActivateSpare() { "tree for pool %s", poolname); return (false); } + + parent_config = find_parent(config, nvroot, m_vdevGUID); + if (parent_config != NULL) { + char *parent_type; + + /* + * Don't activate spares for members of a "replacing" vdev. + * They're already dealt with. Sparing them will just drag out + * the resilver process. + */ + error = nvlist_lookup_string(parent_config, + ZPOOL_CONFIG_TYPE, &parent_type); + if (error == 0 && strcmp(parent_type, VDEV_TYPE_REPLACING) == 0) + return (false); + } + nspares = 0; nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES, &spares, &nspares); Modified: user/markj/netdump/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- user/markj/netdump/contrib/jemalloc/FREEBSD-diffs Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/jemalloc/FREEBSD-diffs Thu Feb 1 16:43:48 2018 (r328682) @@ -153,7 +153,7 @@ index 00000000..355b565c + * each supported architecture. + */ +#undef JEMALLOC_TLS_MODEL -+#undef STATIC_PAGE_SHIFT ++#undef LG_PAGE +#undef LG_VADDR +#undef LG_SIZEOF_PTR +#undef LG_SIZEOF_INT @@ -212,7 +212,7 @@ index 00000000..355b565c +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif + -+#define STATIC_PAGE_SHIFT PAGE_SHIFT ++#define LG_PAGE PAGE_SHIFT +#define LG_SIZEOF_INT 2 +#define LG_SIZEOF_LONG LG_SIZEOF_PTR +#define LG_SIZEOF_INTMAX_T 3 Modified: user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Feb 1 16:43:48 2018 (r328682) @@ -17,7 +17,7 @@ * each supported architecture. */ #undef JEMALLOC_TLS_MODEL -#undef STATIC_PAGE_SHIFT +#undef LG_PAGE #undef LG_VADDR #undef LG_SIZEOF_PTR #undef LG_SIZEOF_INT @@ -76,7 +76,7 @@ # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_PAGE PAGE_SHIFT #define LG_SIZEOF_INT 2 #define LG_SIZEOF_LONG LG_SIZEOF_PTR #define LG_SIZEOF_INTMAX_T 3 Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h Thu Feb 1 16:43:48 2018 (r328682) @@ -422,14 +422,21 @@ class MCFillFragment : public MCFragment { uint8_t Value; /// The number of bytes to insert. - uint64_t Size; + const MCExpr &Size; + /// Source location of the directive that this fragment was created for. + SMLoc Loc; + public: - MCFillFragment(uint8_t Value, uint64_t Size, MCSection *Sec = nullptr) - : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size) {} + MCFillFragment(uint8_t Value, const MCExpr &Size, SMLoc Loc, + MCSection *Sec = nullptr) + : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size), Loc(Loc) { + } uint8_t getValue() const { return Value; } - uint64_t getSize() const { return Size; } + const MCExpr &getSize() const { return Size; } + + SMLoc getLoc() const { return Loc; } static bool classof(const MCFragment *F) { return F->getKind() == MCFragment::FT_Fill; Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Thu Feb 1 16:43:48 2018 (r328682) @@ -161,7 +161,6 @@ class MCObjectStreamer : public MCStreamer { (public) bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc) override; using MCStreamer::emitFill; - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h Thu Feb 1 16:43:48 2018 (r328682) @@ -662,7 +662,7 @@ class MCStreamer { (public) /// \brief Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. - virtual void emitFill(uint64_t NumBytes, uint8_t FillValue); + void emitFill(uint64_t NumBytes, uint8_t FillValue); /// \brief Emit \p Size bytes worth of the value specified by \p FillValue. /// Modified: user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -192,9 +192,6 @@ class MCAsmStreamer final : public MCStreamer { (publi void EmitGPRel32Value(const MCExpr *Value) override; - - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; - void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; @@ -965,17 +962,12 @@ void MCAsmStreamer::EmitGPRel32Value(const MCExpr *Val EmitEOL(); } -/// emitFill - Emit NumBytes bytes worth of the value specified by -/// FillValue. This implements directives such as '.space'. -void MCAsmStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - if (NumBytes == 0) return; - - const MCExpr *E = MCConstantExpr::create(NumBytes, getContext()); - emitFill(*E, FillValue); -} - void MCAsmStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { + int64_t IntNumBytes; + if (NumBytes.evaluateAsAbsolute(IntNumBytes) && IntNumBytes == 0) + return; + if (const char *ZeroDirective = MAI->getZeroDirective()) { // FIXME: Emit location directives OS << ZeroDirective; Modified: user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -281,8 +281,18 @@ uint64_t MCAssembler::computeFragmentSize(const MCAsmL return cast(F).getContents().size(); case MCFragment::FT_CompactEncodedInst: return cast(F).getContents().size(); - case MCFragment::FT_Fill: - return cast(F).getSize(); + case MCFragment::FT_Fill: { + auto &FF = cast(F); + int64_t Size = 0; + if (!FF.getSize().evaluateAsAbsolute(Size, Layout)) + getContext().reportError(FF.getLoc(), + "expected assembly-time absolute expression"); + if (Size < 0) { + getContext().reportError(FF.getLoc(), "invalid number of bytes"); + return 0; + } + return Size; + } case MCFragment::FT_LEB: return cast(F).getContents().size(); @@ -540,7 +550,7 @@ static void writeFragment(const MCAssembler &Asm, cons for (unsigned I = 1; I < MaxChunkSize; ++I) Data[I] = Data[0]; - uint64_t Size = FF.getSize(); + uint64_t Size = FragmentSize; for (unsigned ChunkSize = MaxChunkSize; ChunkSize; ChunkSize /= 2) { StringRef Ref(Data, ChunkSize); for (uint64_t I = 0, E = Size / ChunkSize; I != E; ++I) Modified: user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -411,29 +411,19 @@ void MCMachOStreamer::EmitLocalCommonSymbol(MCSymbol * void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) { - getAssembler().registerSection(*Section); - - // The symbol may not be present, which only creates the section. - if (!Symbol) - return; - // On darwin all virtual sections have zerofill type. assert(Section->isVirtualSection() && "Section does not have zerofill type!"); - assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); + PushSection(); + SwitchSection(Section); - getAssembler().registerSymbol(*Symbol); - - // Emit an align fragment if necessary. - if (ByteAlignment != 1) - new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, Section); - - MCFragment *F = new MCFillFragment(0, Size, Section); - Symbol->setFragment(F); - - // Update the maximum alignment on the zero fill section if necessary. - if (ByteAlignment > Section->getAlignment()) - Section->setAlignment(ByteAlignment); + // The symbol may not be present, which only creates the section. + if (Symbol) { + EmitValueToAlignment(ByteAlignment, 0, 1, 0); + EmitLabel(Symbol); + EmitZeros(Size); + } + PopSection(); } // This should always be called with the thread local bss section. Like the Modified: user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -577,28 +577,13 @@ bool MCObjectStreamer::EmitRelocDirective(const MCExpr return false; } -void MCObjectStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - assert(getCurrentSectionOnly() && "need a section"); - insert(new MCFillFragment(FillValue, NumBytes)); -} - void MCObjectStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { MCDataFragment *DF = getOrCreateDataFragment(); flushPendingLabels(DF, DF->getContents().size()); - int64_t IntNumBytes; - if (!NumBytes.evaluateAsAbsolute(IntNumBytes, getAssembler())) { - getContext().reportError(Loc, "expected absolute expression"); - return; - } - - if (IntNumBytes <= 0) { - getContext().reportError(Loc, "invalid number of bytes"); - return; - } - - emitFill(IntNumBytes, FillValue); + assert(getCurrentSectionOnly() && "need a section"); + insert(new MCFillFragment(FillValue, NumBytes, Loc)); } void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size, Modified: user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -184,8 +184,7 @@ void MCStreamer::EmitGPRel32Value(const MCExpr *Value) /// Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - for (uint64_t i = 0, e = NumBytes; i != e; ++i) - EmitIntValue(FillValue, 1); + emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); } void MCStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) { Modified: user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -257,20 +257,13 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol auto *Symbol = cast(S); MCSection *Section = getContext().getObjectFileInfo()->getBSSSection(); - getAssembler().registerSection(*Section); - if (Section->getAlignment() < ByteAlignment) - Section->setAlignment(ByteAlignment); - - getAssembler().registerSymbol(*Symbol); + PushSection(); + SwitchSection(Section); + EmitValueToAlignment(ByteAlignment, 0, 1, 0); + EmitLabel(Symbol); Symbol->setExternal(false); - - if (ByteAlignment != 1) - new MCAlignFragment(ByteAlignment, /*Value=*/0, /*ValueSize=*/0, - ByteAlignment, Section); - - MCFillFragment *Fragment = new MCFillFragment( - /*Value=*/0, Size, Section); - Symbol->setFragment(Fragment); + EmitZeros(Size); + PopSection(); } void MCWinCOFFStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, Modified: user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -528,7 +528,10 @@ static void addData(SmallVectorImpl &DataBytes, Align->getMaxBytesToEmit()); DataBytes.resize(Size, Value); } else if (auto *Fill = dyn_cast(&Frag)) { - DataBytes.insert(DataBytes.end(), Fill->getSize(), Fill->getValue()); + int64_t Size; + if (!Fill->getSize().evaluateAsAbsolute(Size)) + llvm_unreachable("The fill should be an assembler constant"); + DataBytes.insert(DataBytes.end(), Size, Fill->getValue()); } else { const auto &DataFrag = cast(Frag); const SmallVectorImpl &Contents = DataFrag.getContents(); Modified: user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c ============================================================================== --- user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -52,12 +52,10 @@ run(int n, ...) va_start(va, n); #ifdef __FreeBSD__ -#if defined(__amd64__) +#if defined(__amd64__) || defined(__sparc64__) for (i = 0; i < 5; i++) { -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv__) for (i = 0; i < 7; i++) { -#elif defined(__mips__) - for (i = 0; i < 5; i++) { #else for (i = 0; i < 9; i++) { #endif @@ -121,18 +119,20 @@ ATF_TC_BODY(setcontext_link, tc) uc[i].uc_link = (i > 0) ? &uc[i - 1] : &save; #ifdef __FreeBSD__ -#if defined(__amd64__) - /* FreeBSD/amd64 only permits up to 6 arguments. */ +#if defined(__amd64__) || defined(__sparc64__) + /* + * FreeBSD/amd64 and FreeBSD/sparc64 only permit up to + * 6 arguments. + */ makecontext(&uc[i], (void *)run, 6, i, 0, 1, 2, 3, 4); -#elif defined(__aarch64__) - /* FreeBSD/arm64 only permits up to 8 arguments. */ +#elif defined(__aarch64__) || defined(__riscv__) + /* + * FreeBSD/arm64 and FreeBSD/riscv64 only permit up to + * 8 arguments. + */ makecontext(&uc[i], (void *)run, 8, i, 0, 1, 2, 3, 4, 5, 6); -#elif defined(__mips__) - /* FreeBSD/mips only permits up to 6 arguments. */ - makecontext(&uc[i], (void *)run, 6, i, - 0, 1, 2, 3, 4); #else makecontext(&uc[i], (void *)run, 10, i, 0, 1, 2, 3, 4, 5, 6, 7, 8); Modified: user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Feb 1 16:43:48 2018 (r328682) @@ -646,30 +646,6 @@ mmap_body() atf_check -s exit:1 grep --mmap -e "Z" test1 } -atf_test_case mmap_eof_not_eol -mmap_eof_not_eol_head() -{ - atf_set "descr" "Check --mmap flag handling of encountering EOF without EOL (PR 165471, 219402)" -} -mmap_eof_not_eol_body() -{ - grep_type - if [ $? -eq $GREP_TYPE_GNU ]; then - atf_expect_fail "gnu grep from ports has no --mmap option" - fi - - atf_expect_fail "relies on jemalloc feature no longer available; needs to be rewritten - bug 220309" - - printf "ABC" > test1 - jot -b " " -s "" 4096 >> test2 - - atf_check -s exit:0 -o inline:"B\n" grep --mmap -oe "B" test1 - # Dependency on jemalloc(3) to detect buffer overflow, otherwise this - # unreliably produces a SIGSEGV or SIGBUS - atf_check -s exit:0 -o not-empty \ - env MALLOC_CONF="redzone:true" grep --mmap -e " " test2 -} - atf_test_case matchall matchall_head() { @@ -779,7 +755,6 @@ atf_init_test_cases() atf_add_test_case binary_flags atf_add_test_case badcontext atf_add_test_case mmap - atf_add_test_case mmap_eof_not_eol atf_add_test_case matchall atf_add_test_case fgrep_multipattern atf_add_test_case fgrep_icase Modified: user/markj/netdump/lib/libc/gen/makecontext.3 ============================================================================== --- user/markj/netdump/lib/libc/gen/makecontext.3 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/gen/makecontext.3 Thu Feb 1 16:43:48 2018 (r328682) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd January 31, 2018 .Dt MAKECONTEXT 3 .Os .Sh NAME @@ -68,11 +68,16 @@ with the arguments provided. The .Fa argc argument -must be equal to the number of additional arguments provided to +must be equal to the number of additional arguments of type +.Vt int +provided to .Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. +and also equal to the number of arguments of type +.Vt int +to +.Fn func ; +otherwise , +the behavior is undefined. .Pp The .Fa "ucp->uc_link" Modified: user/markj/netdump/lib/libc/i386/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/i386/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/i386/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -85,7 +85,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in ucp->uc_mcontext.mc_len = 0; } /* XXX - Do we want to sanity check argc? */ - else if ((argc < 0) || (argc > NCARGS)) { + else if (argc < 0) { ucp->uc_mcontext.mc_len = 0; } /* Make sure the context is valid. */ Modified: user/markj/netdump/lib/libc/mips/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/mips/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/mips/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -38,6 +38,7 @@ __RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07 #endif #include +#include #include #include @@ -65,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int * so that we can mark a context as invalid. Store it in * mc->mc_regs[ZERO] perhaps? */ - if (argc < 0 || argc > 6 || ucp == NULL || + if (argc < 0 || ucp == NULL || ucp->uc_stack.ss_sp == NULL || ucp->uc_stack.ss_size < MINSIGSTKSZ) return; @@ -75,13 +76,10 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); #if defined(__mips_o32) || defined(__mips_o64) sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */ - sp = (register_t *) - ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */ #elif defined(__mips_n32) || defined(__mips_n64) sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */ - sp = (register_t *) - ((uintptr_t)sp & ~0xf); /* Align on quad-word boundary. */ #endif + sp = (register_t *)((uintptr_t)sp & ~(STACK_ALIGN - 1)); mc->mc_regs[SP] = (intptr_t)sp; mc->mc_regs[S0] = (intptr_t)ucp; Modified: user/markj/netdump/lib/libc/powerpc/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/powerpc/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/powerpc/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in int i, regargs, stackargs; /* Sanity checks */ - if ((ucp == NULL) || (argc < 0) || (argc > NCARGS) + if ((ucp == NULL) || (argc < 0) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { /* invalidate context */ Modified: user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in int i, regargs, stackargs; /* Sanity checks */ - if ((ucp == NULL) || (argc < 0) || (argc > NCARGS) + if ((ucp == NULL) || (argc < 0) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { /* invalidate context */ Modified: user/markj/netdump/lib/libc/stdlib/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/stdlib/Makefile.inc Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/stdlib/Makefile.inc Thu Feb 1 16:43:48 2018 (r328682) @@ -15,7 +15,7 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. radixsort.c rand.c \ random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ - strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ + strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c # Work around an issue on case-insensitive file systems. Modified: user/markj/netdump/lib/libc/stdlib/strtol.c ============================================================================== --- user/markj/netdump/lib/libc/stdlib/strtol.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/stdlib/strtol.c Thu Feb 1 16:43:48 2018 (r328682) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include "xlocale_private.h" - /* * Convert a string to a long integer. * @@ -152,9 +151,4 @@ long strtol(const char * __restrict nptr, char ** __restrict endptr, int base) { return strtol_l(nptr, endptr, base, __get_locale()); -} -long double -strtold(const char * __restrict nptr, char ** __restrict endptr) -{ - return strtold_l(nptr, endptr, __get_locale()); } Copied: user/markj/netdump/lib/libc/stdlib/strtold.c (from r328681, head/lib/libc/stdlib/strtold.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/stdlib/strtold.c Thu Feb 1 16:43:48 2018 (r328682, copy of r328681, head/lib/libc/stdlib/strtold.c) @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "xlocale_private.h" + +long double +strtold(const char * __restrict nptr, char ** __restrict endptr) +{ + + return strtold_l(nptr, endptr, __get_locale()); +} Modified: user/markj/netdump/lib/libc/tests/gen/Makefile ============================================================================== --- user/markj/netdump/lib/libc/tests/gen/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/tests/gen/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -12,6 +12,7 @@ ATF_TESTS_C+= fpclassify2_test ATF_TESTS_C+= ftw_test ATF_TESTS_C+= getmntinfo_test ATF_TESTS_C+= glob2_test +ATF_TESTS_C+= makecontext_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test Copied: user/markj/netdump/lib/libc/tests/gen/makecontext_test.c (from r328681, head/lib/libc/tests/gen/makecontext_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/tests/gen/makecontext_test.c Thu Feb 1 16:43:48 2018 (r328682, copy of r328681, head/lib/libc/tests/gen/makecontext_test.c) @@ -0,0 +1,189 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +static char uc_stack[16 * 1024]; + +static void +check_1(int arg1) +{ + + ATF_REQUIRE_EQ(arg1, 1); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg1); +ATF_TC_BODY(makecontext_arg1, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_1, 1, 1); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_2(int arg1, int arg2) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg2); +ATF_TC_BODY(makecontext_arg2, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_2, 2, 1, 2); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_3(int arg1, int arg2, int arg3) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg3); +ATF_TC_BODY(makecontext_arg3, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_3, 3, 1, 2, 3); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_4(int arg1, int arg2, int arg3, int arg4) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg4); +ATF_TC_BODY(makecontext_arg4, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_4, 4, 1, 2, 3, 4); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_5(int arg1, int arg2, int arg3, int arg4, int arg5) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); + ATF_REQUIRE_EQ(arg5, 5); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg5); +ATF_TC_BODY(makecontext_arg5, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_5, 5, 1, 2, 3, 4, 5); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_6(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); + ATF_REQUIRE_EQ(arg5, 5); + ATF_REQUIRE_EQ(arg6, 6); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg6); +ATF_TC_BODY(makecontext_arg6, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_6, 6, 1, 2, 3, 4, 5, 6); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, makecontext_arg1); + ATF_TP_ADD_TC(tp, makecontext_arg2); + ATF_TP_ADD_TC(tp, makecontext_arg3); + ATF_TP_ADD_TC(tp, makecontext_arg4); + ATF_TP_ADD_TC(tp, makecontext_arg5); + ATF_TP_ADD_TC(tp, makecontext_arg6); + + return (atf_no_error()); +} Modified: user/markj/netdump/lib/libedit/Makefile ============================================================================== --- user/markj/netdump/lib/libedit/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libedit/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -3,18 +3,19 @@ # $FreeBSD$ PACKAGE=clibs -LIB= edit + SHLIB_MAJOR= 7 SHLIBDIR?= /lib WARNS?= 3 +LIB= edit +LIBADD= ncursesw + OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c -LIBADD= ncursesw - MAN= editline.3 editrc.5 MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 el_init.3 \ @@ -28,25 +29,26 @@ MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 tok_line.3 editline.3 tok_str.3 # For speed and debugging -#SRCS= ${OSRCS} +#SRCS= ${OSRCS} readline.c tokenizer.c history.c # For protection -SRCS= editline.c -SRCS+= tokenizer.c history.c readline.c +SRCS= editline.c readline.c tokenizer.c history.c SRCS+= common.h emacs.h fcns.h help.h vi.h -CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h -INCS= histedit.h - +# Widechar SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c + +INCS= histedit.h + +CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR #CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH #CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT -SUBDIR= edit/readline - AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c + +SUBDIR= edit/readline .for hdr in vi emacs common ${hdr}.h: ${hdr}.c makelist Modified: user/markj/netdump/lib/libgcc_s/Makefile ============================================================================== --- user/markj/netdump/lib/libgcc_s/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libgcc_s/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -28,12 +28,18 @@ SRCS+= s_fabsf.c SRCS+= s_fabsl.c SRCS+= s_fmax.c SRCS+= s_fmaxf.c -SRCS+= s_fmaxl.c SRCS+= s_logb.c SRCS+= s_logbf.c -SRCS+= s_logbl.c SRCS+= s_scalbn.c SRCS+= s_scalbnf.c + +# Don't include long double routines on architectures where long double +# is the same size as double. +.if ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "arm" && \ + ${MACHINE_CPUARCH} != "powerpc" +SRCS+= s_fmaxl.c +SRCS+= s_logbl.c SRCS+= s_scalbnl.c +.endif .include Modified: user/markj/netdump/release/scripts/make-manifest.sh ============================================================================== --- user/markj/netdump/release/scripts/make-manifest.sh Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/release/scripts/make-manifest.sh Thu Feb 1 16:43:48 2018 (r328682) @@ -32,6 +32,7 @@ desc_tests="${tests}" default_doc=off default_src=off +default_ports=off default_tests=off default_base_dbg=off default_lib32_dbg=off Modified: user/markj/netdump/share/man/man4/usb_template.4 ============================================================================== --- user/markj/netdump/share/man/man4/usb_template.4 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/share/man/man4/usb_template.4 Thu Feb 1 16:43:48 2018 (r328682) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 8, 2016 +.Dd January 30, 2018 .Dt USB_TEMPLATE 4 .Os . @@ -66,9 +66,11 @@ or by using the .Xr usbconfig 8 .Cm set_template subcommand. -The sysctl values can be changed at any time, but will not -have any effect until the USB device has been re-enumerated. -. +Changing the +.Va hw.usb.template +sysctl triggers reenumeration by the USB host; changes to other sysctls +may not be visible to the host until reenumeration is performed. +.Pp Available templates are: .Bl -column -offset 3n "Value" .It Em Value Ta Em Description @@ -93,6 +95,7 @@ tunables: .Bl -tag -width indent .It Va hw.usb.template Currently selected template. +Set to -1 to make the device disappear from the USB host point of view. .It Va hw.usb.templates.N Configuration for template number .Va N . Modified: user/markj/netdump/share/man/man7/arch.7 ============================================================================== --- user/markj/netdump/share/man/man7/arch.7 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/share/man/man7/arch.7 Thu Feb 1 16:43:48 2018 (r328682) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2017 +.Dd January 31, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -95,6 +95,7 @@ architectures, the final release. .It arm Ta 6.0 .It armeb Ta 8.0 .It armv6 Ta 10.0 +.It armv7 Ta 12.0 .It arm64 Ta 11.0 .It ia64 Ta 5.0 Ta 10.x .It i386 Ta 1.0 @@ -164,6 +165,8 @@ Examples are: .Dv arm64 currently does not support execution of .Dv armv6 +or +.Dv armv7 binaries, even if the CPU implements .Dv AArch32 execution state. @@ -220,6 +223,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta little Ta unsigned .It armeb Ta big Ta unsigned .It armv6 Ta little Ta unsigned +.It armv7 Ta little Ta unsigned .It arm64 Ta little Ta unsigned .It i386 Ta little Ta signed .It mips Ta big Ta signed @@ -245,6 +249,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta 4K .It armeb Ta 4K .It armv6 Ta 4K, 1M +.It armv7 Ta 4K, 1M .It arm64 Ta 4K, 2M, 1G .It i386 Ta 4K, 2M (PAE), 4M .It mips Ta 4K @@ -270,6 +275,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta soft Ta soft, double precision .It armeb Ta soft Ta soft, double precision .It armv6 Ta hard(1) Ta hard, double precision +.It armv7 Ta hard(1) Ta hard, double precision .It arm64 Ta hard Ta soft, quad precision .It i386 Ta hard Ta hard, 80 bit .It mips Ta soft Ta identical to double @@ -322,6 +328,7 @@ Architecture-specific macros: .It arm Ta Dv __arm__ .It armeb Ta Dv __arm__ .It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6 +.It armv7 Ta Dv __arm__, Dv __ARM_ARCH >= 7 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Thu Feb 1 16:48:27 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D80EDD4FA for ; Thu, 1 Feb 2018 16:48:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B72B676DCD; Thu, 1 Feb 2018 16:48:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22D17981; Thu, 1 Feb 2018 16:48:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11GmQQp026476; Thu, 1 Feb 2018 16:48:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11GmQU6026469; Thu, 1 Feb 2018 16:48:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802011648.w11GmQU6026469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Feb 2018 16:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328686 - in user/markj/netdump/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips sparc64/sparc64 X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips sparc64/sparc64 X-SVN-Commit-Revision: 328686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 16:48:27 -0000 Author: markj Date: Thu Feb 1 16:48:25 2018 New Revision: 328686 URL: https://svnweb.freebsd.org/changeset/base/328686 Log: Print messages after calling dump_start(). This allows dump_start() to print messages without mangling output from the dump progress tracker. Modified: user/markj/netdump/sys/amd64/amd64/minidump_machdep.c user/markj/netdump/sys/arm/arm/minidump_machdep.c user/markj/netdump/sys/arm64/arm64/minidump_machdep.c user/markj/netdump/sys/i386/i386/minidump_machdep.c user/markj/netdump/sys/kern/kern_dump.c user/markj/netdump/sys/mips/mips/minidump_machdep.c user/markj/netdump/sys/sparc64/sparc64/dump_machdep.c Modified: user/markj/netdump/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- user/markj/netdump/sys/amd64/amd64/minidump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/amd64/amd64/minidump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -329,12 +329,12 @@ minidumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize); - printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, - ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump my header */ bzero(&fakepd, sizeof(fakepd)); Modified: user/markj/netdump/sys/arm/arm/minidump_machdep.c ============================================================================== --- user/markj/netdump/sys/arm/arm/minidump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/arm/arm/minidump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -246,12 +246,12 @@ minidumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_ARM_VERSION, dumpsize); - printf("Physical memory: %u MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Physical memory: %u MB\n", ptoa((uintmax_t)physmem) / 1048576); + printf("Dumping %llu MB:", (long long)dumpsize >> 20); /* Dump my header */ bzero(dumpbuf, sizeof(dumpbuf)); Modified: user/markj/netdump/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- user/markj/netdump/sys/arm64/arm64/minidump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/arm64/arm64/minidump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -289,12 +289,12 @@ minidumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_AARCH64_VERSION, dumpsize); - printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, - ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump my header */ bzero(&tmpbuffer, sizeof(tmpbuffer)); Modified: user/markj/netdump/sys/i386/i386/minidump_machdep.c ============================================================================== --- user/markj/netdump/sys/i386/i386/minidump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/i386/i386/minidump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -254,12 +254,12 @@ minidumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); + printf("Dumping %llu MB:", (long long)dumpsize >> 20); /* Dump my header */ bzero(&fakept, sizeof(fakept)); Modified: user/markj/netdump/sys/kern/kern_dump.c ============================================================================== --- user/markj/netdump/sys/kern/kern_dump.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/kern/kern_dump.c Thu Feb 1 16:48:25 2018 (r328686) @@ -330,12 +330,12 @@ dumpsys_generic(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_ARCH_VERSION, dumpsize); - printf("Dumping %ju MB (%d chunks)\n", (uintmax_t)dumpsize >> 20, - ehdr.e_phnum - DUMPSYS_NUM_AUX_HDRS); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Dumping %ju MB (%d chunks)\n", (uintmax_t)dumpsize >> 20, + ehdr.e_phnum - DUMPSYS_NUM_AUX_HDRS); /* Dump ELF header */ error = dumpsys_buf_write(di, (char*)&ehdr, sizeof(ehdr)); Modified: user/markj/netdump/sys/mips/mips/minidump_machdep.c ============================================================================== --- user/markj/netdump/sys/mips/mips/minidump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/mips/mips/minidump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -264,12 +264,12 @@ minidumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_MIPS_VERSION, dumpsize); - printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, - ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump my header */ bzero(tmpbuffer, sizeof(tmpbuffer)); Modified: user/markj/netdump/sys/sparc64/sparc64/dump_machdep.c ============================================================================== --- user/markj/netdump/sys/sparc64/sparc64/dump_machdep.c Thu Feb 1 16:45:44 2018 (r328685) +++ user/markj/netdump/sys/sparc64/sparc64/dump_machdep.c Thu Feb 1 16:48:25 2018 (r328686) @@ -98,11 +98,11 @@ dumpsys(struct dumperinfo *di) dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size); - printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); - error = dump_start(di, &kdh); if (error != 0) goto fail; + + printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); /* Dump the private header. */ hdr.dh_hdr_size = hdrsize; From owner-svn-src-user@freebsd.org Thu Feb 1 17:16:17 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53D5EDF250 for ; Thu, 1 Feb 2018 17:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68135788EB; Thu, 1 Feb 2018 17:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 631547E6C; Thu, 1 Feb 2018 17:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11HGHjk042744; Thu, 1 Feb 2018 17:16:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11HGHdq042743; Thu, 1 Feb 2018 17:16:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802011716.w11HGHdq042743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Feb 2018 17:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328693 - user/markj/netdump/sys/dev/virtio/network X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: user/markj/netdump/sys/dev/virtio/network X-SVN-Commit-Revision: 328693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 17:16:17 -0000 Author: markj Date: Thu Feb 1 17:16:17 2018 New Revision: 328693 URL: https://svnweb.freebsd.org/changeset/base/328693 Log: Fix vtnet tx header preallocation. Modified: user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Modified: user/markj/netdump/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Thu Feb 1 16:53:08 2018 (r328692) +++ user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Thu Feb 1 17:16:17 2018 (r328693) @@ -4003,7 +4003,8 @@ vtnet_netdump_init(struct ifnet *ifp, int *nmbufp, int * XXX add a separate zone like we do for mbufs? otherwise we may alloc * buckets */ - uma_zone_reserve_kva(vtnet_tx_header_zone, NETDUMP_MAX_IN_FLIGHT * 2); + uma_zone_reserve(vtnet_tx_header_zone, NETDUMP_MAX_IN_FLIGHT * 2); + uma_prealloc(vtnet_tx_header_zone, NETDUMP_MAX_IN_FLIGHT * 2); } static void From owner-svn-src-user@freebsd.org Thu Feb 1 21:37:49 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D03BDECBD9A for ; Thu, 1 Feb 2018 21:37:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8554F68A66; Thu, 1 Feb 2018 21:37:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 804A7129F9; Thu, 1 Feb 2018 21:37:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11Lbm9R089606; Thu, 1 Feb 2018 21:37:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11LbmjK089602; Thu, 1 Feb 2018 21:37:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802012137.w11LbmjK089602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Feb 2018 21:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328752 - in user/markj/netdump/sys: geom kern netinet/netdump sys X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump/sys: geom kern netinet/netdump sys X-SVN-Commit-Revision: 328752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 21:37:49 -0000 Author: markj Date: Thu Feb 1 21:37:47 2018 New Revision: 328752 URL: https://svnweb.freebsd.org/changeset/base/328752 Log: Try to clean up integration with the generic kerneldump code. Modified: user/markj/netdump/sys/geom/geom_dev.c user/markj/netdump/sys/kern/kern_shutdown.c user/markj/netdump/sys/netinet/netdump/netdump_client.c user/markj/netdump/sys/sys/conf.h Modified: user/markj/netdump/sys/geom/geom_dev.c ============================================================================== --- user/markj/netdump/sys/geom/geom_dev.c Thu Feb 1 21:34:50 2018 (r328751) +++ user/markj/netdump/sys/geom/geom_dev.c Thu Feb 1 21:37:47 2018 (r328752) @@ -144,6 +144,7 @@ g_dev_setdumpdev(struct cdev *dev, struct diocskerneld cp = dev->si_drv2; len = sizeof(kd); + memset(&kd, 0, len); kd.offset = 0; kd.length = OFF_MAX; error = g_io_getattr("GEOM::kerneldump", cp, &len, &kd); Modified: user/markj/netdump/sys/kern/kern_shutdown.c ============================================================================== --- user/markj/netdump/sys/kern/kern_shutdown.c Thu Feb 1 21:34:50 2018 (r328751) +++ user/markj/netdump/sys/kern/kern_shutdown.c Thu Feb 1 21:37:47 2018 (r328752) @@ -1176,18 +1176,6 @@ dump_encrypted_write(struct dumperinfo *di, void *virt return (0); } - -static int -dump_write_key(struct dumperinfo *di, off_t offset) -{ - struct kerneldumpcrypto *kdc; - - kdc = di->kdcrypto; - if (kdc == NULL) - return (0); - return (dump_write(di, kdc->kdc_dumpkey, 0, offset, - kdc->kdc_dumpkeysize)); -} #endif /* EKCD */ static int @@ -1221,20 +1209,42 @@ kerneldumpcomp_write_cb(void *base, size_t length, off } /* - * Write a kerneldumpheader at the specified offset. The header structure is 512 - * bytes in size, but we must pad to the device sector size. + * Write kernel dump headers at the beginning and end of the dump extent. + * Write the kernel dump encryption key after the leading header if we were + * configured to do so. */ static int -dump_write_header(struct dumperinfo *di, struct kerneldumpheader *kdh, - off_t offset) +dump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh) { - void *buf; +#ifdef EKCD + struct kerneldumpcrypto *kdc; +#endif + void *buf, *key; size_t hdrsz; + uint64_t extent; + uint32_t keysize; + int error; hdrsz = sizeof(*kdh); if (hdrsz > di->blocksize) return (ENOMEM); +#ifdef EKCD + kdc = di->kdcrypto; + key = kdc->kdc_dumpkey; + keysize = kerneldumpcrypto_dumpkeysize(kdc); +#else + key = NULL; + keysize = 0; +#endif + + /* + * If the dump device has special handling for headers, let it take care + * of writing them out. + */ + if (di->dumper_hdr != NULL) + return (di->dumper_hdr(di, kdh, key, keysize)); + if (hdrsz == di->blocksize) buf = kdh; else { @@ -1243,7 +1253,24 @@ dump_write_header(struct dumperinfo *di, struct kernel memcpy(buf, kdh, hdrsz); } - return (dump_write(di, buf, 0, offset, di->blocksize)); + extent = dtoh64(kdh->dumpextent); +#ifdef EKCD + if (kdc != NULL) { + error = dump_write(di, kdc->kdc_dumpkey, 0, + di->mediaoffset + di->mediasize - di->blocksize - extent - + keysize, keysize); + if (error != 0) + return (error); + } +#endif + + error = dump_write(di, buf, 0, + di->mediaoffset + di->mediasize - 2 * di->blocksize - extent - + keysize, di->blocksize); + if (error == 0) + error = dump_write(di, buf, 0, di->mediaoffset + di->mediasize - + di->blocksize, di->blocksize); + return (error); } /* @@ -1268,11 +1295,14 @@ dump_write_header(struct dumperinfo *di, struct kernel * Uncompressed dumps will use the entire extent, but compressed dumps typically * will not. The true length of the dump is recorded in the leading and trailing * headers once the dump has been completed. + * + * The dump device may provide a callback, in which case it will initialize + * dumpoff and take care of laying out the headers. */ int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh) { - uint64_t dumpextent; + uint64_t dumpextent, span; uint32_t keysize; int error; @@ -1282,20 +1312,20 @@ dump_start(struct dumperinfo *di, struct kerneldumphea return (error); keysize = kerneldumpcrypto_dumpkeysize(di->kdcrypto); #else + error = 0; keysize = 0; #endif - if (di->dumper_init != NULL) { - error = di->dumper_init(di->priv); - if (error != 0) - return (error); - } + if (di->dumper_start != NULL) { + error = di->dumper_start(di); + } else { + dumpextent = dtoh64(kdh->dumpextent); + span = SIZEOF_METADATA + dumpextent + 2 * di->blocksize + + keysize; + if (di->mediasize < span) { + if (di->kdcomp == NULL) + return (E2BIG); - dumpextent = dtoh64(kdh->dumpextent); - if (di->mediasize > 0 && - di->mediasize < SIZEOF_METADATA + dumpextent + 2 * di->blocksize + - keysize) { - if (di->kdcomp != NULL) { /* * We don't yet know how much space the compressed dump * will occupy, so try to use the whole swap partition @@ -1304,22 +1334,16 @@ dump_start(struct dumperinfo *di, struct kerneldumphea * be enouch, the bounds checking in dump_write() * will catch us and cause the dump to fail. */ - dumpextent = di->mediasize - SIZEOF_METADATA - - 2 * di->blocksize - keysize; + dumpextent = di->mediasize - span + dumpextent; kdh->dumpextent = htod64(dumpextent); - } else - return (E2BIG); - } + } - /* The offset at which to begin writing the dump. */ - /* XXXMJ ugly */ - if (di->mediasize == 0) - di->dumpoff = di->blocksize; - else + /* The offset at which to begin writing the dump. */ di->dumpoff = di->mediaoffset + di->mediasize - di->blocksize - dumpextent; + } - return (0); + return (error); } static int @@ -1387,17 +1411,10 @@ int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh) { uint64_t extent; - uint32_t keysize; int error; extent = dtoh64(kdh->dumpextent); -#ifdef EKCD - keysize = kerneldumpcrypto_dumpkeysize(di->kdcrypto); -#else - keysize = 0; -#endif - if (di->kdcomp != NULL) { error = compressor_flush(di->kdcomp->kdc_stream); if (error == EAGAIN) { @@ -1425,33 +1442,10 @@ dump_finish(struct dumperinfo *di, struct kerneldumphe /* * Write kerneldump headers at the beginning and end of the dump extent. * Write the key after the leading header. - * XXXMJ quite ugly */ - if (di->mediasize == 0) - error = dump_write_header(di, kdh, 0); - else - error = dump_write_header(di, kdh, - di->mediaoffset + di->mediasize - 2 * di->blocksize - extent - - keysize); + error = dump_write_headers(di, kdh); if (error != 0) return (error); - -#ifdef EKCD - error = dump_write_key(di, - di->mediaoffset + di->mediasize - di->blocksize - extent - keysize); - if (error != 0) - return (error); -#endif - - /* XXX comment */ - if (di->dumper_fini != NULL) - di->dumper_fini(di->priv); - else { - error = dump_write_header(di, kdh, - di->mediaoffset + di->mediasize - di->blocksize); - if (error != 0) - return (error); - } (void)dump_write(di, NULL, 0, 0, 0); return (0); Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump_client.c Thu Feb 1 21:34:50 2018 (r328751) +++ user/markj/netdump/sys/netinet/netdump/netdump_client.c Thu Feb 1 21:37:47 2018 (r328752) @@ -104,10 +104,8 @@ static int netdump_dumper(void *priv __unused, void * vm_offset_t physical __unused, off_t offset, size_t length); static int netdump_ether_output(struct mbuf *m, struct ifnet *ifp, struct ether_addr dst, u_short etype); -static void netdump_fini(void *priv __unused); static void netdump_handle_arp(struct mbuf **mb); static void netdump_handle_ip(struct mbuf **mb); -static int netdump_init(void *priv __unused); static int netdump_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, int flags __unused, struct thread *td); static int netdump_modevent(module_t mod, int type, void *priv); @@ -116,6 +114,7 @@ static void netdump_pkt_in(struct ifnet *ifp, struct static int netdump_send(uint32_t type, off_t offset, unsigned char *data, uint32_t datalen); static int netdump_send_arp(in_addr_t dst); +static int netdump_start(struct dumperinfo *di); static int netdump_udp_output(struct mbuf *m); /* Must be at least as big as the chunks dumpsys() gives us. */ @@ -343,15 +342,15 @@ static int netdump_arp_gw(void) { in_addr_t dst; - int err, polls, retries; + int error, polls, retries; dst = nd_server.s_addr; restart: for (retries = 0; retries < nd_arp_retries && have_gw_mac == 0; retries++) { - err = netdump_send_arp(dst); - if (err != 0) - return (err); + error = netdump_send_arp(dst); + if (error != 0) + return (error); for (polls = 0; polls < nd_polls && have_gw_mac == 0; polls++) { netdump_network_poll(); DELAY(500); @@ -893,34 +892,29 @@ static int netdump_dumper(void *priv __unused, void *virtual, vm_offset_t physical __unused, off_t offset, size_t length) { - int err, msgtype; + int error; NETDDEBUGV("netdump_dumper(NULL, %p, NULL, %ju, %zu)\n", virtual, (uintmax_t)offset, length); - if (virtual == NULL) - /* XXX why don't we need this in onefs? */ + if (virtual == NULL) { + if (dump_failed != 0) + printf("failed to dump the kernel core\n"); + else if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0) + printf("failed to close the transaction\n"); + else + printf("\nnetdump finished.\n"); + netdump_cleanup(); return (0); + } if (length > sizeof(nd_buf)) return (ENOSPC); - /* - * The first write (at offset 0) is the kernel dump header. Flag it - * for the server to treat specially. - * XXX: This doesn't strip out the footer KDH, although it - * should not hurt anything. - */ - msgtype = NETDUMP_VMCORE; - if (offset == 0 && length > 0) { - length = sizeof(struct kerneldumpheader); - msgtype = NETDUMP_KDH; - } else if (offset > 0) - offset -= NETDUMP_DATASIZE; /* di->blocksize */ memmove(nd_buf, virtual, length); - err = netdump_send(msgtype, offset, nd_buf, length); - if (err != 0) { + error = netdump_send(NETDUMP_VMCORE, offset, nd_buf, length); + if (error != 0) { dump_failed = 1; - return (err); + return (error); } return (0); } @@ -928,8 +922,8 @@ netdump_dumper(void *priv __unused, void *virtual, /* * Perform any initalization needed prior to transmitting the kernel core. */ -int -netdump_init(void *priv __unused) +static int +netdump_start(struct dumperinfo *di) { char *path; char buf[INET_ADDRSTRLEN]; @@ -945,14 +939,17 @@ netdump_init(void *priv __unused) MPASS(nd_ifp != NULL); if (nd_server.s_addr == INADDR_ANY) { - printf("netdump_init: can't netdump; no server IP given\n"); + printf("netdump_start: can't netdump; no server IP given\n"); return (EINVAL); } if (nd_client.s_addr == INADDR_ANY) { - printf("netdump_init: can't netdump; no client IP given\n"); + printf("netdump_start: can't netdump; no client IP given\n"); return (EINVAL); } + /* We start dumping at offset 0. */ + di->dumpoff = 0; + nd_seqno = 1; /* @@ -1003,20 +1000,18 @@ trig_abort: return (error); } -/* - * Completion routine for a netdump. - */ -static void -netdump_fini(void *priv __unused) +static int +netdump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh, + void *key, uint32_t keysize) { - if (dump_failed != 0) - printf("failed to dump the kernel core\n"); - else if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0) - printf("failed to close the transaction\n"); - else - printf("\nnetdump finished.\n"); - netdump_cleanup(); + if (sizeof(*kdh) + keysize > sizeof(nd_buf)) + return (EINVAL); + + memcpy(nd_buf, kdh, sizeof(*kdh)); + if (key != NULL) + memcpy(nd_buf + sizeof(*kdh), key, keysize); + return (netdump_send(NETDUMP_KDH, 0, nd_buf, sizeof(*kdh) + keysize)); } /* @@ -1148,9 +1143,9 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c break; } - dumper.dumper_init = netdump_init; + dumper.dumper_start = netdump_start; + dumper.dumper_hdr = netdump_write_headers; dumper.dumper = netdump_dumper; - dumper.dumper_fini = netdump_fini; dumper.priv = NULL; dumper.blocksize = NETDUMP_DATASIZE; dumper.maxiosize = MAXDUMPPGS * PAGE_SIZE; Modified: user/markj/netdump/sys/sys/conf.h ============================================================================== --- user/markj/netdump/sys/sys/conf.h Thu Feb 1 21:34:50 2018 (r328751) +++ user/markj/netdump/sys/sys/conf.h Thu Feb 1 21:37:47 2018 (r328752) @@ -101,6 +101,8 @@ struct cdev { struct bio; struct buf; +struct dumperinfo; +struct kerneldumpheader; struct thread; struct uio; struct knote; @@ -125,14 +127,15 @@ typedef int d_mmap_single_t(struct cdev *cdev, vm_ooff vm_size_t size, struct vm_object **object, int nprot); typedef void d_purge_t(struct cdev *dev); -typedef int dumper_init_t(void *priv); -typedef void dumper_fini_t(void *priv); typedef int dumper_t( void *_priv, /* Private to the driver. */ void *_virtual, /* Virtual (mapped) address. */ vm_offset_t _physical, /* Physical address of virtual. */ off_t _offset, /* Byte-offset to write at. */ size_t _length); /* Number of bytes to dump. */ +typedef int dumper_start_t(struct dumperinfo *di); +typedef int dumper_hdr_t(struct dumperinfo *di, struct kerneldumpheader *kdh, + void *key, uint32_t keylen); #endif /* _KERNEL */ @@ -333,9 +336,9 @@ struct kerneldumpcrypto; struct kerneldumpheader; struct dumperinfo { - dumper_init_t *dumper_init; /* Dump device init callback. */ dumper_t *dumper; /* Dumping function. */ - dumper_fini_t *dumper_fini; /* Dump device completion callback. */ + dumper_start_t *dumper_start; /* Dumper callback for dump_start(). */ + dumper_hdr_t *dumper_hdr; /* Dumper callback for writing headers. */ void *priv; /* Private parts. */ u_int blocksize; /* Size of block in bytes. */ u_int maxiosize; /* Max size allowed for an individual I/O */ From owner-svn-src-user@freebsd.org Thu Feb 1 23:47:52 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50D82ED48C9 for ; Thu, 1 Feb 2018 23:47:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030A76E55C; Thu, 1 Feb 2018 23:47:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F23A713F8E; Thu, 1 Feb 2018 23:47:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11NlpJN056332; Thu, 1 Feb 2018 23:47:51 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11NlpZY056331; Thu, 1 Feb 2018 23:47:51 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802012347.w11NlpZY056331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 1 Feb 2018 23:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328759 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 23:47:52 -0000 Author: jeff Date: Thu Feb 1 23:47:51 2018 New Revision: 328759 URL: https://svnweb.freebsd.org/changeset/base/328759 Log: Implement another variant of per-cpu free page caching derived from markj's patch. Modified: user/jeff/numa/sys/vm/vm_page.c Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Thu Feb 1 22:01:53 2018 (r328758) +++ user/jeff/numa/sys/vm/vm_page.c Thu Feb 1 23:47:51 2018 (r328759) @@ -182,6 +182,9 @@ static int vm_page_reclaim_run(int req_class, int doma static void vm_domain_free_wakeup(struct vm_domain *); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); +static int vm_page_import(void *arg, void **store, int cnt, int domain, + int flags); +static void vm_page_release(void *arg, void **store, int cnt); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -195,6 +198,27 @@ vm_page_init(void *dummy) VM_ALLOC_NORMAL | VM_ALLOC_WIRED); } +/* + * The cache page zone is initialized later since we need to be able to allocate + * pages before UMA is fully initialized. + */ +static void +vm_page_init_cache_zones(void *dummy __unused) +{ + struct vm_domain *vmd; + int i; + + for (i = 0; i < vm_ndomains; i++) { + vmd = VM_DOMAIN(i); + vmd->vmd_pgcache = uma_zcache_create("vm pgcache", + sizeof(struct vm_page), NULL, NULL, NULL, NULL, + vm_page_import, vm_page_release, vmd, + /* UMA_ZONE_NOBUCKETCACHE |*/ + UMA_ZONE_MAXBUCKET | UMA_ZONE_VM); + } +} +SYSINIT(vm_page2, SI_SUB_VM_CONF, SI_ORDER_ANY, vm_page_init_cache_zones, NULL); + /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */ #if PAGE_SIZE == 32768 #ifdef CTASSERT @@ -1709,6 +1733,12 @@ again: } #endif vmd = VM_DOMAIN(domain); + if (object != NULL && !vm_object_reserv(object) && + vmd->vmd_pgcache != NULL) { + m = uma_zalloc(vmd->vmd_pgcache, M_NOWAIT); + if (m != NULL) + goto found; + } vm_domain_free_lock(vmd); if (vm_domain_available(vmd, req, 1)) { /* @@ -1757,9 +1787,7 @@ again: */ if (vm_paging_needed(vmd, free_count)) pagedaemon_wakeup(vmd->vmd_domain); -#if VM_NRESERVLEVEL > 0 found: -#endif vm_page_alloc_check(m); /* @@ -2131,6 +2159,51 @@ again: if (vm_paging_needed(vmd, free_count)) pagedaemon_wakeup(domain); return (m); +} + +static int +vm_page_import(void *arg, void **store, int cnt, int domain, int flags) +{ + struct vm_domain *vmd; + vm_page_t m; + int i; + + vmd = arg; + domain = vmd->vmd_domain; + vm_domain_free_lock(vmd); + for (i = 0; i < cnt; i++) { + m = vm_phys_alloc_pages(domain, VM_FREELIST_DEFAULT, 0); + if (m == NULL) + break; + store[i] = m; + } + if (i != 0) + vm_domain_freecnt_adj(vmd, -i); + vm_domain_free_unlock(vmd); + + return (i); +} + +static void +vm_page_release(void *arg, void **store, int cnt) +{ + struct vm_domain *vmd; + vm_page_t m; + int i; + + vmd = arg; + vm_domain_free_lock(vmd); + for (i = 0; i < cnt; i++) { + m = (vm_page_t)store[i]; +#if VM_NRESERVLEVEL > 0 + KASSERT(vm_reserv_free_page(m) == false, + ("vm_page_release: Cached page belonged to reservation.")); +#endif + vm_phys_free_pages(m, 0); + } + vm_domain_freecnt_adj(vmd, i); + vm_domain_free_wakeup(vmd); + vm_domain_free_unlock(vmd); } #define VPSC_ANY 0 /* No restrictions. */ From owner-svn-src-user@freebsd.org Thu Feb 1 23:48:48 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26E36ED4A0A for ; Thu, 1 Feb 2018 23:48:48 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD45B6E779; Thu, 1 Feb 2018 23:48:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B83DA13F90; Thu, 1 Feb 2018 23:48:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11NmlX0056420; Thu, 1 Feb 2018 23:48:47 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11Nmlal056419; Thu, 1 Feb 2018 23:48:47 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802012348.w11Nmlal056419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 1 Feb 2018 23:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328760 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 23:48:48 -0000 Author: jeff Date: Thu Feb 1 23:48:47 2018 New Revision: 328760 URL: https://svnweb.freebsd.org/changeset/base/328760 Log: Add missing bit of page cache Modified: user/jeff/numa/sys/vm/vm_pagequeue.h Modified: user/jeff/numa/sys/vm/vm_pagequeue.h ============================================================================== --- user/jeff/numa/sys/vm/vm_pagequeue.h Thu Feb 1 23:47:51 2018 (r328759) +++ user/jeff/numa/sys/vm/vm_pagequeue.h Thu Feb 1 23:48:47 2018 (r328760) @@ -73,10 +73,12 @@ struct vm_pagequeue { const char * const pq_name; } __aligned(CACHE_LINE_SIZE); +#include struct vm_domain { struct vm_pagequeue vmd_pagequeues[PQ_COUNT]; struct mtx_padalign vmd_free_mtx; + uma_zone_t vmd_pgcache; struct vmem *vmd_kernel_arena; u_int vmd_domain; /* Domain number. */ u_int vmd_page_count; From owner-svn-src-user@freebsd.org Thu Feb 1 23:49:19 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B16ED4ABB for ; Thu, 1 Feb 2018 23:49:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3C46E881; Thu, 1 Feb 2018 23:49:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 770E213F91; Thu, 1 Feb 2018 23:49:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11NnIwv056486; Thu, 1 Feb 2018 23:49:18 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11NnHWM056482; Thu, 1 Feb 2018 23:49:17 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802012349.w11NnHWM056482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 1 Feb 2018 23:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328761 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 23:49:19 -0000 Author: jeff Date: Thu Feb 1 23:49:17 2018 New Revision: 328761 URL: https://svnweb.freebsd.org/changeset/base/328761 Log: Implement a prototype of pageout free page batching. Modified: user/jeff/numa/sys/vm/vm_object.c user/jeff/numa/sys/vm/vm_object.h user/jeff/numa/sys/vm/vm_pageout.c user/jeff/numa/sys/vm/vnode_pager.c Modified: user/jeff/numa/sys/vm/vm_object.c ============================================================================== --- user/jeff/numa/sys/vm/vm_object.c Thu Feb 1 23:48:47 2018 (r328760) +++ user/jeff/numa/sys/vm/vm_object.c Thu Feb 1 23:49:17 2018 (r328761) @@ -282,6 +282,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, object->handle = NULL; object->backing_object = NULL; object->backing_object_offset = (vm_ooffset_t) 0; + object->iosize = PAGE_SIZE; #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif Modified: user/jeff/numa/sys/vm/vm_object.h ============================================================================== --- user/jeff/numa/sys/vm/vm_object.h Thu Feb 1 23:48:47 2018 (r328760) +++ user/jeff/numa/sys/vm/vm_object.h Thu Feb 1 23:49:17 2018 (r328761) @@ -111,6 +111,7 @@ struct vm_object { objtype_t type; /* type of pager */ u_short flags; /* see below */ u_short pg_color; /* (c) color of first page in obj */ + u_int iosize; /* (c) Natural I/O size in bytes. */ u_int paging_in_progress; /* Paging (in or out) so don't collapse or destroy */ int resident_page_count; /* number of resident pages */ struct vm_object *backing_object; /* object that I'm a shadow of */ Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Thu Feb 1 23:48:47 2018 (r328760) +++ user/jeff/numa/sys/vm/vm_pageout.c Thu Feb 1 23:49:17 2018 (r328761) @@ -1092,6 +1092,83 @@ dolaundry: } } +static int +vm_pageout_free_pages(vm_object_t object, vm_page_t m) +{ + vm_page_t p, pp; + struct mtx *mtx; + struct pglist pgl; + vm_pindex_t start; + int pcount, count; + + pcount = MAX(object->iosize / PAGE_SIZE, 1); + if (pcount == 1) { + vm_page_free(m); + vm_page_unlock(m); + VM_OBJECT_WUNLOCK(object); + count = 1; + goto out; + } + TAILQ_INIT(&pgl); + count = 0; + + /* Find the first page in the block. */ + start = m->pindex - (m->pindex % pcount); + for (p = m; p->pindex > start && (pp = vm_page_prev(p)) != NULL; + p = pp); + + /* Free the original page so we don't validate it twice. */ + if (p == m) + p = vm_page_next(m); + if (vm_page_free_prep(m, false)) { + m->flags &= ~PG_ZERO; + TAILQ_INSERT_TAIL(&pgl, m, listq); + count++; + } + + /* Iterate through the block range and free compatible pages. */ + mtx = vm_page_lockptr(m); + for ( ; p != NULL && p->pindex < start + pcount; p = pp) { + pp = TAILQ_NEXT(p, listq); + if (mtx != vm_page_lockptr(p)) { + mtx_unlock(mtx); + mtx = vm_page_lockptr(p); + mtx_lock(mtx); + } + if (p->hold_count || vm_page_busied(p) || + p->queue != PQ_INACTIVE) + continue; + if (p->valid == 0) + goto free_page; + if ((p->aflags & PGA_REFERENCED) != 0) + continue; + if (object->ref_count != 0) { + if (pmap_ts_referenced(p)) { + vm_page_aflag_set(p, PGA_REFERENCED); + continue; + } + vm_page_test_dirty(p); + if (p->dirty == 0) + pmap_remove_all(p); + } + if (p->dirty) + continue; +free_page: + if (vm_page_free_prep(p, false)) { + p->flags &= ~PG_ZERO; + TAILQ_INSERT_TAIL(&pgl, p, listq); + count++; + } + } + mtx_unlock(mtx); + VM_OBJECT_WUNLOCK(object); + vm_page_free_phys_pglist(&pgl); +out: + VM_CNT_ADD(v_dfree, count); + + return (count); +} + /* * vm_pageout_scan does the dirty work for the pageout daemon. * @@ -1310,14 +1387,14 @@ unlock_page: */ if (m->dirty == 0) { free_page: - vm_page_free(m); - VM_CNT_INC(v_dfree); - --page_shortage; + page_shortage -= vm_pageout_free_pages(object, m); + goto lock_queue; } else if ((object->flags & OBJ_DEAD) == 0) vm_page_launder(m); drop_page: vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); +lock_queue: if (!queue_locked) { vm_pagequeue_lock(pq); queue_locked = TRUE; Modified: user/jeff/numa/sys/vm/vnode_pager.c ============================================================================== --- user/jeff/numa/sys/vm/vnode_pager.c Thu Feb 1 23:48:47 2018 (r328760) +++ user/jeff/numa/sys/vm/vnode_pager.c Thu Feb 1 23:49:17 2018 (r328761) @@ -241,6 +241,7 @@ retry: object->un_pager.vnp.vnp_size = size; object->un_pager.vnp.writemappings = 0; + object->iosize = vp->v_mount->mnt_stat.f_iosize; object->handle = handle; VI_LOCK(vp); @@ -760,7 +761,7 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page object = vp->v_object; foff = IDX_TO_OFF(m[0]->pindex); - bsize = vp->v_mount->mnt_stat.f_iosize; + bsize = object->iosize; pagesperblock = bsize / PAGE_SIZE; KASSERT(foff < object->un_pager.vnp.vnp_size, From owner-svn-src-user@freebsd.org Fri Feb 2 12:52:43 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47BC9ED7CA2 for ; Fri, 2 Feb 2018 12:52:43 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F18B26A459; Fri, 2 Feb 2018 12:52:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC8041BFE1; Fri, 2 Feb 2018 12:52:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w12CqgsO053398; Fri, 2 Feb 2018 12:52:42 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w12CqgvL053397; Fri, 2 Feb 2018 12:52:42 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201802021252.w12CqgvL053397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 2 Feb 2018 12:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328775 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 328775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 12:52:43 -0000 Author: pho Date: Fri Feb 2 12:52:42 2018 New Revision: 328775 URL: https://svnweb.freebsd.org/changeset/base/328775 Log: Added a regression test for pageout of a partially dirty page. Obtained from: Tristan Verniquet Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/mmap33.sh (contents, props changed) Added: user/pho/stress2/misc/mmap33.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap33.sh Fri Feb 2 12:52:42 2018 (r328775) @@ -0,0 +1,95 @@ +#!/bin/sh + +# ftruncate+mmap+fsync fails for small maps +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225586 + +# Original test scenario by tris_vern@hotmail.com + +# Fixed in r328773: +# On pageout, in vnode generic pager, for partially dirty page, only +# clear dirty bits for completely invalid blocks. + +. ../default.cfg + +cat > /tmp/mmap33.c < + +#include +#include +#include +#include +#include +#include + +int +main (int argc, char *argv[]) +{ + size_t i, size1, size2; + int fd; + char *data; + char *filename; + char pattern = 0x01; + + if (argc != 4) { + fprintf(stderr, "Usage: %s filename size1 size2\n", argv[0]); + exit(1); + } + + filename = argv[1]; + size1 = atoi(argv[2]); + size2 = atoi(argv[3]); + + fd = open(filename, O_RDWR | O_TRUNC | O_CREAT, 0644); + for (i = 0; i < size1; i++) + write(fd, &pattern, 1); + close(fd); + + fd = open(filename, O_RDWR, 0644); + if (fd == -1) + err(1, "open(%s)", filename); + if (ftruncate(fd, size2) == -1) + err(1, "ftruncate()"); + data = mmap(NULL, size2, PROT_READ|PROT_WRITE,MAP_SHARED, fd, 0); + if (data == MAP_FAILED) + err(1, "mmap()"); + memset(data, 0xFF, size2); + + if (munmap(data, size2) == -1) + err(1, "munmap"); + close(fd); + + return (0); +} +EOF +cc -o /tmp/mmap33 -Wall -Wextra -O2 -g /tmp/mmap33.c || exit 1 +rm /tmp/mmap33.c + +set -e +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart +bsdlabel -w md$mdstart auto +newfs $newfs_flags -n md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +set +e + +file=file +odir=`pwd` +cd $mntpoint +/tmp/mmap33 $file 1024 511 +s=$? +sum1=`md5 < $mntpoint/$file` +[ -f template.core -a $s -eq 0 ] && + { ls -l template.core; mv template.core /tmp; s=1; } +cd $odir +umount $mntpoint +mount /dev/md${mdstart}$part $mntpoint +# This fails for truncate size < 512 +sum2=`md5 < $mntpoint/$file` +[ $sum1 = $sum2 ] || + { s=2; echo "md5 fingerprint differs."; } +umount $mntpoint + +mdconfig -d -u $mdstart +rm /tmp/mmap33 +exit $s From owner-svn-src-user@freebsd.org Fri Feb 2 14:34:01 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BA9EDC5B3 for ; Fri, 2 Feb 2018 14:34:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3250C6DB16; Fri, 2 Feb 2018 14:34:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12E511D018; Fri, 2 Feb 2018 14:34:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w12EY0cp003615; Fri, 2 Feb 2018 14:34:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w12EXvJM003576; Fri, 2 Feb 2018 14:33:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802021433.w12EXvJM003576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Feb 2018 14:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328777 - in user/markj/netdump: contrib/compiler-rt/lib/tsan/rtl contrib/llvm/include/llvm/Analysis contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/GlobalIS... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: contrib/compiler-rt/lib/tsan/rtl contrib/llvm/include/llvm/Analysis contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/GlobalISel contrib/llvm/lib/CodeG... X-SVN-Commit-Revision: 328777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 14:34:02 -0000 Author: markj Date: Fri Feb 2 14:33:57 2018 New Revision: 328777 URL: https://svnweb.freebsd.org/changeset/base/328777 Log: MFH at r328776. Modified: user/markj/netdump/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h user/markj/netdump/contrib/llvm/include/llvm/Analysis/ValueTracking.h user/markj/netdump/contrib/llvm/lib/Analysis/ValueTracking.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/RegAllocFast.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td user/markj/netdump/contrib/llvm/tools/clang/include/clang/Driver/Options.td user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.h user/markj/netdump/lib/clang/include/clang/Basic/Version.inc user/markj/netdump/lib/clang/include/lld/Common/Version.inc user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h user/markj/netdump/lib/libcompiler_rt/Makefile.inc user/markj/netdump/lib/libufs/cgread.3 user/markj/netdump/sbin/fsck_ffs/suj.c user/markj/netdump/share/examples/bhyve/vmrun.sh user/markj/netdump/stand/defs.mk user/markj/netdump/stand/efi/boot1/Makefile user/markj/netdump/stand/efi/fdt/Makefile user/markj/netdump/stand/efi/libefi/Makefile user/markj/netdump/stand/efi/loader/Makefile user/markj/netdump/stand/fdt/Makefile user/markj/netdump/stand/ficl/Makefile user/markj/netdump/stand/geli/Makefile user/markj/netdump/stand/i386/boot0/Makefile user/markj/netdump/stand/i386/btx/btx/Makefile user/markj/netdump/stand/i386/btx/btxldr/Makefile user/markj/netdump/stand/i386/btx/lib/Makefile user/markj/netdump/stand/i386/cdboot/Makefile user/markj/netdump/stand/i386/kgzldr/Makefile user/markj/netdump/stand/i386/libfirewire/Makefile user/markj/netdump/stand/i386/libi386/Makefile user/markj/netdump/stand/i386/loader/Makefile user/markj/netdump/stand/i386/mbr/Makefile user/markj/netdump/stand/i386/pmbr/Makefile user/markj/netdump/stand/libsa/Makefile user/markj/netdump/stand/mips/beri/boot2/Makefile user/markj/netdump/stand/mips/beri/loader/Makefile user/markj/netdump/stand/ofw/libofw/Makefile user/markj/netdump/stand/powerpc/boot1.chrp/Makefile user/markj/netdump/stand/powerpc/kboot/Makefile user/markj/netdump/stand/powerpc/ofw/Makefile user/markj/netdump/stand/powerpc/uboot/Makefile user/markj/netdump/stand/sparc64/boot1/Makefile user/markj/netdump/stand/sparc64/loader/Makefile user/markj/netdump/stand/uboot/fdt/Makefile user/markj/netdump/stand/uboot/lib/Makefile user/markj/netdump/stand/usb/Makefile.test user/markj/netdump/stand/userboot/test/Makefile user/markj/netdump/stand/userboot/userboot/Makefile user/markj/netdump/stand/zfs/Makefile user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/markj/netdump/sys/compat/linuxkpi/common/src/linux_compat.c user/markj/netdump/sys/dev/etherswitch/etherswitch.c user/markj/netdump/sys/dev/etherswitch/etherswitch.h user/markj/netdump/sys/dev/etherswitch/etherswitch_if.m user/markj/netdump/sys/kern/kern_sysctl.c user/markj/netdump/sys/mips/conf/AP135.hints user/markj/netdump/sys/mips/conf/AP143.hints user/markj/netdump/sys/mips/conf/AR933X_BASE.hints user/markj/netdump/sys/mips/conf/DIR-825C1.hints user/markj/netdump/sys/mips/conf/QCA953X_BASE user/markj/netdump/sys/mips/conf/QCA953X_BASE.hints user/markj/netdump/sys/mips/conf/QCA955X_BASE.hints user/markj/netdump/sys/mips/conf/std.AR933X user/markj/netdump/sys/mips/conf/std.QCA955X user/markj/netdump/sys/netinet6/ip6_mroute.c user/markj/netdump/sys/powerpc/aim/trap_subr64.S user/markj/netdump/sys/vm/vnode_pager.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/contrib/compiler-rt/ (props changed) user/markj/netdump/contrib/libc++/ (props changed) user/markj/netdump/contrib/llvm/ (props changed) user/markj/netdump/contrib/llvm/tools/clang/ (props changed) user/markj/netdump/contrib/llvm/tools/lld/ (props changed) user/markj/netdump/contrib/llvm/tools/lldb/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h ============================================================================== --- user/markj/netdump/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h Fri Feb 2 14:33:57 2018 (r328777) @@ -79,25 +79,27 @@ struct Mapping { #define TSAN_MID_APP_RANGE 1 #elif defined(__mips64) /* -C/C++ on linux/mips64 -0100 0000 00 - 0200 0000 00: main binary -0200 0000 00 - 1400 0000 00: - -1400 0000 00 - 2400 0000 00: shadow -2400 0000 00 - 3000 0000 00: - -3000 0000 00 - 4000 0000 00: metainfo (memory blocks and sync objects) -4000 0000 00 - 6000 0000 00: - -6000 0000 00 - 6200 0000 00: traces -6200 0000 00 - fe00 0000 00: - -fe00 0000 00 - ff00 0000 00: heap -ff00 0000 00 - ff80 0000 00: - -ff80 0000 00 - ffff ffff ff: modules and main thread stack +C/C++ on linux/mips64 (40-bit VMA) +0000 0000 00 - 0100 0000 00: - (4 GB) +0100 0000 00 - 0200 0000 00: main binary (4 GB) +0200 0000 00 - 2000 0000 00: - (120 GB) +2000 0000 00 - 4000 0000 00: shadow (128 GB) +4000 0000 00 - 5000 0000 00: metainfo (memory blocks and sync objects) (64 GB) +5000 0000 00 - aa00 0000 00: - (360 GB) +aa00 0000 00 - ab00 0000 00: main binary (PIE) (4 GB) +ab00 0000 00 - b000 0000 00: - (20 GB) +b000 0000 00 - b200 0000 00: traces (8 GB) +b200 0000 00 - fe00 0000 00: - (304 GB) +fe00 0000 00 - ff00 0000 00: heap (4 GB) +ff00 0000 00 - ff80 0000 00: - (2 GB) +ff80 0000 00 - ffff ffff ff: modules and main thread stack (<2 GB) */ struct Mapping { static const uptr kMetaShadowBeg = 0x4000000000ull; static const uptr kMetaShadowEnd = 0x5000000000ull; static const uptr kTraceMemBeg = 0xb000000000ull; static const uptr kTraceMemEnd = 0xb200000000ull; - static const uptr kShadowBeg = 0x2400000000ull; + static const uptr kShadowBeg = 0x2000000000ull; static const uptr kShadowEnd = 0x4000000000ull; static const uptr kHeapMemBeg = 0xfe00000000ull; static const uptr kHeapMemEnd = 0xff00000000ull; Modified: user/markj/netdump/contrib/llvm/include/llvm/Analysis/ValueTracking.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/Analysis/ValueTracking.h Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/include/llvm/Analysis/ValueTracking.h Fri Feb 2 14:33:57 2018 (r328777) @@ -508,7 +508,8 @@ class Value; /// -> LHS = %a, RHS = i32 4, *CastOp = Instruction::SExt /// SelectPatternResult matchSelectPattern(Value *V, Value *&LHS, Value *&RHS, - Instruction::CastOps *CastOp = nullptr); + Instruction::CastOps *CastOp = nullptr, + unsigned Depth = 0); inline SelectPatternResult matchSelectPattern(const Value *V, const Value *&LHS, const Value *&RHS, Instruction::CastOps *CastOp = nullptr) { Modified: user/markj/netdump/contrib/llvm/lib/Analysis/ValueTracking.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Analysis/ValueTracking.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Analysis/ValueTracking.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -4165,17 +4165,18 @@ static SelectPatternResult matchClamp(CmpInst::Predica /// a < c ? min(a,b) : min(b,c) ==> min(min(a,b),min(b,c)) static SelectPatternResult matchMinMaxOfMinMax(CmpInst::Predicate Pred, Value *CmpLHS, Value *CmpRHS, - Value *TrueVal, Value *FalseVal) { + Value *TVal, Value *FVal, + unsigned Depth) { // TODO: Allow FP min/max with nnan/nsz. assert(CmpInst::isIntPredicate(Pred) && "Expected integer comparison"); Value *A, *B; - SelectPatternResult L = matchSelectPattern(TrueVal, A, B); + SelectPatternResult L = matchSelectPattern(TVal, A, B, nullptr, Depth + 1); if (!SelectPatternResult::isMinOrMax(L.Flavor)) return {SPF_UNKNOWN, SPNB_NA, false}; Value *C, *D; - SelectPatternResult R = matchSelectPattern(FalseVal, C, D); + SelectPatternResult R = matchSelectPattern(FVal, C, D, nullptr, Depth + 1); if (L.Flavor != R.Flavor) return {SPF_UNKNOWN, SPNB_NA, false}; @@ -4240,7 +4241,8 @@ static SelectPatternResult matchMinMaxOfMinMax(CmpInst static SelectPatternResult matchMinMax(CmpInst::Predicate Pred, Value *CmpLHS, Value *CmpRHS, Value *TrueVal, Value *FalseVal, - Value *&LHS, Value *&RHS) { + Value *&LHS, Value *&RHS, + unsigned Depth) { // Assume success. If there's no match, callers should not use these anyway. LHS = TrueVal; RHS = FalseVal; @@ -4249,7 +4251,7 @@ static SelectPatternResult matchMinMax(CmpInst::Predic if (SPR.Flavor != SelectPatternFlavor::SPF_UNKNOWN) return SPR; - SPR = matchMinMaxOfMinMax(Pred, CmpLHS, CmpRHS, TrueVal, FalseVal); + SPR = matchMinMaxOfMinMax(Pred, CmpLHS, CmpRHS, TrueVal, FalseVal, Depth); if (SPR.Flavor != SelectPatternFlavor::SPF_UNKNOWN) return SPR; @@ -4313,7 +4315,8 @@ static SelectPatternResult matchSelectPattern(CmpInst: FastMathFlags FMF, Value *CmpLHS, Value *CmpRHS, Value *TrueVal, Value *FalseVal, - Value *&LHS, Value *&RHS) { + Value *&LHS, Value *&RHS, + unsigned Depth) { LHS = CmpLHS; RHS = CmpRHS; @@ -4429,7 +4432,7 @@ static SelectPatternResult matchSelectPattern(CmpInst: } if (CmpInst::isIntPredicate(Pred)) - return matchMinMax(Pred, CmpLHS, CmpRHS, TrueVal, FalseVal, LHS, RHS); + return matchMinMax(Pred, CmpLHS, CmpRHS, TrueVal, FalseVal, LHS, RHS, Depth); // According to (IEEE 754-2008 5.3.1), minNum(0.0, -0.0) and similar // may return either -0.0 or 0.0, so fcmp/select pair has stricter @@ -4550,7 +4553,11 @@ static Value *lookThroughCast(CmpInst *CmpI, Value *V1 } SelectPatternResult llvm::matchSelectPattern(Value *V, Value *&LHS, Value *&RHS, - Instruction::CastOps *CastOp) { + Instruction::CastOps *CastOp, + unsigned Depth) { + if (Depth >= MaxDepth) + return {SPF_UNKNOWN, SPNB_NA, false}; + SelectInst *SI = dyn_cast(V); if (!SI) return {SPF_UNKNOWN, SPNB_NA, false}; @@ -4579,7 +4586,7 @@ SelectPatternResult llvm::matchSelectPattern(Value *V, FMF.setNoSignedZeros(); return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, cast(TrueVal)->getOperand(0), C, - LHS, RHS); + LHS, RHS, Depth); } if (Value *C = lookThroughCast(CmpI, FalseVal, TrueVal, CastOp)) { // If this is a potential fmin/fmax with a cast to integer, then ignore @@ -4588,11 +4595,11 @@ SelectPatternResult llvm::matchSelectPattern(Value *V, FMF.setNoSignedZeros(); return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, C, cast(FalseVal)->getOperand(0), - LHS, RHS); + LHS, RHS, Depth); } } return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, TrueVal, FalseVal, - LHS, RHS); + LHS, RHS, Depth); } /// Return true if "icmp Pred LHS RHS" is always true. Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -812,6 +812,10 @@ bool IRTranslator::translateCall(const User &U, Machin auto TII = MF->getTarget().getIntrinsicInfo(); const Function *F = CI.getCalledFunction(); + // FIXME: support Windows dllimport function calls. + if (F && F->hasDLLImportStorageClass()) + return false; + if (CI.isInlineAsm()) return translateInlineAsm(CI, MIRBuilder); Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -661,7 +661,24 @@ LegalizerHelper::widenScalar(MachineInstr &MI, unsigne } case TargetOpcode::G_FCONSTANT: { unsigned DstExt = MRI.createGenericVirtualRegister(WideTy); - MIRBuilder.buildFConstant(DstExt, *MI.getOperand(1).getFPImm()); + const ConstantFP *CFP = MI.getOperand(1).getFPImm(); + APFloat Val = CFP->getValueAPF(); + LLVMContext &Ctx = MIRBuilder.getMF().getFunction().getContext(); + auto LLT2Sem = [](LLT Ty) { + switch (Ty.getSizeInBits()) { + case 32: + return &APFloat::IEEEsingle(); + break; + case 64: + return &APFloat::IEEEdouble(); + break; + default: + llvm_unreachable("Unhandled fp widen type"); + } + }; + bool LosesInfo; + Val.convert(*LLT2Sem(WideTy), APFloat::rmTowardZero, &LosesInfo); + MIRBuilder.buildFConstant(DstExt, *ConstantFP::get(Ctx, Val)); MIRBuilder.buildFPTrunc(MI.getOperand(0).getReg(), DstExt); MI.eraseFromParent(); return Legalized; Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/RegAllocFast.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/RegAllocFast.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/RegAllocFast.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -193,9 +193,10 @@ namespace { void spillVirtReg(MachineBasicBlock::iterator MI, unsigned VirtReg); void usePhysReg(MachineOperand &MO); - void definePhysReg(MachineInstr &MI, MCPhysReg PhysReg, RegState NewState); + void definePhysReg(MachineBasicBlock::iterator MI, MCPhysReg PhysReg, + RegState NewState); unsigned calcSpillCost(MCPhysReg PhysReg) const; - void assignVirtToPhysReg(LiveReg&, MCPhysReg PhysReg); + void assignVirtToPhysReg(LiveReg &, MCPhysReg PhysReg); LiveRegMap::iterator findLiveVirtReg(unsigned VirtReg) { return LiveVirtRegs.find(TargetRegisterInfo::virtReg2Index(VirtReg)); @@ -434,8 +435,8 @@ void RegAllocFast::usePhysReg(MachineOperand &MO) { /// Mark PhysReg as reserved or free after spilling any virtregs. This is very /// similar to defineVirtReg except the physreg is reserved instead of /// allocated. -void RegAllocFast::definePhysReg(MachineInstr &MI, MCPhysReg PhysReg, - RegState NewState) { +void RegAllocFast::definePhysReg(MachineBasicBlock::iterator MI, + MCPhysReg PhysReg, RegState NewState) { markRegUsedInInstr(PhysReg); switch (unsigned VirtReg = PhysRegState[PhysReg]) { case regDisabled: @@ -857,7 +858,7 @@ void RegAllocFast::allocateBasicBlock(MachineBasicBloc // Add live-in registers as live. for (const MachineBasicBlock::RegisterMaskPair LI : MBB.liveins()) if (MRI->isAllocatable(LI.PhysReg)) - definePhysReg(*MII, LI.PhysReg, regReserved); + definePhysReg(MII, LI.PhysReg, regReserved); VirtDead.clear(); Coalesced.clear(); Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -1380,8 +1380,10 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Func FastISelFailed = false; // Initialize the Fast-ISel state, if needed. FastISel *FastIS = nullptr; - if (TM.Options.EnableFastISel) + if (TM.Options.EnableFastISel) { + DEBUG(dbgs() << "Enabling fast-isel\n"); FastIS = TLI->createFastISel(*FuncInfo, LibInfo); + } setupSwiftErrorVals(Fn, TLI, FuncInfo); Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -717,6 +717,8 @@ bool TargetPassConfig::addCoreISelPasses() { if (EnableGlobalISel == cl::BOU_TRUE || (EnableGlobalISel == cl::BOU_UNSET && isGlobalISelEnabled() && EnableFastISelOption != cl::BOU_TRUE)) { + TM->setFastISel(false); + if (addIRTranslator()) return true; Modified: user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -476,26 +476,27 @@ unsigned AArch64FastISel::materializeGV(const GlobalVa // ADRP + LDRX BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(AArch64::ADRP), ADRPReg) - .addGlobalAddress(GV, 0, AArch64II::MO_GOT | AArch64II::MO_PAGE); + .addGlobalAddress(GV, 0, AArch64II::MO_PAGE | OpFlags); ResultReg = createResultReg(&AArch64::GPR64RegClass); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(AArch64::LDRXui), ResultReg) - .addReg(ADRPReg) - .addGlobalAddress(GV, 0, AArch64II::MO_GOT | AArch64II::MO_PAGEOFF | - AArch64II::MO_NC); + .addReg(ADRPReg) + .addGlobalAddress(GV, 0, + AArch64II::MO_PAGEOFF | AArch64II::MO_NC | OpFlags); } else { // ADRP + ADDX BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(AArch64::ADRP), ADRPReg) - .addGlobalAddress(GV, 0, AArch64II::MO_PAGE); + .addGlobalAddress(GV, 0, AArch64II::MO_PAGE | OpFlags); ResultReg = createResultReg(&AArch64::GPR64spRegClass); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(AArch64::ADDXri), ResultReg) - .addReg(ADRPReg) - .addGlobalAddress(GV, 0, AArch64II::MO_PAGEOFF | AArch64II::MO_NC) - .addImm(0); + .addReg(ADRPReg) + .addGlobalAddress(GV, 0, + AArch64II::MO_PAGEOFF | AArch64II::MO_NC | OpFlags) + .addImm(0); } return ResultReg; } Modified: user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -929,6 +929,12 @@ bool AArch64InstructionSelector::select(MachineInstr & return false; } + // FIXME: PR36018: Volatile loads in some cases are incorrectly selected by + // folding with an extend. Until we have a G_SEXTLOAD solution bail out if + // we hit one. + if (Opcode == TargetOpcode::G_LOAD && MemOp.isVolatile()) + return false; + const unsigned PtrReg = I.getOperand(1).getReg(); #ifndef NDEBUG const RegisterBank &PtrRB = *RBI.getRegBank(PtrReg, MRI, TRI); Modified: user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -189,15 +189,18 @@ AArch64Subtarget::ClassifyGlobalReference(const Global if (TM.getCodeModel() == CodeModel::Large && isTargetMachO()) return AArch64II::MO_GOT; + unsigned Flags = GV->hasDLLImportStorageClass() ? AArch64II::MO_DLLIMPORT + : AArch64II::MO_NO_FLAG; + if (!TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) - return AArch64II::MO_GOT; + return AArch64II::MO_GOT | Flags; // The small code model's direct accesses use ADRP, which cannot // necessarily produce the value 0 (if the code is above 4GB). if (useSmallAddressing() && GV->hasExternalWeakLinkage()) - return AArch64II::MO_GOT; + return AArch64II::MO_GOT | Flags; - return AArch64II::MO_NO_FLAG; + return Flags; } unsigned char AArch64Subtarget::classifyGlobalFunctionReference( Modified: user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -210,65 +210,73 @@ void SIInsertSkips::kill(MachineInstr &MI) { switch (MI.getOperand(2).getImm()) { case ISD::SETOEQ: case ISD::SETEQ: - Opcode = AMDGPU::V_CMPX_EQ_F32_e32; + Opcode = AMDGPU::V_CMPX_EQ_F32_e64; break; case ISD::SETOGT: case ISD::SETGT: - Opcode = AMDGPU::V_CMPX_LT_F32_e32; + Opcode = AMDGPU::V_CMPX_LT_F32_e64; break; case ISD::SETOGE: case ISD::SETGE: - Opcode = AMDGPU::V_CMPX_LE_F32_e32; + Opcode = AMDGPU::V_CMPX_LE_F32_e64; break; case ISD::SETOLT: case ISD::SETLT: - Opcode = AMDGPU::V_CMPX_GT_F32_e32; + Opcode = AMDGPU::V_CMPX_GT_F32_e64; break; case ISD::SETOLE: case ISD::SETLE: - Opcode = AMDGPU::V_CMPX_GE_F32_e32; + Opcode = AMDGPU::V_CMPX_GE_F32_e64; break; case ISD::SETONE: case ISD::SETNE: - Opcode = AMDGPU::V_CMPX_LG_F32_e32; + Opcode = AMDGPU::V_CMPX_LG_F32_e64; break; case ISD::SETO: - Opcode = AMDGPU::V_CMPX_O_F32_e32; + Opcode = AMDGPU::V_CMPX_O_F32_e64; break; case ISD::SETUO: - Opcode = AMDGPU::V_CMPX_U_F32_e32; + Opcode = AMDGPU::V_CMPX_U_F32_e64; break; case ISD::SETUEQ: - Opcode = AMDGPU::V_CMPX_NLG_F32_e32; + Opcode = AMDGPU::V_CMPX_NLG_F32_e64; break; case ISD::SETUGT: - Opcode = AMDGPU::V_CMPX_NGE_F32_e32; + Opcode = AMDGPU::V_CMPX_NGE_F32_e64; break; case ISD::SETUGE: - Opcode = AMDGPU::V_CMPX_NGT_F32_e32; + Opcode = AMDGPU::V_CMPX_NGT_F32_e64; break; case ISD::SETULT: - Opcode = AMDGPU::V_CMPX_NLE_F32_e32; + Opcode = AMDGPU::V_CMPX_NLE_F32_e64; break; case ISD::SETULE: - Opcode = AMDGPU::V_CMPX_NLT_F32_e32; + Opcode = AMDGPU::V_CMPX_NLT_F32_e64; break; case ISD::SETUNE: - Opcode = AMDGPU::V_CMPX_NEQ_F32_e32; + Opcode = AMDGPU::V_CMPX_NEQ_F32_e64; break; default: llvm_unreachable("invalid ISD:SET cond code"); } - // TODO: Allow this: - if (!MI.getOperand(0).isReg() || - !TRI->isVGPR(MBB.getParent()->getRegInfo(), - MI.getOperand(0).getReg())) - llvm_unreachable("SI_KILL operand should be a VGPR"); + assert(MI.getOperand(0).isReg()); - BuildMI(MBB, &MI, DL, TII->get(Opcode)) - .add(MI.getOperand(1)) - .add(MI.getOperand(0)); + if (TRI->isVGPR(MBB.getParent()->getRegInfo(), + MI.getOperand(0).getReg())) { + Opcode = AMDGPU::getVOPe32(Opcode); + BuildMI(MBB, &MI, DL, TII->get(Opcode)) + .add(MI.getOperand(1)) + .add(MI.getOperand(0)); + } else { + BuildMI(MBB, &MI, DL, TII->get(Opcode)) + .addReg(AMDGPU::VCC, RegState::Define) + .addImm(0) // src0 modifiers + .add(MI.getOperand(1)) + .addImm(0) // src1 modifiers + .add(MI.getOperand(0)) + .addImm(0); // omod + } break; } case AMDGPU::SI_KILL_I1_TERMINATOR: { Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -39,11 +39,11 @@ void X86IntelInstPrinter::printInst(const MCInst *MI, const MCSubtargetInfo &STI) { const MCInstrDesc &Desc = MII.get(MI->getOpcode()); uint64_t TSFlags = Desc.TSFlags; + unsigned Flags = MI->getFlags(); - if (TSFlags & X86II::LOCK) + if ((TSFlags & X86II::LOCK) || (Flags & X86::IP_HAS_LOCK)) OS << "\tlock\t"; - unsigned Flags = MI->getFlags(); if (Flags & X86::IP_HAS_REPEAT_NE) OS << "\trepne\t"; else if (Flags & X86::IP_HAS_REPEAT) Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -31776,9 +31776,10 @@ static SDValue combineSelect(SDNode *N, SelectionDAG & // Check all uses of the condition operand to check whether it will be // consumed by non-BLEND instructions. Those may require that all bits // are set properly. - for (SDNode *U : Cond->uses()) { + for (SDNode::use_iterator UI = Cond->use_begin(), UE = Cond->use_end(); + UI != UE; ++UI) { // TODO: Add other opcodes eventually lowered into BLEND. - if (U->getOpcode() != ISD::VSELECT) + if (UI->getOpcode() != ISD::VSELECT || UI.getOperandNo() != 0) return SDValue(); } Modified: user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -142,10 +142,11 @@ recordConditions(const CallSite &CS, BasicBlock *Pred, recordCondition(CS, Pred, CS.getInstruction()->getParent(), Conditions); BasicBlock *From = Pred; BasicBlock *To = Pred; - SmallPtrSet Visited = {From}; + SmallPtrSet Visited; while (!Visited.count(From->getSinglePredecessor()) && (From = From->getSinglePredecessor())) { recordCondition(CS, From, To, Conditions); + Visited.insert(From); To = From; } } Modified: user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -14,6 +14,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/DivergenceAnalysis.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/RegionIterator.h" #include "llvm/Analysis/RegionPass.h" @@ -176,8 +177,9 @@ class StructurizeCFG : public RegionPass { Region *ParentRegion; DominatorTree *DT; + LoopInfo *LI; - std::deque Order; + SmallVector Order; BBSet Visited; BBPhiMap DeletedPhis; @@ -202,7 +204,7 @@ class StructurizeCFG : public RegionPass { void gatherPredicates(RegionNode *N); - void analyzeNode(RegionNode *N); + void collectInfos(); void insertConditions(bool Loops); @@ -256,6 +258,7 @@ class StructurizeCFG : public RegionPass { AU.addRequired(); AU.addRequiredID(LowerSwitchID); AU.addRequired(); + AU.addRequired(); AU.addPreserved(); RegionPass::getAnalysisUsage(AU); @@ -289,17 +292,55 @@ bool StructurizeCFG::doInitialization(Region *R, RGPas /// \brief Build up the general order of nodes void StructurizeCFG::orderNodes() { - assert(Visited.empty()); - assert(Predicates.empty()); - assert(Loops.empty()); - assert(LoopPreds.empty()); + ReversePostOrderTraversal RPOT(ParentRegion); + SmallDenseMap LoopBlocks; - // This must be RPO order for the back edge detection to work - for (RegionNode *RN : ReversePostOrderTraversal(ParentRegion)) { - // FIXME: Is there a better order to use for structurization? - Order.push_back(RN); - analyzeNode(RN); + // The reverse post-order traversal of the list gives us an ordering close + // to what we want. The only problem with it is that sometimes backedges + // for outer loops will be visited before backedges for inner loops. + for (RegionNode *RN : RPOT) { + BasicBlock *BB = RN->getEntry(); + Loop *Loop = LI->getLoopFor(BB); + ++LoopBlocks[Loop]; } + + unsigned CurrentLoopDepth = 0; + Loop *CurrentLoop = nullptr; + for (auto I = RPOT.begin(), E = RPOT.end(); I != E; ++I) { + BasicBlock *BB = (*I)->getEntry(); + unsigned LoopDepth = LI->getLoopDepth(BB); + + if (is_contained(Order, *I)) + continue; + + if (LoopDepth < CurrentLoopDepth) { + // Make sure we have visited all blocks in this loop before moving back to + // the outer loop. + + auto LoopI = I; + while (unsigned &BlockCount = LoopBlocks[CurrentLoop]) { + LoopI++; + BasicBlock *LoopBB = (*LoopI)->getEntry(); + if (LI->getLoopFor(LoopBB) == CurrentLoop) { + --BlockCount; + Order.push_back(*LoopI); + } + } + } + + CurrentLoop = LI->getLoopFor(BB); + if (CurrentLoop) + LoopBlocks[CurrentLoop]--; + + CurrentLoopDepth = LoopDepth; + Order.push_back(*I); + } + + // This pass originally used a post-order traversal and then operated on + // the list in reverse. Now that we are using a reverse post-order traversal + // rather than re-working the whole pass to operate on the list in order, + // we just reverse the list and continue to operate on it in reverse. + std::reverse(Order.begin(), Order.end()); } /// \brief Determine the end of the loops @@ -425,19 +466,32 @@ void StructurizeCFG::gatherPredicates(RegionNode *N) { } /// \brief Collect various loop and predicate infos -void StructurizeCFG::analyzeNode(RegionNode *RN) { - DEBUG(dbgs() << "Visiting: " - << (RN->isSubRegion() ? "SubRegion with entry: " : "") - << RN->getEntry()->getName() << '\n'); +void StructurizeCFG::collectInfos() { + // Reset predicate + Predicates.clear(); - // Analyze all the conditions leading to a node - gatherPredicates(RN); + // and loop infos + Loops.clear(); + LoopPreds.clear(); - // Remember that we've seen this node - Visited.insert(RN->getEntry()); + // Reset the visited nodes + Visited.clear(); - // Find the last back edges - analyzeLoops(RN); + for (RegionNode *RN : reverse(Order)) { + DEBUG(dbgs() << "Visiting: " + << (RN->isSubRegion() ? "SubRegion with entry: " : "") + << RN->getEntry()->getName() << " Loop Depth: " + << LI->getLoopDepth(RN->getEntry()) << "\n"); + + // Analyze all the conditions leading to a node + gatherPredicates(RN); + + // Remember that we've seen this node + Visited.insert(RN->getEntry()); + + // Find the last back edges + analyzeLoops(RN); + } } /// \brief Insert the missing branch conditions @@ -610,7 +664,7 @@ void StructurizeCFG::changeExit(RegionNode *Node, Basi BasicBlock *StructurizeCFG::getNextFlow(BasicBlock *Dominator) { LLVMContext &Context = Func->getContext(); BasicBlock *Insert = Order.empty() ? ParentRegion->getExit() : - Order.front()->getEntry(); + Order.back()->getEntry(); BasicBlock *Flow = BasicBlock::Create(Context, FlowBlockName, Func, Insert); DT->addNewBlock(Flow, Dominator); @@ -690,8 +744,7 @@ bool StructurizeCFG::isPredictableTrue(RegionNode *Nod /// Take one node from the order vector and wire it up void StructurizeCFG::wireFlow(bool ExitUseAllowed, BasicBlock *LoopEnd) { - RegionNode *Node = Order.front(); - Order.pop_front(); + RegionNode *Node = Order.pop_back_val(); Visited.insert(Node->getEntry()); if (isPredictableTrue(Node)) { @@ -715,7 +768,7 @@ void StructurizeCFG::wireFlow(bool ExitUseAllowed, PrevNode = Node; while (!Order.empty() && !Visited.count(LoopEnd) && - dominatesPredicates(Entry, Order.front())) { + dominatesPredicates(Entry, Order.back())) { handleLoops(false, LoopEnd); } @@ -726,7 +779,7 @@ void StructurizeCFG::wireFlow(bool ExitUseAllowed, void StructurizeCFG::handleLoops(bool ExitUseAllowed, BasicBlock *LoopEnd) { - RegionNode *Node = Order.front(); + RegionNode *Node = Order.back(); BasicBlock *LoopStart = Node->getEntry(); if (!Loops.count(LoopStart)) { @@ -871,9 +924,10 @@ bool StructurizeCFG::runOnRegion(Region *R, RGPassMana ParentRegion = R; DT = &getAnalysis().getDomTree(); + LI = &getAnalysis().getLoopInfo(); orderNodes(); - + collectInfos(); createFlow(); insertConditions(false); insertConditions(true); Modified: user/markj/netdump/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -25,6 +25,7 @@ #include "llvm/IR/CallSite.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" +#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalAlias.h" @@ -536,13 +537,23 @@ Optional MDNodeMapper::tryToMapOperand(con return None; } +static Metadata *cloneOrBuildODR(const MDNode &N) { + auto *CT = dyn_cast(&N); + // If ODR type uniquing is enabled, we would have uniqued composite types + // with identifiers during bitcode reading, so we can just use CT. + if (CT && CT->getContext().isODRUniquingDebugTypes() && + CT->getIdentifier() != "") + return const_cast(CT); + return MDNode::replaceWithDistinct(N.clone()); +} + MDNode *MDNodeMapper::mapDistinctNode(const MDNode &N) { assert(N.isDistinct() && "Expected a distinct node"); assert(!M.getVM().getMappedMD(&N) && "Expected an unmapped node"); - DistinctWorklist.push_back(cast( - (M.Flags & RF_MoveDistinctMDs) - ? M.mapToSelf(&N) - : M.mapToMetadata(&N, MDNode::replaceWithDistinct(N.clone())))); + DistinctWorklist.push_back( + cast((M.Flags & RF_MoveDistinctMDs) + ? M.mapToSelf(&N) + : M.mapToMetadata(&N, cloneOrBuildODR(N)))); return DistinctWorklist.back(); } Modified: user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td Fri Feb 2 14:33:57 2018 (r328777) @@ -354,4 +354,12 @@ def warn_drv_fine_grained_bitfield_accesses_ignored : def note_drv_verify_prefix_spelling : Note< "-verify prefixes must start with a letter and contain only alphanumeric" " characters, hyphens, and underscores">; + +def warn_drv_experimental_isel_incomplete : Warning< + "-fexperimental-isel support for the '%0' architecture is incomplete">, + InGroup; + +def warn_drv_experimental_isel_incomplete_opt : Warning< + "-fexperimental-isel support is incomplete for this architecture at the current optimization level">, + InGroup; } Modified: user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Fri Feb 2 14:33:57 2018 (r328777) @@ -985,3 +985,6 @@ def UnknownArgument : DiagGroup<"unknown-argument">; // A warning group for warnings about code that clang accepts when // compiling OpenCL C/C++ but which is not compatible with the SPIR spec. def SpirCompat : DiagGroup<"spir-compat">; + +// Warning for the experimental-isel options. +def ExperimentalISel : DiagGroup<"experimental-isel">; Modified: user/markj/netdump/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- user/markj/netdump/contrib/llvm/tools/clang/include/clang/Driver/Options.td Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/clang/include/clang/Driver/Options.td Fri Feb 2 14:33:57 2018 (r328777) @@ -1031,6 +1031,8 @@ def finline_functions : Flag<["-"], "finline-functions def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group, Flags<[CC1Option]>, HelpText<"Inline functions which are (explicitly or implicitly) marked inline">; def finline : Flag<["-"], "finline">, Group; +def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group, + HelpText<"Enables the experimental global instruction selector">; def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">, Group, Flags<[CC1Option]>, HelpText<"Enables an experimental new pass manager in LLVM.">; @@ -1237,6 +1239,8 @@ def fno_exceptions : Flag<["-"], "fno-exceptions">, Gr def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group, Flags<[CC1Option]>; def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group, Flags<[CC1Option]>; def fno_inline : Flag<["-"], "fno-inline">, Group, Flags<[CC1Option]>; +def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group, + HelpText<"Disables the experimental global instruction selector">; def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-manager">, Group, Flags<[CC1Option]>, HelpText<"Disables an experimental new pass manager in LLVM.">; Modified: user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -4639,6 +4639,37 @@ void Clang::ConstructJob(Compilation &C, const JobActi CmdArgs.push_back("-fwhole-program-vtables"); } + if (Arg *A = Args.getLastArg(options::OPT_fexperimental_isel, + options::OPT_fno_experimental_isel)) { + CmdArgs.push_back("-mllvm"); + if (A->getOption().matches(options::OPT_fexperimental_isel)) { + CmdArgs.push_back("-global-isel=1"); + + // GISel is on by default on AArch64 -O0, so don't bother adding + // the fallback remarks for it. Other combinations will add a warning of + // some kind. + bool IsArchSupported = Triple.getArch() == llvm::Triple::aarch64; + bool IsOptLevelSupported = false; + + Arg *A = Args.getLastArg(options::OPT_O_Group); + if (Triple.getArch() == llvm::Triple::aarch64) { + if (!A || A->getOption().matches(options::OPT_O0)) + IsOptLevelSupported = true; + } + if (!IsArchSupported || !IsOptLevelSupported) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-global-isel-abort=2"); + + if (!IsArchSupported) + D.Diag(diag::warn_drv_experimental_isel_incomplete) << Triple.getArchName(); + else + D.Diag(diag::warn_drv_experimental_isel_incomplete_opt); + } + } else { + CmdArgs.push_back("-global-isel=0"); + } + } + // Finally add the compile command to the compilation. if (Args.hasArg(options::OPT__SLASH_fallback) && Output.getType() == types::TY_Object && Modified: user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -46,7 +46,7 @@ static void handleHVXWarnings(const Driver &D, const A // Handle the unsupported values passed to mhvx-length. if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_length_EQ)) { StringRef Val = A->getValue(); - if (Val != "64B" && Val != "128B") + if (!Val.equals_lower("64b") && !Val.equals_lower("128b")) D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Val; } Modified: user/markj/netdump/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp Fri Feb 2 14:33:57 2018 (r328777) @@ -47,6 +47,7 @@ using namespace llvm; using namespace llvm::ELF; using namespace llvm::object; +using namespace llvm::support; using namespace llvm::support::endian; using namespace lld; @@ -357,7 +358,7 @@ static uint64_t scanCortexA53Errata843419(InputSection uint64_t PatchOff = 0; const uint8_t *Buf = IS->Data.begin(); - const uint32_t *InstBuf = reinterpret_cast(Buf + Off); + const ulittle32_t *InstBuf = reinterpret_cast(Buf + Off); uint32_t Instr1 = *InstBuf++; uint32_t Instr2 = *InstBuf++; uint32_t Instr3 = *InstBuf++; Modified: user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.h ============================================================================== --- user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.h Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/contrib/llvm/tools/lld/ELF/Writer.h Fri Feb 2 14:33:57 2018 (r328777) @@ -45,8 +45,9 @@ struct PhdrEntry { OutputSection *LastSec = nullptr; bool HasLMA = false; - // True if any of the sections in this program header as a LMA specified via - // linker script: AT(addr). + // True if one of the sections in this program header has a LMA specified via + // linker script: AT(addr). We never allow 2 or more sections with LMA in the + // same program header. bool ASectionHasLMA = false; uint64_t LMAOffset = 0; Modified: user/markj/netdump/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- user/markj/netdump/lib/clang/include/clang/Basic/Version.inc Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/lib/clang/include/clang/Basic/Version.inc Fri Feb 2 14:33:57 2018 (r328777) @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "323338" +#define SVN_REVISION "323948" Modified: user/markj/netdump/lib/clang/include/lld/Common/Version.inc ============================================================================== --- user/markj/netdump/lib/clang/include/lld/Common/Version.inc Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/lib/clang/include/lld/Common/Version.inc Fri Feb 2 14:33:57 2018 (r328777) @@ -4,5 +4,5 @@ #define LLD_VERSION_STRING "6.0.0" #define LLD_VERSION_MAJOR 6 #define LLD_VERSION_MINOR 0 -#define LLD_REVISION_STRING "323338" +#define LLD_REVISION_STRING "323948" #define LLD_REPOSITORY_STRING "FreeBSD" Modified: user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h Fri Feb 2 14:33:57 2018 (r328777) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "svn-r323338" +#define LLVM_REVISION "svn-r323948" Modified: user/markj/netdump/lib/libcompiler_rt/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libcompiler_rt/Makefile.inc Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/lib/libcompiler_rt/Makefile.inc Fri Feb 2 14:33:57 2018 (r328777) @@ -186,7 +186,7 @@ SRCF+= subsf3 SRCF+= truncdfsf2 .endif -.if ${MACHINE_CPUARCH} != "arm" +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" SRCF+= comparedf2 SRCF+= comparesf2 .endif Modified: user/markj/netdump/lib/libufs/cgread.3 ============================================================================== --- user/markj/netdump/lib/libufs/cgread.3 Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/lib/libufs/cgread.3 Fri Feb 2 14:33:57 2018 (r328777) @@ -134,7 +134,7 @@ function returns 0 if there are no more cylinder group The .Fn cgread1 function returns 1 on success and \-1 on error. -The other functions return 0 on success and \-1 on error; +The other functions return 0 on success and \-1 on error. .Sh ERRORS The .Fn cgget , Modified: user/markj/netdump/sbin/fsck_ffs/suj.c ============================================================================== --- user/markj/netdump/sbin/fsck_ffs/suj.c Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/sbin/fsck_ffs/suj.c Fri Feb 2 14:33:57 2018 (r328777) @@ -213,8 +213,8 @@ closedisk(const char *devnam) fs->fs_clean = 1; fs->fs_time = time(NULL); fs->fs_mtime = time(NULL); - if (sbwrite(&disk, 0) == -1) - err(EX_OSERR, "sbwrite(%s)", devnam); + if (sbput(disk.d_fd, fs, 0) == -1) + err(EX_OSERR, "sbput(%s)", devnam); if (ufs_disk_close(&disk) == -1) err(EX_OSERR, "ufs_disk_close(%s)", devnam); fs = NULL; Modified: user/markj/netdump/share/examples/bhyve/vmrun.sh ============================================================================== --- user/markj/netdump/share/examples/bhyve/vmrun.sh Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/share/examples/bhyve/vmrun.sh Fri Feb 2 14:33:57 2018 (r328777) @@ -38,6 +38,7 @@ DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 DEFAULT_CONSOLE=stdio +DEFAULT_NIC=virtio-net DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" @@ -48,33 +49,43 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ] [-d ]" - echo " [-e ] [-f ] [-F ]" + echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ]" \ + "[-d ]" + echo " [-e ] [-f ]" \ + "[-F ]" echo " [-g ] [-H ]" echo " [-I ] [-l ]" echo " [-L ]" - echo " [-m ] [-P ] [-t ] " + echo " [-m ]" \ + "[-n ]" + echo " [-P ] [-t ] " echo "" echo " -h: display this help message" echo " -a: force memory mapped local APIC access" echo " -A: use AHCI disk emulation instead of virtio" - echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" - echo " -C: console device (default is ${DEFAULT_CONSOLE})" - echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" + echo " -c: number of virtual cpus (default: ${DEFAULT_CPUS})" + echo " -C: console device (default: ${DEFAULT_CONSOLE})" + echo " -d: virtio diskdev file (default: ${DEFAULT_VIRTIO_DISK})" echo " -e: set FreeBSD loader environment variable" echo " -E: Use UEFI mode" echo " -f: Use a specific UEFI firmware" - echo " -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768)" + echo " -F: Use a custom UEFI GOP framebuffer size" \ + "(default: w=1024,h=768)" echo " -g: listen for connection from kgdb at " echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" - echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" - echo " -l: the OS loader to use (default is /boot/userboot.so)" - echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" - echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" - echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" + echo " -I: Installation CDROM image location" \ + "(default: ${DEFAULT_ISOFILE})" + echo " -l: the OS loader to use (default: /boot/userboot.so)" + echo " -L: IP address for UEFI GOP VNC server" \ + "(default: 127.0.0.1)" + echo " -m: memory size (default: ${DEFAULT_MEMSIZE})" + echo " -n: network adapter emulation type" \ + "(default: ${DEFAULT_NIC})" + echo " -p: pass-through a host PCI device at bus/slot/func" \ + "(e.g. 10/0/0)" echo " -P: UEFI GOP VNC port (default: 5900)" - echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" + echo " -t: tap device for virtio-net (default: $DEFAULT_TAPDEV)" echo " -T: Enable tablet device (for UEFI GOP)" echo " -u: RTC keeps UTC time" echo " -v: Wait for VNC client connection before booting VM" @@ -100,6 +111,7 @@ isofile=${DEFAULT_ISOFILE} memsize=${DEFAULT_MEMSIZE} console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} +nic=${DEFAULT_NIC} tap_total=0 disk_total=0 disk_emulation="virtio-blk" @@ -117,7 +129,7 @@ vncport=5900 fbsize="w=1024,h=768" tablet="" -while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do +while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:n:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" @@ -171,6 +183,9 @@ while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c m) memsize=${OPTARG} ;; + n) + nic=${OPTARG} + ;; p) eval "pass_dev${pass_total}=\"${OPTARG}\"" pass_total=$(($pass_total + 1)) @@ -313,7 +328,7 @@ while [ 1 ]; do i=0 while [ $i -lt $tap_total ] ; do eval "tapname=\$tap_dev${i}" - devargs="$devargs -s $nextslot:0,virtio-net,${tapname} " + devargs="$devargs -s $nextslot:0,${nic},${tapname} " nextslot=$(($nextslot + 1)) i=$(($i + 1)) done Modified: user/markj/netdump/stand/defs.mk ============================================================================== --- user/markj/netdump/stand/defs.mk Fri Feb 2 12:57:33 2018 (r328776) +++ user/markj/netdump/stand/defs.mk Fri Feb 2 14:33:57 2018 (r328777) @@ -7,6 +7,13 @@ WARNS?=1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***