1. 28 May, 2019 1 commit
  2. 27 May, 2019 16 commits
    • Alan Somers's avatar
      VOP_ADVLOCK.9: fix description of flags · 2b3899c0
      Alan Somers authored
      * F_RDLCK, F_UNLCK, and F_WRLCK aren't flags.  They're stored in the
        fl.l_type field.
      * Add F_REMOTE, added in r177633
      * Add F_NOINTR, added in r180025
      
      MFC after:	2 weeks
      Sponsored by:	The FreeBSD Foundation
      2b3899c0
    • Cy Schubert's avatar
      style(9) · 8a596980
      Cy Schubert authored
      MFC after:	1 week
      8a596980
    • Cy Schubert's avatar
      Fix indentation and while at it simplfy the code. · ef7860a1
      Cy Schubert authored
      Reported by:	lwhsu@
      MFC after:	1 week
      ef7860a1
    • Cy Schubert's avatar
      Remove compile-time tests for unsupported versions of FreeBSD. · 8cd20ebd
      Cy Schubert authored
      MFC after:	1 week
      8cd20ebd
    • Conrad Meyer's avatar
      kldxref(8): Sort MDT_MODULE info first in linker.hints output · 9c1fa7a4
      Conrad Meyer authored
      MDT_MODULE info is required to be ordered before any other MDT metadata for
      a given kld because it serves as an implicit record boundary between
      distinct klds for linker.hints consumers.  kldxref(8) has previously relied
      on the assumption that MDT_MODULE was ordered relative to other module
      metadata in kld objects by source code ordering.
      
      However, C does not require implementations to emit file scope objects in
      any particular order, and it seems that GCC 6.4.0 and/or binutils 2.32 ld
      may reorder emitted objects with respect to source code ordering.
      
      So: just take two passes over a given .ko's module metadata, scanning for
      the MDT_MODULE on the first pass and the other metadata on subsequent
      passes.  It's not super expensive and not exactly a performance-critical
      piece of code.  This ensures MDT_MODULE is always ordered before
      MDT_PNP_INFO and other MDTs, regardless of compiler/linker movement.  As a
      fringe benefit, it removes the requirement that care be taken to always
      order MODULE_PNP_INFO after DRIVER_MODULE in source code.
      
      Reviewed by:	emaste, imp
      Differential Revision:	https://reviews.freebsd.org/D20405
      9c1fa7a4
    • Konstantin Belousov's avatar
      Correct some inconsistencies in the earliest created kernel page · fcd0c06e
      Konstantin Belousov authored
      tables which affect demotion.
      
      The last last-level page table under 2M mappings below KERNend was
      only partially initialized.  When that page was used as the hardware
      page table for demotion of the 2M mapping, the result was not
      consistent.  Since pmap_demote_pde() is switched to use PG_PROMOTED as
      the test for the validity of the saved last level page table page, we
      can keep page table pages zero-initialized instead.  Demotion would
      fill them as needed.
      
      Only map the created page tables beyond KERNend, there is no need to
      pre-promote PTmap after KERNend, because the extra mapping is not used.
      
      Only round up *firstaddr to 2M boundary when it is below rounded
      KERNend.  Sometimes the allocpages() calls advance *firstaddr past the
      end of the last 2MB page mapping. In that case, this conditional
      avoids wasting an average of 1MB of physical memory.
      
      Update comments to explain action in more clean and direct language.
      
      Reported and tested by:	pho
      In collaboration with:	alc
      Sponsored by:	The FreeBSD Foundation (kib)
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D20380
      fcd0c06e
    • Andrey V. Elsukov's avatar
      Fix possible NULL pointer dereference. · 44a51474
      Andrey V. Elsukov authored
      bpf_mtap() can invoke catchpacket() for already detached descriptor.
      And this can lead to NULL pointer dereference, since bd_bif pointer
      was reset to NULL in bpf_detachd_locked(). To avoid this, use
      NET_EPOCH_WAIT() when descriptor is removed from interface's descriptors
      list. After the wait it is safe to modify descriptor's content.
      
      Submitted by:	kib
      Reported by:	slavash
      MFC after:	1 week
      44a51474
    • Xin LI's avatar
      Chase r261913: hardcoded default crypt(3) algorithm is SHA-512 when DES · a6c0c824
      Xin LI authored
      is not available.
      
      Submitted by:	Ali Mashtizadeh <ali mashtizadeh.com>
      MFC after:	3 days
      a6c0c824
    • Andrey V. Elsukov's avatar
      Remove unused token that was added in r348235. · 09899450
      Andrey V. Elsukov authored
      MFC after:	2 weeks
      09899450
    • Kirk McKusick's avatar
      Add function name and line number debugging information to softupdates · 298184ac
      Kirk McKusick authored
      worklist structures to help track their movement between work lists.
      No functional change to the operation of soft updates intended.
      298184ac
    • Justin Hibbits's avatar
      kern/CTF: link_elf_ctf_get() on big endian platforms · a5868885
      Justin Hibbits authored
      Check the CTF magic number in big endian platforms.  This lets DTrace FBT
      handle types correctly on these platforms.
      
      Submitted by:	Brandon Bergren
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D20413
      a5868885
    • Justin Hibbits's avatar
      powerpc/dtrace: Fix fbt function probing for ELFv2 · b2aea1ad
      Justin Hibbits authored
      '.' function names exist only in ELFv1.  ELFv2 does away with function
      descriptors, and look more like they do on powerpc(32) and most other
      platforms, as direct function pointers.  Stop blacklisting regular function
      names in ELFv2.
      
      Submitted by:	Brandon Bergren
      Differential Revision:	https://reviews.freebsd.org/D20346
      b2aea1ad
    • Conrad Meyer's avatar
      virtio_random(4): Remove unneeded reference to device · af8f74ad
      Conrad Meyer authored
      The device_t always references the softc, so we can pass the device and
      obtain the softc instead of the other way around.
      af8f74ad
    • Conrad Meyer's avatar
      virtio.4: Add missing devices and Xr · b1adb000
      Conrad Meyer authored
      This page could probably use further improvement.
      b1adb000
    • Conrad Meyer's avatar
      aesni(4): Fix trivial type typo · 6fe286ed
      Conrad Meyer authored
      This fixes the kernel build with xtoolchain-gcc (6.4.0).
      
      X-MFC-With:	r348268
      6fe286ed
    • Conrad Meyer's avatar
      sys/bufobj.h: Avoid using C++ reserved keyword 'private' · 9ecc02ea
      Conrad Meyer authored
      No functional change (except for out-of-tree C++ kmods).
      9ecc02ea
  3. 26 May, 2019 5 commits
  4. 25 May, 2019 9 commits
  5. 24 May, 2019 9 commits
    • Konstantin Belousov's avatar
      Fix too loose assert in pmap_large_unmap(). · 59659e78
      Konstantin Belousov authored
      The upper bound for the valid address from the large map used
      LARGEMAP_MAX_ADDRESS instead of LARGEMAP_MIN_ADDRESS.  Provide a
      function-like macro for proper upper value.
      
      Noted by:	markj
      Reviewed by:	alc, markj
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D20386
      59659e78
    • Konstantin Belousov's avatar
      Add PG_PS_PDP_FRAME symbol. · f3dbf2ca
      Konstantin Belousov authored
      Similar to PG_FRAME and PG_PS_FRAME, it denotes the mask of the
      physical address component of 1G superpage PDP entry.
      
      Reviewed by:	alc, markj
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D20386
      f3dbf2ca
    • Conrad Meyer's avatar
      Disable intr_storm_threshold mechanism by default · 5d0e8299
      Conrad Meyer authored
      The ixl.4 manual page has documented that the threshold falsely detects
      interrupt storms on 40Gbit NICs as long ago as 2015, and we have seen
      similar false positives with the ioat(4) DMA device (which can push GB/s).
      
      For example, synthetic load can be generated with tools/tools/ioat
      'ioatcontrol 0 200 8192 1 1000' (allocate 200x8kB buffers, generate an
      interrupt for each one, and do this for 1000 milliseconds).  With
      storm-detection disabled, the Broadwell-EP version of this device is capable
      of generating ~350k real interrupts per second.
      
      The following historical context comes from jhb@: Originally, the threshold
      worked around incorrect routing of PCI INTx interrupts on single-CPU systems
      which would end up in a hard hang during boot.  Since the threshold was
      added, our PCI interrupt routing was improved, most PCI interrupts use
      edge-triggered MSI instead of level-triggered INTx, and typical systems have
      multiple CPUs available to service interrupts.
      
      On the off chance that the threshold is useful in the future, it remains
      available as a tunable and sysctl.
      
      Reviewed by:	jhb
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D20401
      5d0e8299
    • John Baldwin's avatar
      Restructure mbuf send tags to provide stronger guarantees. · fb3bc596
      John Baldwin authored
      - Perform ifp mismatch checks (to determine if a send tag is allocated
        for a different ifp than the one the packet is being output on), in
        ip_output() and ip6_output().  This avoids sending packets with send
        tags to ifnet drivers that don't support send tags.
      
        Since we are now checking for ifp mismatches before invoking
        if_output, we can now try to allocate a new tag before invoking
        if_output sending the original packet on the new tag if allocation
        succeeds.
      
        To avoid code duplication for the fragment and unfragmented cases,
        add ip_output_send() and ip6_output_send() as wrappers around
        if_output and nd6_output_ifp, respectively.  All of the logic for
        setting send tags and dealing with send tag-related errors is done
        in these wrapper functions.
      
        For pseudo interfaces that wrap other network interfaces (vlan and
        lagg), wrapper send tags are now allocated so that ip*_output see
        the wrapper ifp as the ifp in the send tag.  The if_transmit
        routines rewrite the send tags after performing an ifp mismatch
        check.  If an ifp mismatch is detected, the transmit routines fail
        with EAGAIN.
      
      - To provide clearer life cycle management of send tags, especially
        in the presence of vlan and lagg wrapper tags, add a reference count
        to send tags managed via m_snd_tag_ref() and m_snd_tag_rele().
        Provide a helper function (m_snd_tag_init()) for use by drivers
        supporting send tags.  m_snd_tag_init() takes care of the if_ref
        on the ifp meaning that code alloating send tags via if_snd_tag_alloc
        no longer has to manage that manually.  Similarly, m_snd_tag_rele
        drops the refcount on the ifp after invoking if_snd_tag_free when
        the last reference to a send tag is dropped.
      
        This also closes use after free races if there are pending packets in
        driver tx rings after the socket is closed (e.g. from tcpdrop).
      
        In order for m_free to work reliably, add a new CSUM_SND_TAG flag in
        csum_flags to indicate 'snd_tag' is set (rather than 'rcvif').
        Drivers now also check this flag instead of checking snd_tag against
        NULL.  This avoids false positive matches when a forwarded packet
        has a non-NULL rcvif that was treated as a send tag.
      
      - cxgbe was relying on snd_tag_free being called when the inp was
        detached so that it could kick the firmware to flush any pending
        work on the flow.  This is because the driver doesn't require ACK
        messages from the firmware for every request, but instead does a
        kind of manual interrupt coalescing by only setting a flag to
        request a completion on a subset of requests.  If all of the
        in-flight requests don't have the flag when the tag is detached from
        the inp, the flow might never return the credits.  The current
        snd_tag_free command issues a flush command to force the credits to
        return.  However, the credit return is what also frees the mbufs,
        and since those mbufs now hold references on the tag, this meant
        that snd_tag_free would never be called.
      
        To fix, explicitly drop the mbuf's reference on the snd tag when the
        mbuf is queued in the firmware work queue.  This means that once the
        inp's reference on the tag goes away and all in-flight mbufs have
        been queued to the firmware, tag's refcount will drop to zero and
        snd_tag_free will kick in and send the flush request.  Note that we
        need to avoid doing this in the middle of ethofld_tx(), so the
        driver grabs a temporary reference on the tag around that loop to
        defer the free to the end of the function in case it sends the last
        mbuf to the queue after the inp has dropped its reference on the
        tag.
      
      - mlx5 preallocates send tags and was using the ifp pointer even when
        the send tag wasn't in use.  Explicitly use the ifp from other data
        structures instead.
      
      - Sprinkle some assertions in various places to assert that received
        packets don't have a send tag, and that other places that overwrite
        rcvif (e.g. 802.11 transmit) don't clobber a send tag pointer.
      
      Reviewed by:	gallatin, hselasky, rgrimes, ae
      Sponsored by:	Netflix
      Differential Revision:	https://reviews.freebsd.org/D20117
      fb3bc596
    • John Baldwin's avatar
      Add initial support for 'qSupported' to the debug server. · 07e007e1
      John Baldwin authored
      This doesn't recognize any features yet, but does parse the features
      string.  It advertises an arbitrary packet size of 4k.
      
      Reviewed by:	markj, Scott Phillips <d.scott.phillips@intel.com>
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D20308
      07e007e1
    • Alan Somers's avatar
      Remove "struct ucred*" argument from vtruncbuf · 65417f5e
      Alan Somers authored
      vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever
      since that function was first added in r34611. Remove it.  Also, remove some
      "struct ucred" arguments from fuse and nfs functions that were only used by
      vtruncbuf.
      
      Reviewed by:	cem
      MFC after:	2 weeks
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D20377
      65417f5e
    • Piotr Kubaj's avatar
      Add snd_hda(4) to GENERIC64 used by powerpc64. · 57557e71
      Piotr Kubaj authored
      amd64 also has snd_hda(4) in GENERIC.
      
      Approved by:	jhibbits (src committer), linimon (mentor)
      57557e71
    • Simon J. Gerraty's avatar
      ficl pfopen: verify file · 2ef9ff7d
      Simon J. Gerraty authored
      If the file is verified - do not allow write
      otherwise do not allow read.
      
      Add O_ACCMODE to stand.h
      
      Reviewed by:	stevek, mindal_semihalf.com
      MFC after:	3 days
      Sponsored by:	Juniper Networks
      Differential Revision:	https://reviews.freebsd.org/D20387
      2ef9ff7d
    • Leandro Lupori's avatar
      Make options MD_ROOT_MEM default on PPC64 · d3f78f00
      Leandro Lupori authored
      Having this option enabled by default on PowerPC64 kernels makes
      booting ISO images much easier when on PowerNV.
      
      With it, the ISO may simply be given to the -i flag of kexec.
      Better yet, the ISO may be loop mounted on PetitBoot and its
      kernel may be used to load itself.
      
      Without this option, booting ISOs on remote PPC64 machines usually
      involve preparing a separate kernel, with this option enabled.
      d3f78f00