1. 23 Mar, 2018 10 commits
    • Cy Schubert's avatar
      Fix build on i386 without INVARIANTS following r331369. · 72346b22
      Cy Schubert authored
      --- vm_reserv.o ---
      In file included from /opt/src/svn-current/sys/vm/vm_reserv.c:48:
      In file included from /opt/src/svn-current/sys/sys/counter.h:37:
      ./machine/counter.h:174:3: error: implicit declaration of function
      'critical_enter' is invalid in C99 [-Werror,-Wimplicit-function-declarat
      ion]
                      critical_enter();
      
      Reviewed by:	jeff@
      72346b22
    • Alexander Motin's avatar
      Reduce struct aggsum_bucket padding to fit into one cache line. · 4148c56f
      Alexander Motin authored
      Reported by:	mjg
      4148c56f
    • Kyle Evans's avatar
      efidev: Drop a quick note in about efi_cfgtbl/efi_runtime · 50da29d2
      Kyle Evans authored
      There's no real annotation for it, so it's not immediately obvious to the
      unfamiliar that these pointers are to locations in the EFI runtime map
      unlike the system table pointer immediately above them.
      50da29d2
    • Alexander Motin's avatar
      MFV r331407: 9213 zfs: sytem typo · e76e77a9
      Alexander Motin authored
      illumos/illumos-gate@edc8ef7d921c96b23969898aeb766cb24960bda7
      
      Reviewed by: C Fraire <cfraire@me.com>
      Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
      Approved by: Joshua M. Clulow <josh@sysmgr.org>
      Author: Toomas Soome <tsoome@me.com>
      e76e77a9
    • Alexander Motin's avatar
      9213 zfs: sytem typo · 6027cbd4
      Alexander Motin authored
      illumos/illumos-gate@edc8ef7d921c96b23969898aeb766cb24960bda7
      
      Reviewed by: C Fraire <cfraire@me.com>
      Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
      Approved by: Joshua M. Clulow <josh@sysmgr.org>
      Author: Toomas Soome <tsoome@me.com>
      6027cbd4
    • Alexander Motin's avatar
      MFV r331405: 9084 spa_*_ashift must ignore spare devices · f222611a
      Alexander Motin authored
      illumos/illumos-gate@b037f3dbd69cef4a7ffd576ad33e07bfaf0b1e84
      
      Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
      Reviewed by: George Wilson <george.wilson@delphix.com>
      Approved by: Dan McDonald <danmcd@joyent.com>
      Author: Prakash Surya <prakash.surya@delphix.com>
      f222611a
    • Alexander Motin's avatar
      9084 spa_*_ashift must ignore spare devices · 057fec90
      Alexander Motin authored
      illumos/illumos-gate@b037f3dbd69cef4a7ffd576ad33e07bfaf0b1e84
      
      Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
      Reviewed by: George Wilson <george.wilson@delphix.com>
      Approved by: Dan McDonald <danmcd@joyent.com>
      Author: Prakash Surya <prakash.surya@delphix.com>
      057fec90
    • Alexander Motin's avatar
      MFV r331400: 8484 Implement aggregate sum and use for arc counters · b8436536
      Alexander Motin authored
      In pursuit of improving performance on multi-core systems, we should
      implements fanned out counters and use them to improve the performance of
      some of the arc statistics. These stats are updated extremely frequently,
      and can consume a significant amount of CPU time.
      
      Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
      Reviewed by: Matthew Ahrens <mahrens@delphix.com>
      Approved by: Dan McDonald <danmcd@joyent.com>
      Author: Paul Dagnelie <pcd@delphix.com>
      b8436536
    • Justin Hibbits's avatar
      Debug interrupts aren't instruction traps · 9ae2eed9
      Justin Hibbits authored
      The EXC_DEBUG type is akin to the MPC74xx "Instruction Breakpoint" trap.
      Don't treat it as a trap instruction.
      9ae2eed9
    • Alexander Motin's avatar
      8484 Implement aggregate sum and use for arc counters · ba31d399
      Alexander Motin authored
      In pursuit of improving performance on multi-core systems, we should
      implements fanned out counters and use them to improve the performance of
      some of the arc statistics. These stats are updated extremely frequently,
      and can consume a significant amount of CPU time.
      
      Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
      Reviewed by: Matthew Ahrens <mahrens@delphix.com>
      Approved by: Dan McDonald <danmcd@joyent.com>
      Author: Paul Dagnelie <pcd@delphix.com>
      ba31d399
  2. 22 Mar, 2018 30 commits
    • Sean Bruno's avatar
      Refactor ip6_getpcbopt() for better locking and memory management · 06b479a6
      Sean Bruno authored
      Created GET_PKTOPT_EXT_HDR() and GET_PKTOPT_SOCKADDR() macros to
      handle safely fetching options from in6p_outputopts, including
      properly dealing with in6p locking and preparing memory for
      sooptcopyout().
      
      Changed the function signature of ip6_getpcbopt() to allow the
      function to acquire and release locks on in6p as needed.
      
      Submitted by:	Jason Eggleston <jason@eggnet.com>
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D14619
      06b479a6
    • Sean Bruno's avatar
      Simple locking fixes in ip_ctloutput, ip6_ctloutput, rip_ctloutput. · 2a499acf
      Sean Bruno authored
      Submitted by:	Jason Eggleston <jason@eggnet.com>
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D14624
      2a499acf
    • Landon J. Fuller's avatar
      Add missing NULL checks when calling malloc(M_NOWAIT) in · 397b9e40
      Landon J. Fuller authored
      bhnd_nv_strdup/bhnd_nv_strndup.
      
      If malloc(9) failed during initial bhnd(4) attach, while allocating the root
      NVRAM path string ("/"), the returned NULL pointer would be passed as the
      destination to memcpy().
      
      Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
      397b9e40
    • Sean Bruno's avatar
      Handle locking and memory safety for IPV6_PATHMTU in ip6_ctloutput(). · 5cbeca44
      Sean Bruno authored
      Submitted by:	Jason Eggleston <jason@eggnet.com>
      Reviewed by:	ae
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D14622
      5cbeca44
    • Konstantin Belousov's avatar
      Do not send signals to init directly from shutdown_nice(9), do it from · c3982007
      Konstantin Belousov authored
      the task context.
      
      shutdown_nice() is used from the fast interrupt handlers, mostly for
      console drivers, where we cannot lock blockable locks.  Schedule the
      task in the fast queue to send the signal from the proper context.
      
      Reviewed by:	imp
      Discussed with:	bde
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      c3982007
    • Konstantin Belousov's avatar
      Fixes for ptrace(PT_GETXSTATE_INFO) related to the padding in struct · 54f30ad9
      Konstantin Belousov authored
      ptrace_xstate_info).
      
      struct ptrace_xstate_info has 64bit member but ends up with 32bit
      one. As result, on amd64 there is a 32bit padding at the end, but not
      on i386.
      
      We must clear the padding before doing the copyout. For compat32 case,
      we must copyout the structure which does not have the padding at the
      end.  The later fixes 32bit gdb display of the YMM registers when
      running on amd64 kernel.
      
      Reported by:	Vlad Tsyrklevich
      Reviewed by:	brooks (previous version)
      Sponsored by:	The FreeBSD Foundation
      admbugs:	765
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D14794
      54f30ad9
    • Sean Bruno's avatar
      Improve write locking in ip6_ctloutput() with macros. · 37d4fc1e
      Sean Bruno authored
      Submitted by:	Jason Eggleston <jason@eggnet.com>
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D14620
      37d4fc1e
    • Jeff Roberson's avatar
      Lock reservations with a dedicated lock in each reservation. Protect the · 5c930c89
      Jeff Roberson authored
      vmd_free_count with atomics.
      
      This allows us to allocate and free from reservations without the free lock
      except where a superpage is allocated from the physical layer, which is
      roughly 1/512 of the operations on amd64.
      
      Use the counter api to eliminate cache conention on counters.
      
      Reviewed by:	markj
      Tested by:	pho
      Sponsored by:	Netflix, Dell/EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D14707
      5c930c89
    • Jeff Roberson's avatar
      Start witness much earlier in boot so that we can shrink the pend list and · 9a4b4cd3
      Jeff Roberson authored
      make it more immune to further change.
      
      Reviewed by:	markj, imp (Part of D14707)
      Sponsored by:	Netflix, Dell/EMC Isilon
      9a4b4cd3
    • Jeff Roberson's avatar
      Use read_mostly and alignment tags to eliminate or limit false sharing. · cdfeced8
      Jeff Roberson authored
      Reviewed by:	markj (Part of D14707)
      Sponsored by:	Netflix, Dell/EMC Isilon
      cdfeced8
    • Dimitry Andric's avatar
      Pull in r327101 from upstream llvm trunk (by Rafael Espindola): · ad414d86
      Dimitry Andric authored
        Don't treat .symver as a regular alias definition.
      
        This patch starts simplifying the handling of .symver.
      
        For now it just moves the responsibility for creating an alias down to
        the streamer. With that the asm streamer can pass a .symver unchanged,
        which is nice since gas cannot parse "foo@bar = zed".
      
        In a followup I hope to move the handling down to the writer so that
        we don't need special hacks for avoiding breaking names with @@@ on
        windows.
      
      Pull in r327160 from upstream llvm trunk (by Rafael Espindola):
      
        Delay creating an alias for @@@.
      
        With this we only create an alias for @@@ once we know if it should
        use @ or @@. This avoids last minutes renames and hacks to handle MS
        names.
      
        This only handles the ELF writer. LTO still has issues with @@@
        aliases.
      
      Pull in r327928 from upstream llvm trunk (by Vitaly Buka):
      
        Object: Move attribute calculation into RecordStreamer. NFC
      
        Summary: Preparation for D44274
      
        Reviewers: pcc, espindola
      
        Subscribers: hiraditya
      
        Differential Revision: https://reviews.llvm.org/D44276
      
      Pull in r327930 from upstream llvm trunk (by Vitaly Buka):
      
        Object: Fix handling of @@@ in .symver directive
      
        Summary:
        name@@@nodename is going to be replaced with name@@nodename if symbols is
        defined in the assembled file, or name@nodename if undefined.
        https://sourceware.org/binutils/docs/as/Symver.html
      
        Fixes PR36623
      
        Reviewers: pcc, espindola
      
        Subscribers: mehdi_amini, hiraditya
      
        Differential Revision: https://reviews.llvm.org/D44274
      
      Together, these changes fix handling of @@@ in .symver directives when
      doing Link Time Optimization.
      
      Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
      MFC after:	3 months
      X-MFC-With:	r327952
      ad414d86
    • Kyle Evans's avatar
      Re-work efidev ordering to fix efirt preloaded by loader on amd64 · ad456dd9
      Kyle Evans authored
      On amd64, efi_enter calls fpu_kern_enter(). This may not be called until
      fpuinitstate has been invoked, resulting in a kernel panic with
      efirt_load="YES" in loader.conf(5).
      
      Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze
      efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be
      after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at
      SI_SUB_DRIVER, SI_ORDER_ANY.
      
      The not immediately obvious dependency of fpuinitstate by efirt has been
      noted in both places.
      
      Discussed with:	kib, andrew
      Reported by:	Jakob Alvermark <jakob@alvermark.net>
      X-MFC-With:	r330868
      ad456dd9
    • Glen Barber's avatar
      Remove google_accounts_manager from VM_RC_LIST in the GCE configuration · c0505015
      Glen Barber authored
      file, no longer needed.
      
      PR:		221714
      MFC after:	3 days
      Sponsored by:	The FreeBSD Foundation
      c0505015
    • Warner Losh's avatar
      Drop any recursed taking of Giant once and for all at the top of · f0d847af
      Warner Losh authored
      kern_reboot(). The shutdown path is now safe to run without Giant.
      
      Discussed with: kib@
      Sponsored by: Netflix
      f0d847af
    • Andrew Turner's avatar
      Enter into the EFI environment before dereferencing the runtime services · 112b88e3
      Andrew Turner authored
      pointer. This may be within the EFI address space and not the FreeBSD
      kernel address space.
      
      X-MFC-With:	r330868
      Sponsored by:	DARPA, AFRL
      112b88e3
    • Andrew Turner's avatar
      Increase the size of the endpoint buffers. They are double buffered so · c5149a49
      Andrew Turner authored
      need to be twice the size.
      
      Sponsored by:	DARPA, AFRL
      c5149a49
    • Warner Losh's avatar
      Revert r331298 · e7932420
      Warner Losh authored
      Normally, shutdown_nice() just signals init. However, sometimes it
      calls kern_reboot directly. For that case, r331298 dropped the Giant
      lock before calling it. This turns out to be incorrect for the more
      common case where init exists and we just signal it. Restore the old
      behavior. The direct call to kern_reboot() doesn't sync buffers to the
      disk, so should work with Giant held, so we don't need to drop locks
      here for that.
      
      Noticed by: bde@
      Sponsored by: Netflix
      e7932420
    • Alan Somers's avatar
      tftpd: misc Coverity cleanup in the tests · ad5c8bd6
      Alan Somers authored
      A bunch of unchecked return values from open(2) and read(2)
      
      Reported by:	Coverity
      CID:		1386900, 1386911, 1386926, 1386928, 1386932, 1386942
      CID:		1386961, 1386979
      MFC after:	8 days
      X-MFC-With:	330696
      ad5c8bd6
    • Hans Petter Selasky's avatar
      The pci_disable_device() function is also expected to clear the PCI · 555deb3c
      Hans Petter Selasky authored
      busmaster. This fixes LinuxKPI compliancy with Linux.
      
      MFC after:	1 week
      Sponsored by:	Mellanox Technologies
      555deb3c
    • Ed Maste's avatar
      Share Linux errno table with libsysdecode · 1ac2776b
      Ed Maste authored
      Requested by:	jhb
      Reviewed by:	jhb
      Sponsored by:	Turing Robotic Industries Inc.
      1ac2776b
    • Hans Petter Selasky's avatar
      Clear old MSIX IRQ numbers in the LinuxKPI. · e1992aa1
      Hans Petter Selasky authored
      When disabling the MSIX IRQ vectors for a PCI device through the
      LinuxKPI, make sure any old MSIX IRQ numbers are no longer visible to
      the linux_pci_find_irq_dev() function else IRQs can be requested from
      the wrong PCI device.
      
      MFC after:	1 week
      Sponsored by:	Mellanox Technologies
      e1992aa1
    • Kyle Evans's avatar
      Partially revert r328780 · bb0f707e
      Kyle Evans authored
      efi.4th was added to ObsoleteFiles and disconnected from the build, but not
      removed from hte repo. We've since found a mild use for it that makes some
      amount of sense, so partially revert r328780 and bring it back to life.
      
      Reported by:	many
      X-MFC-With:	r331326
      bb0f707e
    • Jonathan T. Looney's avatar
      Bump netstat.1's .Dd after r331347. · 752c009f
      Jonathan T. Looney authored
      752c009f
    • Jonathan T. Looney's avatar
      Add the "TCP Blackbox Recorder" which we discussed at the developer · 2529f56e
      Jonathan T. Looney authored
      summits at BSDCan and BSDCam in 2017.
      
      The TCP Blackbox Recorder allows you to capture events on a TCP connection
      in a ring buffer. It stores metadata with the event. It optionally stores
      the TCP header associated with an event (if the event is associated with a
      packet) and also optionally stores information on the sockets.
      
      It supports setting a log ID on a TCP connection and using this to correlate
      multiple connections that share a common log ID.
      
      You can log connections in different modes. If you are doing a coordinated
      test with a particular connection, you may tell the system to put it in
      mode 4 (continuous dump). Or, if you just want to monitor for errors, you
      can put it in mode 1 (ring buffer) and dump all the ring buffers associated
      with the connection ID when we receive an error signal for that connection
      ID. You can set a default mode that will be applied to a particular ratio
      of incoming connections. You can also manually set a mode using a socket
      option.
      
      This commit includes only basic probes. rrs@ has added quite an abundance
      of probes in his TCP development work. He plans to commit those soon.
      
      There are user-space programs which we plan to commit as ports. These read
      the data from the log device and output pcapng files, and then let you
      analyze the data (and metadata) in the pcapng files.
      
      Reviewed by:	gnn (previous version)
      Obtained from:	Netflix, Inc.
      Relnotes:	yes
      Differential Revision:	https://reviews.freebsd.org/D11085
      2529f56e
    • Li-Wen Hsu's avatar
      Fix build. · bf8e3513
      Li-Wen Hsu authored
      Reviewed by:	cem
      Differential Revision:	https://reviews.freebsd.org/D14793
      bf8e3513
    • Ravi Pokala's avatar
      jedec_dimm: Use correct string length when populating sc->slotid_str · 4754f6ad
      Ravi Pokala authored
      Don't limit the copy to the size of the target string *pointer* (always
      4 on 32-bit / 8 on 64-bit). Instead, just use strdup().
      
      Reported by:	Coverity
      CID:		1386912
      Reviewed by:	cem, imp
      MFC after:	1 week
      4754f6ad
    • Gleb Smirnoff's avatar
      Redo r331328. We need to fix not only type but also format. While · 27cd06b3
      Gleb Smirnoff authored
      here again notice that we are fixing regression from r331106.
      27cd06b3
    • Gleb Smirnoff's avatar
      Fix LINT-NOINET build initializing local to false. This is · 3108a71a
      Gleb Smirnoff authored
      a dead code, since for NOINET build isipv6 is always true,
      but this dead code makes it compilable.
      
      Reported by:	rpokala
      3108a71a
    • Navdeep Parhar's avatar
      cxgbe(4): Do not read MFG diags information from custom boards. · 1b4df78b
      Navdeep Parhar authored
      MFC after:	1 week
      Sponsored by:	Chelsio Communications
      1b4df78b
    • Kyle Evans's avatar
      forthloader: Don't break BIOS boots... · 9afece1e
      Kyle Evans authored
      I thought I tested this scenario, but clearly I failed to. =(
      
      BIOS boots won't have efi-autoresizecons, so trying to use it as a forth
      word fails during include. Use evaluate on "efi-autoresizecons" as a string
      instead to move any potential errors to runtime- safely after we've already
      checked that we're booting UEFI.
      
      Pointy hat to:	me
      Reported by:	cy
      9afece1e