1. 10 Aug, 2017 7 commits
    • royger's avatar
      x86: bump MAX_APIC_ID to 512 · 55936e52
      royger authored
      Introduce a new define to take int account the xAPIC ID limit, for
      systems where x2APIC is not available/reliable.
      Also change some of the usages of the APIC ID to use an unsigned int
      (which is the correct storage type to deal with x2APIC IDs as found in
      x2APIC MADT entries).
      This allows booting FreeBSD on a box with 256 CPUs and APIC IDs up to
      FreeBSD/SMP: Multiprocessor System Detected: 256 CPUs
      FreeBSD/SMP: 1 package(s) x 64 core(s) x 4 hardware threads
      Package HW ID = 0
      	Core HW ID = 0
      		CPU0 (BSP): APIC ID: 0
      		CPU1 (AP/HT): APIC ID: 1
      		CPU2 (AP/HT): APIC ID: 2
      		CPU3 (AP/HT): APIC ID: 3
      	Core HW ID = 73
      		CPU252 (AP): APIC ID: 292
      		CPU253 (AP/HT): APIC ID: 293
      		CPU254 (AP/HT): APIC ID: 294
      		CPU255 (AP/HT): APIC ID: 295
      Submitted by:		kib (previous version)
      Relnotes:		yes
      MFC after:		1 month
      Reviewed by:		kib
      Differential revision:	https://reviews.freebsd.org/D11913
    • royger's avatar
      x86: make the arrays that depend on MAX_APIC_ID dynamic · e45f85c5
      royger authored
      So that MAX_APIC_ID can be bumped without wasting memory.
      Note that the usage of MAX_APIC_ID in the SRAT parsing forces the
      parser to allocate memory directly from the phys_avail physical memory
      array, which is not the best approach probably, but I haven't found
      any other way to allocate memory so early in boot. This memory is not
      returned to the system afterwards, but at least it's sized according
      to the maximum APIC ID found in the MADT table.
      Sponsored by:		Citrix Systems R&D
      MFC after:		1 month
      Reviewed by:		kib
      Differential revision:	https://reviews.freebsd.org/D11912
    • royger's avatar
      apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase · 345fb326
      royger authored
      Populate the lapics arrays and call cpu_add/lapic_create in the setup
      phase instead. Also store the max APIC ID found in the newly
      introduced max_apic_id global variable.
      This is a requirement in order to make the static arrays currently
      using MAX_LAPIC_ID dynamic.
      Sponsored by:		Citrix Systems R&D
      MFC after:		1 month
      Reviewed by:		kib
      Differential revision:	https://reviews.freebsd.org/D11911
    • sbruno's avatar
      Don't leak mbufs if clusers exceeds the number of segments. This would · fa16cef5
      sbruno authored
      leak mbufs over time causing crashes.
      PR:		221202
      Submitted by:	Matt Macy <matt@mattmacy.io>
      Reported by:	gergely.czuczy@harmless.hu
      Sponsored by:	Limelight Networks
    • sbruno's avatar
      Export IFCAP_HWSTATS so that we don't experience double stats counting · 3be0299b
      sbruno authored
      on iflib enabled devices.
      PR:		220198
      Submitted by:	Matt Macy <matt@mattmacy.io>
      Reported by:	Ben Woods <woodsb02@freebsd.org>
      Sponsored by:	Limelight Networks
    • sbruno's avatar
      Add sbruno@ birthday information. · 0b3aa1c5
      sbruno authored
      Reported by:	mckusick
    • rlibby's avatar
      Add myself (rlibby) to calendar.freebsd · 961d30ab
      rlibby authored
      Reported by:	mckusick
      Approved by:	markj (mentor)
      Differential Revision:	https://reviews.freebsd.org/D11947
  2. 09 Aug, 2017 33 commits
    • rlibby's avatar
      Pick 'Remove external linkage for spin_adaptive' from upstream jemalloc · 39ef9da6
      rlibby authored
      Apply the changes from upstream jemalloc 048c6679.  This is actually not
      quite a cherry pick due to makefile difference and because FreeBSD does
      not carry the msvc project files which were also modified in that
      Approved by:	jasone (maintainer), markj (mentor)
      Sponsored by:	Dell EMC Isilon
    • davidcs's avatar
    • kevans's avatar
      Add myself to calendar.freebsd · efd03286
      kevans authored
      Requested by:	mckusick
      Approved by:	emaste (mentor)
      Differential Revision:	https://reviews.freebsd.org/D11936
    • rlibby's avatar
      i386/boot2: -fno-asynchronous-unwind-tables for gcc · 214aa8f9
      rlibby authored
      The amd64 build of boot2 was failing with gcc 6.3.0 due to being more
      than 1 kB too large. It was apparently generating a .eh_frame section
      which was not being removed by objcopy -S. The .eh_frame section seems
      to be mandatory per the amd64 ABI, but boot2 is compiled for i386 (uses
      -m32), and therefore should be optional in this context. Suppress
      generation of .eh_frame with the -fno-asynchronous-unwind-tables flag to
      gcc. This saves 1348 bytes (the limit is 7680 bytes).
      Reviewed by:	dim, imp
      Approved by:	markj (mentor)
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D11928
    • ae's avatar
      Make user supplied data checks a bit stricter. · f7286cb3
      ae authored
      key_msg2sp() is used for parsing data from setsockopt(IP[V6]_IPSEC_POLICY)
      call. This socket option is usually used to configure IPsec bypass for
      socket. Only privileged user can set this socket option.
      The message syntax is described here
      and our libipsec is usually used to create the correct request.
      Add additional checks:
      * that sadb_x_ipsecrequest_len is not out of bounds of user supplied buffer
      * that src/dst's sa_len is the same
      * that 2*sa_len is not out of bounds of user supplied buffer
      * that 2*sa_len fits into bounds of sadb_x_ipsecrequest
      Reported by:	Ilja van Sprundel
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D11796
    • gjb's avatar
      Add a dependency on the kernel package for the runtime package. · 4f9c2661
      gjb authored
      The idea here is that, provided upstream pkg(8) maintainers accept
      the proposed change, the kernel.ucl will contain a post-install
      script causing pkg(8) to emit a message informing to reboot the
      system after the kernel is upgraded using 'pkg upgrade', so the
      new userland is installed on the running new kernel.  At present,
      this functionality does not exist in pkg(8), but will help ensure
      the upgrade path follows that from UPDATING.  To work around this
      for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
      wish to proceed if not set to true.
      Since there is a kernel dependency, and a non-GENERIC kernel may
      be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
      runtime.ucl with the first-built kernel set either via command line
      or in make.conf(5).
      MFC after:	5 days
      Sponsored by:	The FreeBSD Foundation
    • emaste's avatar
      lldb: Make i386-*-freebsd expression work on JIT path · ec11c516
      emaste authored
      * Enable i386 ABI creation for freebsd
      * Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap
      * Unlike linux, the last argument of mmap is actually 64-bit(off_t).
        This requires us to push an additional word for the higher order bits.
      * Prior to this change, ktrace dump will show mmap failures due to
        invalid argument coming from the 6th mmap argument.
      Submitted by:	Karnajit Wangkhem
      Differential Revision:	https://reviews.llvm.org/D34776
    • emaste's avatar
      cat: fix build with -DNO_UDOM_SUPPORT · e278a20c
      emaste authored
      Sponsored by:	The FreeBSD Foundation
    • kevans's avatar
      capsicum_helpers: Add FIODTYPE to default ioctls allowed · d2e90c7d
      kevans authored
      FIODTYPE will be needed by hexdump(1) to speed up the -s flag on devices
      that should be able to support fseek(3); specifically, in an attempt to
      correct for the fact that most tape drives don't support seeking yet don't
      indicate as such when fseeko(3) is invoked. Related: D10939
      Reviewed by:	cem, emaste, oshogbo
      Approved by:	emaste (mentor)
      Differential Revision:	https://reviews.freebsd.org/D10937
    • jkim's avatar
      Split identify_cpu() into two functions for amd64 as we do for i386. This · d871b34d
      jkim authored
      reduces diff between amd64 and i386.  Also, it fixes a regression introduced
      in r322076, i.e., identify_hypervisor() failed to identify some hypervisors.
      This function assumes cpu_feature2 is already initialized.
      Reported by:	dexuan
      Tested by:	dexuan
    • kevans's avatar
      libusb(3): Expose device caps as libusb_bos_descriptor::dev_capability · db457130
      kevans authored
      Some libusb consumers in Linux-land (in this case, libusb4java) expect a
      dev_capability member that they can use to enumerate the device
      No particular layout is expected of this, just that it can be traversed
      using the bLength member until bNumDeviceCapabilities are read and that the
      consumer may then use one of the libusb_get_*_descriptor methods to extract
      specific (usb 2.0 vs. ss) capability information.
      In collaboration with:	hselasky
      Reviewed by:	hselasky
      Approved by:	emaste (mentor)
      Differential Revision:	https://reviews.freebsd.org/D11494
    • glebius's avatar
      Plug uninitialized stack variable leak in sendfile(2). · 3eeca31b
      glebius authored
      Reported by:	Ilja Van Sprundel <ivansprundel ioactive.com>
      Submitted by:	Domagoj Stolfa <domagoj.stolfa gmail.com>
      MFC after:	1 week
      Security:	uninitialized stack variable leak
    • dim's avatar
      Upgrade our copies of clang, llvm and libc++ to r310316 from the · 2dddd7a4
      dim authored
      upstream release_50 branch.
      MFC after:	2 months
      X-MFC-with:	r321369
    • imp's avatar
      Also provide a warning for geom_fox. · baef6c41
      imp authored
      Differential Review: https://reviews.freebsd.org/D11935
      Requested by: jhb@
      MFC After: 3 days
    • imp's avatar
      Mark geom classes as deprecated. · 158640d1
      imp authored
      geom_bsd, geom_mbr and geom_sunlabel have been obsolete since Marcel
      Moolenaar's geom_part was in FreeBSD 7. They haven't been in GENERIC
      since FreeBSD 8. Add warning when used.
      geom_vol_ffs has been obsolete since ufs support to geom_label was
      committed in FreeBSD 5. It hasn't been in GENERIC since FreeBSD 5.
      Add warning when used.
      geom_fox has been obsolete since gmultipath was committed in FreeBSD 7.
      (no warning added, since this is a very obscure class).
      These will all be removed in FreeBSD 12.
      MFC After: 3 days
      Differential Revision: https://reviews.freebsd.org/D11935
      Note: Classes will be removed after MFC
    • mav's avatar
      Missing remanant of 322309. · a253b5b1
      mav authored
      MFC after:	1 week
    • jonathan's avatar
      Add birthday information for jonathan@. · 717f3298
      jonathan authored
      As requested by mckusick@...
    • ae's avatar
      Add to if_enc(4) ability to capture packets via BPF after pfil processing. · 6dd69d60
      ae authored
      New flag 0x4 can be configured in net.enc.[in|out].ipsec_bpf_mask.
      When it is set, if_enc(4) additionally captures a packet via BPF after
      invoking pfil hook. This may be useful for debugging.
      MFC after:	2 weeks
      Sponsored by:	Yandex LLC
      Differential Revision:	https://reviews.freebsd.org/D11804
    • mav's avatar
      Use "Ibex Peak" codename for "5 Series/3400 Series" chipsets. · 6dbc92fb
      mav authored
      This is shorter and unifies naming with later chipsets.
      MFC after:	1 week
    • mav's avatar
      Add new Intel Lewisburg and Union Point chipset PCI IDs. · ce150489
      mav authored
      While there, polish some old AHCI ones, since they are still reused.
      MFC after:	1 week
    • oleg's avatar
      Fix comment typo. · b81e7a7f
      oleg authored
    • hselasky's avatar
      Print maximum MTU when trying to set invalid MTU in the mlx4en(4) driver. · 884a24aa
      hselasky authored
      Useful for debugging.
      Submitted by:		Sepherosa Ziehau <sephe@dragonflybsd.org>
      MFC after:		3 days
      Sponsored by:		Mellanox Technologies
    • hselasky's avatar
      Increment queue drops in the network statistics when transmitted packets · 1786668d
      hselasky authored
      are dropped by the mlx4en(4) driver.
      Submitted by:		Sepherosa Ziehau <sephe@dragonflybsd.org>
      MFC after:		3 days
      Sponsored by:		Mellanox Technologies
    • hselasky's avatar
      Add support for RX and TX statistics when the mlx4en(4) PCI device · 92b2a382
      hselasky authored
      is in VF or SRIOV mode typically in a virtual machine environment.
      Submitted by:		Sepherosa Ziehau <sephe@dragonflybsd.org>
      MFC after:		3 days
      Sponsored by:		Mellanox Technologies
    • mav's avatar
      Do not loose CCB flags after r320493. · 1d2ace71
      mav authored
      There is at least CAM_UNLOCKED that should be kept.
      MFC after:	3 days
    • des's avatar
      Correct sysctl names. · 8930206b
      des authored
    • sephe's avatar
      hyperv/hn: Implement transparent mode network VF. · 4b42c6e8
      sephe authored
      How network VF works with hn(4) on Hyper-V in transparent mode:
      - Each network VF has a cooresponding hn(4).
      - The network VF and the it's cooresponding hn(4) have the same hardware
      - Once the network VF is attached, the cooresponding hn(4) waits several
        seconds to make sure that the network VF attach routing completes, then:
        o  Set the intersection of the network VF's if_capabilities and the
           cooresponding hn(4)'s if_capabilities to the cooresponding hn(4)'s
           if_capabilities.  And adjust the cooresponding hn(4) if_capable and
           if_hwassist accordingly. (*)
        o  Make sure that the cooresponding hn(4)'s TSO parameters meet the
           constraints posed by both the network VF and the cooresponding hn(4).
        o  The network VF's if_input is overridden.  The overriding if_input
           changes the input packet's rcvif to the cooreponding hn(4).  The
           network layers are tricked into thinking that all packets are
           neceived by the cooresponding hn(4).
        o  If the cooresponding hn(4) was brought up, bring up the network VF.
           The transmission dispatched to the cooresponding hn(4) are
           redispatched to the network VF.
        o  Bringing down the cooresponding hn(4) also brings down the network
        o  All IOCTLs issued to the cooresponding hn(4) are pass-through'ed to
           the network VF; the cooresponding hn(4) changes its internal state
           if necessary.
        o  The media status of the cooresponding hn(4) solely relies on the
           network VF.
        o  If there are multicast filters on the cooresponding hn(4), allmulti
           will be enabled on the network VF. (**)
      - Once the network VF is detached.  Undo all damages did to the
        cooresponding hn(4) in the above item.
      No operation should be issued directly to the network VF, if the
      network VF transparent mode is enabled.  The network VF transparent mode
      can be enabled by setting tunable hw.hn.vf_transparent to 1.  The network
      VF transparent mode is _not_ enabled by default, as of this commit.
      The benefit of the network VF transparent mode is that the network VF
      attachment and detachment are transparent to all network layers; e.g. live
      migration detaches and reattaches the network VF.
      The major drawbacks of the network VF transparent mode:
      - The netmap(4) support is lost, even if the VF supports it.
      - ALTQ does not work, since if_start method cannot be properly supported.
      These decisions were made so that things will not be messed up too much
      during the transition period.
      This does _not_ need to go through the fancy multicast filter management
      stuffs like what vlan(4) has, at least currently:
      - As of this write, multicast does not work in Azure.
      - As of this write, multicast packets go through the cooresponding hn(4).
      MFC after:	3 days
      Sponsored by:	Microsoft
      Differential Revision:	https://reviews.freebsd.org/D11803
    • mckusick's avatar
      Add an entry to UPDATING for r322297 which restores the ability · 8c269a03
      mckusick authored
      of fsck to automatically find alternate superblocks when the
      standard one is trashed or unavailable.
      MFC after: 2 weeks
      Differential Revision: https://reviews.freebsd.org/D11589
    • mckusick's avatar
      Since the switch to GPT disk labels, fsck for UFS/FFS has been · 7898ca21
      mckusick authored
      unable to automatically find alternate superblocks. This checkin
      places the information needed to find alternate superblocks to the
      end of the area reserved for the boot block.
      Filesystems created with a newfs of this vintage or later will
      create the recovery information. If you have a filesystem created
      prior to this change and wish to have a recovery block created for
      your filesystem, you can do so by running fsck in forground mode
      (i.e., do not use the -p or -y options). As it starts, fsck will
      ask ``SAVE DATA TO FIND ALTERNATE SUPERBLOCKS'' to which you should
      answer yes.
      Discussed with: kib, imp
      MFC after: 2 weeks
      Differential Revision: https://reviews.freebsd.org/D11589
    • alc's avatar
      Introduce vm_page_grab_pages(), which is intended to replace loops calling · 318304a5
      alc authored
      vm_page_grab() on consecutive page indices.  Besides simplifying the code
      in the caller, vm_page_grab_pages() allows for batching optimizations.
      For example, the current implementation replaces calls to vm_page_lookup()
      on consecutive page indices by cheaper calls to vm_page_next().
      Reviewed by:	kib, markj
      Tested by:	pho (an earlier version)
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D11926
    • mw's avatar
      Update pl310 node in Armada 38x DTS to match the one used in Linux · 4bd0fb56
      mw authored
      Since the cache controller nodes fixup is added to the platform code,
      this patch aligns it to the Linux device tree representation.
      Submitted by: Patryk Duda <pdk@semihalf.com>
      Reviewed by: cognet (mentor)
      Approved by: cognet (mentor)
      Obtained from: Semihalf
      Differential Revision: https://reviews.freebsd.org/D11884
    • mw's avatar
      Enable pl310 coherent operation in platform init for Armada 38x · af179cce
      mw authored
      Updating PL310 sotfware context sc_io_coherent field in
      platform_pl310_init() routine for Armada 38x helps to avoid
      using 'arm,io-coherent' property, which is by default not present
      in the device tree node in Linux.
      This way another step for DT unification between two operating
      systems is done. The improvemnt will also work after enabling
      PLATFORM for Marvell ARMv7 SoCs.
      Reviewed by: andrew, cognet (mentor)
      Approved by: cognet (mentor)
      Obtained from: Semihalf
      Differential Revision: https://reviews.freebsd.org/D11883
    • kevans's avatar
      df(1): Add --si as an alias for -H · 14830dbd
      kevans authored
      Reviewed by:	cem (earlier version), emaste
      Approved by:	emaste (mentor)
      Differential Revision:	https://reviews.freebsd.org/D11749