]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoFix off-by-one error in HPA/AMA maximum reporting.
Alexander Motin [Fri, 22 Nov 2019 15:41:47 +0000 (15:41 +0000)]
Fix off-by-one error in HPA/AMA maximum reporting.

Before my refactoring the code reported value as maximum number of sectors,
adding one to the maximum sector number returned by respective command.
While this difference is somewhat confusing, restore previous behavior.

MFC after: 3 days

4 years agoamd: add deprecation warning on program startup
Ed Maste [Fri, 22 Nov 2019 15:06:07 +0000 (15:06 +0000)]
amd: add deprecation warning on program startup

Reviewed by: rgrimes, trasz, kevans, brooks
Discussed with: cy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22466

4 years agoadd deprecation notice to amd man page
Ed Maste [Fri, 22 Nov 2019 15:04:03 +0000 (15:04 +0000)]
add deprecation notice to amd man page

Clarify the deprecation notice in amd.8.  amd will be removed from the
FreeBSD base system before FreeBSD 13.0.

Reviewed by: rgrimes, trasz, kevans, brooks (all earlier, in D22466)
Discussed with: cy
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoInitialize variable bitstr
Li-Wen Hsu [Fri, 22 Nov 2019 10:15:15 +0000 (10:15 +0000)]
Initialize variable bitstr

r354991 removed variable-sized object initializing on defining.  For the safe
reason, manually initialize the members to 0.

Sponsored by: The FreeBSD Foundation

4 years agoFix GCC build.
Li-Wen Hsu [Fri, 22 Nov 2019 10:03:16 +0000 (10:03 +0000)]
Fix GCC build.

Sponsored by: The FreeBSD Foundation

4 years agopowerpc/ptrace: Give ptrace(2) access to SPE registers when available
Justin Hibbits [Fri, 22 Nov 2019 04:34:46 +0000 (04:34 +0000)]
powerpc/ptrace: Give ptrace(2) access to SPE registers when available

SPE registers are already exported in core dumps with the VMX note, so use
the same interface for live access.

Instead of simply guarding out in #ifndef __SPE__ the cpu_feature check, I
chose to keep the check and check against PPC_FEATURE_SPE, on the off-chance
someone decides to run a SPE kernel on a non-SPE device (which is possible,
though highly unlikely, and would be no different from running a MPC85XX
kernel in that instance).

4 years agoFix the pNFS server's reporting of SpaceUsed (va_bytes).
Rick Macklem [Fri, 22 Nov 2019 00:22:55 +0000 (00:22 +0000)]
Fix the pNFS server's reporting of SpaceUsed (va_bytes).

The pNFS server currently reports SpaceUsed (va_bytes) for the metadata
file. This in not correct, since the metadata file is always empty and,
as such, va_bytes is just the allocation for the empty file.
This patch adds va_bytes to the list of attributes acquired from the
DS for a file, so that it includes the allocated data size and is updated
when the file is written.
For files created on a pNFS server before this patch is applied, the
va_bytes value is estimated by rounding va_size up to a multiple of
BLKDEV_IOSIZE. Once the file is written after this patch has been
applied to the metadata server, the va_bytes returned for the file
will be correct.

This patch only affects a pNFS metadata server.

Found during testing of the NFSv4.2 pNFS server for the Allocate operation.
(Not yet in head/current.)

MFC after: 2 weeks

4 years agocc_ktr_event_name is used only with KTR
Gleb Smirnoff [Thu, 21 Nov 2019 23:55:43 +0000 (23:55 +0000)]
cc_ktr_event_name is used only with KTR

4 years agoDelete ih_thread. Should have gone in r334170.
Gleb Smirnoff [Thu, 21 Nov 2019 23:55:19 +0000 (23:55 +0000)]
Delete ih_thread.  Should have gone in r334170.

4 years agoAdd variant of root_mount_hold() without allocation.
Alexander Motin [Thu, 21 Nov 2019 21:59:35 +0000 (21:59 +0000)]
Add variant of root_mount_hold() without allocation.

It allows to use this KPI in non-sleepable contexts.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoMerge commit a751f557d from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:36:46 +0000 (20:36 +0000)]
Merge commit a751f557d from llvm git (by Simon Atanasyan):

  [mips] Set macros for Octeon+ CPU

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit 0d14656b9 from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:35:53 +0000 (20:35 +0000)]
Merge commit 0d14656b9 from llvm git (by Simon Atanasyan):

  [mips] Set __OCTEON__ macros

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit e578d0fd2 from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:32:34 +0000 (20:32 +0000)]
Merge commit e578d0fd2 from llvm git (by Simon Atanasyan):

  [mips] Fix `__mips_isa_rev` macros value for Octeon CPU

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit 3552d3e0f from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:26:34 +0000 (20:26 +0000)]
Merge commit 3552d3e0f from llvm git (by Simon Atanasyan):

  [mips] Add `octeon+` to the list of CPUs accepted by the driver

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit bf996f761 from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:25:12 +0000 (20:25 +0000)]
Merge commit bf996f761 from llvm git (by Simon Atanasyan):

  [mips] Write `AFL_EXT_OCTEONP` flag to the `.MIPS.abiflags` section

  Differential Revision: https://reviews.llvm.org/D69851

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit 3718102d4 from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:23:35 +0000 (20:23 +0000)]
Merge commit 3718102d4 from llvm git (by Simon Atanasyan):

  [mips] Support `octeon+` CPU in the `.set arch=` directive

  Differential Revision: https://reviews.llvm.org/D69850

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoMerge commit 7bed381ea from llvm git (by Simon Atanasyan):
Dimitry Andric [Thu, 21 Nov 2019 20:22:07 +0000 (20:22 +0000)]
Merge commit 7bed381ea from llvm git (by Simon Atanasyan):

  [mips] Implement Octeon+ `saa` and `saad` instructions

  `saa` and `saad` are 32-bit and 64-bit store atomic add instructions.

     memory[base] = memory[base] + rt

  These instructions are available for "Octeon+" CPU. The patch adds
  support for both instructions to MIPS assembler and diassembler and
  introduces new CPU type - "octeon+".

  Next patches will implement `.set arch=octeon+` directive and
  `AFL_EXT_OCTEONP` ISA extension flag support.

  Differential Revision: https://reviews.llvm.org/D69849

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans
MFC after: 1 month
X-MFC-With: r353358

4 years agoChase r344883. ntp is 4.2.8p13.
Cy Schubert [Thu, 21 Nov 2019 20:15:22 +0000 (20:15 +0000)]
Chase r344883. ntp is 4.2.8p13.

MFC after: 3 days

4 years agobitstring: add functions to find contiguous set/unset bit sequences
Eric Joyner [Thu, 21 Nov 2019 19:57:56 +0000 (19:57 +0000)]
bitstring: add functions to find contiguous set/unset bit sequences

Add bit_ffs_area_at and bit_ffc_area_at functions for searching a bit
string for a sequence of contiguous set or unset bits of at least the
specified size.

The bit_ffc_area function will be used by the Intel ice driver for
implementing resource assignment logic using a bitstring to represent
whether or not a given index has been assigned or is currently free.

The bit_ffs_area, bit_ffc_area_at and bit_ffs_area_at functions are
implemented for completeness.

I'd like to add further test cases for the new functions, but I'm not
really sure how to add them easily. The new functions depend on specific
sequences of bits being set, while the bitstring tests appear to run for
varying bit sizes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: asomers@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D22400

4 years agoInstall bsd.sysdir.mk.
Warner Losh [Thu, 21 Nov 2019 19:54:10 +0000 (19:54 +0000)]
Install bsd.sysdir.mk.

Submitted by: Jung-uk Kim

4 years agobitstring: exit early if _start is past size of the bitstring
Eric Joyner [Thu, 21 Nov 2019 19:36:11 +0000 (19:36 +0000)]
bitstring: exit early if _start is past size of the bitstring

bit_ffs_at and bit_ffc_at both take _start parameters which indicate to
start searching from _start onwards.

If the given _start index is past the size of the bit string, these
functions will calculate an address of the current bitstring which is
after the expected size. The function will also dereference the memory,
resulting in a read buffer overflow.

The output of the function remains correct, because the tests ensure to
stop the loop if the current bitstring chunk passes the stop bitstring
chunk, and because of a check to ensure the reported _value is never
past _nbits.

However, if <sys/bitstring.h> is ever used in code which is checked by
-fsanitize=undefined, or similar static analysis, it can produce
warnings about reading past the buffer size.

Because of the above mentioned checks, these buffer overflows do not
occur as long as _start is less than _nbits. Additionally, by definition
bit_ffs_at and bif_ffc_at should set _result to -1 in any case where the
_start is after the _nbits.

Check for this case at the start of the function and exit early if so,
preventing the buffer read overflow, and reducing the amount of
computation that occurs.

Note that it may seem odd to ever have code that could call bit_ffc_at
or bit_ffs_at with a _start value greater than _nbits. However, consider
a for-loop that used bit_ffs and bit_ffs_at to loop over a bit string
and perform some operation on each bit that was set. If the last bit of
the bit string was set, the simplest loop implementation would call
bit_ffs_at with a start of _nbits, and expect that to return -1. While
it does infact perform correctly, this is what ultimately triggers the
unexpected buffer read overflow.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: asomers@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D22398

4 years agoNIC KTLS for Chelsio T6 adapters.
John Baldwin [Thu, 21 Nov 2019 19:30:31 +0000 (19:30 +0000)]
NIC KTLS for Chelsio T6 adapters.

This adds support for ifnet (NIC) KTLS using Chelsio T6 adapters.
Unlike the TOE-based KTLS in r353328, NIC TLS works with non-TOE
connections.

NIC KTLS on T6 is not able to use the normal TSO (LSO) path to segment
the encrypted TLS frames output by the crypto engine.  Instead, the
TOE is placed into a special setup to permit "dummy" connections to be
associated with regular sockets using KTLS.  This permits using the
TOE to segment the encrypted TLS records.  However, this approach does
have some limitations:

1) Regular TOE sockets cannot be used when the TOE is in this special
   mode.  One can use either TOE and TOE-based KTLS or NIC KTLS, but
   not both at the same time.

2) In NIC KTLS mode, the TOE is only able to accept a per-connection
   timestamp offset that varies in the upper 4 bits.  Put another way,
   only connections whose timestamp offset has the 28 lower bits
   cleared can use NIC KTLS and generate correct timestamps.  The
   driver will refuse to enable NIC KTLS on connections with a
   timestamp offset with any of the lower 28 bits set.  To use NIC
   KTLS, users can either disable TCP timestamps by setting the
   net.inet.tcp.rfc1323 sysctl to 0, or apply a local patch to the
   tcp_new_ts_offset() function to clear the lower 28 bits of the
   generated offset.

3) Because the TCP segmentation relies on fields mirrored in a TCB in
   the TOE, not all fields in a TCP packet can be sent in the TCP
   segments generated from a TLS record.  Specifically, for packets
   containing TCP options other than timestamps, the driver will
   inject an "empty" TCP packet holding the requested options (e.g. a
   SACK scoreboard) along with the segments from the TLS record.
   These empty TCP packets are counted by the
   dev.cc.N.txq.M.kern_tls_options sysctls.

Unlike TOE TLS which is able to buffer encrypted TLS records in
on-card memory to handle retransmits, NIC KTLS must re-encrypt TLS
records for retransmit requests as well as non-retransmit requests
that do not include the start of a TLS record but do include the
trailer.  The T6 NIC KTLS code tries to optimize some of the cases for
requests to transmit partial TLS records.  In particular it attempts
to minimize sending "waste" bytes that have to be given as input to
the crypto engine but are not needed on the wire to satisfy mbufs sent
from the TCP stack down to the driver.

TCP packets for TLS requests are broken down into the following
classes (with associated counters):

- Mbufs that send an entire TLS record in full do not have any waste
  bytes (dev.cc.N.txq.M.kern_tls_full).

- Mbufs that send a short TLS record that ends before the end of the
  trailer (dev.cc.N.txq.M.kern_tls_short).  For sockets using AES-CBC,
  the encryption must always start at the beginning, so if the mbuf
  starts at an offset into the TLS record, the offset bytes will be
  "waste" bytes.  For sockets using AES-GCM, the encryption can start
  at the 16 byte block before the starting offset capping the waste at
  15 bytes.

- Mbufs that send a partial TLS record that has a non-zero starting
  offset but ends at the end of the trailer
  (dev.cc.N.txq.M.kern_tls_partial).  In order to compute the
  authentication hash stored in the trailer, the entire TLS record
  must be sent as input to the crypto engine, so the bytes before the
  offset are always "waste" bytes.

In addition, other per-txq sysctls are provided:

- dev.cc.N.txq.M.kern_tls_cbc: Count of sockets sent via this txq
  using AES-CBC.

- dev.cc.N.txq.M.kern_tls_gcm: Count of sockets sent via this txq
  using AES-GCM.

- dev.cc.N.txq.M.kern_tls_fin: Count of empty FIN-only packets sent to
  compensate for the TOE engine not being able to set FIN on the last
  segment of a TLS record if the TLS record mbuf had FIN set.

- dev.cc.N.txq.M.kern_tls_records: Count of TLS records sent via this
  txq including full, short, and partial records.

- dev.cc.N.txq.M.kern_tls_octets: Count of non-waste bytes (TLS header
  and payload) sent for TLS record requests.

- dev.cc.N.txq.M.kern_tls_waste: Count of waste bytes sent for TLS
  record requests.

To enable NIC KTLS with T6, set the following tunables prior to
loading the cxgbe(4) driver:

hw.cxgbe.config_file=kern_tls
hw.cxgbe.kern_tls=1

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21962

4 years agoRewrite iicdev_writeto() to use a single buffer and a single iic_msg, rather
Ian Lepore [Thu, 21 Nov 2019 19:13:05 +0000 (19:13 +0000)]
Rewrite iicdev_writeto() to use a single buffer and a single iic_msg, rather
than effectively doing scatter/gather IO with a pair of iic_msgs that direct
the controller to do a single transfer with no bus STOP/START between the
two buffers.  It turns out we have multiple i2c hardware drivers that don't
honor the NOSTOP and NOSTART flags; sometimes they just try to do the
transfers anyway, creating confusing failures or leading to corrupted data.

4 years agoRemove two obsolete comments that reference splhigh/splx.
Warner Losh [Thu, 21 Nov 2019 18:49:54 +0000 (18:49 +0000)]
Remove two obsolete comments that reference splhigh/splx.

4 years agoUse kmod.opts.mk to fix standalone build.
John Baldwin [Thu, 21 Nov 2019 18:21:30 +0000 (18:21 +0000)]
Use kmod.opts.mk to fix standalone build.

4 years agoAdd a kmod.opts.mk.
John Baldwin [Thu, 21 Nov 2019 18:14:26 +0000 (18:14 +0000)]
Add a kmod.opts.mk.

This Makefile sets KERN_OPTS.  This permits kernel module Makefiles to
use KERN_OPTS to control the value of variables such as SRCS that are
used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT
options for standalone builds.

4 years agoAdd USB ID for Diamond Multimedia BVU195 Display Link device.
Hans Petter Selasky [Thu, 21 Nov 2019 16:42:25 +0000 (16:42 +0000)]
Add USB ID for Diamond Multimedia BVU195 Display Link device.

Submitted by: darius@dons.net.au
PR: 242128
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoIntroduce bsd.sysdir.mk to consolidate looking for the kernel.
Warner Losh [Thu, 21 Nov 2019 15:59:33 +0000 (15:59 +0000)]
Introduce bsd.sysdir.mk to consolidate looking for the kernel.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D22144

4 years agobsdinstall.8: Fix description of DISTRIBUTIONS environment variable
Mateusz Piotrowski [Thu, 21 Nov 2019 15:54:56 +0000 (15:54 +0000)]
bsdinstall.8: Fix description of DISTRIBUTIONS environment variable

Reviewed by: bcr
Approved by: bcr (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22478

4 years agoObsoleteFiles.inc: add sio(4) leftovers
Niclas Zeising [Thu, 21 Nov 2019 15:38:27 +0000 (15:38 +0000)]
ObsoleteFiles.inc: add sio(4) leftovers

Add the manual page for sio(4) to ObsoleteFiles.inc, so that make delete-all
will remove it.  The manual page was removed together with sio(4) in
r354929.

Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D22477

4 years agoarch.7: document only FreeBSD 11.0 and later
Ed Maste [Thu, 21 Nov 2019 14:23:16 +0000 (14:23 +0000)]
arch.7: document only FreeBSD 11.0 and later

FreeBSD 11 is the earliest supported version and there is no longer a
need to include information about differences present in earlier
releases.

4 years agobcm2835_sdhci: only inspect interrupts we handle
Kyle Evans [Thu, 21 Nov 2019 14:01:44 +0000 (14:01 +0000)]
bcm2835_sdhci: only inspect interrupts we handle

We'll write the value we read back to ack pending interrupts, but we should
at least make it clear to ourselves that we only want to ack pending
transfer interrupts.

4 years agoDisable KCSAN within a panic.
Andrew Turner [Thu, 21 Nov 2019 13:59:01 +0000 (13:59 +0000)]
Disable KCSAN within a panic.

The kernel is single threaded at this point and the panic is more
important.

Sponsored by: DARPA, AFRL

4 years agorevert contrib/amd changes accidentally committed with r354950
Ed Maste [Thu, 21 Nov 2019 13:57:30 +0000 (13:57 +0000)]
revert contrib/amd changes accidentally committed with r354950

4 years agorevert r354935 and apply fix for cleandir failure
Ed Maste [Thu, 21 Nov 2019 13:56:16 +0000 (13:56 +0000)]
revert r354935 and apply fix for cleandir failure

This reapplies the RISC-V GNU ld workaround from r354896, r354899, and
354900, along with a fix for the build failure during cleandir.

LINKER_TYPE was not being set during cleandir, resulting in
Malformed conditional (${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv")
from Cirrus-CI.

PR: 242109
Sponsored by: The FreeBSD Foundation

4 years agoMFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixes
Andriy Gapon [Thu, 21 Nov 2019 13:35:43 +0000 (13:35 +0000)]
MFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixes

illumos/illumos-gate@555d674d5d4b8191dc83723188349d28278b2431
https://github.com/illumos/illumos-gate/commit/555d674d5d4b8191dc83723188349d28278b2431

https://www.illumos.org/issues/10592
  This is a collection of recent fixes from ZoL:
  8eef997679b Error path in metaslab_load_impl() forgets to drop ms_sync_lock
  928e8ad47d3 Introduce auxiliary metaslab histograms
  425d3237ee8 Get rid of space_map_update() for ms_synced_length
  6c926f426a2 Simplify log vdev removal code
  21e7cf5da89 zdb -L should skip leak detection altogether
  df72b8bebe0 Rename range_tree_verify to range_tree_verify_not_present
  75058f33034 Remove unused vdev_t fields

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
MFC after: 4 weeks

4 years agoAdd kcsan_md_unsupported from NetBSD.
Andrew Turner [Thu, 21 Nov 2019 13:22:23 +0000 (13:22 +0000)]
Add kcsan_md_unsupported from NetBSD.

It's used to ignore virtual addresses that may have a different physical
address depending on the CPU.

Sponsored by: DARPA, AFRL

4 years agoFix the bus_space functions with KCSAN on arm64.
Andrew Turner [Thu, 21 Nov 2019 13:12:58 +0000 (13:12 +0000)]
Fix the bus_space functions with KCSAN on arm64.

Arm64 doesn't define the bus_space_set_multi_stream and
bus_space_set_region_stream functions. Don't try to define them there.

Sponsored by: DARPA, AFRL

4 years agoFix for style(9): use parentheses around return statements.
Andrew Turner [Thu, 21 Nov 2019 12:29:20 +0000 (12:29 +0000)]
Fix for style(9): use parentheses around return statements.

Reported by: kib
Sponsored by: DARPA, AFRL

4 years agoPort the NetBSD KCSAN runtime to FreeBSD.
Andrew Turner [Thu, 21 Nov 2019 11:22:08 +0000 (11:22 +0000)]
Port the NetBSD KCSAN runtime to FreeBSD.

Update the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime to work in
the FreeBSD kernel. It is a useful tool for finding data races between
threads executing on different CPUs.

This can be enabled by enabling KCSAN in the kernel config, or by using the
GENERIC-KCSAN amd64 kernel. It works on amd64 and arm64, however the later
needs a compiler change to allow -fsanitize=thread that KCSAN uses.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22315

4 years agoMFV r354382,r354385: 10601 10757 Pool allocation classes
Andriy Gapon [Thu, 21 Nov 2019 08:20:05 +0000 (08:20 +0000)]
MFV r354382,r354385: 10601 10757 Pool allocation classes

illumos/illumos-gate@663207adb1669640c01c5ec6949ce78fd806efae
https://github.com/illumos/illumos-gate/commit/663207adb1669640c01c5ec6949ce78fd806efae

10601 Pool allocation classes
https://www.illumos.org/issues/10601
  illumos port of ZoL Pool allocation classes. Includes at least these two
  commits:
  441709695 Pool allocation classes misplacing small file blocks
  cc99f275a Pool allocation classes

10757 Add -gLp to zpool subcommands for alt vdev names
https://www.illumos.org/issues/10757
  Port from ZoL of
  d2f3e292d Add -gLp to zpool subcommands for alt vdev names
  Note that a subsequent ZoL commit changed -p to -P
  a77f29f93 Change full path subcommand flag from -p to -P

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Portions contributed by: HÃ¥kan Johansson <f96hajo@chalmers.se>
Portions contributed by: Richard Yao <ryao@gentoo.org>
Portions contributed by: Chunwei Chen <david.chen@nutanix.com>
Portions contributed by: loli10K <ezomori.nozomu@gmail.com>
Author: Don Brady <don.brady@delphix.com>

11541 allocation_classes feature must be enabled to add log device

illumos/illumos-gate@c1064fd7ce62fe763a4475e9988ffea3b22137de
https://github.com/illumos/illumos-gate/commit/c1064fd7ce62fe763a4475e9988ffea3b22137de

https://www.illumos.org/issues/11541
  After the allocation_classes feature was integrated, one can no longer add a
  log device to a pool unless that feature is enabled. There is an explicit check
  for this, but it is unnecessary in the case of log devices, so we should handle
  this better instead of forcing the feature to be enabled.

Author: Jerry Jelinek <jerry.jelinek@joyent.com>

FreeBSD notes.
I faithfully added the new -g, -L, -P flags, but only -g does something:
vdev GUIDs are displayed instead of device names.  -L, resolve symlinks,
and -P, display full disk paths, do nothing at the moment.
The use of special vdevs is backward compatible for read-only access, so
root pools should be bootable, but exercise caution.

MFC after: 4 weeks

4 years agoInclude MACHINE in the which variable selection to use section.
Warner Losh [Thu, 21 Nov 2019 06:48:30 +0000 (06:48 +0000)]
Include MACHINE in the which variable selection to use section.

4 years agoAdd table for MACHINE_CPUARCH
Warner Losh [Thu, 21 Nov 2019 06:44:19 +0000 (06:44 +0000)]
Add table for MACHINE_CPUARCH

Add table and also some additional verbage of which one to use.

4 years agoRevert r354896, r354899, r354900:
Glen Barber [Thu, 21 Nov 2019 04:12:08 +0000 (04:12 +0000)]
Revert r354896, r354899, r354900:
 Fix build.

Sponsored by: Rubicon Communications, LLC (netgate.com)

4 years agomark arm.arm (v4/v5) kernels as NO_UNIVERSE for now
Ed Maste [Thu, 21 Nov 2019 03:10:02 +0000 (03:10 +0000)]
mark arm.arm (v4/v5) kernels as NO_UNIVERSE for now

r354290 removed arm.arm from universe, but arm.arm kernels were still
found and built during the kernel stage.  I'm not aware of a better way
to address this at the moment, but since there aren't many arm.arm
kernels anyhow just add an explicit NO_UNIVERSE to them.

Reported by: rpokala

4 years agobcm2835_sdhci: clean up DMA segments in error handling path
Kyle Evans [Thu, 21 Nov 2019 02:49:41 +0000 (02:49 +0000)]
bcm2835_sdhci: clean up DMA segments in error handling path

Later parts assume that this would've been done if interrupts are enabled,
but this is the only case in which that wouldn't have been true. This commit
also reorders operations such that we're done touching slot/slot->intmask
before we call back into the SDHCI framework and exit.

4 years agobcm2835_sdhci: roll back r354823
Kyle Evans [Thu, 21 Nov 2019 02:47:55 +0000 (02:47 +0000)]
bcm2835_sdhci: roll back r354823

r354823 kicked DATA_END handling out of the DMA interrupt path "to make
things easy", but this was likely a mistake -- if we know we're done after
we've finished pending DMA operations, we should go ahead and acknowledge
it rather than waiting for the controller to finalize it. If it's not ready,
we'll simply re-enable interrupts and wait for it anyways, to be re-entered
in sdhci_data_intr.

4 years agoRevert r354930: wrong diff, right message.
Kyle Evans [Thu, 21 Nov 2019 02:44:05 +0000 (02:44 +0000)]
Revert r354930: wrong diff, right message.

4 years agobcm2835_sdhci: clean up DMA segments in error handling path
Kyle Evans [Thu, 21 Nov 2019 02:41:22 +0000 (02:41 +0000)]
bcm2835_sdhci: clean up DMA segments in error handling path

Later parts assume that this would've been done if interrupts are enabled,
but this is the only case in which that wouldn't have been true. This commit
also reorders operations such that we're done touching slot/slot->intmask
before we call back into the SDHCI framework and exit.

4 years agoRemove sio(4).
Gleb Smirnoff [Thu, 21 Nov 2019 01:24:49 +0000 (01:24 +0000)]
Remove sio(4).
It had been disconnected from build in r181233 in 2008.

Reviewed by: imp

4 years agoAvoid relying on pollution from libcasper.h.
Mark Johnston [Thu, 21 Nov 2019 00:17:14 +0000 (00:17 +0000)]
Avoid relying on pollution from libcasper.h.

Reported by: sjg
Sponsored by: The FreeBSD Foundation

4 years agoAdd --esp/-E argument to print the currently booted ESP
Warner Losh [Wed, 20 Nov 2019 23:58:36 +0000 (23:58 +0000)]
Add --esp/-E argument to print the currently booted ESP

Add code to decode the BootCurrent and BootXXXX variable it points at
to deduce the ESP used to boot the system. By default, it prints the
path to that device. With --unix-path (-p) it will instead print the
current mount point for the ESP, if any (or an error). With
--device-path (-d) it wil print the UEFI device path for the ESP.

Note: This is the best guess based on the UEFI variables. If the ESP
is part of a gmirror, etc, that won't be reported. If by some weird
chance there was a complicated series of chain boots, this may not be
what you want. For setups that don't add layers on top of the raw
devices, it is accurate.

Differential Revision: https://reviews.freebsd.org/D22432

4 years agoMFV 354917, 354918, 354919
Pedro F. Giffuni [Wed, 20 Nov 2019 23:56:20 +0000 (23:56 +0000)]
MFV 354917, 354918, 354919
openresolv: update to version 3.9.2

MFC after: 3 weeks

4 years agoCreate /etc/os-release file.
Warner Losh [Wed, 20 Nov 2019 23:45:31 +0000 (23:45 +0000)]
Create /etc/os-release file.

Each boot, regenerate /var/run/os-release based on the currently running
system. Create a /etc/os-release symlink pointing to this file (so that this
doesn't create a new reason /etc can not be mounted read-only).

This is compatible with what other systems do and is what the sysutil/os-release
port attempted to do, but in an incomplete way. Linux, Solaris and DragonFly all
implement this natively as well. The complete standard can be found at
https://www.freedesktop.org/software/systemd/man/os-release.html

Moving this to the base solves both the non-standard location problem with the
port, as well as the lack of update of this file on system update.

Bump __FreeBSD_version to 1300060

PR: 238953
Differential Revision:  https://reviews.freebsd.org/D22271

4 years agoImport openresolv 3.9.0
Pedro F. Giffuni [Wed, 20 Nov 2019 22:13:14 +0000 (22:13 +0000)]
Import openresolv 3.9.0

More information at: https://roy.marples.name/projects/openresolv

4 years agoStandardize EFI's ESP mount point.
Warner Losh [Wed, 20 Nov 2019 21:06:29 +0000 (21:06 +0000)]
Standardize EFI's ESP mount point.

Mount the UEFI ESP on /boot/efi. No current system uses this by default, but
there are many ad-hoc schemes that do this in /efi or /esp or /uefi and adding a
new directory at the top-level would have a much higher likelihood of
collision. Document this in /etc/mtree/BSD.root.mtree and create EFIDIR and
related variables in bsd.own.mk.

Differential Revision: https://reviews.freebsd.org/D21344

4 years agoSet handling for some "Logical unit not ready" errors.
Alexander Motin [Wed, 20 Nov 2019 20:00:03 +0000 (20:00 +0000)]
Set handling for some "Logical unit not ready" errors.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agorandom/ivy: Trivial refactoring
Conrad Meyer [Wed, 20 Nov 2019 19:55:43 +0000 (19:55 +0000)]
random/ivy: Trivial refactoring

It is clearer to me to return success/error (true/false) instead of some
retry count linked to the inline assembly implementation.

No functional change.

Approved by: core(csprng) => csprng(markm)
Differential Revision: https://reviews.freebsd.org/D22454

4 years agoRe-apply fixed r354847
Conrad Meyer [Wed, 20 Nov 2019 19:43:34 +0000 (19:43 +0000)]
Re-apply fixed r354847

unifdef(1): Improve worst-case bound on symbol resolution

Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N)
and O(N^2).

While here, remove arbitrarily limit on number of macros understood.

Reverts r354877 and r354878, which disabled the (correct) test.

PR: 242095
Reported by: lwhsu

4 years agoRevert r354847 for now
Conrad Meyer [Wed, 20 Nov 2019 19:07:22 +0000 (19:07 +0000)]
Revert r354847 for now

It was broken.

PR: 242095
Reported by: lwhsu

4 years agoFix typo: deprected -> deprecated.
Dimitry Andric [Wed, 20 Nov 2019 19:07:08 +0000 (19:07 +0000)]
Fix typo: deprected -> deprecated.

4 years agoMake the warning for deprecated NO_ variables an error.
Brooks Davis [Wed, 20 Nov 2019 18:36:58 +0000 (18:36 +0000)]
Make the warning for deprecated NO_ variables an error.

Support for NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB, NO_MAN, NO_PROFILE,
and NO_WARNS as deprecated in 2014 with a warning added for each one
found. Turn these into error in preperation for removal of compatability
support before FreeBSD 13.

Reviewed by: imp
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22448

4 years agoAdd explanatory comments for the different SRCS_xxx variables used in
Dimitry Andric [Wed, 20 Nov 2019 18:12:01 +0000 (18:12 +0000)]
Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang.  While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

4 years agoAs with r354905 use uint16_t to store aflags on the stack and as function
Andrew Turner [Wed, 20 Nov 2019 18:00:43 +0000 (18:00 +0000)]
As with r354905 use uint16_t to store aflags on the stack and as function
arguments as the aflags size in vm_page_t has increased.

Sponsored by: DARPA, AFRL

4 years agosrc.conf.5: regen for several recent changes
Ed Maste [Wed, 20 Nov 2019 17:57:46 +0000 (17:57 +0000)]
src.conf.5: regen for several recent changes

r354289 armv6: Switch to LLD by default
r354290 Take arm.arm (armv5) out of universe
r354348 armv6, armv7: Switch to llvm-libunwind by default
r354660 Enable the RISC-V LLVM backend by default.

as well as lib32 changes

Sponsored by: The FreeBSD Foundation

4 years agoUse atomic_load_16 to load aflags as it's a uint16_t after r354820.
Andrew Turner [Wed, 20 Nov 2019 17:49:58 +0000 (17:49 +0000)]
Use atomic_load_16 to load aflags as it's a uint16_t after r354820.

Sponsored by: DARPA, AFRL

4 years agosrc.conf.5: regen after r354902, WITHOUT_AMD by default
Ed Maste [Wed, 20 Nov 2019 17:49:32 +0000 (17:49 +0000)]
src.conf.5: regen after r354902, WITHOUT_AMD by default

4 years agoAdd description for WITH_AMD
Ed Maste [Wed, 20 Nov 2019 17:45:31 +0000 (17:45 +0000)]
Add description for WITH_AMD

WITHOUT_AMD is now the default as of r354902.

Sponsored by: The FreeBSD Foundation

4 years agodisable amd(8) by default
Ed Maste [Wed, 20 Nov 2019 17:37:45 +0000 (17:37 +0000)]
disable amd(8) by default

As of FreeBSD 10.1 the autofs(5) is available for automounting, and the
amd man page has indicated that the in-tree copy of amd is obsolete.
Disable it by default for now, with the expectation that it will be
removed before FreeBSD 13.0.

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22460

4 years agoAllow boostrapping xinstall on Linux
Alex Richardson [Wed, 20 Nov 2019 17:24:49 +0000 (17:24 +0000)]
Allow boostrapping xinstall on Linux

Linux does not have st_flags so we have to avoid using it there.

Reviewed By: emaste, imp
Differential Revision: https://reviews.freebsd.org/D22446

4 years agoUse the correct variable, also limit the scope to bfd
Li-Wen Hsu [Wed, 20 Nov 2019 16:54:21 +0000 (16:54 +0000)]
Use the correct variable, also limit the scope to bfd

PR: 242109
Reported by: jhb
Sponsored by: The FreeBSD Foundation

4 years agoLimit the workaround to riscv only
Li-Wen Hsu [Wed, 20 Nov 2019 16:35:58 +0000 (16:35 +0000)]
Limit the workaround to riscv only

PR: 242109
Sponsored by: The FreeBSD Foundation

4 years agoUntil every possible root cause for an "invalid ASID" assertion failure is
Alan Cox [Wed, 20 Nov 2019 16:32:13 +0000 (16:32 +0000)]
Until every possible root cause for an "invalid ASID" assertion failure is
resolved, assign every pmap a valid ASID when it is first initialized.

4 years agosshd: make getpwclass wrapper MON_ISAUTH not MON_AUTH
Ed Maste [Wed, 20 Nov 2019 16:30:37 +0000 (16:30 +0000)]
sshd: make getpwclass wrapper MON_ISAUTH not MON_AUTH

In r339216 a privsep wrapper was added for login_getpwclass to address
PR 231172.  Unfortunately the change used the MON_AUTH flag in the
wrapper, and MON_AUTH includes MON_AUTHDECIDE which triggers an
auth_log() on each invocation.  getpwclass() does not participate in the
authentication decision, so should be MON_ISAUTH instead.

PR: 234793
Submitted by: Henry Hu
Reviewed by: Yuichiro NAITO
MFC after: 1 week

4 years agoWorkaround riscv64 build when using binutils 2.33.1
Li-Wen Hsu [Wed, 20 Nov 2019 16:20:49 +0000 (16:20 +0000)]
Workaround riscv64 build when using binutils 2.33.1

PR: 242109
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22457

4 years agoInstead of looking up a predecessor or successor to the current map
Doug Moore [Wed, 20 Nov 2019 16:06:48 +0000 (16:06 +0000)]
Instead of looking up a predecessor or successor to the current map
entry, when that entry has been seen already, keep the
already-looked-up value in a variable and use that instead of looking
it up again.

Approved by: alc, markj (earlier version), kib (earlier version)
Differential Revision: https://reviews.freebsd.org/D22348

4 years agoImport the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime.
Andrew Turner [Wed, 20 Nov 2019 14:37:48 +0000 (14:37 +0000)]
Import the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime.

KCSAN is a tool to find concurrent memory access that may race each other.
After a determined number of memory accesses a cell is created, this
describes the current access. It will then delay for a short period
to allow other CPUs a chance to race. If another CPU performs a memory
access to an overlapping region during this delay the race is reported.

This is a straight import of the NetBSD code, it will be adapted to
FreeBSD in a future commit.

Sponsored by: DARPA, AFRL

4 years agocache: minor stat cleanup
Mateusz Guzik [Wed, 20 Nov 2019 12:08:32 +0000 (12:08 +0000)]
cache: minor stat cleanup

Remove duplicated stats and move numcachehv from debug to vfs.cache.

4 years agovfs: perform a more racy check in vfs_notify_upper
Mateusz Guzik [Wed, 20 Nov 2019 12:07:54 +0000 (12:07 +0000)]
vfs: perform a more racy check in vfs_notify_upper

Locking mp does not buy anything interms of correctness and only contributes to
contention.

4 years agolinux: avoid overhead of P_CONTROLT checks if possible
Mateusz Guzik [Wed, 20 Nov 2019 12:06:29 +0000 (12:06 +0000)]
linux: avoid overhead of P_CONTROLT checks if possible

Sponsored by: The FreeBSD Foundation

4 years agovfs: change si_usecount management to count used vnodes
Mateusz Guzik [Wed, 20 Nov 2019 12:05:59 +0000 (12:05 +0000)]
vfs: change si_usecount management to count used vnodes

Currently si_usecount is effectively a sum of usecounts from all associated
vnodes. This is maintained by special-casing for VCHR every time usecount is
modified. Apart from complicating the code a little bit, it has a scalability
impact since it forces a read from a cacheline shared with said count.

There are no consumers of the feature in the ports tree. In head there are only
2: revoke and devfs_close. Both can get away with a weaker requirement than the
exact usecount, namely just the count of active vnodes. Changing the meaning to
the latter means we only need to modify it on 0<->1 transitions, avoiding the
check plenty of times (and entirely in something like vrefact).

Reviewed by: kib, jeff
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D22202

4 years agoamd64: in double fault handler, do not rely on sane gsbase value.
Konstantin Belousov [Wed, 20 Nov 2019 11:12:19 +0000 (11:12 +0000)]
amd64: in double fault handler, do not rely on sane gsbase value.

Typical reasons for doublefault faults are either kernel stack
overflow or bugs in the code that manipulates protection CPU state.
The later code is the code which often has to set up gsbase for
kernel.  Switching to explicit load of GSBASE MSR in the fault handler
makes it more probable to output a useful information.

Now all IST handlers have nmi_pcpu structure on top of their stacks.

It would be even more useful to save gsbase value at the moment of the
fault.  I did not this because I do not want to modify PCB layout now.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agozpool.8: remove a paragraph about quorum disks
Andriy Gapon [Wed, 20 Nov 2019 08:56:01 +0000 (08:56 +0000)]
zpool.8: remove a paragraph about quorum disks

FreeBSD has no such thing.
illumos and ZoL manuals do not talk about quorum disks either.
Only Oracle ZFS mentions them.

MFC after: 1 week

4 years agofix up r354804, resolve merge conflicts in zpool.8
Andriy Gapon [Wed, 20 Nov 2019 08:49:13 +0000 (08:49 +0000)]
fix up r354804, resolve merge conflicts in zpool.8

Somehow I managed to commit the manual page with unresolved conflicts in
it.

While here, I also replaced .sp with .Pp.

MFC after: 3 weeks
X-MFC with: r354804

4 years agoOnly skip failing test case in CI.
Li-Wen Hsu [Wed, 20 Nov 2019 05:34:02 +0000 (05:34 +0000)]
Only skip failing test case in CI.

PR: 242095
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip the failing test case usr.bin.unifdef.basic_test.basic
Li-Wen Hsu [Wed, 20 Nov 2019 05:30:31 +0000 (05:30 +0000)]
Temporarily skip the failing test case usr.bin.unifdef.basic_test.basic

PR: 242095
Sponsored by: The FreeBSD Foundation

4 years agobcm2835_vcbus: add compatibility name for ^/sys/contrib/vchiq
Kyle Evans [Wed, 20 Nov 2019 05:04:44 +0000 (05:04 +0000)]
bcm2835_vcbus: add compatibility name for ^/sys/contrib/vchiq

It's unclear how this didn't get caught in my last iteration, but the fix is
easy- the interface is still compatible, it was just gratuituously renamed
to match my arbitrary definition of consistency... VCBUS, the BCM2835 name,
represents an address on the VideoCore CPU Bus.

In a similar fashion, while it is a physical address, the ARMC portion
represents that these are addresses as seen by the ARM CPU.

To make things even more fun, the BCM2711 peripheral documentation describes
not virtual address space vs. physical address space, but instead the 32-bit
address map vs. the address map in "Low Peripheral" mode. The latter of
these is what the *ARMC* macros translate to/from.

4 years agobcm2835: push address mapping conversion for DMA/mailbox to runtime
Kyle Evans [Wed, 20 Nov 2019 03:57:46 +0000 (03:57 +0000)]
bcm2835: push address mapping conversion for DMA/mailbox to runtime

We could maintain the static conversions for the !AArch64 Raspberry Pis, but
I'm not sure it's worth it -- we'll traverse the platform list exactly once
(of which there are only two for armv7), then every conversion there-after
traverses the memory map listing of which there are at-most two entries for
these boards: sdram and peripheral space.

Detecting this at runtime is necessary for the AArch64 SOC, though, because
of the distinct IO windows being otherwise not discernible just from support
compiled into the kernel. We currently select the correct window based on
/compatible in the FDT.

We also use a similar mechanism to describe the DMA restrictions- the RPi 4
can have up to 4GB of RAM while the DMA controller and mailbox mechanism can
technically, kind of, only access the lowest 1GB. See the comment in
bcm2835_vcbus.h for a fun description/clarification of this.

Differential Revision: https://reviews.freebsd.org/D22301

4 years agoWhen we set OFFPAGE to limit fragmentation we should also set VTOSLAB
Jeff Roberson [Wed, 20 Nov 2019 01:57:33 +0000 (01:57 +0000)]
When we set OFFPAGE to limit fragmentation we should also set VTOSLAB
so that we avoid the hashtables.  The hashtable is now only required if
a zone is created with OFFPAGE specified initially, not internally.  This
flag signals to UMA that it can't touch the allocated memory and so
can't store a slab pointer in the containing page.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D22453

4 years agoWhite space cleanup. No functional change.
Kirk McKusick [Wed, 20 Nov 2019 01:14:22 +0000 (01:14 +0000)]
White space cleanup. No functional change.

Sponsored by: Netflix

4 years agoAdd some KASSERTs. Reacquire a mutex after a kernel printf rather
Kirk McKusick [Wed, 20 Nov 2019 01:10:01 +0000 (01:10 +0000)]
Add some KASSERTs. Reacquire a mutex after a kernel printf rather
than holding it during the printf. White space cleanup.

Sponsored by: Netflix

4 years agoOnly keep anonymous objects on shadow lists. This eliminates locking of
Jeff Roberson [Wed, 20 Nov 2019 00:31:14 +0000 (00:31 +0000)]
Only keep anonymous objects on shadow lists.  This eliminates locking of
globally visible objects when they are part of a backing chain.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D22423

4 years agoRemove unnecessary object locking from the vnode pager. Recent changes to
Jeff Roberson [Tue, 19 Nov 2019 23:30:09 +0000 (23:30 +0000)]
Remove unnecessary object locking from the vnode pager.  Recent changes to
busy/valid/dirty locking make these acquires redundant.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D22186

4 years agoSimplify anonymous memory handling with an OBJ_ANON flag. This eliminates
Jeff Roberson [Tue, 19 Nov 2019 23:19:43 +0000 (23:19 +0000)]
Simplify anonymous memory handling with an OBJ_ANON flag.  This eliminates
reudundant complicated checks and additional locking required only for
anonymous memory.  Introduce vm_object_allocate_anon() to create these
objects.  DEFAULT and SWAP objects now have the correct settings for
non-anonymous consumers and so individual consumers need not modify the
default flags to create super-pages and avoid ONEMAPPING/NOSPLIT.

Reviewed by: alc, dougm, kib, markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D22119

4 years agobcm2835_sdhci: various refactoring of DMA path
Kyle Evans [Tue, 19 Nov 2019 23:12:43 +0000 (23:12 +0000)]
bcm2835_sdhci: various refactoring of DMA path

This round of refactoring is mostly about streamlining the interrupt handler
to make it easier to verify and reason about operations taking place while
trying to bring FreeBSD up on the RPi4.

4 years agonetmap: check if we already ran mmap before we attempt it
Vincenzo Maffione [Tue, 19 Nov 2019 21:29:49 +0000 (21:29 +0000)]
netmap: check if we already ran mmap before we attempt it

Submitted by: neel@neelc.org
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22390

4 years agoin6: move include
Bjoern A. Zeeb [Tue, 19 Nov 2019 21:14:15 +0000 (21:14 +0000)]
in6: move include

Move the include for sysctl.h out of the middle of the file to the
includes at the beginning.  This is will make it easier to add new
sysctls.

No functional changes.

MFC after: 3 weeks
Sponsored by: Netflix

4 years agobhyve: virtio-net: disable receive until features are negotiated
Vincenzo Maffione [Tue, 19 Nov 2019 21:10:44 +0000 (21:10 +0000)]
bhyve: virtio-net: disable receive until features are negotiated

This patch fixes a race condition where the receive callback is called
while the device is being reset. Since the rx_merge variable may change
during reset, the receive callback may operate inconsistently with what
the guest expects.
Also, get rid of the unused rx_vhdrlen variable.

PR: 242023
Reported by: aleksandr.fedorov@itglobal.com
Reviewed by: markj, jhb
MFC with: r354552
Differential Revision: https://reviews.freebsd.org/D22440

4 years agond6: sysctl
Bjoern A. Zeeb [Tue, 19 Nov 2019 21:08:18 +0000 (21:08 +0000)]
nd6: sysctl

Move the SYSCTL_DECL to the top of the file.  Move the sysctl function
before SYSCTL_PROC so that we don't need an extra function declaration in
the middle of the file.

No functional changes.

MFC after: 3 weeks
Sponsored by: Netflix

4 years agond6: make nd6_timer_ch static
Bjoern A. Zeeb [Tue, 19 Nov 2019 20:54:17 +0000 (20:54 +0000)]
nd6: make nd6_timer_ch static

nd6_timer_ch is only used in file local context.  There is no need to
export it, so make it static.

MFC after: 3 weeks
Sponsored by: Netflix