1. Jul 01, 2016
  2. Jun 30, 2016
    • bz's avatar
      Virtualise ipfilter. · 0c1171f9
      bz authored
      Split initializzation an teardown into module (global state) and VNET
      (per virtual network stack) parts.  Virtualise global state, which is
      not "const".
      
      Cleanup eventhandlers, so that we can make use of the passed in argument
      to get the vnet state from the ifp;  disable the "cloner" event as it is
      too early, has no state, and can fire before initialisation (see comment
      in the source).
      
      Handle the dynamic sysctls specially.  The problem is that "ipmain"
      is the virtualized struct, but the fields used for the sysctls are
      hanging off memory allocated and attached to the virtualized "ipmain"
      thus standard VNET macros and sysctl handling do not work.
      We still say it is VNET sysctls to get the proper protection checks
      in the VIMAGE case;  to solve the problem of accessing the right bit
      of memory hanging of each per-VNET ipmain, we use a dedicated handler
      function wrapping around sysctl_ipf_int() undoing the base calculation
      from kern_sysctl.c and then adding the passed-in offset into the right
      struct depending on handler.  A bit of a mess exposing VNET-internals
      this way but the only way to keep the code without having to massively
      restructure ipf internals.
      
      Approved by:		re (hrs)
      Sponsored by:		The FreeBSD Foundation
      Obtained from:		projects/vnet
      MFC after:		2 weeks
      Reviewed by:		cy
      Differential Revision:	https://reviews.freebsd.org/D7000
      0c1171f9
    • mav's avatar
      Revert r299454 and r299448. · b281d573
      mav authored
      Those changes were found confusing FreeBSD libc ACL code, that doesn't
      differentiate ACL for directories and files, and report ACLs for all
      directories created after those patches as non-trivial.  On the other
      side these changes were considered wrong from POSIX and NFSv4 points of
      view.  Until further investigation done upstream, revert those changes
      locally in preparation for FreeBSD 11.0 release.
      
      Approved by:	re (hrs)
      b281d573
    • cy's avatar
      Remove dead code. · 95616411
      cy authored
      Approved by:	re@ (hrs@)
      MFC after:	1 week
      95616411
    • mm's avatar
      MFV r302264: · d19e109f
      mm authored
      Sync libarchive with vendor, bugfixes for tests:
      - fix tests on filesystems without birthtime support, e.g. UFS1 (1)
      - vendor issue #729: avoid use of C99 for-scope declarations in
        test_write_format_gnutar_filenames.c
      
      MFC after:	1 week
      PR:		204157 (1)
      Approved by:	re (hrs)
      d19e109f
    • tuexen's avatar
      This patch fixes two bugs related to the setting of the I-Bit · 557adfd0
      tuexen authored
      for SCTP DATA and I-DATA chunks.
      * For fragmented user messages, set the I-Bit only on the last
        fragment.
      * When using explicit EOR mode, set the I-Bit on the last
        fragment, whenever SCTP_SACK_IMMEDIATELY was set in snd_flags
        for any of the send() calls.
      
      Approved by:	re (hrs)
      MFC after:	1 week
      557adfd0
    • wma's avatar
      ARM, ARM64: Workaround for buf_ring reordering · eaf77c9c
      wma authored
          This patch offers a workaround to buf_ring reordering
          visible on armv7 and armv8. This is supposed to be
          removed once new buf_ring implementation is integrated
          into the tree.
      
          Obtained from:         Semihalf
          Reviewed by:           alc,emaste
          Differential Revision: https://reviews.freebsd.org/D6986
          Approved by:           re (gjb)
      eaf77c9c
    • wma's avatar
      ARM64: fix DMAP calculation · 2da75cc6
      wma authored
          Use arithmetic operators instead of logical. This fixes
          DMAP ranges calculation for ThunderX Dual Socket.
      
          Obtained from:         Semihalf
          Sponsored by:          Cavium
          Reviewed by:           zbb
          Differential Revision: https://reviews.freebsd.org/D7023
          Approved by:           re (gjb)
      2da75cc6
    • bz's avatar
      Move the ipfw_log_bpf() calls from global module initialisation to · c79242bc
      bz authored
      per-VNET initialisation and virtualise the interface cloning to
      allow a dedicated ipfw log interface per VNET.
      
      Approved by:		re (gjb)
      MFC after:		2 weeks
      Sponsored by:		The FreeBSD Foundation
      c79242bc
    • bz's avatar
      Remove unused global variables as well as unused memory · 47f08657
      bz authored
      allocations from ipfilter in preparation for VNET support.
      
      Suggested by:		cy (see D7000)
      Sponsored by:		The FreeBSD Foundation
      MFC after:		2 weeks
      Approved by:		re (gjb)
      47f08657
    • cperciva's avatar
      Enable indirect segment I/Os by default in the Xen blkfront driver when · 94125daa
      cperciva authored
      running on EC2.  Due to improvements in EC2, the performance penalty which
      was present on some EC2 instances no longer exists, and enabling this
      feature now consistently yields ~20% higher throughput with equal or lower
      latency.
      
      Reverts:	r286063
      Approved by:	re (gjb)
      MFC after:	2 weeks
      Relnotes:	Improved disk throughput on EC2
      94125daa
    • gonzo's avatar
      Fixed FreeBSD/mips MALTA support for QEMU · 62a7c954
      gonzo authored
      Recource management functions in GT PCI controller driver
      treated memory/IO resources as KSEG1 addresses, later during
      activation these values would be increased by KSEG1 base again
      rendering the address invalid and causing "bus error" trap.
      
      Actual logic was converted to use real physical addresses,
      so mapping takes place only during activation.
      
      Submitted by:	Aleksandr Rybalko <ray@FreeBSD.org>
      Approved by:	re (gjb)
      62a7c954
    • bdrewery's avatar
      Flush every line when using meta mode and no -j or with -B. · c3a4dbd1
      bdrewery authored
      Otherwise the output is buffered and it appears that make is stuck on something
      long-running.  This problem is not present with -j as it uses different
      code that was already flushing.
      
      Discussed with:	sjg
      Approved by:	re (blanket, META_MODE)
      Sponsored by:	EMC / Isilon Storage Division
      c3a4dbd1
    • bdrewery's avatar
      WITH_META_MODE: Avoid false-positive error due to missing .meta with build commands. · 3ef66a1a
      bdrewery authored
      Sponsored by:	EMC / Isilon Storage Division
      Approved by:	re (blanket, META_MODE)
      3ef66a1a
    • sobomax's avatar
      1.Improve handling around last compressed block of the file, which is · fa8fbeaa
      sobomax authored
        necessary because CLOOP format lacks explicit EOF or length, so that
        in the presence of padding or when the CLOOP is put onto a larger
        partition upper level provider size may be larger. Bound amount
        of extra data that we might touch to the max length of the compressed
        block and detect zero-padding in the last cluster, which when
        sector is all-zero might cause us to emit bogus I/O error after
        decompression of that fails. To not make code any more complicated
        that it needs to be deal with it in lazy-manner, i.e. when we
        first access that specific cluster.
      
        This change also fixes stupid mistake in the LZMA code, inherited
        from geom_lzma, which does not share length of the output buffer
        buffer with the decompression routine, so that in the presence
        of corrupted or purposedly tailored data may easily cause heap
        overflow and kernel memory corruption.
      
        Beef up validation of the CLOOP TOC by checking that lengths of
        all but the last compressed clusters match upper limit set by
        the decompressor and improve some error diagnostic output while
        I am here.
      
      2.Add kern.geom.uzip.attach_to tunable to artifically limit
        attaching uzip to certain devices in the dev tree only.
      
          For example the following only makes us attaching to the
          GPT labels:
      
          kern.geom.uzip.attach_to="gpt/*"
      
      3.Add kern.geom.uzip.noattach_to, which does opposite to the (2)
        above, i.e. prevents geom_uzip from tasting / attaching to
        providers matching some pattern. By default we don't attach
        to our own kind, i.e. kern.geom.uzip.noattach_to="*.uzip".
        It saves us quite some CPU cycles, esp on low-end embedded
        systems.
      
      Approved by:	re (gjb)
      Differential Revision:	https://reviews.freebsd.org/D7013
      fa8fbeaa
    • avos's avatar
      net80211: fix LOR/deadlock in ieee80211_ff_node_cleanup(). · 19e19631
      avos authored
      Add new lock for stageq (part of ieee80211_superg structure) and
      ni_tx_superg (part of ieee80211_node structure);
      drop com_lock protection where it is used to protect them.
      
      While here, drop duplicate OPACKETS counter incrementation.
      
      ni_tx_ampdu is not protected with it (however, it is also used without
      locking in other places; probably, it requires some other solution
      to be thread-safe).
      
      Tested with RTL8188CUS (AP) and RTL8188EU (STA).
      
      NOTE: Since this change breaks KBI, all wireless drivers need to be
      recompiled.
      
      Reviewed by:	adrian
      Approved by:	re (gjb)
      Differential Revision:	https://reviews.freebsd.org/D6958
      19e19631
    • bdrewery's avatar
      Don't warn about needing filemon for makeman. · 5c68448b
      bdrewery authored
      r287879 wasn't quite enough here since Makefile.inc1 is running
      'make -C release -V VERSION' and hitting the warning.
      
      Reported by:	lattera
      Sponsored by:	EMC / Isilon Storage Division
      Approved by:	re (blanket, META_MODE)
      5c68448b
    • sbruno's avatar
      Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length. · 7fe30bec
      sbruno authored
      PR:	202625
      Submitted by:	niakrisn@gmail.com
      Reviewed by:	scottl kenm
      Approved by:	re (gjb)
      MFC after:	2 weeks
      7fe30bec
    • nwhitehorn's avatar
      Fix fat-fingering: #if AIM should have been #ifdef AIM to avoid failures on · 032d51d9
      nwhitehorn authored
      Book-E kernels.
      
      Approved by:	re (gjb)
      Pointy hat to:	nwhitehorn
      032d51d9
  3. Jun 29, 2016
    • nwhitehorn's avatar
      Do not rely on firmware having pre-enabled the MMU in a reasonable way for · 74554ccb
      nwhitehorn authored
      late boot: enable it explicitly after installing the page tables. If booting
      from an FDT, also make sure to escape the firmware's MMU context early
      before overwriting firmware page tables.
      
      Approved by:	re (gjb)
      74554ccb
    • emaste's avatar
      libcxxrt: correct mangled "typeinfo name" symbols in Version.map · e45b60ce
      emaste authored
      r260553 added missing C++ typinfos to libcxxrt's version script.
      It appears that a number of duplicate mangled symbols were added due to
      a cut and paste error. Switch the second instances to _ZTS*,
      typeinfo name for *.
      
      Found by lld, which produces an error or warning for duplicate symbols.
      
      Reviewed by:	dim
      Approved by:	re (gjb)
      MFC after:	1 week
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D7011
      e45b60ce
    • smh's avatar
      Allow ZFS ARC min / max to be tuned at runtime · b2463409
      smh authored
      Prior to this change ZFS ARC min / max could only be changed using
      boot time tunables, this allows the values to be tuned at runtime
      using the sysctls:
      * vfs.zfs.arc_max
      * vfs.zfs.arc_min
      
      When adjusting ZFS ARC minimum the memory used  will only reduce
      to the new minimum given memory pressure.
      
      Reviewed by:	allanjude
      Approved by:	re (gjb)
      MFC after:	2 weeks
      Relnotes:	yes
      Sponsored by:	Multiplay
      Differential Revision:	https://reviews.freebsd.org/D5907
      b2463409
    • np's avatar
      cxgbe(4): Do not bring up an interface when IFCAP_TOE is enabled on it. · ecbf2c35
      np authored
      The interface's queues are functional after VI_INIT_DONE (which is short
      of interface-up) and that's all that's needed for t4_tom to communicate
      with the chip.
      
      Approved by:	re@ (gjb@)
      Sponsored by:	Chelsio Communications
      ecbf2c35
    • cem's avatar
      USB: Add Garmin FR230 device quirk (broken INQUIRY) · eaa90873
      cem authored
      PR:		210544
      Reviewed by:	hps
      Approved by:	re
      eaa90873
    • delphij's avatar
      Vendor import of expat 2.2.0 (trimmed). · 133af1c3
      delphij authored
      133af1c3
    • bz's avatar
      Several device drivers call if_alloc() and then do further checks and · 2acea814
      bz authored
      will cal if_free() in case of conflict, error, ..
      if_free() however sets the VNET instance from the ifp->if_vnet which
      was not yet initialized but would only in if_attach(). Fix this by
      setting the curvnet from where we allocate the interface in if_alloc().
      if_attach() will later overwrite this as needed. We do not set the home_vnet
      early on as we only want to prevent the if_free() panic but not change any
      of the other housekeeping, e.g., triggered through ifioctl()s.
      
      Reviewed by:	brooks
      Approved by:	re (gjb)
      MFC after:	2 weeks
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D7010
      2acea814
    • bdrewery's avatar
      WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms. · 1e1f5317
      bdrewery authored
      As the XXX notes, these should really be checking MK_GNUCXX since there is
      already a version check in share/mk/src.opts.mk to disable it.  Fixing that
      here is more complex though.  This could also be using X_COMPILER_FEATURES
      but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic.
      
      Tested by:	andreast
      Sponsored by:	EMC / Isilon Storage Division
      Approved by:	re (gjb)
      1e1f5317
    • phk's avatar
      Do not coredump if the packet is too long in the global (non-interface · 8c8129e2
      phk authored
      associated) instance.
      
      The result is that the packet is dropped without an indication
      that smaller MTU is advisable, which is not optimal, but better
      than a NULL pointer deref.
      
      Approved by:	re (glebius)
      8c8129e2
    • bdrewery's avatar
      Use on crypto.x and rpc.x from the source tree. · a88a58d8
      bdrewery authored
      This fixes the build when DESTDIR may be blank or not yet populated.
      It also fixes reproducibility.
      
      Submitted by:	brooks
      Approved by:	re (gjb)
      Differential Revision:	https://reviews.freebsd.org/D6455
      a88a58d8
    • sbruno's avatar
      Revert svn r302253 at the request/review of Ken M. This commit is · c6d7fbc0
      sbruno authored
      incorrect.
      
      PR:		202625
      Approved by:	re (implicit)
      c6d7fbc0
    • sbruno's avatar
      Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length. · 90baee12
      sbruno authored
      PR:		202625
      Submitted by:	niakrisn@gmail.com
      Reviewed by:	scottl
      Approved by:	re (hrs)
      MFC after:	2 weeks
      90baee12
    • kib's avatar
      Currently the ntptime code and resettodr() are Giant-locked. In · 42d92058
      kib authored
      particular, the Giant is supposed to protect against parallel
      ntp_adjtime(2) invocations.  But, for instance, sys_ntp_adjtime() does
      copyout(9) under Giant and then examines time_status to return syscall
      result.  Since copyout(9) could sleep, the syscall result might be
      inconsistent.
      
      Another and more important issue is that if PPS is configured,
      hardpps(9) is executed without any protection against the parallel
      top-level code invocation. Potentially, this may result in the
      inconsistent state of the ntptime state variables, but I cannot say
      how serious such distortion is. The non-functional splclock() call in
      sys_ntp_adjtime() protected against clock interrupts calling hardpps()
      in the pre-SMP era.
      
      Modernize the locking. A mutex protects ntptime data.  Due to the
      hardpps() KPI legitimately serving from the interrupt filters (and
      e.g. uart(4) does call it from filter), the lock cannot be sleepable
      mutex if PPS_SYNC is defined.  Otherwise, use normal sleepable mutex
      to reduce interrupt latency.
      
      Reviewed by:	  imp, jhb
      Sponsored by:	  The FreeBSD Foundation
      Approved by:	  re (gjb)
      Differential revision:	https://reviews.freebsd.org/D6825
      42d92058
    • kib's avatar
      Do not use Giant to prevent parallel calls to CLOCK_SETTIME(). Use · 8543a46c
      kib authored
      private mtx in resettodr(), no implementation of CLOCK_SETTIME() is
      allowed to sleep.
      
      Reviewed by:	  imp, jhb
      Sponsored by:	  The FreeBSD Foundation
      Approved by:	  re (gjb)
      X-Differential revision:	https://reviews.freebsd.org/D6825
      8543a46c
    • kib's avatar
      Complete r302215. TDF_SBDRY | TDF_SERESTART and TDF_SBDRY | · fb3ea99e
      kib authored
      TDF_SEINTR flags values, unlike TDF_SBDRY, must be treated almost as
      if TDF_SBDRY is not set for STOP signal delivery.  The only difference
      is that sig_suspend_threads() should abort the sleep instead of doing
      immediate suspension.
      
      Reported by:	ngie
      Sponsored by:	The FreeBSD Foundation
      MFC after:	12 days
      Approved by:	re (gjb)
      fb3ea99e
  4. Jun 28, 2016